Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix proj search paths are incorrectly set and missing the local profi…
…le proj folder
  • Loading branch information
github-actions[bot] authored and nirvn committed Apr 4, 2020
1 parent c22a1d0 commit 96b8943
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/core/qgstaskmanager.cpp
Expand Up @@ -18,6 +18,7 @@
#include "qgstaskmanager.h"
#include "qgsproject.h"
#include "qgsmaplayerlistutils.h"
#include <mutex>
#include <QtConcurrentRun>


Expand Down Expand Up @@ -390,8 +391,7 @@ QgsTaskManager::QgsTaskManager( QObject *parent )
: QObject( parent )
, mTaskMutex( new QMutex( QMutex::Recursive ) )
{
connect( QgsProject::instance(), static_cast < void ( QgsProject::* )( const QList< QgsMapLayer * >& ) > ( &QgsProject::layersWillBeRemoved ),
this, &QgsTaskManager::layersWillBeRemoved );

}

QgsTaskManager::~QgsTaskManager()
Expand Down Expand Up @@ -432,6 +432,15 @@ long QgsTaskManager::addTaskPrivate( QgsTask *task, QgsTaskList dependencies, bo
if ( !task )
return 0;

if ( !mInitialized )
{
mInitialized = true;
// defer connection to project until we actually need it -- we don't want to connect to the project instance in the constructor,
// cos that forces early creation of QgsProject
connect( QgsProject::instance(), static_cast < void ( QgsProject::* )( const QList< QgsMapLayer * >& ) > ( &QgsProject::layersWillBeRemoved ),
this, &QgsTaskManager::layersWillBeRemoved );
}

long taskId = mNextTaskId++;

mTaskMutex->lock();
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgstaskmanager.h
Expand Up @@ -592,6 +592,8 @@ class CORE_EXPORT QgsTaskManager : public QObject
QgsTaskRunnableWrapper *runnable = nullptr;
};

bool mInitialized = false;

mutable QMutex *mTaskMutex;

QMap< long, TaskInfo > mTasks;
Expand Down

0 comments on commit 96b8943

Please sign in to comment.