Giter Site home page Giter Site logo

qgz support ? about autosaver HOT 4 CLOSED

ChameleonScales avatar ChameleonScales commented on May 20, 2024
qgz support ?

from autosaver.

Comments (4)

mikedufty avatar mikedufty commented on May 20, 2024

qgz support would be a really great feature.
I guess it may be difficult to implement?
A less ideal but useful alternative could be for the autosaver to automatically name the backup xxxx.qgs.bak instead of xxx.qgz.bak I think this would actually be 99% as good, especially if the qgd file is also renamed appropriately.

Then restoring would just be a matter of removing the .bak from the filenames regardless of whether your original file was qgz or qgs

from autosaver.

ChameleonScales avatar ChameleonScales commented on May 20, 2024

That would be fine for me, although I hope the api allows for saving as qgz, in which case it should be a piece of cake.

from autosaver.

mikedufty avatar mikedufty commented on May 20, 2024

Yeah, could be very simple if so. Code appears to use QgsProject.instance().write() to save the backup, and I can't see any documentation of how to change that to qgz. May need to use the zip utilities to zip it?

I think the only modification to save as qgs would be to line 395 of autosave.py
currently it is
bakFileName = origFileName + ".bak"
I think changing it to
bakFileName = origFileName[:-1] + "s.bak"

Will remove the last letter of the filename and replace with s.bak so .qgs files will become .qgs.bak and qgz will become .qgs.bak also.

I have not tested this, but it looks like an easy fix to me, though I have not investigated understand how the .qgd file is being generated currently. Looks like it might be working by accident as one seems to be generated outside the .qgz when autosaver is running.

from autosaver.

enricofer avatar enricofer commented on May 20, 2024

fixed. b52535e
thanks for suggestions

from autosaver.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.