Merge lp:~seb128/ubuntu-system-settings/storage-correct-ini-info into lp:ubuntu-system-settings

Proposed by Sebastien Bacher
Status: Merged
Approved by: Ken VanDine
Approved revision: 1164
Merged at revision: 1178
Proposed branch: lp:~seb128/ubuntu-system-settings/storage-correct-ini-info
Merge into: lp:ubuntu-system-settings
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:~seb128/ubuntu-system-settings/storage-correct-ini-info
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+240225@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
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Looks good!

review: Approve

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-10-31 08:44:23 +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-10-31 08:44:23 +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