summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/gtksymbols.cpp
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2009-09-02 10:56:51 (GMT)
committerJens Bache-Wiig <jbache@trolltech.com>2009-09-02 10:58:57 (GMT)
commite008ce19585bf607ff652ab95391a890a9523076 (patch)
treedc7838c85d1ddf3126566b50a672ca16a4faedb2 /src/gui/styles/gtksymbols.cpp
parent66fc43343b06575a97b84ad44d70fd3082a6140e (diff)
downloadQt-e008ce19585bf607ff652ab95391a890a9523076.zip
Qt-e008ce19585bf607ff652ab95391a890a9523076.tar.gz
Qt-e008ce19585bf607ff652ab95391a890a9523076.tar.bz2
Respect "menus_have_icons" property in GTK+
The default value is planned to be changed in the next minor update to Gtk+ (2.28), hence we need to read this dynamically now. We also added a helper-function to easily read a gconf bool. Note, as a bonus feature I also added support for "buttons_have_icons". Task-number: 260684 Reviewed-by: joao
Diffstat (limited to 'src/gui/styles/gtksymbols.cpp')
-rw-r--r--src/gui/styles/gtksymbols.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp
index 0d34c77..b61675b 100644
--- a/src/gui/styles/gtksymbols.cpp
+++ b/src/gui/styles/gtksymbols.cpp
@@ -194,6 +194,7 @@ Ptr_gdk_x11_drawable_get_xdisplay QGtk::gdk_x11_drawable_get_xdisplay = 0;
Ptr_gconf_client_get_default QGtk::gconf_client_get_default = 0;
Ptr_gconf_client_get_string QGtk::gconf_client_get_string = 0;
+Ptr_gconf_client_get_bool QGtk::gconf_client_get_bool = 0;
static QString classPath(GtkWidget *widget)
{
@@ -336,6 +337,7 @@ static bool resolveGConf()
if (!QGtk::gconf_client_get_default) {
QGtk::gconf_client_get_default = (Ptr_gconf_client_get_default)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_default");
QGtk::gconf_client_get_string = (Ptr_gconf_client_get_string)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_string");
+ QGtk::gconf_client_get_bool = (Ptr_gconf_client_get_bool)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_bool");
}
return (QGtk::gconf_client_get_default !=0);
}
@@ -361,6 +363,23 @@ QString QGtk::getGConfString(const QString &value, const QString &fallback)
return retVal;
}
+bool QGtk::getGConfBool(const QString &key, bool fallback)
+{
+ bool retVal = fallback;
+ if (resolveGConf()) {
+ g_type_init();
+ GConfClient* client = QGtk::gconf_client_get_default();
+ GError *err = 0;
+ bool result = QGtk::gconf_client_get_bool(client, qPrintable(key), &err);
+ g_object_unref(client);
+ if (!err)
+ retVal = result;
+ else
+ g_error_free (err);
+ }
+ return retVal;
+}
+
static QString getThemeName()
{
QString themeName;