mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Archive has to be cleared when clear() is called
This commit is contained in:
parent
92bad9254e
commit
49730ed475
@ -494,6 +494,13 @@ void QgsProject::clear()
|
||||
mRootGroup->clear();
|
||||
|
||||
mLabelingEngineSettings->clear();
|
||||
|
||||
// unzip action use read() method to read the embedded qgs project file.
|
||||
// And read() clear everything in a first step. But we don't want to reset
|
||||
// the current archive while unzipping...
|
||||
if ( !mUnzipping )
|
||||
mArchive->clear();
|
||||
|
||||
emit labelingEngineSettingsChanged();
|
||||
|
||||
// reset some default project properties
|
||||
@ -765,9 +772,6 @@ bool QgsProject::read()
|
||||
{
|
||||
clearError();
|
||||
|
||||
if ( ! mUnzipping )
|
||||
mArchive->clear();
|
||||
|
||||
std::unique_ptr<QDomDocument> doc( new QDomDocument( QStringLiteral( "qgis" ) ) );
|
||||
|
||||
if ( !mFile.open( QIODevice::ReadOnly | QIODevice::Text ) )
|
||||
|
@ -750,6 +750,9 @@ class TestQgsProject(unittest.TestCase):
|
||||
self.assertTrue(layers[l0.id()].isValid(), True)
|
||||
self.assertTrue(layers[l1.id()].isValid(), True)
|
||||
|
||||
project2.clear()
|
||||
self.assertFalse(project2.unzipped())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user