7GSettings::GSettings(QObject *parent):
13QStringList GSettings::storedApplications() const
15 QStringList storedApps;
17 QGSettings gSettings("com.canonical.Unity.Launcher", "/com/canonical/unity/launcher/");
19 QString settingsKey = "items";
21 // If "items" doesn't contain anything yet, import unity7's "favorites"
22 if (gSettings.get(settingsKey).toStringList().isEmpty()) {
23 settingsKey = "favorites";
26 Q_FOREACH(const QString &entry, gSettings.get(settingsKey).toStringList()) {
27 qDebug() << "got entry" << entry;
28 if (entry.startsWith("application://")) {
29 // convert legacy entries to new world appids
30 QString appId = entry;
31 // Transform "application://foobar.desktop" to "foobar"
32 appId.remove(QRegExp("^application://"));
33 appId.remove(QRegExp(".desktop$"));
36 if (entry.startsWith("appid://")) {
37 QString appId = entry;
38 appId.remove("appid://");
39 if (appId.split('/').count() == 3) {
40 // Strip current-user-version in case its there
41 appId = appId.split('/').first() + "_" + appId.split('/').at(1);
49void GSettings::setStoredApplications(const QStringList &storedApplications)
51 QGSettings gSettings("com.canonical.Unity.Launcher", "/com/canonical/unity/launcher/");
52 QStringList gSettingsList;
53 Q_FOREACH(const QString &entry, storedApplications) {
54 gSettingsList << QString("appid://%1").arg(entry);
56 gSettings.set("items", gSettingsList);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list