Don't show error message on ERR_USER_CANCELED

There's no point telling the user what they just did.

After f192c133eb
this error has a text associated with it, so it might
show up in the UI.


(cherry picked from commit a44830c3a9)
This commit is contained in:
Kai Uwe Broulik 2022-08-24 17:00:01 +02:00
parent f595a9b7a9
commit 573fc54be3
4 changed files with 12 additions and 4 deletions

View 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);

View 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());
}
});
}
}
}

View 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());
}
});
}
}

View file

@ -1342,7 +1342,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()) {