diff --git a/src/fileitemactionplugin/sharefileitemaction.cpp b/src/fileitemactionplugin/sharefileitemaction.cpp --- a/src/fileitemactionplugin/sharefileitemaction.cpp +++ b/src/fileitemactionplugin/sharefileitemaction.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include "menu.h" #include "alternativesmodel.h" @@ -51,7 +52,7 @@ m_menu->model()->setPluginType(QStringLiteral("Export")); QObject::connect(m_menu, &Purpose::Menu::finished, [](const QJsonObject &output, int error, const QString &errorMessage) { - if (error == 0) { + if (error == 0 || error == KIO::ERR_USER_CANCELED) { if (output.contains(QLatin1String("url"))) QDesktopServices::openUrl(QUrl(output.value(QLatin1String("url")).toString())); } else { diff --git a/src/widgets/JobDialog.qml b/src/widgets/JobDialog.qml --- a/src/widgets/JobDialog.qml +++ b/src/widgets/JobDialog.qml @@ -40,7 +40,7 @@ minimumWidth: view.Layout.minimumWidth onClosing: { - q.finished(null, 1, i18n("Configuration cancelled")); + q.finished(null, 1 /* KIO::ERR_USER_CANCELED */, i18n("Configuration cancelled")); } function adoptJob() { @@ -92,7 +92,7 @@ Button { text: i18n("Cancel") onClicked: { - window.q.finished(null, 1, i18n("Configuration cancelled")); + window.q.finished(null, 1 /* KIO::ERR_USER_CANCELED */, i18n("Configuration cancelled")); window.visible = false; } } diff --git a/src/widgets/menu.h b/src/widgets/menu.h --- a/src/widgets/menu.h +++ b/src/widgets/menu.h @@ -50,7 +50,7 @@ * Emitted when a triggered job finishes * * @p output contains the information offered by the plugin. The information offered will depend on the plugin type. - * @p error will be 0 if the execution was successful, otherwise it will provide an error message + * @p error will be 0 if the execution was successful, KIO::ERR_USER_CANCELED if cancelled by the user, otherwise it will provide an error message * @p errorMessage the error message * * @see Purpose::Job