Skip to content

Commit 9820e6b

Browse files
committedMar 31, 2019
Revert "fix removal of temporary directories"
This reverts commit b141349, which causes crashes in almost every unit test.
1 parent e5a4716 commit 9820e6b

14 files changed

+26
-26
lines changed
 

‎python/core/auto_generated/qgsarchive.sip.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010

1111

12-
1312
class QgsArchive
1413
{
1514
%Docstring

‎python/core/auto_generated/qgsnetworkcontentfetcherregistry.sip.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212

1313

14+
15+
1416
class QgsFetchedContent : QObject
1517
{
1618
%Docstring

‎src/core/qgsarchive.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "qgsziputils.h"
2121
#include "qgsmessagelog.h"
2222
#include "qgsauxiliarystorage.h"
23+
#include <iostream>
2324

2425
#include <QStandardPaths>
2526
#include <QUuid>
@@ -31,7 +32,7 @@ QgsArchive::QgsArchive()
3132

3233
QgsArchive::QgsArchive( const QgsArchive &other )
3334
: mFiles( other.mFiles )
34-
, mDir( new QTemporaryDir() )
35+
, mDir( new QTemporaryDir() )
3536
{
3637
}
3738

‎src/core/qgsarchive.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#define QGSARCHIVE_H
2121

2222
#include "qgis_core.h"
23-
2423
#include <QStringList>
2524
#include <QTemporaryFile>
2625
#include <QTemporaryDir>

‎src/core/qgscoordinatereferencesystem.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <cmath>
2222

2323
#include <QDir>
24+
#include <QTemporaryFile>
2425
#include <QDomNode>
2526
#include <QDomElement>
2627
#include <QFileInfo>

‎src/core/qgsnetworkcontentfetcherregistry.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@
2323
#include <QMap>
2424
#include <QMutex>
2525
#include <QNetworkReply>
26+
#include <QTemporaryFile>
2627

2728
#include "qgis_core.h"
29+
30+
class QTemporaryFile;
31+
2832
#include "qgstaskmanager.h"
2933
#include "qgsnetworkcontentfetchertask.h"
3034

31-
class QTemporaryFile;
3235

3336
/**
3437
* \class QgsFetchedContent

‎src/core/qgsproject.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
#endif
7474

7575
// canonical project instance
76-
std::unique_ptr<QgsProject> QgsProject::sProject;
76+
QgsProject *QgsProject::sProject = nullptr;
7777

7878
/**
7979
Take the given scope and key and convert them to a string list of key
@@ -410,33 +410,30 @@ QgsProject::~QgsProject()
410410
{
411411
mIsBeingDeleted = true;
412412

413-
if ( this != sProject.get() )
414-
clear();
415-
413+
clear();
416414
delete mBadLayerHandler;
417415
delete mRelationManager;
418416
delete mLayerTreeRegistryBridge;
419417
delete mRootGroup;
420-
421-
if ( this == sProject.get() )
418+
if ( this == sProject )
422419
{
423-
sProject.release();
420+
sProject = nullptr;
424421
}
425422
}
426423

427424
void QgsProject::setInstance( QgsProject *project )
428425
{
429-
sProject.reset( project );
426+
sProject = project;
430427
}
431428

432429

433430
QgsProject *QgsProject::instance()
434431
{
435-
if ( !sProject.get() )
432+
if ( !sProject )
436433
{
437-
sProject.reset( new QgsProject );
434+
sProject = new QgsProject;
438435
}
439-
return sProject.get();
436+
return sProject;
440437
}
441438

442439
void QgsProject::setTitle( const QString &title )

‎src/core/qgsproject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
13851385

13861386
private:
13871387

1388-
static std::unique_ptr<QgsProject> sProject;
1388+
static QgsProject *sProject;
13891389

13901390
/**
13911391
* Set the current project instance to \a project

‎src/core/qgssettings.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515

1616

1717
#include <cstdlib>
18-
1918
#include <QFileInfo>
2019
#include <QSettings>
2120
#include <QDir>
22-
#include <QCoreApplication>
2321

2422
#include "qgssettings.h"
2523
#include "qgslogger.h"

‎src/crssync/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,5 @@ int main( int argc, char **argv )
8484
std::cout << -res << " CRSs could not be updated." << std::endl;
8585
}
8686

87-
return 0;
87+
exit( 0 );
8888
}

‎src/gui/qgscolorbutton.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "qgsguiutils.h"
2727

2828
#include <QPainter>
29+
#include <QTemporaryFile>
2930
#include <QMouseEvent>
3031
#include <QMenu>
3132
#include <QClipboard>

‎src/gui/qgscolorbutton.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include <QColorDialog>
1919
#include <QToolButton>
20+
#include <QTemporaryFile>
2021
#include "qgis_gui.h"
2122
#include "qgis_sip.h"
2223

‎src/gui/symbology/qgsstyleexportimportdialog.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,8 @@
3333
#include <QCloseEvent>
3434
#include <QFileDialog>
3535
#include <QMessageBox>
36-
#include <QProgressDialog>
3736
#include <QPushButton>
3837
#include <QStandardItemModel>
39-
#include <QNetworkAccessManager>
40-
#include <QNetworkReply>
4138

4239

4340
QgsStyleExportImportDialog::QgsStyleExportImportDialog( QgsStyle *style, QWidget *parent, Mode mode )

‎src/gui/symbology/qgsstyleexportimportdialog.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919

2020
#include <QDialog>
2121
#include <QUrl>
22+
#include <QProgressDialog>
23+
#include <QTemporaryFile>
24+
#include <QNetworkAccessManager>
25+
#include <QNetworkReply>
26+
#include <QStandardItem>
2227

2328
#include "ui_qgsstyleexportimportdialogbase.h"
2429
#include "qgis_gui.h"
@@ -31,10 +36,6 @@ class QgsStyle;
3136
class QgsStyleGroupSelectionDialog;
3237
class QgsTemporaryCursorOverride;
3338
class QgsStyleModel;
34-
class QTemporaryFile;
35-
class QProgressDialog;
36-
class QNetworkAccessManager;
37-
class QNetworkReply;
3839

3940
/**
4041
* \ingroup gui

0 commit comments

Comments
 (0)
Please sign in to comment.