]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Don't show error message on ERR_USER_CANCELED
authorKai Uwe Broulik <kde@privat.broulik.de>
Wed, 24 Aug 2022 15:00:01 +0000 (17:00 +0200)
committerKai Uwe Broulik <kde@privat.broulik.de>
Wed, 24 Aug 2022 15:00:01 +0000 (17:00 +0200)
There's no point telling the user what they just did.

After https://invent.kde.org/frameworks/kio/-/commit/f192c133eb01bc8448d5ddd97fe20f8e6dbc467d
this error has a text associated with it, so it might
show up in the UI.

src/dolphinnewfilemenu.cpp
src/panels/folders/folderspanel.cpp
src/panels/places/placespanel.cpp
src/views/dolphinview.cpp

index f83beccdafb5c6e882b4730515108925a939b6bf..9b6b53b2e6de5c9c9d4fc8232b0962de36cb1423 100644 (file)
@@ -24,7 +24,7 @@ DolphinNewFileMenu::~DolphinNewFileMenu()
 
 void DolphinNewFileMenu::slotResult(KJob* job)
 {
-    if (job->error()) {
+    if (job->error() && job->error() != KIO::ERR_USER_CANCELED) {
         Q_EMIT errorMessage(job->errorString());
     } else {
         KNewFileMenu::slotResult(job);
index d3d8b81f14d6ed34c8cb1e0fcd457b5cc0bbc10d..d9cc6128c4ff961acf4e18cfcb9667038b6b4821 100644 (file)
@@ -255,7 +255,11 @@ void FoldersPanel::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* eve
 
         KIO::DropJob *job = DragAndDropHelper::dropUrls(destItem.mostLocalUrl(), &dropEvent, this);
         if (job) {
-            connect(job, &KIO::DropJob::result, this, [this](KJob *job) { if (job->error()) Q_EMIT errorMessage(job->errorString()); });
+            connect(job, &KIO::DropJob::result, this, [this](KJob *job) {
+                if (job->error() && job->error() != KIO::ERR_USER_CANCELED) {
+                    Q_EMIT errorMessage(job->errorString());
+                }
+            });
         }
     }
 }
index a55df9b45db925130330d13cb8a1babb18d7ef26..095dc99704f9ba0ea6f42a743f6adbe331da34d4 100644 (file)
@@ -173,7 +173,11 @@ void PlacesPanel::slotUrlsDropped(const QUrl& dest, QDropEvent* event, QWidget*
 {
     KIO::DropJob *job = DragAndDropHelper::dropUrls(dest, event, parent);
     if (job) {
-        connect(job, &KIO::DropJob::result, this, [this](KJob *job) { if (job->error()) Q_EMIT errorMessage(job->errorString()); });
+        connect(job, &KIO::DropJob::result, this, [this](KJob *job) {
+            if (job->error() && job->error() != KIO::ERR_USER_CANCELED) {
+                Q_EMIT errorMessage(job->errorString());
+            }
+        });
     }
 }
 
index c3460067839705ee65eb97febe5b95c3810b33bd..a00d485c85dc3c4008712a686915cb1df09eeb67 100644 (file)
@@ -1367,7 +1367,7 @@ void DolphinView::slotItemCreated(const QUrl& url)
 
 void DolphinView::slotJobResult(KJob *job)
 {
-    if (job->error()) {
+    if (job->error() && job->error() != KIO::ERR_USER_CANCELED) {
         Q_EMIT errorMessage(job->errorString());
     }
     if (!m_selectedUrls.isEmpty()) {