Merge lp:~dobey/unity-scope-click/le-title into lp:unity-scope-click

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 287
Merged at revision: 291
Proposed branch: lp:~dobey/unity-scope-click/le-title
Merge into: lp:unity-scope-click
Diff against target: 105 lines (+24/-18)
3 files modified
libclickscope/click/interface.cpp (+10/-11)
libclickscope/click/preview.cpp (+10/-3)
libclickscope/tests/test_interface.cpp (+4/-4)
To merge this branch: bzr merge lp:~dobey/unity-scope-click/le-title
Reviewer Review Type Date Requested Status
Alejandro J. Cura (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+238765@code.launchpad.net

Commit message

Use the locally translated title and description for application previews.

Description of the change

Use the locally translated title and description for application previews.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alejandro J. Cura (alecu) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libclickscope/click/interface.cpp'
2--- libclickscope/click/interface.cpp 2014-08-26 14:57:03 +0000
3+++ libclickscope/click/interface.cpp 2014-10-17 19:28:53 +0000
4@@ -182,17 +182,16 @@
5 QStringList id = app_id.split("_", QString::SkipEmptyParts);
6 app.name = id[0].toUtf8().data();
7 app.version = id[2].toUtf8().data();
8- } else {
9- if (keyFile.has_key(DESKTOP_FILE_GROUP, DESKTOP_FILE_COMMENT)) {
10- app.description = get_translated_string(keyFile,
11- DESKTOP_FILE_GROUP,
12- DESKTOP_FILE_COMMENT,
13- domain);
14- }
15- if (keyFile.has_key(DESKTOP_FILE_GROUP, DESKTOP_FILE_SCREENSHOT)) {
16- app.main_screenshot = keyFile.get_string(DESKTOP_FILE_GROUP,
17- DESKTOP_FILE_SCREENSHOT);
18- }
19+ }
20+ if (keyFile.has_key(DESKTOP_FILE_GROUP, DESKTOP_FILE_COMMENT)) {
21+ app.description = get_translated_string(keyFile,
22+ DESKTOP_FILE_GROUP,
23+ DESKTOP_FILE_COMMENT,
24+ domain);
25+ }
26+ if (keyFile.has_key(DESKTOP_FILE_GROUP, DESKTOP_FILE_SCREENSHOT)) {
27+ app.main_screenshot = keyFile.get_string(DESKTOP_FILE_GROUP,
28+ DESKTOP_FILE_SCREENSHOT);
29 }
30 return app;
31 }
32
33=== modified file 'libclickscope/click/preview.cpp'
34--- libclickscope/click/preview.cpp 2014-10-10 17:53:00 +0000
35+++ libclickscope/click/preview.cpp 2014-10-17 19:28:53 +0000
36@@ -331,7 +331,7 @@
37 scopes::PreviewWidgetList widgets;
38
39 scopes::PreviewWidget header("hdr", "header");
40- header.add_attribute_value("title", scopes::Variant(details.package.title));
41+ header.add_attribute_value("title", scopes::Variant(result.title()));
42 if (!details.publisher.empty())
43 {
44 header.add_attribute_value("subtitle", scopes::Variant(details.publisher));
45@@ -340,7 +340,7 @@
46 header.add_attribute_value("mascot", scopes::Variant(details.package.icon_url));
47 widgets.push_back(header);
48
49- qDebug() << "Pushed widgets for package:" << QString::fromStdString(details.package.title);
50+ qDebug() << "Pushed widgets for package:" << QString::fromStdString(details.package.name);
51 return widgets;
52 }
53
54@@ -351,7 +351,14 @@
55 {
56 scopes::PreviewWidget summary("summary", "text");
57 summary.add_attribute_value("title", scopes::Variant(_("Info")));
58- summary.add_attribute_value("text", scopes::Variant(details.description));
59+ if (result.contains("description") && !result["description"].get_string().empty())
60+ {
61+ summary.add_attribute_value("text", scopes::Variant(result["description"].get_string()));
62+ }
63+ else
64+ {
65+ summary.add_attribute_value("text", scopes::Variant(details.description));
66+ }
67 widgets.push_back(summary);
68 }
69
70
71=== modified file 'libclickscope/tests/test_interface.cpp'
72--- libclickscope/tests/test_interface.cpp 2014-08-18 21:36:01 +0000
73+++ libclickscope/tests/test_interface.cpp 2014-10-17 19:28:53 +0000
74@@ -55,11 +55,11 @@
75 static const std::vector<click::Application> non_desktop_applications =
76 {
77 {"com.ubuntu.stock-ticker-mobile", "Stock Ticker", 0.0,
78- "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.stock-ticker-mobile/icons/stock_icon_48.png", "application:///com.ubuntu.stock-ticker-mobile_stock-ticker-mobile_0.3.7.66.desktop", "", "", ""},
79+ "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.stock-ticker-mobile/icons/stock_icon_48.png", "application:///com.ubuntu.stock-ticker-mobile_stock-ticker-mobile_0.3.7.66.desktop", "An awesome Stock Ticker application with all the features you could imagine", "", ""},
80 {"", "Weather", 0.0, "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.weather/./weather64.png", "application:///com.ubuntu.weather_weather_1.0.168.desktop", "", "", ""},
81 {"com.ubuntu.developer.webapps.webapp-twitter", "Twitter", 0.0,
82 "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.developer.webapps.webapp-twitter/./twitter.png", "application:///com.ubuntu.developer.webapps.webapp-twitter_webapp-twitter_1.0.5.desktop", "", "", ""},
83- {"com.ubuntu.music", "Music", 0.0, "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.music/images/music.png", "application:///com.ubuntu.music_music_1.1.329.desktop", "", "", ""},
84+ {"com.ubuntu.music", "Music", 0.0, "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.music/images/music.png", "application:///com.ubuntu.music_music_1.1.329.desktop", "Ubuntu Touch Music Player", "", ""},
85 {"com.ubuntu.clock", "Clock", 0.0, "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.clock/./clock64.png", "application:///com.ubuntu.clock_clock_1.0.300.desktop", "", "", ""},
86 {"com.ubuntu.dropping-letters", "Dropping Letters", 0.0, "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.dropping-letters/dropping-letters.png", "application:///com.ubuntu.dropping-letters_dropping-letters_0.1.2.2.43.desktop", "", "", ""},
87 {"com.ubuntu.developer.webapps.webapp-gmail", "Gmail", 0.0,
88@@ -72,7 +72,7 @@
89 {"com.ubuntu.shorts", "Shorts", 0.0, "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.shorts/./rssreader64.png", "application:///com.ubuntu.shorts_shorts_0.2.162.desktop", "", "", ""},
90 {"com.ubuntu.filemanager", "File Manager", 0.0, "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.filemanager/./filemanager64.png", "application:///com.ubuntu.filemanager_filemanager_0.1.1.97.desktop", "", "", ""},
91 {"com.ubuntu.calculator", "Calculator", 0.0, "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.calculator/./calculator64.png", "application:///com.ubuntu.calculator_calculator_0.1.3.206.desktop", "", "", ""},
92- {"com.ubuntu.sudoku", "Sudoku", 0.0, "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.sudoku/SudokuGameIcon.png", "application:///com.ubuntu.sudoku_sudoku_1.0.142.desktop", "", "", ""},
93+ {"com.ubuntu.sudoku", "Sudoku", 0.0, "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.sudoku/SudokuGameIcon.png", "application:///com.ubuntu.sudoku_sudoku_1.0.142.desktop", "Sudoku Game for Ubuntu Touch", "", ""},
94 {"com.ubuntu.developer.webapps.webapp-ebay", "eBay", 0.0,
95 "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.developer.webapps.webapp-ebay/./ebay.png", "application:///com.ubuntu.developer.webapps.webapp-ebay_webapp-ebay_1.0.8.desktop", "", "", ""},
96 {"com.ubuntu.developer.webapps.webapp-facebook", "Facebook", 0.0,
97@@ -250,7 +250,7 @@
98 const std::vector<click::Application> expected_results = {
99 {"com.ubuntu.clock", "Clock", 0.0, "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.clock/./clock64.png", "application:///com.ubuntu.clock_clock_1.0.300.desktop", "", "", ""},
100 {"com.ubuntu.stock-ticker-mobile", "Stock Ticker", 0.0,
101- "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.stock-ticker-mobile/icons/stock_icon_48.png", "application:///com.ubuntu.stock-ticker-mobile_stock-ticker-mobile_0.3.7.66.desktop", "", "", ""},
102+ "/usr/share/click/preinstalled/.click/users/@all/com.ubuntu.stock-ticker-mobile/icons/stock_icon_48.png", "application:///com.ubuntu.stock-ticker-mobile_stock-ticker-mobile_0.3.7.66.desktop", "An awesome Stock Ticker application with all the features you could imagine", "", ""},
103 };
104 EXPECT_EQ(expected_results, results);
105 }

Subscribers

People subscribed via source and target branches

to all changes: