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
1=== modified file 'plugins/about/click.cpp'
2--- plugins/about/click.cpp 2014-09-25 13:11:09 +0000
3+++ plugins/about/click.cpp 2014-11-18 19:46:48 +0000
4@@ -45,7 +45,8 @@
5 */
6 void ClickModel::populateFromDesktopOrIniFile (Click *newClick,
7 QVariantMap hooks,
8- QDir directory)
9+ QDir directory,
10+ QString name)
11 {
12 QVariantMap appHooks;
13 GKeyFile *appinfo = g_key_file_new();
14@@ -69,17 +70,13 @@
15 {
16 keyGroup = "ScopeConfig";
17 keyName = "DisplayName";
18-
19- QDir scopeDirectory(
20- directory.absoluteFilePath(appHooks.value("scope", "").toString()));
21- scopeDirectory.setNameFilters(QStringList()<<"*.ini");
22-
23- QStringList iniEntry(scopeDirectory.entryList());
24-
25- if (iniEntry.isEmpty())
26- goto out;
27-
28- QFile desktopOrIniFile(scopeDirectory.absoluteFilePath(iniEntry[0]));
29+ QString scope(appHooks.value("scope", "").toString());
30+
31+ QDir scopeDirectory(directory.absoluteFilePath(scope));
32+
33+ /* the config is 'name_scope.ini' */
34+ QFile desktopOrIniFile(scopeDirectory.absoluteFilePath(
35+ name + "_" + scope + ".ini"));
36 desktopOrIniFileName =
37 g_strdup(desktopOrIniFile.fileName().toLocal8Bit().constData());
38 if (!desktopOrIniFile.exists())
39@@ -193,7 +190,8 @@
40 if (hooks.isValid()) {
41 QVariantMap allHooks(hooks.toMap());
42 // The desktop or ini file contains an icon and the display name
43- populateFromDesktopOrIniFile(&newClick, allHooks, directory);
44+ populateFromDesktopOrIniFile(&newClick, allHooks, directory,
45+ manifest.value("name", "").toString());
46 }
47
48 newClick.installSize = manifest.value("installed-size",
49
50=== modified file 'plugins/about/click.h'
51--- plugins/about/click.h 2014-09-25 11:17:42 +0000
52+++ plugins/about/click.h 2014-11-18 19:46:48 +0000
53@@ -58,7 +58,8 @@
54 private:
55 void populateFromDesktopOrIniFile(Click *newClick,
56 QVariantMap hooks,
57- QDir directory);
58+ QDir directory,
59+ QString name);
60 Click buildClick(QVariantMap manifest);
61 QList<Click> buildClickList();
62

Subscribers

People subscribed via source and target branches