Bug 152004 - KColorChooser crash in QtGui4!?text@QListWidgetItem on choosing "Named Colors"
Summary: KColorChooser crash in QtGui4!?text@QListWidgetItem on choosing "Named Colors"
Status: RESOLVED FIXED
Alias: None
Product: kcoloredit
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Microsoft Windows
: LO crash
Target Milestone: ---
Assignee: Percy Camilo Triveño Aucahuasi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-08 09:10 UTC by skierpage
Modified: 2008-12-09 23:37 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot 1 (118.51 KB, image/png)
2008-12-09 23:34 UTC, Percy Camilo Triveño Aucahuasi
Details
Screenshot 2 (939.03 KB, image/png)
2008-12-09 23:35 UTC, Percy Camilo Triveño Aucahuasi
Details
Screenshot 3 (945.54 KB, image/png)
2008-12-09 23:37 UTC, Percy Camilo Triveño Aucahuasi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description skierpage 2007-11-08 09:10:14 UTC
Version:            (using KDE KDE 3.95.0)
Installed from:    MS Windows Binaries
Compiler:          MSVC binaries installed from the fine kdewin-installer-gui-0.8.1-2.exe
OS:                MS Windows

(My first KDE bug report evar! ;-)

On MS Windows XP,
1. run KColorChooser.exe
2. choose "Named Colors" from its pop-up list.

Result: Immediate crash.

gdb shows:
Program received signal SIGSEGV, Segmentation fault.
0x652ccd0c in QtGui4!?text@QListWidgetItem@@QBE?AVQString@@XZ ()
   from /cygdrive/c/KDE4/bin/QtGui4.dll

The crash may occur in the underlying namedColorList widget in kdeui/colors/kcolordialog.cpp.

Before it crashes KColorChooser tries and fails to open 	"/usr/share/X11/rgb.txt", "/usr/X11R6/lib/X11/rgb.txt", "/usr/openwin/lib/X11/rgb.txt and fails each one.
(Maybe Unix users can reproduce the crash by temporarily renaming all rgb.txt instances.)

KColorTable::readNamedColors() reads these files.  It should then invoke slotShowNamedColorReadError() to display an error, instead crash.

The code shouldn't crash, but I believe even MS Windows and Mac users should the named colors like "Misty Rose" available.

One workaround is to create C:\usr\X11R6\lib\X11 and put a copy of rgb.txt (from, e.g., http://xorg.freedesktop.org/archive/X11R7.3/src/app/rgb-1.0.1.tar.bz2) in it; then Named Colors works fine.

There's probably a way for KDE on Windows to ship rgb.txt in a standard location, e.g. {KDEroot}/share/X11/rgb.txt, and have readNamedColors() find it.
Comment 1 Christian Ehrlicher 2007-11-10 16:52:05 UTC
I've fixed the crash but let the bug open until we decided what to do with rgb.txt
Comment 2 FiNeX 2008-11-19 20:24:48 UTC
Changed severity to "crash". I hope to have selected only the right bugs (>100) :-)
Comment 3 Percy Camilo Triveño Aucahuasi 2008-12-09 23:33:30 UTC
Hello all ;)

The default extensions of palettes files are:
-> "*.colors" [KDE/Oxygen palette format]
-> "*.gpl" [GIMP palette format]

Basically both formats are the same except the first line: "*.colors" has the text "KDE RGB Palette" and "*.gpl" has "GIMP Palette".

Systems with X11 environment (GNU/Linux, BSD, ...) contain the file "rgb.txt", this file hold the data in the same format of that .colors and .gpl files. However, the first line of "rgb.txt" doesn't contain a valid text, and would no be load by KColorEdit (neither by KColorDialog/KColorChooser)

If you copy the file "rgb.txt", rename to "rgb.colors" and replace the first line with "KDE RGB Palette", then KColorEdit 2.0 can open the data inside this file without any issue. Please see screenshot 1.


After that, you can move "rgb.colors" to [your-home-path]/.kde/share/config/colors and applications like KColorEdit, KColorDialog and KColorChooser can upload "rgb.colors" as if it were a "system palette". Please see the screenshot 2 and screenshot 3.

I consider "rgb.txt" as reference palette of X11 and I don't see the point of include this file inside a KDE 4 instalation.

I'm closing this bug, becouse I already showed how to include the data of "rgb.txt" inside to KDE 4 system.

Bests, 
Percy
Comment 4 Percy Camilo Triveño Aucahuasi 2008-12-09 23:34:19 UTC
Created attachment 29195 [details]
Screenshot 1

Screenshot 1
Comment 5 Percy Camilo Triveño Aucahuasi 2008-12-09 23:35:32 UTC
Created attachment 29196 [details]
Screenshot 2

Screenshot 2
Comment 6 Percy Camilo Triveño Aucahuasi 2008-12-09 23:37:12 UTC
Created attachment 29197 [details]
Screenshot 3

Screenshot 3