Skip to content

Commit

Permalink
Revert "fix removal of temporary directories"
Browse files Browse the repository at this point in the history
This reverts commit b141349, which
causes crashes in almost every unit test.
  • Loading branch information
nyalldawson committed Mar 31, 2019
1 parent e5a4716 commit 9820e6b
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 26 deletions.
1 change: 0 additions & 1 deletion python/core/auto_generated/qgsarchive.sip.in
Expand Up @@ -9,7 +9,6 @@




class QgsArchive
{
%Docstring
Expand Down
Expand Up @@ -11,6 +11,8 @@





class QgsFetchedContent : QObject
{
%Docstring
Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsarchive.cpp
Expand Up @@ -20,6 +20,7 @@
#include "qgsziputils.h"
#include "qgsmessagelog.h"
#include "qgsauxiliarystorage.h"
#include <iostream>

#include <QStandardPaths>
#include <QUuid>
Expand All @@ -31,7 +32,7 @@ QgsArchive::QgsArchive()

QgsArchive::QgsArchive( const QgsArchive &other )
: mFiles( other.mFiles )
, mDir( new QTemporaryDir() )
, mDir( new QTemporaryDir() )
{
}

Expand Down
1 change: 0 additions & 1 deletion src/core/qgsarchive.h
Expand Up @@ -20,7 +20,6 @@
#define QGSARCHIVE_H

#include "qgis_core.h"

#include <QStringList>
#include <QTemporaryFile>
#include <QTemporaryDir>
Expand Down
1 change: 1 addition & 0 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -21,6 +21,7 @@
#include <cmath>

#include <QDir>
#include <QTemporaryFile>
#include <QDomNode>
#include <QDomElement>
#include <QFileInfo>
Expand Down
5 changes: 4 additions & 1 deletion src/core/qgsnetworkcontentfetcherregistry.h
Expand Up @@ -23,12 +23,15 @@
#include <QMap>
#include <QMutex>
#include <QNetworkReply>
#include <QTemporaryFile>

#include "qgis_core.h"

class QTemporaryFile;

#include "qgstaskmanager.h"
#include "qgsnetworkcontentfetchertask.h"

class QTemporaryFile;

/**
* \class QgsFetchedContent
Expand Down
19 changes: 8 additions & 11 deletions src/core/qgsproject.cpp
Expand Up @@ -73,7 +73,7 @@
#endif

// canonical project instance
std::unique_ptr<QgsProject> QgsProject::sProject;
QgsProject *QgsProject::sProject = nullptr;

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

if ( this != sProject.get() )
clear();

clear();
delete mBadLayerHandler;
delete mRelationManager;
delete mLayerTreeRegistryBridge;
delete mRootGroup;

if ( this == sProject.get() )
if ( this == sProject )
{
sProject.release();
sProject = nullptr;
}
}

void QgsProject::setInstance( QgsProject *project )
{
sProject.reset( project );
sProject = project;
}


QgsProject *QgsProject::instance()
{
if ( !sProject.get() )
if ( !sProject )
{
sProject.reset( new QgsProject );
sProject = new QgsProject;
}
return sProject.get();
return sProject;
}

void QgsProject::setTitle( const QString &title )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsproject.h
Expand Up @@ -1385,7 +1385,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera

private:

static std::unique_ptr<QgsProject> sProject;
static QgsProject *sProject;

/**
* Set the current project instance to \a project
Expand Down
2 changes: 0 additions & 2 deletions src/core/qgssettings.cpp
Expand Up @@ -15,11 +15,9 @@


#include <cstdlib>

#include <QFileInfo>
#include <QSettings>
#include <QDir>
#include <QCoreApplication>

#include "qgssettings.h"
#include "qgslogger.h"
Expand Down
2 changes: 1 addition & 1 deletion src/crssync/main.cpp
Expand Up @@ -84,5 +84,5 @@ int main( int argc, char **argv )
std::cout << -res << " CRSs could not be updated." << std::endl;
}

return 0;
exit( 0 );
}
1 change: 1 addition & 0 deletions src/gui/qgscolorbutton.cpp
Expand Up @@ -26,6 +26,7 @@
#include "qgsguiutils.h"

#include <QPainter>
#include <QTemporaryFile>
#include <QMouseEvent>
#include <QMenu>
#include <QClipboard>
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgscolorbutton.h
Expand Up @@ -17,6 +17,7 @@

#include <QColorDialog>
#include <QToolButton>
#include <QTemporaryFile>
#include "qgis_gui.h"
#include "qgis_sip.h"

Expand Down
3 changes: 0 additions & 3 deletions src/gui/symbology/qgsstyleexportimportdialog.cpp
Expand Up @@ -33,11 +33,8 @@
#include <QCloseEvent>
#include <QFileDialog>
#include <QMessageBox>
#include <QProgressDialog>
#include <QPushButton>
#include <QStandardItemModel>
#include <QNetworkAccessManager>
#include <QNetworkReply>


QgsStyleExportImportDialog::QgsStyleExportImportDialog( QgsStyle *style, QWidget *parent, Mode mode )
Expand Down
9 changes: 5 additions & 4 deletions src/gui/symbology/qgsstyleexportimportdialog.h
Expand Up @@ -19,6 +19,11 @@

#include <QDialog>
#include <QUrl>
#include <QProgressDialog>
#include <QTemporaryFile>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QStandardItem>

#include "ui_qgsstyleexportimportdialogbase.h"
#include "qgis_gui.h"
Expand All @@ -31,10 +36,6 @@ class QgsStyle;
class QgsStyleGroupSelectionDialog;
class QgsTemporaryCursorOverride;
class QgsStyleModel;
class QTemporaryFile;
class QProgressDialog;
class QNetworkAccessManager;
class QNetworkReply;

/**
* \ingroup gui
Expand Down

0 comments on commit 9820e6b

Please sign in to comment.