Commit 2e371d5f authored by Artem Grinev's avatar Artem Grinev
Browse files

cuttlefish: Show file in FM action

parent 1187d73e
Pipeline #165275 passed with stage
in 1 minute and 43 seconds
......@@ -10,6 +10,7 @@ ecm_add_test(iconmodeltest.cpp ../src/iconmodel.cpp ../src/sortfiltermodel.cpp
LINK_LIBRARIES
Qt::Gui
Qt::Test
KF5::KIOWidgets
KF5::ConfigCore
KF5::IconThemes
KF5::Package
......
......@@ -17,6 +17,11 @@ Item {
iconName: "document-open"
onTriggered: Qt.openUrlExternally(preview.fullPath)
},
Kirigami.Action {
text: i18n("Open icon containing folder")
iconName: "document-open-folder"
onTriggered: iconModel.openContainingFolder(preview.fullPath)
},
Kirigami.Action {
text: pickerMode ? i18n("Insert icon name") : i18n("Copy icon name to clipboard")
iconName: "edit-copy"
......
......@@ -18,6 +18,7 @@
#include <QStandardPaths>
#include <KConfigGroup>
#include <KIO/OpenFileManagerWindowJob>
#include <KIconLoader>
#include <KIconTheme>
#include <KPackage/PackageLoader>
......@@ -245,6 +246,11 @@ void IconModel::output(const QString &text)
cout.flush();
}
void IconModel::openContainingFolder(const QString &filename)
{
KIO::highlightInFileManager({QUrl(filename)});
}
QVariantList IconModel::inOtherThemes(const QString &name, int iconSize)
{
QVariantList list;
......
......@@ -57,6 +57,8 @@ public:
Q_INVOKABLE void output(const QString &text);
Q_INVOKABLE void openContainingFolder(const QString &filename);
Q_SIGNALS:
void categoriesChanged();
void loadingChanged();
......
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