Merge lp:~tiagosh/unity-2d/bugfix-857575 into lp:unity-2d

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Gerry Boland
Approved revision: 808
Merged at revision: 810
Proposed branch: lp:~tiagosh/unity-2d/bugfix-857575
Merge into: lp:unity-2d
Diff against target: 66 lines (+10/-3)
3 files modified
CMakeLists.txt (+3/-2)
config.h.in (+1/-0)
libunity-2d-private/src/unity2ddeclarativeview.cpp (+6/-1)
To merge this branch: bzr merge lp:~tiagosh/unity-2d/bugfix-857575
Reviewer Review Type Date Requested Status
Gerry Boland Pending
Review via email: mp+84830@code.launchpad.net

Description of the change

In a particular scenario unity-2d-places may abort due to a SIGABRT raised by QConf().
If for some reason (probably during a distro upgrade) the schema file isn't properly installed and
unity-2d-places is wrapped, then it simply aborts with the following message:

unity-2d-places: [FATAL] Settings schema 'com.canonical.Unity2d' is not installed

This patch adds a simple check if the schema file is present, and if not, assume the default
value. Other components like launcher and panel won't probably have this same issue since
they keep running in memory, and not launched on-the-fly.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2011-11-23 12:43:09 +0000
3+++ CMakeLists.txt 2011-12-07 19:50:36 +0000
4@@ -9,8 +9,6 @@
5 set(UNITY_DIR /usr/share/unity/)
6 set(UNITY_2D_DATA_DIR "${CMAKE_SOURCE_DIR}/data")
7
8-configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
9-
10 # Configure debian files
11 string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" 1 -1 DEBIAN_INSTALL_PREFIX)
12 file(GLOB DEBIAN_FILES debian/*.in)
13@@ -53,6 +51,7 @@
14 set (UNITY_2D_SCHEMAS "com.canonical.Unity2d.gschema.xml")
15 set (UNITY_2D_GCONF_CONVERT "unity-2d.convert")
16 set (GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas/")
17+set (UNITY_2D_SCHEMA_FILE "${GSETTINGS_DIR}${UNITY_2D_SCHEMAS}")
18 set (GCONF_CONVERT_DIR "${CMAKE_INSTALL_PREFIX}/share/GConf/gsettings")
19 execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE GLIB_COMPILE_SCHEMAS OUTPUT_STRIP_TRAILING_WHITESPACE)
20
21@@ -69,6 +68,8 @@
22 install (CODE "message (STATUS \"Compiling GSettings schemas\")")
23 install (CODE "execute_process (COMMAND ${GLIB_COMPILE_SCHEMAS} ${GSETTINGS_DIR})")
24
25+configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
26+
27 # Install GConf to GSettings conversion file
28 install (FILES ${UNITY_2D_DATA_DIR}/${UNITY_2D_GCONF_CONVERT} DESTINATION ${GCONF_CONVERT_DIR})
29
30
31=== modified file 'config.h.in'
32--- config.h.in 2011-11-18 10:15:49 +0000
33+++ config.h.in 2011-12-07 19:50:36 +0000
34@@ -3,6 +3,7 @@
35 #define INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@"
36 #define UNITY_2D_DIR "@UNITY_2D_DIR@"
37 #define UNITY_DIR "@UNITY_DIR@"
38+#define UNITY_2D_SCHEMA_FILE "@UNITY_2D_SCHEMA_FILE@"
39
40 #include <QCoreApplication>
41 #include "qconf.h"
42
43=== modified file 'libunity-2d-private/src/unity2ddeclarativeview.cpp'
44--- libunity-2d-private/src/unity2ddeclarativeview.cpp 2011-11-18 10:15:49 +0000
45+++ libunity-2d-private/src/unity2ddeclarativeview.cpp 2011-12-07 19:50:36 +0000
46@@ -20,6 +20,7 @@
47 #include <QGLWidget>
48 #include <QVariant>
49 #include <QX11Info>
50+#include <QFileInfo>
51
52 #include <X11/Xlib.h>
53 #include <X11/Xatom.h>
54@@ -33,7 +34,11 @@
55 m_transparentBackground(false),
56 m_last_focused_window(None)
57 {
58- m_useOpenGL = unity2dConfiguration().property("useOpengl").toBool();
59+ if (!QFileInfo(UNITY_2D_SCHEMA_FILE).exists()) {
60+ m_useOpenGL = false;
61+ } else {
62+ m_useOpenGL = unity2dConfiguration().property("useOpengl").toBool();
63+ }
64
65 setupViewport();
66 }

Subscribers

People subscribed via source and target branches