Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[launcher] Allow retrieving custom values from .desktop files

  • Loading branch information...
commit 1166cf94c0cb73ba9e58e5ceefbc048717e74074 1 parent b49b66e
@giucam giucam authored
View
8 src/components/launcheritem.cpp
@@ -297,3 +297,11 @@ void LauncherItem::setCustomTitle(QString customTitle)
emit itemChanged();
}
}
+
+QString LauncherItem::readValue(const QString &key) const
+{
+ if (_desktopEntry.isNull())
+ return QString();
+
+ return _desktopEntry->value("Desktop Entry", key);
+}
View
2  src/components/launcheritem.h
@@ -112,6 +112,8 @@ public slots:
void setCustomTitle(QString customTitle);
+ Q_INVOKABLE QString readValue(const QString &key) const;
+
signals:
void itemChanged();
void isLaunchingChanged();
View
9 tests/ut_launchermodel/ut_launchermodel.cpp
@@ -100,6 +100,15 @@ MDesktopEntry::hash() const
return 1234;
}
+QString
+MDesktopEntry::value(const QString &group, const QString &key) const
+{
+ Q_UNUSED(key)
+ Q_UNUSED(group)
+
+ return QString();
+}
+
void QTimer::singleShot(int, const QObject *receiver, const char *member)
{
// The "member" string is of form "1member()", so remove the trailing 1 and the ()
Please sign in to comment.
Something went wrong with that request. Please try again.