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
=== modified file 'build'
--- build 2013-04-15 16:07:58 +0000
+++ build 2013-05-01 00:00:41 +0000
@@ -50,9 +50,9 @@
50 sudo apt-get update || exit 450 sudo apt-get update || exit 4
51 echo "Installing dependencies.."51 echo "Installing dependencies.."
52 if ! $RARING; then52 if ! $RARING; then
53 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 553 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
54 else54 else
55 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 655 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
56 fi56 fi
57}57}
5858
5959
=== modified file 'main.cpp'
--- main.cpp 2013-04-18 15:31:33 +0000
+++ main.cpp 2013-05-01 00:00:41 +0000
@@ -19,6 +19,7 @@
1919
20// Qt20// Qt
21#include <QtQuick/QQuickView>21#include <QtQuick/QQuickView>
22#include <QtGui/QIcon>
22#include <QtGui/QGuiApplication>23#include <QtGui/QGuiApplication>
23#include <QtQml/QQmlEngine>24#include <QtQml/QQmlEngine>
24#include <qpa/qplatformnativeinterface.h>25#include <qpa/qplatformnativeinterface.h>
@@ -37,6 +38,13 @@
37 importPathList.append(path);38 importPathList.append(path);
38 engine->setImportPathList(importPathList);39 engine->setImportPathList(importPathList);
39}40}
41
42void resolveIconTheme() {
43 const char *ubuntuIconTheme = getenv("UBUNTU_ICON_THEME");
44 if (ubuntuIconTheme != NULL) {
45 QIcon::setThemeName(ubuntuIconTheme);
46 }
47}
40} // namespace {48} // namespace {
4149
42int main(int argc, char** argv)50int main(int argc, char** argv)
@@ -52,6 +60,8 @@
52 QGuiApplication::setApplicationName("Qml Phone Shell");60 QGuiApplication::setApplicationName("Qml Phone Shell");
53 QGuiApplication application(argc, argv);61 QGuiApplication application(argc, argv);
5462
63 resolveIconTheme();
64
55 QStringList args = application.arguments();65 QStringList args = application.arguments();
5666
57 // The testability driver is only loaded by QApplication but not by QGuiApplication.67 // The testability driver is only loaded by QApplication but not by QGuiApplication.
5868
=== modified file 'run'
--- run 2013-04-26 08:33:41 +0000
+++ run 2013-05-01 00:00:41 +0000
@@ -35,6 +35,12 @@
35 export QML2_IMPORT_PATH=$PWD/builddir/plugins:$PWD/builddir/tests/mocks35 export QML2_IMPORT_PATH=$PWD/builddir/plugins:$PWD/builddir/tests/mocks
36fi36fi
3737
38# Force icon theme if running on the desktop, otherwise gnome theme (if running
39# on Ubuntu Desktop) will be used and icons won't be found
40if [ -n "$DESKTOP_SESSION" ]; then
41 export UBUNTU_ICON_THEME=ubuntu-mobile
42fi
43
38if $GDB; then44if $GDB; then
39 gdb -ex run --args $QML_PHONE_SHELL_PATH $@45 gdb -ex run --args $QML_PHONE_SHELL_PATH $@
40else46else

Subscribers

People subscribed via source and target branches