Verified Commit 0dbcba3d authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

wallpapers/image: replace `openFolder` with `Qt.openUrlExternally`

This makes ImageBackend lighter.
parent f246bf29
Pipeline #190311 passed with stage
in 12 minutes and 14 seconds
......@@ -21,11 +21,7 @@
#include <QScreen>
#include <QStandardPaths>
#include <KIO/CopyJob>
#include <KIO/Job>
#include <KIO/OpenUrlJob>
#include <KLocalizedString>
#include <KNotificationJobUiDelegate>
#include "debug.h"
#include "finder/packagefinder.h"
......@@ -453,16 +449,6 @@ void ImageBackend::slotSlideModelDataChanged(const QModelIndex &topLeft, const Q
}
}
void ImageBackend::openFolder(const QString &path)
{
// TODO: Move to SlideFilterModel
auto *job = new KIO::OpenUrlJob(QUrl::fromLocalFile(path));
auto *delegate = new KNotificationJobUiDelegate;
delegate->setAutoErrorHandlingEnabled(true);
job->setUiDelegate(delegate);
job->start();
}
QStringList ImageBackend::uncheckedSlides() const
{
return m_uncheckedSlides;
......
......@@ -67,7 +67,6 @@ public:
// this is for QML use
Q_INVOKABLE void addSlidePath(const QUrl &url);
Q_INVOKABLE void removeSlidePath(const QString &path);
Q_INVOKABLE void openFolder(const QString &path);
Q_INVOKABLE void showFileDialog();
......
......@@ -220,7 +220,7 @@ ColumnLayout {
Kirigami.Action {
icon.name: "document-open-folder"
tooltip: i18nd("plasma_wallpaper_org.kde.image", "Open Folder")
onTriggered: imageWallpaper.openFolder(modelData)
onTriggered: Qt.openUrlExternally(modelData)
}
]
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment