diff --git a/wallpapers/image/backgroundlistmodel.h b/wallpapers/image/backgroundlistmodel.h --- a/wallpapers/image/backgroundlistmodel.h +++ b/wallpapers/image/backgroundlistmodel.h @@ -90,6 +90,7 @@ int count() const {return m_packages.size();}; + Q_INVOKABLE void openContainingFolder(int rowIndex); Q_INVOKABLE void setPendingDeletion(int rowIndex, bool pendingDeletion); const QStringList wallpapersAwaitingDeletion(); diff --git a/wallpapers/image/backgroundlistmodel.cpp b/wallpapers/image/backgroundlistmodel.cpp --- a/wallpapers/image/backgroundlistmodel.cpp +++ b/wallpapers/image/backgroundlistmodel.cpp @@ -44,6 +44,8 @@ #include #include +#include + #include "image.h" QStringList BackgroundFinder::m_suffixes; @@ -470,6 +472,11 @@ return m_packages.at(index); } +void BackgroundListModel::openContainingFolder(int rowIndex) +{ + KIO::highlightInFileManager({index(rowIndex, 0).data(PathRole).toUrl()}); +} + void BackgroundListModel::setPendingDeletion(int rowIndex, bool pendingDeletion) { setData(index(rowIndex, 0), pendingDeletion, PendingDeletionRole); diff --git a/wallpapers/image/imagepackage/contents/ui/WallpaperDelegate.qml b/wallpapers/image/imagepackage/contents/ui/WallpaperDelegate.qml --- a/wallpapers/image/imagepackage/contents/ui/WallpaperDelegate.qml +++ b/wallpapers/image/imagepackage/contents/ui/WallpaperDelegate.qml @@ -110,6 +110,25 @@ PlasmaComponents.ToolButton { anchors { top: parent.top + left: parent.left + margins: units.smallSpacing + } + iconSource: "document-open-folder" + tooltip: i18nd("plasma_applet_org.kde.image", "Open Containing Folder") + flat: false + onClicked: imageWallpaper.wallpaperModel.openContainingFolder(index) + opacity: wallpaperDelegate.containsMouse ? 1 : 0 + Behavior on opacity { + PropertyAnimation { + duration: units.longDuration + easing.type: Easing.OutQuad + } + } + } + + PlasmaComponents.ToolButton { + anchors { + top: parent.top right: parent.right margins: units.smallSpacing }