Closed sfkeller closed 8 years ago
A lot of plugins generates some layers in memory or in the temp folder (Processing is the biggest one). I think it's QGIS which should have a look about the source before saving (if a layer is not in /tmp or in memory). Maybe improving&using this plugin : https://plugins.qgis.org/plugins/MemoryLayerSaver/ ?
I thought about this too, that QGIS should care about this and I discussed it with QGIS core programmers. The conclusion is that QGIS can't be made responsible for this. QGIS can't know if a Memory Layer should finally be persisted. Therefore it's still the app/plugin has to care about saving.
About "QGIS can't know if a Memory Layer should finally be persisted", it's useless for QGIS to save some layers which are in /tmp or in memory, because in 99% these layers won't exist in a few minutes. QGIS must inform the user about these layers : "Be careful, you have some layers in /tmp ...." QuickOSM is just a data provider for QGIS, not responsible for what will happen next. We could just inform better the user that layers won't be saved persistently if they saved the project when the query is finished.
That's what I thought first too. But if QGIS would always ask about saving, it would also ask in cases where it shouldn't. So, yes: QuickOSM is a data provider for QGIS and just because of this, it remains responsible what happens to the data and what's stored in the project file.
Processing has the same behaviour than QuickOSM. I'm closing this issue as I think it's related to QGIS.
Given a user
Now when reopening, QGIS project manager says "Layer ...not found" and all data is lost.
I therefore propose, that QuickOSM plugin asks user something like "There are unsaved layers. Do you really want to close project?"