9

I have QGIS-Project-Files saved to a network drive and was wondering if it is possible to warn users that a project file is already opened by an other user to prevent concurrent editing of the same project file.

I was thinking of showing an alert like this:

enter image description here

Does anyone have a clue how this could be done?

I found some information on stackexchange but I am not sure if these could be implemented in QGIS in some generic way(not a manually added 'openProject' macro):

https://stackoverflow.com/questions/21126108/ensuring-that-my-program-is-not-doing-a-concurrent-file-write/21149744#21149744

https://stackoverflow.com/questions/11114492/check-if-a-file-is-not-open-not-used-by-other-process-in-python

I know that QGIS shows a warning if I try to save a project file another user has changed since I opened it.... But it would be even better if I got the information in the moment when I open the project that someone else has opened the project, too.

The best option would be to implement this in QGIS core (C++) but a pythonic solution would be also interesting.

A generic C++ solution is probably harder as it has to check the exclusive file access on different OS's (windows, linux, mac).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.