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

This makes ImageBackend lighter.
wilder-5.26
Fushan Wen 4 years ago
parent f246bf2938
commit 0dbcba3dec
No known key found for this signature in database
GPG Key ID: 2E48D1487C91DCAA
  1. 14
      wallpapers/image/plugin/imagebackend.cpp
  2. 1
      wallpapers/image/plugin/imagebackend.h
  3. 2
      wallpapers/image/slideshowpackage/contents/ui/SlideshowComponent.qml

@ -21,11 +21,7 @@
#include <QScreen> #include <QScreen>
#include <QStandardPaths> #include <QStandardPaths>
#include <KIO/CopyJob>
#include <KIO/Job>
#include <KIO/OpenUrlJob>
#include <KLocalizedString> #include <KLocalizedString>
#include <KNotificationJobUiDelegate>
#include "debug.h" #include "debug.h"
#include "finder/packagefinder.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 QStringList ImageBackend::uncheckedSlides() const
{ {
return m_uncheckedSlides; return m_uncheckedSlides;

@ -67,7 +67,6 @@ public:
// this is for QML use // this is for QML use
Q_INVOKABLE void addSlidePath(const QUrl &url); Q_INVOKABLE void addSlidePath(const QUrl &url);
Q_INVOKABLE void removeSlidePath(const QString &path); Q_INVOKABLE void removeSlidePath(const QString &path);
Q_INVOKABLE void openFolder(const QString &path);
Q_INVOKABLE void showFileDialog(); Q_INVOKABLE void showFileDialog();

@ -220,7 +220,7 @@ ColumnLayout {
Kirigami.Action { Kirigami.Action {
icon.name: "document-open-folder" icon.name: "document-open-folder"
tooltip: i18nd("plasma_wallpaper_org.kde.image", "Open Folder") tooltip: i18nd("plasma_wallpaper_org.kde.image", "Open Folder")
onTriggered: imageWallpaper.openFolder(modelData) onTriggered: Qt.openUrlExternally(modelData)
} }
] ]
} }

Loading…
Cancel
Save