Merge lp:~ken-vandine/ubuntu-system-settings/rtm-1387834 into lp:ubuntu-system-settings/rtm-14.09

Proposed by Ken VanDine
Status: Rejected
Rejected by: Sebastien Bacher
Proposed branch: lp:~ken-vandine/ubuntu-system-settings/rtm-1387834
Merge into: lp:ubuntu-system-settings/rtm-14.09
Diff against target: 61 lines (+13/-14)
2 files modified
plugins/about/click.cpp (+11/-13)
plugins/about/click.h (+2/-1)
To merge this branch: bzr merge lp:~ken-vandine/ubuntu-system-settings/rtm-1387834
Reviewer Review Type Date Requested Status
Sebastien Bacher (community) Approve
Review via email: mp+242119@code.launchpad.net

Commit message

[storage] build the correct ini name rather than guessing it

Description of the change

[storage] build the correct ini name rather than guessing it

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks

review: Approve
Revision history for this message
Sebastien Bacher (seb128) wrote :

seems like we are not doing more rtm landing, so cleaning the list a bit, that one is rather going to be including with the vivid rebase

Unmerged revisions

940. By Ken VanDine

[storage] build the correct ini name rather than guessing it

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/about/click.cpp'
--- plugins/about/click.cpp 2014-09-25 13:11:09 +0000
+++ plugins/about/click.cpp 2014-11-18 19:46:48 +0000
@@ -45,7 +45,8 @@
45 */45 */
46void ClickModel::populateFromDesktopOrIniFile (Click *newClick,46void ClickModel::populateFromDesktopOrIniFile (Click *newClick,
47 QVariantMap hooks,47 QVariantMap hooks,
48 QDir directory)48 QDir directory,
49 QString name)
49{50{
50 QVariantMap appHooks;51 QVariantMap appHooks;
51 GKeyFile *appinfo = g_key_file_new();52 GKeyFile *appinfo = g_key_file_new();
@@ -69,17 +70,13 @@
69 {70 {
70 keyGroup = "ScopeConfig";71 keyGroup = "ScopeConfig";
71 keyName = "DisplayName";72 keyName = "DisplayName";
7273 QString scope(appHooks.value("scope", "").toString());
73 QDir scopeDirectory(74
74 directory.absoluteFilePath(appHooks.value("scope", "").toString()));75 QDir scopeDirectory(directory.absoluteFilePath(scope));
75 scopeDirectory.setNameFilters(QStringList()<<"*.ini");76
7677 /* the config is 'name_scope.ini' */
77 QStringList iniEntry(scopeDirectory.entryList());78 QFile desktopOrIniFile(scopeDirectory.absoluteFilePath(
7879 name + "_" + scope + ".ini"));
79 if (iniEntry.isEmpty())
80 goto out;
81
82 QFile desktopOrIniFile(scopeDirectory.absoluteFilePath(iniEntry[0]));
83 desktopOrIniFileName =80 desktopOrIniFileName =
84 g_strdup(desktopOrIniFile.fileName().toLocal8Bit().constData());81 g_strdup(desktopOrIniFile.fileName().toLocal8Bit().constData());
85 if (!desktopOrIniFile.exists())82 if (!desktopOrIniFile.exists())
@@ -193,7 +190,8 @@
193 if (hooks.isValid()) {190 if (hooks.isValid()) {
194 QVariantMap allHooks(hooks.toMap());191 QVariantMap allHooks(hooks.toMap());
195 // The desktop or ini file contains an icon and the display name192 // The desktop or ini file contains an icon and the display name
196 populateFromDesktopOrIniFile(&newClick, allHooks, directory);193 populateFromDesktopOrIniFile(&newClick, allHooks, directory,
194 manifest.value("name", "").toString());
197 }195 }
198196
199 newClick.installSize = manifest.value("installed-size",197 newClick.installSize = manifest.value("installed-size",
200198
=== modified file 'plugins/about/click.h'
--- plugins/about/click.h 2014-09-25 11:17:42 +0000
+++ plugins/about/click.h 2014-11-18 19:46:48 +0000
@@ -58,7 +58,8 @@
58private:58private:
59 void populateFromDesktopOrIniFile(Click *newClick,59 void populateFromDesktopOrIniFile(Click *newClick,
60 QVariantMap hooks,60 QVariantMap hooks,
61 QDir directory);61 QDir directory,
62 QString name);
62 Click buildClick(QVariantMap manifest);63 Click buildClick(QVariantMap manifest);
63 QList<Click> buildClickList();64 QList<Click> buildClickList();
6465

Subscribers

People subscribed via source and target branches