Skip to content
Permalink
Browse files

Revert "fix removal of temporary directories"

This reverts commit b141349, which
causes crashes in almost every unit test.
  • Loading branch information
nyalldawson committed Mar 31, 2019
1 parent e5a4716 commit 9820e6b2224e5db1b61f0d36617f70dcce7c352a
@@ -9,7 +9,6 @@




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





class QgsFetchedContent : QObject
{
%Docstring
@@ -20,6 +20,7 @@
#include "qgsziputils.h"
#include "qgsmessagelog.h"
#include "qgsauxiliarystorage.h"
#include <iostream>

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

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

@@ -20,7 +20,6 @@
#define QGSARCHIVE_H

#include "qgis_core.h"

#include <QStringList>
#include <QTemporaryFile>
#include <QTemporaryDir>
@@ -21,6 +21,7 @@
#include <cmath>

#include <QDir>
#include <QTemporaryFile>
#include <QDomNode>
#include <QDomElement>
#include <QFileInfo>
@@ -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
@@ -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
@@ -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 )
@@ -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
@@ -15,11 +15,9 @@


#include <cstdlib>

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

#include "qgssettings.h"
#include "qgslogger.h"
@@ -84,5 +84,5 @@ int main( int argc, char **argv )
std::cout << -res << " CRSs could not be updated." << std::endl;
}

return 0;
exit( 0 );
}
@@ -26,6 +26,7 @@
#include "qgsguiutils.h"

#include <QPainter>
#include <QTemporaryFile>
#include <QMouseEvent>
#include <QMenu>
#include <QClipboard>
@@ -17,6 +17,7 @@

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

@@ -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 )
@@ -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"
@@ -31,10 +36,6 @@ class QgsStyle;
class QgsStyleGroupSelectionDialog;
class QgsTemporaryCursorOverride;
class QgsStyleModel;
class QTemporaryFile;
class QProgressDialog;
class QNetworkAccessManager;
class QNetworkReply;

/**
* \ingroup gui

0 comments on commit 9820e6b

Please sign in to comment.
You can’t perform that action at this time.