File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -494,6 +494,13 @@ void QgsProject::clear()
494
494
mRootGroup ->clear ();
495
495
496
496
mLabelingEngineSettings ->clear ();
497
+
498
+ // unzip action use read() method to read the embedded qgs project file.
499
+ // And read() clear everything in a first step. But we don't want to reset
500
+ // the current archive while unzipping...
501
+ if ( !mUnzipping )
502
+ mArchive ->clear ();
503
+
497
504
emit labelingEngineSettingsChanged ();
498
505
499
506
// reset some default project properties
@@ -765,9 +772,6 @@ bool QgsProject::read()
765
772
{
766
773
clearError ();
767
774
768
- if ( ! mUnzipping )
769
- mArchive ->clear ();
770
-
771
775
std::unique_ptr<QDomDocument> doc ( new QDomDocument ( QStringLiteral ( " qgis" ) ) );
772
776
773
777
if ( !mFile .open ( QIODevice::ReadOnly | QIODevice::Text ) )
Original file line number Diff line number Diff line change @@ -750,6 +750,9 @@ def test_zip_unzip(self):
750
750
self .assertTrue (layers [l0 .id ()].isValid (), True )
751
751
self .assertTrue (layers [l1 .id ()].isValid (), True )
752
752
753
+ project2 .clear ()
754
+ self .assertFalse (project2 .unzipped ())
755
+
753
756
754
757
if __name__ == '__main__' :
755
758
unittest .main ()
You can’t perform that action at this time.
0 commit comments