From 4ac4c0779b09de411cbdce3cabcb63d7f88889ee Mon Sep 17 00:00:00 2001 From: Matthias Kretz Date: Thu, 20 Jul 2006 13:11:46 +0000 Subject: [PATCH] toAscii() only returns a temporary QByteArray, the QPixmap ctor would crash for me: keep the QByteArray until all three pixmaps are created svn path=/trunk/KDE/kdebase/workspace/; revision=564550 --- kcmkwin/kwinoptions/mouse.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kcmkwin/kwinoptions/mouse.cpp b/kcmkwin/kwinoptions/mouse.cpp index fd3dc8b03e..5037925e16 100644 --- a/kcmkwin/kwinoptions/mouse.cpp +++ b/kcmkwin/kwinoptions/mouse.cpp @@ -44,6 +44,7 @@ #include #include +#include #include "mouse.h" #include "mouse.moc" @@ -112,13 +113,13 @@ void createMaxButtonPixmaps() "..............."}, }; - QString baseColor(". c " + KGlobalSettings::baseColor().name()); - QString textColor("# c " + KGlobalSettings::textColor().name()); + QByteArray baseColor(". c " + KGlobalSettings::baseColor().name().toAscii()); + QByteArray textColor("# c " + KGlobalSettings::textColor().name().toAscii()); for (int t = 0; t < 3; ++t) { maxButtonXpms[t][0] = "15 13 2 1"; - maxButtonXpms[t][1] = baseColor.toAscii(); - maxButtonXpms[t][2] = textColor.toAscii(); + maxButtonXpms[t][1] = baseColor.constData(); + maxButtonXpms[t][2] = textColor.constData(); maxButtonPixmaps[t] = QPixmap(maxButtonXpms[t]); maxButtonPixmaps[t].setMask(maxButtonPixmaps[t].createHeuristicMask()); }