┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/org.kde.dolphin.appdata.xml2
-rw-r--r--src/panels/places/placesitem.cpp13
-rw-r--r--src/panels/places/placesitem.h3
-rw-r--r--src/panels/places/placesitemmodel.cpp14
-rw-r--r--src/panels/places/placesitemmodel.h6
5 files changed, 28 insertions, 10 deletions
diff --git a/src/org.kde.dolphin.appdata.xml b/src/org.kde.dolphin.appdata.xml
index 4eaaaac94..2b09f4ed9 100644
--- a/src/org.kde.dolphin.appdata.xml
+++ b/src/org.kde.dolphin.appdata.xml
@@ -541,9 +541,11 @@
<caption xml:lang="pl">Zarządzanie plikami w Dolphinie</caption>
<caption xml:lang="pt">Gestão de ficheiros no Dolphin</caption>
<caption xml:lang="pt-BR">Gerenciamento de arquivos no Dolphin</caption>
+ <caption xml:lang="sk">Správa súborov v Dolphin</caption>
<caption xml:lang="sv">Filhantering i Dolphin</caption>
<caption xml:lang="uk">Керування файлами у Dolphin</caption>
<caption xml:lang="x-test">xxFile management in Dolphinxx</caption>
+ <caption xml:lang="zh-CN">在 Dolphin 中管理文件</caption>
<caption xml:lang="zh-TW">在 Dolphin 管理檔案</caption>
<image>https://kde.org/images/screenshots/dolphin.png</image>
</screenshot>
diff --git a/src/panels/places/placesitem.cpp b/src/panels/places/placesitem.cpp
index 9f9041bfa..3d3645ea2 100644
--- a/src/panels/places/placesitem.cpp
+++ b/src/panels/places/placesitem.cpp
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (C) 2012 by Peter Penz <[email protected]> *
+ * Copyright (C) 2018 by Elvis Angelaccio <[email protected]> *
* *
* Based on KFilePlacesItem from kdelibs: *
* Copyright (C) 2007 Kevin Ottens <[email protected]> *
@@ -80,6 +81,16 @@ QString PlacesItem::udi() const
return dataValue("udi").toString();
}
+void PlacesItem::setApplicationName(const QString &applicationName)
+{
+ setDataValue("applicationName", applicationName);
+}
+
+QString PlacesItem::applicationName() const
+{
+ return dataValue("applicationName").toString();
+}
+
void PlacesItem::setHidden(bool hidden)
{
setDataValue("isHidden", hidden);
@@ -247,6 +258,8 @@ void PlacesItem::updateBookmarkForRole(const QByteArray& role)
m_bookmark.setUrl(url());
} else if (role == "udi") {
m_bookmark.setMetaDataItem(QStringLiteral("UDI"), udi());
+ } else if (role == "applicationName") {
+ m_bookmark.setMetaDataItem(QStringLiteral("OnlyInApp"), applicationName());
} else if (role == "isSystemItem") {
m_bookmark.setMetaDataItem(QStringLiteral("isSystemItem"), isSystemItem() ? QStringLiteral("true") : QStringLiteral("false"));
} else if (role == "isHidden") {
diff --git a/src/panels/places/placesitem.h b/src/panels/places/placesitem.h
index 1677cca19..eccd297fa 100644
--- a/src/panels/places/placesitem.h
+++ b/src/panels/places/placesitem.h
@@ -52,6 +52,9 @@ public:
void setUdi(const QString& udi);
QString udi() const;
+ void setApplicationName(const QString& applicationName);
+ QString applicationName() const;
+
void setHidden(bool hidden);
bool isHidden() const;
diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp
index f7fe5587c..86fbf886d 100644
--- a/src/panels/places/placesitemmodel.cpp
+++ b/src/panels/places/placesitemmodel.cpp
@@ -78,12 +78,14 @@ PlacesItemModel::~PlacesItemModel()
{
}
-void PlacesItemModel::createPlacesItem(const QString& text,
- const QUrl& url,
- const QString& iconName,
- int after)
+void PlacesItemModel::createPlacesItem(const QString &text, const QUrl &url, const QString &iconName, const QString &appName)
{
- m_sourceModel->addPlace(text, url, iconName, {}, mapToSource(after));
+ createPlacesItem(text, url, iconName, appName, -1);
+}
+
+void PlacesItemModel::createPlacesItem(const QString &text, const QUrl &url, const QString &iconName, const QString &appName, int after)
+{
+ m_sourceModel->addPlace(text, url, iconName, appName, mapToSource(after));
}
PlacesItem* PlacesItemModel::placesItem(int index) const
@@ -369,7 +371,7 @@ void PlacesItemModel::dropMimeDataBefore(int index, const QMimeData* mimeData)
continue;
}
- createPlacesItem(text, url, KIO::iconNameForUrl(url), qMax(0, index - 1));
+ createPlacesItem(text, url, KIO::iconNameForUrl(url), {}, qMax(0, index - 1));
}
}
// will save bookmark alteration and fix sort if that is broken by the drag/drop operation
diff --git a/src/panels/places/placesitemmodel.h b/src/panels/places/placesitemmodel.h
index 58d0d55b2..dde3f3d7b 100644
--- a/src/panels/places/placesitemmodel.h
+++ b/src/panels/places/placesitemmodel.h
@@ -52,10 +52,8 @@ public:
* @brief Create a new place entry in the bookmark file
* and add it to the model
*/
- void createPlacesItem(const QString& text,
- const QUrl& url,
- const QString& iconName = QString(),
- int after = -1);
+ void createPlacesItem(const QString& text, const QUrl& url, const QString& iconName = {}, const QString& appName = {});
+ void createPlacesItem(const QString& text, const QUrl& url, const QString& iconName, const QString& appName, int after);
PlacesItem* placesItem(int index) const;