Skip to content
Permalink
Browse files

fix removal of temporary directories

  • Loading branch information
jef-n committed Mar 31, 2019
1 parent ca80fb6 commit b141349c90be91f191f612b7e2a349adde3c6349
@@ -9,6 +9,7 @@




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





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

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

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

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

#include "qgis_core.h"

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

#include <QDir>
#include <QTemporaryFile>
#include <QDomNode>
#include <QDomElement>
#include <QFileInfo>
@@ -23,15 +23,12 @@
#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
QgsProject *QgsProject::sProject = nullptr;
std::unique_ptr<QgsProject> QgsProject::sProject;

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

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

delete mBadLayerHandler;
delete mRelationManager;
delete mLayerTreeRegistryBridge;
delete mRootGroup;
if ( this == sProject )

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

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


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

void QgsProject::setTitle( const QString &title )
@@ -1385,7 +1385,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera

private:

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

/**
* Set the current project instance to \a project
@@ -15,9 +15,11 @@


#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;
}

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

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

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

@@ -33,8 +33,11 @@
#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,11 +19,6 @@

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

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

/**
* \ingroup gui

1 comment on commit b141349

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson commented on b141349 Mar 31, 2019

@jef-n I've reverted in 9820e6b - this fix needs reworking as it's broken almost all the unit tests

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