OSDN Git Service

getting rid of QHashableLatin1Literal
authorIvailo Monev <xakepa10@laimg.moc>
Sun, 16 Oct 2016 01:31:10 +0000 (01:31 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Sun, 16 Oct 2016 01:31:10 +0000 (01:31 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/gui/styles/qgtkpainter.cpp
src/gui/styles/qgtkstyle.cpp
src/gui/styles/qgtkstyle.h
src/gui/styles/qgtkstyle_p.cpp
src/gui/styles/qgtkstyle_p.h

index 21d6eff..68958aa 100644 (file)
@@ -143,7 +143,7 @@ QPixmap QGtkPainter::renderTheme(uchar *bdata, uchar *wdata, const QRect &rect)
     }
 
 QGtkPainter::QGtkPainter(QPainter *_painter)
-        : m_window(QGtkStylePrivate::gtkWidget("GtkWindow"))
+        : m_window(QGtkStylePrivate::gtkWidget(QLS("GtkWindow")))
         , m_painter(_painter)
         , m_alpha(true)
         , m_hflipped(false)
index c7f86e1..9a5b37e 100644 (file)
@@ -214,7 +214,7 @@ QPalette QGtkStyle::standardPalette() const
     QPalette palette = QCleanlooksStyle::standardPalette();
     if (d->isThemeAvailable()) {
         GtkStyle *style = d->gtkStyle();
-        GtkWidget *gtkButton = d->gtkWidget("GtkButton");
+        GtkWidget *gtkButton = d->gtkWidget(QLatin1String("GtkButton"));
         GtkWidget *gtkEntry = d->getTextColorWidget();
         GdkColor gdkBg, gdkBase, gdkText, gdkForeground, gdkSbg, gdkSfg, gdkaSbg, gdkaSfg;
         QColor bg, base, text, fg, highlight, highlightText, inactiveHighlight, inactiveHighlightedTExt;
@@ -253,7 +253,7 @@ QPalette QGtkStyle::standardPalette() const
         palette.setColor(QPalette::Base, base);
 
         QColor alternateRowColor = palette.base().color().lighter(93); // ref gtkstyle.c draw_flat_box
-        GtkWidget *gtkTreeView = d->gtkWidget("GtkTreeView");
+        GtkWidget *gtkTreeView = d->gtkWidget(QLatin1String("GtkTreeView"));
         GdkColor *gtkAltBase = NULL;
         gtk_widget_style_get(gtkTreeView, "odd-row-color", &gtkAltBase, NULL);
         if (gtkAltBase) {
@@ -427,14 +427,14 @@ int QGtkStyle::pixelMetric(PixelMetric metric,
         return 0;
 
     case PM_ButtonShiftHorizontal: {
-        GtkWidget *gtkButton = d->gtkWidget("GtkButton");
+        GtkWidget *gtkButton = d->gtkWidget(QLatin1String("GtkButton"));
         guint horizontal_shift;
         gtk_widget_style_get(gtkButton, "child-displacement-x", &horizontal_shift, NULL);
         return horizontal_shift;
     }
 
     case PM_ButtonShiftVertical: {
-        GtkWidget *gtkButton = d->gtkWidget("GtkButton");
+        GtkWidget *gtkButton = d->gtkWidget(QLatin1String("GtkButton"));
         guint vertical_shift;
         gtk_widget_style_get(gtkButton, "child-displacement-y", &vertical_shift, NULL);
         return vertical_shift;
@@ -444,7 +444,7 @@ int QGtkStyle::pixelMetric(PixelMetric metric,
         return 0;
 
     case PM_MenuPanelWidth: {
-        GtkWidget *gtkMenu = d->gtkWidget("GtkMenu");
+        GtkWidget *gtkMenu = d->gtkWidget(QLatin1String("GtkMenu"));
         guint horizontal_padding = 0;
         // horizontal-padding is used by Maemo to get thicker borders
         if (!gtk_check_version(2, 10, 0))
@@ -501,7 +501,7 @@ int QGtkStyle::pixelMetric(PixelMetric metric,
 
     case PM_SliderThickness:
     case PM_SliderControlThickness: {
-        GtkWidget *gtkScale = d->gtkWidget("GtkHScale");
+        GtkWidget *gtkScale = d->gtkWidget(QLatin1String("GtkHScale"));
         gint val;
         gtk_widget_style_get(gtkScale, "slider-width", &val, NULL);
         if (metric == PM_SliderControlThickness)
@@ -512,7 +512,7 @@ int QGtkStyle::pixelMetric(PixelMetric metric,
     case PM_ScrollBarExtent: {
         gint sliderLength;
         gint trough_border;
-        GtkWidget *hScrollbar = d->gtkWidget("GtkHScrollbar");
+        GtkWidget *hScrollbar = d->gtkWidget(QLS("GtkHScrollbar"));
         gtk_widget_style_get(hScrollbar,
                                "trough-border",   &trough_border,
                                "slider-width",    &sliderLength,
@@ -525,34 +525,34 @@ int QGtkStyle::pixelMetric(PixelMetric metric,
 
     case PM_SliderLength:
         gint val;
-        gtk_widget_style_get(d->gtkWidget("GtkHScale"), "slider-length", &val, NULL);
+        gtk_widget_style_get(d->gtkWidget(QLS("GtkHScale")), "slider-length", &val, NULL);
         return val;
 
     case PM_ExclusiveIndicatorWidth:
     case PM_ExclusiveIndicatorHeight:
     case PM_IndicatorWidth:
     case PM_IndicatorHeight: {
-        GtkWidget *gtkCheckButton = d->gtkWidget("GtkCheckButton");
+        GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton"));
         gint size, spacing;
         gtk_widget_style_get(gtkCheckButton, "indicator-spacing", &spacing, "indicator-size", &size, NULL);
         return size + 2 * spacing;
     }
 
     case PM_MenuBarVMargin: {
-        GtkWidget *gtkMenubar = d->gtkWidget("GtkMenuBar");
+        GtkWidget *gtkMenubar = d->gtkWidget(QLS("GtkMenuBar"));
         return  qMax(0, gtkMenubar->style->ythickness);
     }
     case PM_ScrollView_ScrollBarSpacing:
     {
         gint spacing = 3;
-        GtkWidget *gtkScrollWindow = d->gtkWidget("GtkScrolledWindow");
+        GtkWidget *gtkScrollWindow = d->gtkWidget(QLS("GtkScrolledWindow"));
         Q_ASSERT(gtkScrollWindow);
         gtk_widget_style_get(gtkScrollWindow, "scrollbar-spacing", &spacing, NULL);
         return spacing;
     }
     case PM_SubMenuOverlap: {
         gint offset = 0;
-        GtkWidget *gtkMenu = d->gtkWidget("GtkMenu");
+        GtkWidget *gtkMenu = d->gtkWidget(QLS("GtkMenu"));
         gtk_widget_style_get(gtkMenu, "horizontal-offset", &offset, NULL);
         return offset;
     }
@@ -593,7 +593,7 @@ int QGtkStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidg
     {
         if (d->isKDE4Session())
             return QCleanlooksStyle::styleHint(hint, option, widget, returnData);
-        GtkWidget *gtkToolbar = d->gtkWidget("GtkToolbar");
+        GtkWidget *gtkToolbar = d->gtkWidget(QLS("GtkToolbar"));
         GtkToolbarStyle toolbar_style = GTK_TOOLBAR_ICONS;
         g_object_get(gtkToolbar, "toolbar-style", &toolbar_style, NULL);
         switch (toolbar_style) {
@@ -616,7 +616,7 @@ int QGtkStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidg
         return int(false);
 
     case SH_ComboBox_Popup: {
-        GtkWidget *gtkComboBox = d->gtkWidget("GtkComboBox");
+        GtkWidget *gtkComboBox = d->gtkWidget(QLS("GtkComboBox"));
         gboolean appears_as_list;
         gtk_widget_style_get((GtkWidget*)gtkComboBox, "appears-as-list", &appears_as_list, NULL);
         return appears_as_list ? 0 : 1;
@@ -640,7 +640,7 @@ int QGtkStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidg
         if (widget && widget->isWindow())
             scrollbars_within_bevel = true;
         else if (!gtk_check_version(2, 12, 0)) {
-            GtkWidget *gtkScrollWindow = d->gtkWidget("GtkScrolledWindow");
+            GtkWidget *gtkScrollWindow = d->gtkWidget(QLS("GtkScrolledWindow"));
             gtk_widget_style_get(gtkScrollWindow, "scrollbars-within-bevel", &scrollbars_within_bevel, NULL);
         }
         return !scrollbars_within_bevel;
@@ -718,7 +718,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
             GtkStyle *style = gtk_rc_get_style_by_paths(gtk_settings_get_default(),
                                      "*.GtkScrolledWindow", "*.GtkScrolledWindow", gtk_window_get_type());
             if (style)
-                gtkFramePainter.paintShadow(d->gtkWidget("GtkFrame"), "viewport", pmRect,
+                gtkFramePainter.paintShadow(d->gtkWidget(QLS("GtkFrame")), "viewport", pmRect,
                                          option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE,
                                          shadow_type, style);
             QPixmapCache::insert(pmKey, pixmap);
@@ -745,7 +745,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
     break;
 
     case PE_PanelTipLabel: {
-        GtkWidget *gtkWindow = d->gtkWidget("GtkWindow"); // The Murrine Engine currently assumes a widget is passed
+        GtkWidget *gtkWindow = d->gtkWidget(QLS("GtkWindow")); // The Murrine Engine currently assumes a widget is passed
         style = gtk_rc_get_style_by_paths(gtk_settings_get_default(), "gtk-tooltips", "GtkWindow",
                 gtk_window_get_type());
         gtkPainter.paintFlatBox(gtkWindow, "tooltip", option->rect, GTK_STATE_NORMAL, GTK_SHADOW_NONE, style);
@@ -760,7 +760,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
             break;
         }
         GtkShadowType shadow_type;
-        GtkWidget *gtkStatusbarFrame = d->gtkWidget("GtkStatusbar.GtkFrame");
+        GtkWidget *gtkStatusbarFrame = d->gtkWidget(QLS("GtkStatusbar.GtkFrame"));
         gtk_widget_style_get(gtkStatusbarFrame->parent, "shadow-type", &shadow_type, NULL);
         gtkPainter.paintShadow(gtkStatusbarFrame, "frame", option->rect, GTK_STATE_NORMAL,
                                shadow_type, gtkStatusbarFrame->style);
@@ -769,7 +769,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
 
     case PE_IndicatorHeaderArrow:
         if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
-            GtkWidget *gtkTreeHeader = d->gtkWidget("GtkTreeView.GtkButton");
+            GtkWidget *gtkTreeHeader = d->gtkWidget(QLS("GtkTreeView.GtkButton"));
             GtkStateType state = gtkPainter.gtkState(option);
             style = gtkTreeHeader->style;
             GtkArrowType type = GTK_ARROW_UP;
@@ -794,7 +794,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
             QRect frameRect = option->rect.adjusted(1, 1, -1, -2);
 
             if (qobject_cast<const QTabBar*>(widget)) {
-                GtkWidget *gtkNotebook = d->gtkWidget("GtkNotebook");
+                GtkWidget *gtkNotebook = d->gtkWidget(QLS("GtkNotebook"));
                 style = gtkPainter.getStyle(gtkNotebook);
                 gtkPainter.paintFocus(gtkNotebook, "tab", frameRect.adjusted(-1, 1, 1, 1), GTK_STATE_ACTIVE, style);
             } else {
@@ -811,7 +811,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
             rect.translate(2, 0);
             GtkExpanderStyle openState = GTK_EXPANDER_EXPANDED;
             GtkExpanderStyle closedState = GTK_EXPANDER_COLLAPSED;
-            GtkWidget *gtkTreeView = d->gtkWidget("GtkTreeView");
+            GtkWidget *gtkTreeView = d->gtkWidget(QLS("GtkTreeView"));
 
             GtkStateType state = GTK_STATE_NORMAL;
             if (!(option->state & State_Enabled))
@@ -852,7 +852,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
                 if (!(option->state & State_Selected))
                     break;
             }
-            if (GtkWidget *gtkTreeView = d->gtkWidget("GtkTreeView")) {
+            if (GtkWidget *gtkTreeView = d->gtkWidget(QLS("GtkTreeView"))) {
                 const char *detail = "cell_even_ruled";
                 if (vopt && vopt->features & QStyleOptionViewItemV2::Alternate)
                     detail = "cell_odd_ruled";
@@ -876,7 +876,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
     case PE_IndicatorToolBarSeparator:
         {
             const int margin = 6;
-            GtkWidget *gtkSeparator = d->gtkWidget("GtkToolbar.GtkSeparatorToolItem");
+            GtkWidget *gtkSeparator = d->gtkWidget(QLS("GtkToolbar.GtkSeparatorToolItem"));
             if (option->state & State_Horizontal) {
                 const int offset = option->rect.width()/2;
                 QRect rect = option->rect.adjusted(offset, margin, 0, -margin);
@@ -896,7 +896,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
        break;
 
     case PE_IndicatorToolBarHandle: {
-        GtkWidget *gtkToolbar = d->gtkWidget("GtkToolbar");
+        GtkWidget *gtkToolbar = d->gtkWidget(QLS("GtkToolbar"));
         GtkShadowType shadow_type;
         gtk_widget_style_get(gtkToolbar, "shadow-type", &shadow_type, NULL);
         //Note when the toolbar is horizontal, the handle is vertical
@@ -944,7 +944,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
         GtkStateType state = gtkPainter.gtkState(option);
 
         QColor arrowColor = option->palette.buttonText().color();
-        GtkWidget *gtkArrow = d->gtkWidget("GtkArrow");
+        GtkWidget *gtkArrow = d->gtkWidget(QLS("GtkArrow"));
         GdkColor color = fromQColor(arrowColor);
         gtk_widget_modify_fg (gtkArrow, state, &color);
         gtkPainter.paintArrow(gtkArrow, "button", arrowRect,
@@ -960,7 +960,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
         break;
 
     case PE_PanelMenu: {
-            GtkWidget *gtkMenu = d->gtkWidget("GtkMenu");
+            GtkWidget *gtkMenu = d->gtkWidget(QLS("GtkMenu"));
             gtkPainter.setAlphaSupport(false); // Note, alpha disabled for performance reasons
             gtkPainter.paintBox(gtkMenu, "menu", option->rect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, gtkMenu->style, QString());
         }
@@ -972,7 +972,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
 
         // This is only used by floating tool bars
         if (qobject_cast<const QToolBar *>(widget)) {
-            GtkWidget *gtkMenubar = d->gtkWidget("GtkMenuBar");
+            GtkWidget *gtkMenubar = d->gtkWidget(QLS("GtkMenuBar"));
             gtkPainter.paintBox( gtkMenubar, "toolbar",  option->rect,
                                  GTK_STATE_NORMAL, GTK_SHADOW_OUT, style);
             gtkPainter.paintBox( gtkMenubar, "menu",  option->rect,
@@ -981,7 +981,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
         break;
 
     case PE_FrameLineEdit: {
-        GtkWidget *gtkEntry = d->gtkWidget("GtkEntry");
+        GtkWidget *gtkEntry = d->gtkWidget(QLS("GtkEntry"));
 
 
         gboolean interior_focus;
@@ -1015,7 +1015,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
 
     case PE_PanelLineEdit:
         if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
-            GtkWidget *gtkEntry = d->gtkWidget("GtkEntry");
+            GtkWidget *gtkEntry = d->gtkWidget(QLS("GtkEntry"));
             if (panel->lineWidth > 0)
                 proxy()->drawPrimitive(PE_FrameLineEdit, option, painter, widget);
             uint resolve_mask = option->palette.resolve();
@@ -1033,7 +1033,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
 
     case PE_FrameTabWidget:
         if (const QStyleOptionTabWidgetFrame *frame = qstyleoption_cast<const QStyleOptionTabWidgetFrame*>(option)) {
-            GtkWidget *gtkNotebook = d->gtkWidget("GtkNotebook");
+            GtkWidget *gtkNotebook = d->gtkWidget(QLS("GtkNotebook"));
             style = gtkPainter.getStyle(gtkNotebook);
             gtkPainter.setAlphaSupport(false);
             GtkShadowType shadow = GTK_SHADOW_OUT;
@@ -1081,7 +1081,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
         GtkStateType state = gtkPainter.gtkState(option);
         if (option->state & State_On || option->state & State_Sunken)
             state = GTK_STATE_ACTIVE;
-        GtkWidget *gtkButton = isTool ? d->gtkWidget("GtkToolButton.GtkButton") : d->gtkWidget("GtkButton");
+        GtkWidget *gtkButton = isTool ? d->gtkWidget(QLS("GtkToolButton.GtkButton")) : d->gtkWidget(QLS("GtkButton"));
         gint focusWidth, focusPad;
         gboolean interiorFocus = false;
         gtk_widget_style_get (gtkButton,
@@ -1137,14 +1137,14 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
         else
             shadow = GTK_SHADOW_OUT;
 
-        GtkWidget *gtkRadioButton = d->gtkWidget("GtkRadioButton");
+        GtkWidget *gtkRadioButton = d->gtkWidget(QLS("GtkRadioButton"));
         gint spacing;
         gtk_widget_style_get(gtkRadioButton, "indicator-spacing", &spacing, NULL);
         QRect buttonRect = option->rect.adjusted(spacing, spacing, -spacing, -spacing);
         gtkPainter.setClipRect(option->rect);
         // ### Note: Ubuntulooks breaks when the proper widget is passed
         //           Murrine engine requires a widget not to get RGBA check - warnings
-        GtkWidget *gtkCheckButton = d->gtkWidget("GtkCheckButton");
+        GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton"));
         QString key(QLS("radiobutton"));
         if (option->state & State_HasFocus) { // Themes such as Nodoka check this flag
             key += QLatin1Char('f');
@@ -1172,7 +1172,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
 
         int spacing;
 
-        GtkWidget *gtkCheckButton = d->gtkWidget("GtkCheckButton");
+        GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton"));
         QString key(QLS("checkbutton"));
         if (option->state & State_HasFocus) { // Themes such as Nodoka checks this flag
             key += QLatin1Char('f');
@@ -1311,7 +1311,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
 
             if ((groupBox->subControls & QStyle::SC_GroupBoxLabel) && !groupBox->text.isEmpty()) {
                 // Draw prelight background
-                GtkWidget *gtkCheckButton = d->gtkWidget("GtkCheckButton");
+                GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton"));
 
                 if (option->state & State_MouseOver) {
                     QRect bgRect = textRect | checkBoxRect;
@@ -1379,7 +1379,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
 
             GtkShadowType shadow = (option->state & State_Sunken || option->state & State_On ) ?
                                    GTK_SHADOW_IN : GTK_SHADOW_OUT;
-            const QHashableLatin1Literal comboBoxPath = comboBox->editable ? QHashableLatin1Literal("GtkComboBoxEntry") : QHashableLatin1Literal("GtkComboBox");
+            const QString comboBoxPath = comboBox->editable ? QLatin1String("GtkComboBoxEntry") : QLatin1String("GtkComboBox");
 
             // We use the gtk widget to position arrows and separators for us
             GtkWidget *gtkCombo = d->gtkWidget(comboBoxPath);
@@ -1387,8 +1387,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
             gtk_widget_set_direction(gtkCombo, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
             gtk_widget_size_allocate(gtkCombo, &geometry);
 
-            QHashableLatin1Literal buttonPath = comboBox->editable ? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton")
-                                : QHashableLatin1Literal("GtkComboBox.GtkToggleButton");
+            QString buttonPath = comboBox->editable ? QLatin1String("GtkComboBoxEntry.GtkToggleButton")
+                                : QLatin1String("GtkComboBox.GtkToggleButton");
             GtkWidget *gtkToggleButton = d->gtkWidget(buttonPath);
             gtk_widget_set_direction(gtkToggleButton, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
             if (gtkToggleButton && (appears_as_list || comboBox->editable)) {
@@ -1397,7 +1397,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
                 // Draw the combo box as a line edit with a button next to it
                 if (comboBox->editable || appears_as_list) {
                     GtkStateType frameState = (state == GTK_STATE_PRELIGHT) ? GTK_STATE_NORMAL : state;
-                    QHashableLatin1Literal entryPath = comboBox->editable ? QHashableLatin1Literal("GtkComboBoxEntry.GtkEntry") : QHashableLatin1Literal("GtkComboBox.GtkFrame");
+                    QString entryPath = comboBox->editable ? QLatin1String("GtkComboBoxEntry.GtkEntry") : QLatin1String("GtkComboBox.GtkFrame");
                     GtkWidget *gtkEntry = d->gtkWidget(entryPath);
                     gtk_widget_set_direction(gtkEntry, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
                     QRect frameRect = option->rect;
@@ -1423,11 +1423,11 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
                     else {
                         gtkCachedPainter.paintFlatBox(gtkEntry, "entry_bg", contentRect,
                                                 option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE,
-                                                GTK_SHADOW_NONE, gtkEntry->style, entryPath.toString() + QString::number(focus));
+                                                GTK_SHADOW_NONE, gtkEntry->style, entryPath + QString::number(focus));
                     }
 
                     gtkCachedPainter.paintShadow(gtkEntry, comboBox->editable ? "entry" : "frame", frameRect, frameState,
-                                           GTK_SHADOW_IN, gtkEntry->style, entryPath.toString() +
+                                           GTK_SHADOW_IN, gtkEntry->style, entryPath +
                                            QString::number(focus) + QString::number(comboBox->editable) +
                                            QString::number(option->direction));
                     if (focus)
@@ -1445,7 +1445,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
 
                 Q_ASSERT(gtkToggleButton);
                 gtkCachedPainter.paintBox( gtkToggleButton, "button", arrowButtonRect, buttonState,
-                                     shadow, gtkToggleButton->style, buttonPath.toString() +
+                                     shadow, gtkToggleButton->style, buttonPath +
                                      QString::number(focus) + QString::number(option->direction));
                 if (focus)
                     GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
@@ -1458,15 +1458,15 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
                 gtkCachedPainter.paintBox(gtkToggleButton, "button",
                                     buttonRect, state,
                                     shadow, gtkToggleButton->style,
-                                    buttonPath.toString() + QString::number(focus));
+                                    buttonPath + QString::number(focus));
                 if (focus)
                     GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
 
 
                 // Draw the separator between label and arrows
-                QHashableLatin1Literal vSeparatorPath = comboBox->editable
-                    ? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton.GtkHBox.GtkVSeparator")
-                    : QHashableLatin1Literal("GtkComboBox.GtkToggleButton.GtkHBox.GtkVSeparator");
+                QString vSeparatorPath = comboBox->editable
+                    ? QLatin1String("GtkComboBoxEntry.GtkToggleButton.GtkHBox.GtkVSeparator")
+                    : QLatin1String("GtkComboBox.GtkToggleButton.GtkHBox.GtkVSeparator");
 
                 if (GtkWidget *gtkVSeparator = d->gtkWidget(vSeparatorPath)) {
                     QRect vLineRect(gtkVSeparator->allocation.x,
@@ -1476,7 +1476,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
 
                     gtkCachedPainter.paintVline( gtkVSeparator, "vseparator",
                                            vLineRect, state, gtkVSeparator->style,
-                                           0, vLineRect.height(), 0,  vSeparatorPath.toString());
+                                           0, vLineRect.height(), 0,  vSeparatorPath);
 
 
                     gint interiorFocus = true;
@@ -1501,17 +1501,17 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
                 else
                     state = GTK_STATE_NORMAL;
 
-                QHashableLatin1Literal arrowPath("");
+                QString arrowPath = QLatin1String("");
                 if (comboBox->editable) {
                     if (appears_as_list)
-                        arrowPath = QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton.GtkArrow");
+                        arrowPath = QLatin1String("GtkComboBoxEntry.GtkToggleButton.GtkArrow");
                     else
-                        arrowPath = QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton.GtkHBox.GtkArrow");
+                        arrowPath = QLatin1String("GtkComboBoxEntry.GtkToggleButton.GtkHBox.GtkArrow");
                 } else {
                     if (appears_as_list)
-                        arrowPath = QHashableLatin1Literal("GtkComboBox.GtkToggleButton.GtkArrow");
+                        arrowPath = QLatin1String("GtkComboBox.GtkToggleButton.GtkArrow");
                     else
-                        arrowPath = QHashableLatin1Literal("GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow");
+                        arrowPath = QLatin1String("GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow");
                 }
 
                 GtkWidget *gtkArrow = d->gtkWidget(arrowPath);
@@ -1539,9 +1539,9 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
 
                 if (sunken) {
                     int xoff, yoff;
-                    const QHashableLatin1Literal toggleButtonPath = comboBox->editable
-                            ? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton")
-                            : QHashableLatin1Literal("GtkComboBox.GtkToggleButton");
+                    const QString toggleButtonPath = comboBox->editable
+                            ? QLatin1String("GtkComboBoxEntry.GtkToggleButton")
+                            : QLatin1String("GtkComboBox.GtkToggleButton");
 
                     GtkWidget *gtkButton = d->gtkWidget(toggleButtonPath);
                     gtk_widget_style_get(gtkButton, "child-displacement-x", &xoff, NULL);
@@ -1555,7 +1555,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
                     gtkCachedPainter.setClipRect(option->rect);
                     gtkCachedPainter.paintArrow( gtkArrow, "arrow", arrowRect,
                                            GTK_ARROW_DOWN, state, GTK_SHADOW_NONE, TRUE,
-                                           style, arrowPath.toString() + QString::number(option->direction));
+                                           style, arrowPath + QString::number(option->direction));
                 }
             }
             END_STYLE_PIXMAPCACHE;
@@ -1616,7 +1616,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
 
             QStyleOptionToolButton label = *toolbutton;
             label.state = bflags;
-            GtkWidget *gtkButton = d->gtkWidget("GtkToolButton.GtkButton");
+            GtkWidget *gtkButton = d->gtkWidget(QLS("GtkToolButton.GtkButton"));
             QPalette pal = toolbutton->palette;
             if (option->state & State_Enabled && 
                 option->state & State_MouseOver && !(widget && widget->testAttribute(Qt::WA_SetPalette))) {
@@ -1651,8 +1651,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
 
     case CC_ScrollBar:
         if (const QStyleOptionSlider *scrollBar = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
-            GtkWidget *gtkHScrollBar = d->gtkWidget("GtkHScrollbar");
-            GtkWidget *gtkVScrollBar = d->gtkWidget("GtkVScrollbar");
+            GtkWidget *gtkHScrollBar = d->gtkWidget(QLS("GtkHScrollbar"));
+            GtkWidget *gtkVScrollBar = d->gtkWidget(QLS("GtkVScrollbar"));
 
             // Fill background in case the scrollbar is partially transparent
             painter->fillRect(option->rect, option->palette.background());
@@ -1810,8 +1810,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
         if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
 
             GtkWidget *gtkSpinButton = spinBox->buttonSymbols == QAbstractSpinBox::NoButtons
-                        ? d->gtkWidget("GtkEntry")
-                        : d->gtkWidget("GtkSpinButton");
+                        ? d->gtkWidget(QLS("GtkEntry"))
+                        : d->gtkWidget(QLS("GtkSpinButton"));
             bool isEnabled = (spinBox->state & State_Enabled);
             bool hover = isEnabled && (spinBox->state & State_MouseOver);
             bool sunken = (spinBox->state & State_Sunken);
@@ -1961,8 +1961,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
 
     case CC_Slider:
         if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
-            GtkWidget *hScaleWidget = d->gtkWidget("GtkHScale");
-            GtkWidget *vScaleWidget = d->gtkWidget("GtkVScale");
+            GtkWidget *hScaleWidget = d->gtkWidget(QLS("GtkHScale"));
+            GtkWidget *vScaleWidget = d->gtkWidget(QLS("GtkVScale"));
 
             QRect groove = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget);
             QRect handle = proxy()->subControlRect(CC_Slider, option, SC_SliderHandle, widget);
@@ -2177,7 +2177,7 @@ void QGtkStyle::drawControl(ControlElement element,
     switch (element) {
     case CE_ProgressBarLabel:
         if (const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
-            GtkWidget *gtkProgressBar = d->gtkWidget("GtkProgressBar");
+            GtkWidget *gtkProgressBar = d->gtkWidget(QLS("GtkProgressBar"));
             if (!gtkProgressBar)
                 return;
 
@@ -2280,7 +2280,7 @@ void QGtkStyle::drawControl(ControlElement element,
             if (button->features & QStyleOptionButton::HasMenu)
                 ir = ir.adjusted(0, 0, -pixelMetric(PM_MenuButtonIndicator, button, widget), 0);
 
-            GtkWidget *gtkButton = d->gtkWidget("GtkButton");
+            GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton"));
             QPalette pal = button->palette;
             int labelState = GTK_STATE_INSENSITIVE;
             if (option->state & State_Enabled)
@@ -2301,7 +2301,7 @@ void QGtkStyle::drawControl(ControlElement element,
             bool isRadio = (element == CE_RadioButton);
 
             // Draw prelight background
-            GtkWidget *gtkRadioButton = d->gtkWidget("GtkRadioButton");
+            GtkWidget *gtkRadioButton = d->gtkWidget(QLS("GtkRadioButton"));
 
             if (option->state & State_MouseOver) {
                 gtkPainter.paintFlatBox(gtkRadioButton, "checkbutton", option->rect,
@@ -2369,7 +2369,7 @@ void QGtkStyle::drawControl(ControlElement element,
             }
 
             if (!cb->currentText.isEmpty() && !cb->editable) {
-                GtkWidget *gtkCombo = d->gtkWidget("GtkComboBox");
+                GtkWidget *gtkCombo = d->gtkWidget(QLS("GtkComboBox"));
                 QPalette pal = cb->palette;
                 int labelState = GTK_STATE_INSENSITIVE;
 
@@ -2446,7 +2446,7 @@ void QGtkStyle::drawControl(ControlElement element,
         // Draws the header in tables.
         if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
             Q_UNUSED(header);
-            GtkWidget *gtkTreeView = d->gtkWidget("GtkTreeView");
+            GtkWidget *gtkTreeView = d->gtkWidget(QLS("GtkTreeView"));
             // Get the middle column
             GtkTreeViewColumn *column = gtk_tree_view_get_column((GtkTreeView*)gtkTreeView, 1);
             Q_ASSERT(column);
@@ -2467,7 +2467,7 @@ void QGtkStyle::drawControl(ControlElement element,
 #ifndef QT_NO_SIZEGRIP
 
     case CE_SizeGrip: {
-        GtkWidget *gtkStatusbar = d->gtkWidget("GtkStatusbar.GtkFrame");
+        GtkWidget *gtkStatusbar = d->gtkWidget(QLS("GtkStatusbar.GtkFrame"));
         QRect gripRect = option->rect.adjusted(0, 0, -gtkStatusbar->style->xthickness, -gtkStatusbar->style->ythickness);
         gtkPainter.paintResizeGrip( gtkStatusbar, "statusbar", gripRect, GTK_STATE_NORMAL,
                                     GTK_SHADOW_OUT, QApplication::isRightToLeft() ?
@@ -2479,7 +2479,7 @@ void QGtkStyle::drawControl(ControlElement element,
 #endif // QT_NO_SIZEGRIP
 
     case CE_MenuBarEmptyArea: {
-        GtkWidget *gtkMenubar = d->gtkWidget("GtkMenuBar");
+        GtkWidget *gtkMenubar = d->gtkWidget(QLS("GtkMenuBar"));
         GdkColor gdkBg = gtkMenubar->style->bg[GTK_STATE_NORMAL]; // Theme can depend on transparency
         painter->fillRect(option->rect, QColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8));
         if (widget) { // See CE_MenuBarItem
@@ -2502,8 +2502,8 @@ void QGtkStyle::drawControl(ControlElement element,
         painter->save();
 
         if (const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
-            GtkWidget *gtkMenubarItem = d->gtkWidget("GtkMenuBar.GtkMenuItem");
-            GtkWidget *gtkMenubar = d->gtkWidget("GtkMenuBar");
+            GtkWidget *gtkMenubarItem = d->gtkWidget(QLS("GtkMenuBar.GtkMenuItem"));
+            GtkWidget *gtkMenubar = d->gtkWidget(QLS("GtkMenuBar"));
 
             style = gtkMenubarItem->style;
 
@@ -2559,7 +2559,7 @@ void QGtkStyle::drawControl(ControlElement element,
         break;
 
     case CE_Splitter: {
-        GtkWidget *gtkWindow = d->gtkWidget("GtkWindow"); // The Murrine Engine currently assumes a widget is passed
+        GtkWidget *gtkWindow = d->gtkWidget(QLS("GtkWindow")); // The Murrine Engine currently assumes a widget is passed
         gtkPainter.paintHandle(gtkWindow, "splitter", option->rect, gtkPainter.gtkState(option), GTK_SHADOW_NONE,
                                 !(option->state & State_Horizontal) ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL,
                                 style);
@@ -2579,7 +2579,7 @@ void QGtkStyle::drawControl(ControlElement element,
             if (toolbar->positionWithinLine != QStyleOptionToolBar::End)
                 rect.adjust(0, 0, 1, 0);
 
-            GtkWidget *gtkToolbar = d->gtkWidget("GtkToolbar");
+            GtkWidget *gtkToolbar = d->gtkWidget(QLS("GtkToolbar"));
             GtkShadowType shadow_type = GTK_SHADOW_NONE;
             gtk_widget_style_get(gtkToolbar, "shadow-type", &shadow_type, NULL);
             gtkPainter.paintBox( gtkToolbar, "toolbar",  rect,
@@ -2598,14 +2598,14 @@ void QGtkStyle::drawControl(ControlElement element,
             const int windowsItemHMargin      =  3; // menu item hor text margin
             const int windowsItemVMargin      = 26; // menu item ver text margin
             const int windowsRightBorder      = 15; // right border on windows
-            GtkWidget *gtkMenuItem = menuItem->checked ? d->gtkWidget("GtkMenu.GtkCheckMenuItem") :
-                                     d->gtkWidget("GtkMenu.GtkMenuItem");
+            GtkWidget *gtkMenuItem = menuItem->checked ? d->gtkWidget(QLS("GtkMenu.GtkCheckMenuItem")) :
+                                     d->gtkWidget(QLS("GtkMenu.GtkMenuItem"));
 
             style = gtkPainter.getStyle(gtkMenuItem);
             QColor shadow = option->palette.dark().color();
 
             if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) {
-                GtkWidget *gtkMenuSeparator = d->gtkWidget("GtkMenu.GtkSeparatorMenuItem");
+                GtkWidget *gtkMenuSeparator = d->gtkWidget(QLS("GtkMenu.GtkSeparatorMenuItem"));
                 painter->setPen(shadow.lighter(106));
                 gboolean wide_separators = 0;
                 gint     separator_height = 0;
@@ -2649,7 +2649,7 @@ void QGtkStyle::drawControl(ControlElement element,
             bool ignoreCheckMark = false;
 
             gint checkSize;
-            gtk_widget_style_get(d->gtkWidget("GtkMenu.GtkCheckMenuItem"), "indicator-size", &checkSize, NULL);
+            gtk_widget_style_get(d->gtkWidget(QLS("GtkMenu.GtkCheckMenuItem")), "indicator-size", &checkSize, NULL);
 
             int checkcol = qMax(menuItem->maxIconWidth, qMax(20, checkSize));
 
@@ -2858,7 +2858,7 @@ void QGtkStyle::drawControl(ControlElement element,
 
     case CE_PushButton:
         if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
-            GtkWidget *gtkButton = d->gtkWidget("GtkButton");
+            GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton"));
             proxy()->drawControl(CE_PushButtonBevel, btn, painter, widget);
             QStyleOptionButton subopt = *btn;
             subopt.rect = subElementRect(SE_PushButtonContents, btn, widget);
@@ -2884,7 +2884,7 @@ void QGtkStyle::drawControl(ControlElement element,
 
     case CE_TabBarTabShape:
         if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option)) {
-            GtkWidget *gtkNotebook = d->gtkWidget("GtkNotebook");
+            GtkWidget *gtkNotebook = d->gtkWidget(QLS("GtkNotebook"));
             style = gtkPainter.getStyle(gtkNotebook);
 
             QRect rect = option->rect;
@@ -2951,7 +2951,7 @@ void QGtkStyle::drawControl(ControlElement element,
     case CE_ProgressBarGroove:
         if (const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
             Q_UNUSED(bar);
-            GtkWidget *gtkProgressBar = d->gtkWidget("GtkProgressBar");
+            GtkWidget *gtkProgressBar = d->gtkWidget(QLS("GtkProgressBar"));
             GtkStateType state = gtkPainter.gtkState(option);
             gtkPainter.paintBox( gtkProgressBar, "trough",  option->rect, state, GTK_SHADOW_IN, gtkProgressBar->style);
         }
@@ -2961,7 +2961,7 @@ void QGtkStyle::drawControl(ControlElement element,
     case CE_ProgressBarContents:
         if (const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
             GtkStateType state = option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE;
-            GtkWidget *gtkProgressBar = d->gtkWidget("GtkProgressBar");
+            GtkWidget *gtkProgressBar = d->gtkWidget(QLS("GtkProgressBar"));
             style = gtkProgressBar->style;
             gtkPainter.paintBox( gtkProgressBar, "trough",  option->rect, state, GTK_SHADOW_IN, style);
             int xt = style->xthickness;
@@ -3118,7 +3118,7 @@ QRect QGtkStyle::subControlRect(ComplexControl control, const QStyleOptionComple
 
     case CC_SpinBox:
         if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
-            GtkWidget *gtkSpinButton = d->gtkWidget("GtkSpinButton");
+            GtkWidget *gtkSpinButton = d->gtkWidget(QLS("GtkSpinButton"));
             int center = spinbox->rect.height() / 2;
             int xt = spinbox->frame ? gtkSpinButton->style->xthickness : 0;
             int yt = spinbox->frame ? gtkSpinButton->style->ythickness : 0;
@@ -3171,18 +3171,18 @@ QRect QGtkStyle::subControlRect(ComplexControl control, const QStyleOptionComple
     case CC_ComboBox:
         if (const QStyleOptionComboBox *box = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
             // We employ the gtk widget to position arrows and separators for us
-            GtkWidget *gtkCombo = box->editable ? d->gtkWidget("GtkComboBoxEntry")
-                                                : d->gtkWidget("GtkComboBox");
+            GtkWidget *gtkCombo = box->editable ? d->gtkWidget(QLS("GtkComboBoxEntry"))
+                                                : d->gtkWidget(QLS("GtkComboBox"));
             gtk_widget_set_direction(gtkCombo, (option->direction == Qt::RightToLeft) ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
             GtkAllocation geometry = {0, 0, qMax(0, option->rect.width()), qMax(0, option->rect.height())};
             gtk_widget_size_allocate(gtkCombo, &geometry);
             int appears_as_list = !proxy()->styleHint(QStyle::SH_ComboBox_Popup, option, widget);
-            QHashableLatin1Literal arrowPath("GtkComboBoxEntry.GtkToggleButton");
+            QString arrowPath = QLatin1String("GtkComboBoxEntry.GtkToggleButton");
             if (!box->editable) {
                 if (appears_as_list)
-                    arrowPath = "GtkComboBox.GtkToggleButton";
+                    arrowPath = QLatin1String("GtkComboBox.GtkToggleButton");
                 else
-                    arrowPath = "GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow";
+                    arrowPath = QLatin1String("GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow");
             }
 
             GtkWidget *arrowWidget = d->gtkWidget(arrowPath);
@@ -3242,7 +3242,7 @@ QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option,
 
     case CT_ToolButton:
         if (const QStyleOptionToolButton *toolbutton = qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
-            GtkWidget *gtkButton = d->gtkWidget("GtkToolButton.GtkButton");
+            GtkWidget *gtkButton = d->gtkWidget(QLS("GtkToolButton.GtkButton"));
             newSize = size + QSize(2 * gtkButton->style->xthickness, 2 + 2 * gtkButton->style->ythickness);
             if (widget && qobject_cast<QToolBar *>(widget->parentWidget())) {
                 QSize minSize(0, 25);
@@ -3260,14 +3260,14 @@ QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option,
             int textMargin = 8;
 
             if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) {
-                GtkWidget *gtkMenuSeparator = d->gtkWidget("GtkMenu.GtkSeparatorMenuItem");
+                GtkWidget *gtkMenuSeparator = d->gtkWidget(QLS("GtkMenu.GtkSeparatorMenuItem"));
                 GtkRequisition sizeReq = {0, 0};
                 gtk_widget_size_request(gtkMenuSeparator, &sizeReq);
                 newSize = QSize(size.width(), sizeReq.height);
                 break;
             }
 
-            GtkWidget *gtkMenuItem = d->gtkWidget("GtkMenu.GtkCheckMenuItem");
+            GtkWidget *gtkMenuItem = d->gtkWidget(QLS("GtkMenu.GtkCheckMenuItem"));
             GtkStyle* style = gtkMenuItem->style;
 
             // Note we get the perfect height for the default font since we
@@ -3289,12 +3289,12 @@ QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option,
 
     case CT_SpinBox:
         // QSpinBox does some nasty things that depends on CT_LineEdit
-        newSize = size + QSize(0, -d->gtkWidget("GtkSpinButton")->style->ythickness * 2);
+        newSize = size + QSize(0, -d->gtkWidget(QLS("GtkSpinButton"))->style->ythickness * 2);
         break;
 
     case CT_PushButton:
         if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
-            GtkWidget *gtkButton = d->gtkWidget("GtkButton");
+            GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton"));
             gint focusPadding, focusWidth;
             gtk_widget_style_get(gtkButton, "focus-padding", &focusPadding, NULL);
             gtk_widget_style_get(gtkButton, "focus-line-width", &focusWidth, NULL);
@@ -3302,7 +3302,7 @@ QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option,
             newSize += QSize(2*gtkButton->style->xthickness + 4, 2*gtkButton->style->ythickness);
             newSize += QSize(2*(focusWidth + focusPadding + 2), 2*(focusWidth + focusPadding));
 
-            GtkWidget *gtkButtonBox = d->gtkWidget("GtkHButtonBox");
+            GtkWidget *gtkButtonBox = d->gtkWidget(QLS("GtkHButtonBox"));
             gint minWidth = 85, minHeight = 0;
             gtk_widget_style_get(gtkButtonBox, "child-min-width", &minWidth,
                                    "child-min-height", &minHeight, NULL);
@@ -3315,13 +3315,13 @@ QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option,
         break;
 
     case CT_Slider: {
-        GtkWidget *gtkSlider = d->gtkWidget("GtkHScale");
+        GtkWidget *gtkSlider = d->gtkWidget(QLS("GtkHScale"));
         newSize = size + QSize(2*gtkSlider->style->xthickness, 2*gtkSlider->style->ythickness);
     }
     break;
 
     case CT_LineEdit: {
-        GtkWidget *gtkEntry = d->gtkWidget("GtkEntry");
+        GtkWidget *gtkEntry = d->gtkWidget(QLS("GtkEntry"));
         newSize = size + QSize(2*gtkEntry->style->xthickness, 2 + 2*gtkEntry->style->ythickness);
     }
     break;
@@ -3332,7 +3332,7 @@ QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option,
 
     case CT_ComboBox:
         if (const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
-            GtkWidget *gtkCombo = d->gtkWidget("GtkComboBox");
+            GtkWidget *gtkCombo = d->gtkWidget(QLS("GtkComboBox"));
             QRect arrowButtonRect = proxy()->subControlRect(CC_ComboBox, combo, SC_ComboBoxArrow, widget);
             newSize = size + QSize(12 + arrowButtonRect.width() + 2*gtkCombo->style->xthickness, 4 + 2*gtkCombo->style->ythickness);
 
@@ -3487,7 +3487,7 @@ QRect QGtkStyle::subElementRect(SubElement element, const QStyleOption *option,
         return option->rect;
     case SE_PushButtonContents:
         if (!gtk_check_version(2, 10, 0)) {
-            GtkWidget *gtkButton = d->gtkWidget("GtkButton");
+            GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton"));
             GtkBorder *border = 0;
             gtk_widget_style_get(gtkButton, "inner-border", &border, NULL);
             if (border) {
@@ -3506,50 +3506,6 @@ QRect QGtkStyle::subElementRect(SubElement element, const QStyleOption *option,
     return r;
 }
 
-/*!
-  \reimp
-*/
-QRect QGtkStyle::itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const
-{
-    return QCleanlooksStyle::itemPixmapRect(r, flags, pixmap);
-}
-
-/*!
-  \reimp
-*/
-void QGtkStyle::drawItemPixmap(QPainter *painter, const QRect &rect,
-                            int alignment, const QPixmap &pixmap) const
-{
-    QCleanlooksStyle::drawItemPixmap(painter, rect, alignment, pixmap);
-}
-
-/*!
-  \reimp
-*/
-QStyle::SubControl QGtkStyle::hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
-                              const QPoint &pt, const QWidget *w) const
-{
-    return QCleanlooksStyle::hitTestComplexControl(cc, opt, pt, w);
-}
-
-/*!
-  \reimp
-*/
-QPixmap QGtkStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
-                                        const QStyleOption *opt) const
-{
-    return QCleanlooksStyle::generatedIconPixmap(iconMode, pixmap, opt);
-}
-
-/*!
-  \reimp
-*/
-void QGtkStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
-                                    bool enabled, const QString& text, QPalette::ColorRole textRole) const
-{
-    return QCleanlooksStyle::drawItemText(painter, rect, alignment, pal, enabled, text, textRole);
-}
-
 QT_END_NAMESPACE
 
 
index f5bb450..ec51270 100644 (file)
@@ -76,31 +76,20 @@ public:
                      QPainter *painter, const QWidget *widget) const;
     void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option,
                             QPainter *painter, const QWidget *widget) const;
-    void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
-                        const QPixmap &pixmap) const;
-    void drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
-                      bool enabled, const QString& text, QPalette::ColorRole textRole) const;
 
     int pixelMetric(PixelMetric metric, const QStyleOption *option = 0,
                     const QWidget *widget = 0) const;
     int styleHint(StyleHint hint, const QStyleOption *option,
                   const QWidget *widget, QStyleHintReturn *returnData) const;
 
-    QStyle::SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
-                              const QPoint &pt, const QWidget *w) const;
-
     QRect subControlRect(ComplexControl control, const QStyleOptionComplex *option,
                          SubControl subControl, const QWidget *widget) const;
     QRect subElementRect(SubElement sr, const QStyleOption *opt, const QWidget *w) const;
-    QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const;
-
 
     QSize sizeFromContents(ContentsType type, const QStyleOption *option,
                            const QSize &size, const QWidget *widget) const;
     QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *option,
                            const QWidget *widget) const;
-    QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
-                                const QStyleOption *opt) const;
 
     void polish(QWidget *widget);
     void polish(QApplication *app);
index f4462d4..b1b5cdc 100644 (file)
@@ -123,7 +123,7 @@ static void update_toolbar_style(GtkWidget *gtkToolBar, GParamSpec *, gpointer)
     }
 }
 
-static QHashableLatin1Literal classPath(GtkWidget *widget)
+static QString classPath(GtkWidget *widget)
 {
     char *class_path;
     gtk_widget_path (widget, NULL, &class_path, NULL);
@@ -138,7 +138,7 @@ static QHashableLatin1Literal classPath(GtkWidget *widget)
 
     g_free(class_path);
 
-    return QHashableLatin1Literal::fromData(copy);
+    return QString::fromLatin1(copy);
 }
 
 
@@ -179,7 +179,7 @@ void QGtkStylePrivate::init()
     initGtkWidgets();
 }
 
-GtkWidget* QGtkStylePrivate::gtkWidget(const QHashableLatin1Literal &path)
+GtkWidget* QGtkStylePrivate::gtkWidget(const QString &path)
 {
     GtkWidget *widget = gtkWidgetMap()->value(path);
     if (!widget) {
@@ -189,7 +189,7 @@ GtkWidget* QGtkStylePrivate::gtkWidget(const QHashableLatin1Literal &path)
     return widget;
 }
 
-GtkStyle* QGtkStylePrivate::gtkStyle(const QHashableLatin1Literal &path)
+GtkStyle* QGtkStylePrivate::gtkStyle(const QString &path)
 {
     if (GtkWidget *w = gtkWidgetMap()->value(path))
         return w->style;
@@ -261,7 +261,7 @@ void QGtkStylePrivate::initGtkWidgets() const
     }
 
     static QString themeName;
-    if (!gtkWidgetMap()->contains("GtkWindow") && themeName.isEmpty()) {
+    if (!gtkWidgetMap()->contains(QLS("GtkWindow")) && themeName.isEmpty()) {
         themeName = getThemeName();
 
         if (themeName == QLS("Qt") || themeName == QLS("Qt4")) {
@@ -280,7 +280,7 @@ void QGtkStylePrivate::initGtkWidgets() const
     // make a window
     GtkWidget* gtkWindow = gtk_window_new(GTK_WINDOW_POPUP);
     gtk_widget_realize(gtkWindow);
-    QHashableLatin1Literal widgetPath = QHashableLatin1Literal::fromData(strdup("GtkWindow"));
+    QString widgetPath = QString::fromLatin1("GtkWindow");
     removeWidgetFromMap(widgetPath);
     gtkWidgetMap()->insert(widgetPath, gtkWindow);
 
@@ -289,7 +289,7 @@ void QGtkStylePrivate::initGtkWidgets() const
     if (qApp->layoutDirection() == Qt::RightToLeft)
         gtk_widget_set_default_direction(GTK_TEXT_DIR_RTL);
 
-    if (!gtkWidgetMap()->contains("GtkButton")) {
+    if (!gtkWidgetMap()->contains(QLS("GtkButton"))) {
         GtkWidget *gtkButton = gtk_button_new();
         addWidget(gtkButton);
         g_signal_connect(gtkButton, "style-set", G_CALLBACK(gtkStyleSetCallback), 0);
@@ -327,15 +327,14 @@ void QGtkStylePrivate::initGtkWidgets() const
         // When styles change subwidgets can get rearranged
         // as with the combo box. We need to update the widget map
         // to reflect this;
-        QHash<QHashableLatin1Literal, GtkWidget*> oldMap = *gtkWidgetMap();
+        QHash<QString, GtkWidget*> oldMap = *gtkWidgetMap();
         gtkWidgetMap()->clear();
-        QHashIterator<QHashableLatin1Literal, GtkWidget*> it(oldMap);
+        QHashIterator<QString, GtkWidget*> it(oldMap);
         while (it.hasNext()) {
             it.next();
-            if (!strchr(it.key().data(), '.')) {
+            if (it.key() != QLatin1String(".")) {
                 addAllSubWidgets(it.value());
             }
-            free(const_cast<char *>(it.key().data()));
         }
     }
 }
@@ -347,11 +346,9 @@ void QGtkStylePrivate::cleanupGtkWidgets()
 {
     if (!widgetMap)
         return;
-    if (widgetMap->contains("GtkWindow")) // Gtk will destroy all children
-        gtk_widget_destroy(widgetMap->value("GtkWindow"));
-    for (QHash<QHashableLatin1Literal, GtkWidget *>::const_iterator it = widgetMap->constBegin();
-         it != widgetMap->constEnd(); ++it)
-        free(const_cast<char *>(it.key().data()));
+    if (widgetMap->contains(QLS("GtkWindow"))) // Gtk will destroy all children
+        gtk_widget_destroy(widgetMap->value(QLS("GtkWindow")));
+    widgetMap->clear();
 }
 
 QString QGtkStylePrivate::getGConfString(const QString &value, const QString &fallback)
@@ -450,7 +447,7 @@ QString QGtkStylePrivate::getIconThemeName() {
 int QGtkStylePrivate::getSpinboxArrowSize() const
 {
     const int MIN_ARROW_WIDTH = 6;
-    GtkWidget *spinButton = gtkWidget("GtkSpinButton");
+    GtkWidget *spinButton = gtkWidget(QLS("GtkSpinButton"));
     GtkStyle *style = spinButton->style;
     gint size = pango_font_description_get_size (style->font_desc);
     gint arrow_size;
@@ -470,17 +467,17 @@ bool QGtkStylePrivate::isKDE4Session()
 
 void QGtkStylePrivate::applyCustomPaletteHash()
 {
-    QPalette menuPal = gtkWidgetPalette("GtkMenu");
-    GdkColor gdkBg = gtkWidget("GtkMenu")->style->bg[GTK_STATE_NORMAL];
+    QPalette menuPal = gtkWidgetPalette(QLS("GtkMenu"));
+    GdkColor gdkBg = gtkWidget(QLS("GtkMenu"))->style->bg[GTK_STATE_NORMAL];
     QColor bgColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8);
     menuPal.setBrush(QPalette::Base, bgColor);
     menuPal.setBrush(QPalette::Window, bgColor);
     qApp->setPalette(menuPal, "QMenu");
 
-    QPalette toolbarPal = gtkWidgetPalette("GtkToolbar");
+    QPalette toolbarPal = gtkWidgetPalette(QLS("GtkToolbar"));
     qApp->setPalette(toolbarPal, "QToolBar");
 
-    QPalette menuBarPal = gtkWidgetPalette("GtkMenuBar");
+    QPalette menuBarPal = gtkWidgetPalette(QLS("GtkMenuBar"));
     qApp->setPalette(menuBarPal, "QMenuBar");
 }
 
@@ -489,7 +486,7 @@ void QGtkStylePrivate::applyCustomPaletteHash()
 */
 GtkWidget* QGtkStylePrivate::getTextColorWidget() const
 {
-    return  gtkWidget("GtkEntry");
+    return  gtkWidget(QLS("GtkEntry"));
 }
 
 void QGtkStylePrivate::setupGtkWidget(GtkWidget* widget)
@@ -498,7 +495,7 @@ void QGtkStylePrivate::setupGtkWidget(GtkWidget* widget)
         static GtkWidget* protoLayout = 0;
         if (!protoLayout) {
             protoLayout = gtk_fixed_new();
-            gtk_container_add((GtkContainer*)(gtkWidgetMap()->value("GtkWindow")), protoLayout);
+            gtk_container_add((GtkContainer*)(gtkWidgetMap()->value(QLS("GtkWindow"))), protoLayout);
         }
         Q_ASSERT(protoLayout);
 
@@ -508,12 +505,11 @@ void QGtkStylePrivate::setupGtkWidget(GtkWidget* widget)
     }
 }
 
-void QGtkStylePrivate::removeWidgetFromMap(const QHashableLatin1Literal &path)
+void QGtkStylePrivate::removeWidgetFromMap(const QString &path)
 {
     WidgetMap *map = gtkWidgetMap();
     WidgetMap::iterator it = map->find(path);
     if (it != map->end()) {
-        free(const_cast<char *>(it.key().data()));
         map->erase(it);
     }
 }
@@ -522,7 +518,7 @@ void QGtkStylePrivate::addWidgetToMap(GtkWidget *widget)
 {
     if (Q_GTK_IS_WIDGET(widget)) {
         gtk_widget_realize(widget);
-        QHashableLatin1Literal widgetPath = classPath(widget);
+        QString widgetPath = classPath(widget);
 
         removeWidgetFromMap(widgetPath);
         gtkWidgetMap()->insert(widgetPath, widget);
@@ -541,7 +537,7 @@ void QGtkStylePrivate::addAllSubWidgets(GtkWidget *widget, gpointer v)
 }
 
 // Updates window/windowtext palette based on the indicated gtk widget
-QPalette QGtkStylePrivate::gtkWidgetPalette(const QHashableLatin1Literal &gtkWidgetName) const
+QPalette QGtkStylePrivate::gtkWidgetPalette(const QString &gtkWidgetName) const
 {
     GtkWidget *gtkWidget = QGtkStylePrivate::gtkWidget(gtkWidgetName);
     Q_ASSERT(gtkWidget);
@@ -877,28 +873,6 @@ QIcon QGtkStylePrivate::getFilesystemIcon(const QFileInfo &info)
     return icon;
 }
 
-bool operator==(const QHashableLatin1Literal &l1, const QHashableLatin1Literal &l2)
-{
-    return l1.size() == l2.size() || qstrcmp(l1.data(), l2.data()) == 0;
-}
-
-// copied from qHash.cpp
-uint qHash(const QHashableLatin1Literal &key)
-{
-    int n = key.size();
-    const uchar *p = reinterpret_cast<const uchar *>(key.data());
-    uint h = 0;
-    uint g;
-
-    while (n--) {
-        h = (h << 4) + *p++;
-        if ((g = (h & 0xf0000000)) != 0)
-            h ^= g >> 23;
-        h &= ~g;
-    }
-    return h;
-}
-
 QT_END_NAMESPACE
 
 #include "moc_qgtkstyle_p.h"
index 27ab228..63b5861 100644 (file)
@@ -78,55 +78,6 @@ typedef unsigned long XID;
 
 QT_BEGIN_NAMESPACE
 
-// ### Qt 4.7 - merge with QLatin1Literal
-class QHashableLatin1Literal
-{
-public:
-    int size() const { return m_size; }
-    const char *data() const { return m_data; }
-
-#ifdef __SUNPRO_CC
-        QHashableLatin1Literal(const char* str)
-        : m_size(strlen(str)), m_data(str) {}
-#else
-    template <int N>
-        QHashableLatin1Literal(const char (&str)[N])
-        : m_size(N - 1), m_data(str) {}
-#endif
-
-    QHashableLatin1Literal(const QHashableLatin1Literal &other)
-        : m_size(other.m_size), m_data(other.m_data)
-    {}
-
-    QHashableLatin1Literal &operator=(const QHashableLatin1Literal &other)
-    {
-        if (this == &other)
-            return *this;
-        *const_cast<int *>(&m_size) = other.m_size;
-        *const_cast<char **>(&m_data) = const_cast<char *>(other.m_data);
-        return *this;
-    }
-
-    QString toString() const { return QString::fromLatin1(m_data, m_size); }
-
-    static QHashableLatin1Literal fromData(const char *str)
-    {
-        return QHashableLatin1Literal(str, qstrlen(str));
-    }
-
-private:
-    QHashableLatin1Literal(const char *str, int length)
-        : m_size(length), m_data(str)
-    {}
-
-    const int m_size;
-    const char *m_data;
-};
-
-bool operator==(const QHashableLatin1Literal &l1, const QHashableLatin1Literal &l2);
-inline bool operator!=(const QHashableLatin1Literal &l1, const QHashableLatin1Literal &l2) { return !operator==(l1, l2); }
-uint qHash(const QHashableLatin1Literal &key);
-
 typedef QStringList (*_qt_filedialog_open_filenames_hook)(QWidget * parent, const QString &caption, const QString &dir,
                                                           const QString &filter, QString *selectedFilter, QFileDialog::Options options);
 typedef QString (*_qt_filedialog_open_filename_hook)     (QWidget * parent, const QString &caption, const QString &dir,
@@ -185,8 +136,8 @@ public:
 
     QGtkStyleFilter filter;
 
-    static GtkWidget* gtkWidget(const QHashableLatin1Literal &path);
-    static GtkStyle* gtkStyle(const QHashableLatin1Literal &path = QHashableLatin1Literal("GtkWindow"));
+    static GtkWidget* gtkWidget(const QString &path);
+    static GtkStyle* gtkStyle(const QString &path = QLatin1String("GtkWindow"));
 
     virtual void initGtkMenu() const;
     virtual void initGtkTreeview() const;
@@ -223,10 +174,10 @@ public:
     static Ptr_gnome_icon_lookup_sync gnome_icon_lookup_sync;
     static Ptr_gnome_vfs_init gnome_vfs_init;
 
-    virtual QPalette gtkWidgetPalette(const QHashableLatin1Literal &gtkWidgetName) const;
+    virtual QPalette gtkWidgetPalette(const QString &gtkWidgetName) const;
 
 protected:
-    typedef QHash<QHashableLatin1Literal, GtkWidget*> WidgetMap;
+    typedef QHash<QString, GtkWidget*> WidgetMap;
 
     static inline void destroyWidgetMap()
     {
@@ -251,7 +202,7 @@ protected:
     static void addWidgetToMap(GtkWidget* widget);
     static void addAllSubWidgets(GtkWidget *widget, gpointer v = 0);
     static void addWidget(GtkWidget *widget);
-    static void removeWidgetFromMap(const QHashableLatin1Literal &path);
+    static void removeWidgetFromMap(const QString &path);
 
     virtual void init();