Merge lp:~dandrader/unity/phablet_iconThemeEnvVar into lp:unity/phablet

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Albert Astals Cid
Approved revision: no longer in the source branch.
Merged at revision: 648
Proposed branch: lp:~dandrader/unity/phablet_iconThemeEnvVar
Merge into: lp:unity/phablet
Diff against target: 67 lines (+18/-2)
3 files modified
build (+2/-2)
main.cpp (+10/-0)
run (+6/-0)
To merge this branch: bzr merge lp:~dandrader/unity/phablet_iconThemeEnvVar
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+161743@code.launchpad.net

Commit message

Correctly load icons when running on the desktop

Less warnings and more eye-candy.

Description of the change

Correctly load icons when running on the desktop

Less warnings and more eye-candy.

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
Albert Astals Cid (aacid) 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 'build'
2--- build 2013-04-15 16:07:58 +0000
3+++ build 2013-05-01 00:00:41 +0000
4@@ -50,9 +50,9 @@
5 sudo apt-get update || exit 4
6 echo "Installing dependencies.."
7 if ! $RARING; then
8- sudo apt-get install -y qt-components-ubuntu qtdeclarative5-dee-plugin indicators-client indicators-client-plugin-* qtbase5-dev qtdeclarative5-dev qtdeclarative5-dev-tools qtdeclarative5-test-plugin libdee-qt5-dev libpulse-dev qtdeclarative5-xmllistmodel-plugin unity-lens-mock demo-assets libboost-regex1.49-dev || exit 5
9+ sudo apt-get install -y qt-components-ubuntu qtdeclarative5-dee-plugin indicators-client indicators-client-plugin-* qtbase5-dev qtdeclarative5-dev qtdeclarative5-dev-tools qtdeclarative5-test-plugin libdee-qt5-dev libpulse-dev qtdeclarative5-xmllistmodel-plugin unity-lens-mock demo-assets libboost-regex1.49-dev ubuntu-mobile || exit 5
10 else
11- sudo apt-get install -y qtdeclarative5-ubuntu-ui-toolkit-plugin qtdeclarative5-dee-plugin indicators-client indicators-client-plugin-* qtbase5-dev qtdeclarative5-dev qtdeclarative5-dev-tools qtdeclarative5-test-plugin libdee-qt5-dev libpulse-dev qtdeclarative5-xmllistmodel-plugin unity-lens-mock demo-assets libboost-regex1.49-dev || exit 6
12+ sudo apt-get install -y qtdeclarative5-ubuntu-ui-toolkit-plugin qtdeclarative5-dee-plugin indicators-client indicators-client-plugin-* qtbase5-dev qtdeclarative5-dev qtdeclarative5-dev-tools qtdeclarative5-test-plugin libdee-qt5-dev libpulse-dev qtdeclarative5-xmllistmodel-plugin unity-lens-mock demo-assets libboost-regex1.49-dev ubuntu-mobile || exit 6
13 fi
14 }
15
16
17=== modified file 'main.cpp'
18--- main.cpp 2013-04-18 15:31:33 +0000
19+++ main.cpp 2013-05-01 00:00:41 +0000
20@@ -19,6 +19,7 @@
21
22 // Qt
23 #include <QtQuick/QQuickView>
24+#include <QtGui/QIcon>
25 #include <QtGui/QGuiApplication>
26 #include <QtQml/QQmlEngine>
27 #include <qpa/qplatformnativeinterface.h>
28@@ -37,6 +38,13 @@
29 importPathList.append(path);
30 engine->setImportPathList(importPathList);
31 }
32+
33+void resolveIconTheme() {
34+ const char *ubuntuIconTheme = getenv("UBUNTU_ICON_THEME");
35+ if (ubuntuIconTheme != NULL) {
36+ QIcon::setThemeName(ubuntuIconTheme);
37+ }
38+}
39 } // namespace {
40
41 int main(int argc, char** argv)
42@@ -52,6 +60,8 @@
43 QGuiApplication::setApplicationName("Qml Phone Shell");
44 QGuiApplication application(argc, argv);
45
46+ resolveIconTheme();
47+
48 QStringList args = application.arguments();
49
50 // The testability driver is only loaded by QApplication but not by QGuiApplication.
51
52=== modified file 'run'
53--- run 2013-04-26 08:33:41 +0000
54+++ run 2013-05-01 00:00:41 +0000
55@@ -35,6 +35,12 @@
56 export QML2_IMPORT_PATH=$PWD/builddir/plugins:$PWD/builddir/tests/mocks
57 fi
58
59+# Force icon theme if running on the desktop, otherwise gnome theme (if running
60+# on Ubuntu Desktop) will be used and icons won't be found
61+if [ -n "$DESKTOP_SESSION" ]; then
62+ export UBUNTU_ICON_THEME=ubuntu-mobile
63+fi
64+
65 if $GDB; then
66 gdb -ex run --args $QML_PHONE_SHELL_PATH $@
67 else

Subscribers

People subscribed via source and target branches