diff --git a/src/core/qfieldcloudprojectsmodel.cpp b/src/core/qfieldcloudprojectsmodel.cpp index 693f24015a..906896122f 100644 --- a/src/core/qfieldcloudprojectsmodel.cpp +++ b/src/core/qfieldcloudprojectsmodel.cpp @@ -1438,7 +1438,7 @@ void QFieldCloudProjectsModel::projectUpload( const QString &projectId, const bo QgsMessageLog::logMessage( QStringLiteral( "Failed to reset delta file after delta push. %1" ).arg( deltaFileWrapper->errorString() ) ); emit dataChanged( projectIndex, projectIndex, QVector() << StatusRole << ModificationRole << LastLocalPushDeltasRole ); - emit pushFinished( projectId, false ); + emit pushFinished( projectId, false, false ); projectRefreshData( projectId, ProjectRefreshReason::DeltaUploaded ); } } ); @@ -1500,12 +1500,13 @@ void QFieldCloudProjectsModel::projectUpload( const QString &projectId, const bo // download the updated files, so the files are for sure the same on the client and on the server if ( shouldDownloadUpdates ) { + emit pushFinished( projectId, true, false ); projectPackageAndDownload( projectId ); } else { emit dataChanged( projectIndex, projectIndex, QVector() << StatusRole ); - emit pushFinished( projectId, false ); + emit pushFinished( projectId, false, false ); projectRefreshData( projectId, ProjectRefreshReason::DeltaUploaded ); } } @@ -1649,7 +1650,7 @@ void QFieldCloudProjectsModel::projectCancelUpload( const QString &projectId ) project->errorStatus = UploadErrorStatus; emit dataChanged( projectIndex, projectIndex, QVector() << StatusRole << ErrorStatusRole ); - emit pushFinished( projectId, true, project->deltaFileUploadStatusString ); + emit pushFinished( projectId, false, true, project->deltaFileUploadStatusString ); return; } diff --git a/src/core/qfieldcloudprojectsmodel.h b/src/core/qfieldcloudprojectsmodel.h index e33b3744da..51d6cc8672 100644 --- a/src/core/qfieldcloudprojectsmodel.h +++ b/src/core/qfieldcloudprojectsmodel.h @@ -314,7 +314,7 @@ class QFieldCloudProjectsModel : public QAbstractListModel void networkAllAttachmentsUploaded( const QString &projectId ); void networkLayerDownloaded( const QString &projectId ); void networkAllLayersDownloaded( const QString &projectId ); - void pushFinished( const QString &projectId, bool hasError, const QString &errorString = QString() ); + void pushFinished( const QString &projectId, bool isDownloadingProject, bool hasError, const QString &errorString = QString() ); private slots: void connectionStatusChanged(); diff --git a/src/qml/qgismobileapp.qml b/src/qml/qgismobileapp.qml index 6380e4d557..0f3b8780a7 100644 --- a/src/qml/qgismobileapp.qml +++ b/src/qml/qgismobileapp.qml @@ -3736,12 +3736,14 @@ ApplicationWindow { return hasError ? displayToast(qsTr("Project %1 failed to download").arg(projectName), 'error') : displayToast(qsTr("Project %1 successfully downloaded, it's now available to open").arg(projectName)); } - onPushFinished: function (projectId, hasError, errorString) { + onPushFinished: function (projectId, isDownloadingProject, hasError, errorString) { if (hasError) { displayToast(qsTr("Changes failed to reach QFieldCloud: %1").arg(errorString), 'error'); return; } - displayToast(qsTr("Changes successfully pushed to QFieldCloud")); + if (!isDownloadingProject) { + displayToast(qsTr("Changes successfully pushed to QFieldCloud")); + } if (QFieldCloudUtils.hasPendingAttachments()) { // Go ahead and upload pending attachments in the background platformUtilities.uploadPendingAttachments(cloudConnection);