[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: KIconLoader / QImage crash
From: Dirk Mueller <mueller () kde ! org>
Date: 2000-09-30 12:59:12
[Download RAW message or body]
On Sam, 30 Sep 2000, Dirk Mueller wrote:
> comments?
forgot to append the corrected patch..
Dirk
["patch.kiconeffect" (text/plain)]
Index: Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kdecore/Makefile.am,v
retrieving revision 1.201
diff -u -2 -d -p -t -B -b -r1.201 Makefile.am
--- Makefile.am 2000/09/08 09:23:49 1.201
+++ Makefile.am 2000/09/30 12:58:29
@@ -55,5 +55,5 @@ libkdecore_la_SOURCES = libintl.cpp kdeb
kcmdlineargs.cpp kaboutdata.cpp kcompletionbase.cpp knotifyclient.cpp \
kaudioplayer.cpp kdestyle.cpp kdcoppropertyproxy.cpp \
- kpixmapprovider.cpp qxml.cpp
+ kpixmapprovider.cpp
libkdecore_la_LDFLAGS = $(QT_LDFLAGS) $(X_LDFLAGS) $(USER_LDFLAGS) -version-info 3:0 -no-undefined
Index: kdestyle.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kdestyle.cpp,v
retrieving revision 1.26
diff -u -2 -d -p -t -B -b -r1.26 kdestyle.cpp
--- kdestyle.cpp 2000/09/27 13:05:00 1.26
+++ kdestyle.cpp 2000/09/30 12:58:29
@@ -182,9 +182,6 @@ void KDEStyle::polish(QWidget *w)
return;
if(w->inherits("QButton") ) {
- if(!w->parent() || ( !w->parent()->inherits("KToolBar") &&
- !w->parent()->inherits("KHTMLView")))
+ if(!w->parent() || ( !w->parent()->inherits("KToolBar")))
w->setBackgroundOrigin(QWidget::ParentOrigin);
- else
- w->setAutoMask(true);
}
@@ -204,9 +201,6 @@ void KDEStyle::unPolish(QWidget *w)
if(w->inherits("QButton")){
- if(!w->parent() || (!w->parent()->inherits("KToolBar") &&
- !w->parent()->inherits("KHTMLView")))
+ if(!w->parent() || (!w->parent()->inherits("KToolBar")))
w->setBackgroundOrigin(QWidget::WidgetOrigin);
- else
- w->setAutoMask(false);
}
Index: kiconeffect.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kiconeffect.cpp,v
retrieving revision 1.23
diff -u -2 -d -p -t -B -b -r1.23 kiconeffect.cpp
--- kiconeffect.cpp 2000/09/29 18:20:42 1.23
+++ kiconeffect.cpp 2000/09/30 12:58:29
@@ -15,4 +15,5 @@
#include <unistd.h>
#include <math.h>
+#include <assert.h>
#include <qstring.h>
@@ -335,8 +336,7 @@ void KIconEffect::semiTransparent(QImage
{
// Insert transparent pixel into the clut.
- int transColor = 256;
- if (img.numColors() > 255)
- {
- // no space for transparent pixel..
+ int transColor = -1;
+
+ // search for a color that is already transparent
for (x=0; x<img.numColors(); x++)
{
@@ -348,10 +348,13 @@ void KIconEffect::semiTransparent(QImage
}
}
- } else
- {
- transColor = img.numColors()-1;
- }
+
+
+ // image must have transparency
+ assert(transColor >= 0 && transColor < img.numColors());
+
img.setColor(transColor, 0);
+ if(img.depth() == 8)
+ {
for (y=0; y<img.height(); y++)
{
@@ -361,4 +364,12 @@ void KIconEffect::semiTransparent(QImage
}
}
+ else
+ {
+ // SLOOW
+ for (y=0; y<img.height(); y++)
+ for (x=(y%2); x<img.width(); x+=2)
+ img.setPixel(x, y, transColor);
+ }
+ }
}
Index: kiconloader.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kiconloader.cpp,v
retrieving revision 1.142
diff -u -2 -d -p -t -B -b -r1.142 kiconloader.cpp
--- kiconloader.cpp 2000/09/24 11:25:35 1.142
+++ kiconloader.cpp 2000/09/30 12:58:29
@@ -546,8 +546,14 @@ QPixmap KIconLoader::loadIcon(const QStr
img = d->mpEffect.doublePixels(img);
}
+#if 1
if (group >= 0)
{
+ qDebug("3");
img = d->mpEffect.apply(img, group, state);
}
+#endif
+
+ qDebug("icon.path is %s", icon.path.latin1());
+ qDebug("img isNull: %d", img.isNull());
pix.convertFromImage(img);
Index: klocale.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/klocale.cpp,v
retrieving revision 1.211
diff -u -2 -d -p -t -B -b -r1.211 klocale.cpp
--- klocale.cpp 2000/09/28 12:56:07 1.211
+++ klocale.cpp 2000/09/30 12:58:29
@@ -174,5 +174,5 @@ KLocale::KLocale( const QString& _catalo
chset = config->readEntry(QString::fromLatin1("Charset"));
}
- if (chset.isNull()) chset = QString::fromLatin1("iso-8859-1");
+ if (chset.isNull()) chset = QTextCodec::codecForLocale()->name();
catalogues = new QStrList(true);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic