[network/ruqola] src/widgets: Don't show kmessagewidget when we cancel saving file

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 818e8dfd461a7201679c2901bcd6a9a9d16f8eed by Laurent Montel.
Committed on 13/08/2026 at 16:46.
Pushed by mlaurent into branch 'master'.

Don't show kmessagewidget when we cancel saving file

M  +6    -3    src/widgets/dialogs/showimagewidget.cpp
M  +6    -0    src/widgets/misc/messageattachmentdownloadandsavejob.cpp

https://invent.kde.org/network/ruqola/-/commit/818e8dfd461a7201679c2901bcd6a9a9d16f8eed

diff --git a/src/widgets/dialogs/showimagewidget.cpp b/src/widgets/dialogs/showimagewidget.cpp
index 5c0cc2b774..20fe58544e 100644
--- a/src/widgets/dialogs/showimagewidget.cpp
+++ b/src/widgets/dialogs/showimagewidget.cpp
@@ -226,9 +226,12 @@ const ShowImageWidget::ImageInfo &ShowImageWidget::imageInfo() const
 
 void ShowImageWidget::saveAs()
 {
-    TextAddonsWidgets::SaveFileUtils::saveFile(this,
-                                               mRocketChatAccount->attachmentUrlFromLocalCache(mImageGraphicsView->imageInfo().bigImagePath).toLocalFile(),
-                                               i18n("Save Image"));
+#if TEXTADDONSWIDGETS_VERSION >= QT_VERSION_CHECK(2, 1, 43)
+    std::ignore =
+#endif
+        TextAddonsWidgets::SaveFileUtils::saveFile(this,
+                                                   mRocketChatAccount->attachmentUrlFromLocalCache(mImageGraphicsView->imageInfo().bigImagePath).toLocalFile(),
+                                                   i18n("Save Image"));
 }
 
 void ShowImageWidget::copyImage()
diff --git a/src/widgets/misc/messageattachmentdownloadandsavejob.cpp b/src/widgets/misc/messageattachmentdownloadandsavejob.cpp
index 54084afb7f..00aab97978 100644
--- a/src/widgets/misc/messageattachmentdownloadandsavejob.cpp
+++ b/src/widgets/misc/messageattachmentdownloadandsavejob.cpp
@@ -23,7 +23,13 @@ void MessageAttachmentDownloadAndSaveJob::slotDownloadDone(const QString &path)
 {
     switch (mInfo.actionType) {
     case MessageAttachmentDownloadAndSaveJob::ActionType::DownloadAndSave:
+#if TEXTADDONSWIDGETS_VERSION >= QT_VERSION_CHECK(2, 1, 43)
+        if (!TextAddonsWidgets::SaveFileUtils::saveFile(mInfo.parentWidget, path, saveFileString())) {
+            return;
+        }
+#else
         TextAddonsWidgets::SaveFileUtils::saveFile(mInfo.parentWidget, path, saveFileString());
+#endif
         Q_EMIT mRocketChatAccount->openSavedFileFolderDone({QUrl::fromLocalFile(path)}, RocketChatAccount::FileType::File);
         break;
     case MessageAttachmentDownloadAndSaveJob::ActionType::DownloadOnly:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.