Skip to content

Commit

Permalink
unabling project reloading after project sync
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorVieiraZ committed Apr 30, 2024
1 parent a7a1ea3 commit 293bf68
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
6 changes: 1 addition & 5 deletions app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,14 +581,10 @@ int main( int argc, char *argv[] )
QObject::connect( &pw, &ProjectWizard::projectCreated, &localProjectsManager, &LocalProjectsManager::addLocalProject );
QObject::connect( &activeProject, &ActiveProject::projectReloaded, vm.get(), &VariablesManager::merginProjectChanged );
QObject::connect( &activeProject, &ActiveProject::projectWillBeReloaded, &inputProjUtils, &InputProjUtils::resetHandlers );
QObject::connect( &syncManager, &SynchronizationManager::syncFinished, &activeProject, [&activeProject]( const QString & projectFullName, bool successfully, int version, bool reloadNeeded )
QObject::connect( &syncManager, &SynchronizationManager::syncFinished, &activeProject, [&activeProject]( const QString & projectFullName, bool successfully, int version )
{
Q_UNUSED( successfully );
Q_UNUSED( version );
if ( reloadNeeded && activeProject.projectFullName() == projectFullName )
{
activeProject.reloadProject( activeProject.qgsProject()->homePath() );
}
} );
QObject::connect( QgsApplication::messageLog(),
static_cast<void ( QgsMessageLog::* )( const QString &message, const QString &tag, Qgis::MessageLevel level )>( &QgsMessageLog::messageReceived ),
Expand Down
5 changes: 2 additions & 3 deletions app/synchronizationmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ void SynchronizationManager::onProjectSyncFinished( const QString &projectFullNa
if ( mSyncProcesses.contains( projectFullName ) )
{
SyncProcess &process = mSyncProcesses[projectFullName];
bool reloadNeeded = process.reloadProject;

if ( !successfully && process.awaitsRetry )
{
Expand All @@ -202,7 +201,7 @@ void SynchronizationManager::onProjectSyncFinished( const QString &projectFullNa
mSyncProcesses.remove( projectFullName );
}

emit syncFinished( projectFullName, successfully, version, reloadNeeded );
emit syncFinished( projectFullName, successfully, version );
}
}

Expand Down Expand Up @@ -273,7 +272,7 @@ void SynchronizationManager::onProjectSyncFailure(
else
{
mSyncProcesses.remove( projectFullName );
emit syncFinished( projectFullName, false, -1, false );
emit syncFinished( projectFullName, false, -1 );

return;
}
Expand Down
2 changes: 1 addition & 1 deletion app/synchronizationmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class SynchronizationManager : public QObject
void syncStarted( const QString &projectFullName );
void syncCancelled( const QString &projectFullName );
void syncProgressChanged( const QString &projectFullName, qreal progress );
void syncFinished( const QString &projectFullName, bool success, int newVersion, bool reloadNeeded );
void syncFinished( const QString &projectFullName, bool success, int newVersion );

void syncError( const QString &projectFullName, int errorType, bool willRetry = false, const QString &errorMessage = QLatin1String() );

Expand Down

0 comments on commit 293bf68

Please sign in to comment.