diff options
author | Robert Griebl <rgriebl@trolltech.com> | 2009-11-18 14:55:44 (GMT) |
---|---|---|
committer | Robert Griebl <rgriebl@trolltech.com> | 2009-11-18 15:05:07 (GMT) |
commit | d173dabf3e441bf4a16237df1a90e256ae525596 (patch) | |
tree | 052d811b4cf33e118350586ccbd78777530f986e /src/gui/styles/qgtkstyle_p.h | |
parent | e2a6bf8d1c69d86c939aafcf357d60dcaa5f3d42 (diff) | |
download | Qt-d173dabf3e441bf4a16237df1a90e256ae525596.zip Qt-d173dabf3e441bf4a16237df1a90e256ae525596.tar.gz Qt-d173dabf3e441bf4a16237df1a90e256ae525596.tar.bz2 |
Fix QGtkStyle crash when switching themes.
This is a workaround for a bug that we introduced with the QGtkStyle refactoring
to properly support Maemo5.
RevBy: jbache
Diffstat (limited to 'src/gui/styles/qgtkstyle_p.h')
-rw-r--r-- | src/gui/styles/qgtkstyle_p.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gui/styles/qgtkstyle_p.h b/src/gui/styles/qgtkstyle_p.h index fa16769..f6ab8a3 100644 --- a/src/gui/styles/qgtkstyle_p.h +++ b/src/gui/styles/qgtkstyle_p.h @@ -255,16 +255,17 @@ class QGtkStylePrivate : public QCleanlooksStylePrivate Q_DECLARE_PUBLIC(QGtkStyle) public: QGtkStylePrivate(); + ~QGtkStylePrivate(); QGtkStyleFilter filter; static GtkWidget* gtkWidget(const QString &path); static GtkStyle* gtkStyle(const QString &path = QLatin1String("GtkWindow")); - virtual void resolveGtk(); - virtual void initGtkMenu(); - virtual void initGtkTreeview(); - virtual void initGtkWidgets(); + virtual void resolveGtk() const; + virtual void initGtkMenu() const; + virtual void initGtkTreeview() const; + virtual void initGtkWidgets() const; static void cleanupGtkWidgets(); @@ -276,7 +277,7 @@ public: static bool getGConfBool(const QString &key, bool fallback = 0); static QString getGConfString(const QString &key, const QString &fallback = QString()); - virtual QString getThemeName() const; + static QString getThemeName(); virtual int getSpinboxArrowSize() const; static void setupGtkFileChooser(GtkWidget* gtkFileChooser, QWidget *parent, @@ -412,7 +413,7 @@ public: static Ptr_gnome_icon_lookup_sync gnome_icon_lookup_sync; static Ptr_gnome_vfs_init gnome_vfs_init; - virtual QPalette gtkWidgetPalette(const QString >kWidgetName); + virtual QPalette gtkWidgetPalette(const QString >kWidgetName) const; protected: typedef QHash<QString, GtkWidget*> WidgetMap; @@ -434,6 +435,10 @@ protected: static void addWidget(GtkWidget *widget); virtual void init(); + +private: + static QList<QGtkStylePrivate *> instances; + friend class QGtkStyleUpdateScheduler; }; // Helper to ensure that we have polished all our gtk widgets @@ -442,7 +447,7 @@ class QGtkStyleUpdateScheduler : public QObject { Q_OBJECT public slots: - void updateTheme( QGtkStylePrivate* stylePrivate ); + void updateTheme(); }; QT_END_NAMESPACE |