
Various KDE 1.-4. Improvements
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
This is a quick-and-dirty LD_PRELOAD hack that allows *some* Gtk applications to use KDE's file dialogs when run under KDE.
The Gtk file chooser functions have been overridden to communicate with this KDE module/application.
After compiling and installing this, you can run Gtk applications in 2 ways:
A. call /usr/local/bin/kgtk-wrapper gimp
B. i. Create a symbolic link from the wrapper script to your application, e.g.
ln -s /usr/local/bin/kgtk-wrapper /usr/local/bin/gimp
ii. Make sure /usr/local/bin is before /usr/bin (or wherever gimp is installed) in your $PATH
iii. Now simply run 'gimp' - this should find the wrapper script first.
If this works OK, then edit the .desktop file (e.g. /usr/share/applications/gimp.desktop) to have "Exec=/usr/local/bin/[appname]" instead of "Exec=[appname]", e.g. for gimp.desktop this would be:
Exec=/usr/local/bin/gimp-remote-2.2 %U
or:
Exec=/usr/local/bin/kgtk-wrapper gimp-remote-2.2 %U
So far I have tested this with the following applications:
1. Kino. Works perfectly - in fact Kino was my main reason for doing this.
2. Firefox. Works with Firefox 1.5, but *not* Firefox 1.0.x
3. GIMP. Again, seems to work just fine. However, there is no progress bar on file loading - as GIMP uses a progress bar embedded in the file chooser.
4. Inkscape. Works OK - at least 0.43
5. Streamtuner - the folder browser button works.
6. AbiWord - does *not* work. Don't even try...
7. Glade2. Seems to work OK, however I have had it crash when loading Kino's .glade file, but not always. So I'm not sure if this is Glade's fault, or mine.
8. Eclipse. Will work only if dlsym can be overriden
As the only Gtk apps I use are Kino, GIMP, and a little of Firefox, this library works great for me. Your millage may vary, and please note that this is only a quick hack to get things working now for me. I'm not sure how stable it will be under heavy usage, so don't be surprised if it breaks. However, if it does break - the only thing that should happen is that the Gtk apps will fall back to using the standard Gtk dialogs.
p.s. Before anyone asks, as they always do:
Widget style: QtCurve, works for KDE and Gtk (also does KDE->Gtk icon mapping). This is set on the "Clear" variation.
Window decoration: Crystal with Knifty buttons
Font: Verdana. However, I have recompiled FreeType with the TrueType byte encoder enabled - this give great looking non anti-aliased fonts (otherwise they look *horrible*)
9 years ago
0.11.0
------
1. Gtk3 support.
2. Better, and safer, lookup of file filters.
3. Correctly determine size of string needed for pidfile!
4. Add thunderbird, and LibreOffice apps, to list of gtk2 apps.
5. Cleanup usless stuff; remove kdialogd3, qt3, qt4, kgtk2-wrapper, kqt3-wrapper, kqt4-wrapper.
6. Merge kgtkXX-wrapper scripts into kgtk-wrapper
7. Install kdialogd4 into KDE4 libexec dir.
8. Fix crash where client is terminated whilst file dialog is open.
9. Configurable debug. Pass cmake -DKGTK_DEBUG=true
When starting app, set KGTK_DEBUG env var, e.g.
KGTK_DEBUG=0x10 kgtk-wrapper lowriter
0x01 Connection debug
0x02 General debug
0x04 Filter get and set debug
0x08 Filter creation debug
0x10 Custom widget debug
0x20 dlsym debug
Values may be combined
10. If LibreOffice is detected (app is libreoffice, lowriter, etc.) then also set the OOO_FORCE_DESKTOP env var to gnome, so that we get nicer
themeing.
11. When passing filters to KFileDialog, replace / with \/
12. Make filter combo non-editable.
13. When returning selected filter to Gtk app, also return the filter name and not just the file pattern. This way if two filters have the same file pattern the corrent one can be selected.
14. Support for checkbox custom widgets.
15. Save location history per app.
9 years ago
0.11.0
------
1. Gtk3 support.
2. Better, and safer, lookup of file filters.
3. Correctly determine size of string needed for pidfile!
4. Add thunderbird, and LibreOffice apps, to list of gtk2 apps.
5. Cleanup usless stuff; remove kdialogd3, qt3, qt4, kgtk2-wrapper, kqt3-wrapper, kqt4-wrapper.
6. Merge kgtkXX-wrapper scripts into kgtk-wrapper
7. Install kdialogd4 into KDE4 libexec dir.
8. Fix crash where client is terminated whilst file dialog is open.
9. Configurable debug. Pass cmake -DKGTK_DEBUG=true
When starting app, set KGTK_DEBUG env var, e.g.
KGTK_DEBUG=0x10 kgtk-wrapper lowriter
0x01 Connection debug
0x02 General debug
0x04 Filter get and set debug
0x08 Filter creation debug
0x10 Custom widget debug
0x20 dlsym debug
Values may be combined
10. If LibreOffice is detected (app is libreoffice, lowriter, etc.) then also set the OOO_FORCE_DESKTOP env var to gnome, so that we get nicer
themeing.
11. When passing filters to KFileDialog, replace / with \/
12. Make filter combo non-editable.
13. When returning selected filter to Gtk app, also return the filter name and not just the file pattern. This way if two filters have the same file pattern the corrent one can be selected.
14. Support for checkbox custom widgets.
15. Save location history per app.
PabliNet
8 years ago
Debian testing 3.2.0-3-686-pae + KDE 4.8.4
Library installed:
libgtk-3-0:i386
libgtk-3-bin
libgtk-3-common
libgtk-3-dev
libgtk2.0-0:i386
libgtk2.0-bin
libgtk2.0-common
libgtk2.0-dev
1) $ cmake .. -DCMAKE_INSTALL_PREFIX=/usr
-- The C compiler identification is GNU 4.7.1
-- The CXX compiler identification is GNU 4.7.1
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- Found Qt-Version 4.8.2 (using /usr/bin/qmake)
-- Looking for XOpenDisplay in /usr/lib/i386-linux-gnu/libX11.so;/usr/lib/i386-linux-gnu/libXext.so;/usr/lib/i386-linux-gnu/libXft.so;/usr/lib/i386-linux-gnu/libXau.so;/usr/lib/i386-linux-gnu/libXdmcp.so
-- Looking for XOpenDisplay in /usr/lib/i386-linux-gnu/libX11.so;/usr/lib/i386-linux-gnu/libXext.so;/usr/lib/i386-linux-gnu/libXft.so;/usr/lib/i386-linux-gnu/libXau.so;/usr/lib/i386-linux-gnu/libXdmcp.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/i386-linux-gnu/libX11.so
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found.
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for _POSIX_TIMERS
-- Looking for _POSIX_TIMERS - found
-- Found Automoc4: /usr/bin/automoc4
-- Found Perl: /usr/bin/perl (found version "5.14.2")
-- Found Phonon: /usr/include
-- Performing Test _OFFT_IS_64BIT
-- Performing Test _OFFT_IS_64BIT - Failed
-- Performing Test HAVE_FPIE_SUPPORT
-- Performing Test HAVE_FPIE_SUPPORT - Success
-- Performing Test __KDE_HAVE_W_OVERLOADED_VIRTUAL
-- Performing Test __KDE_HAVE_W_OVERLOADED_VIRTUAL - Success
-- Performing Test __KDE_HAVE_GCC_VISIBILITY
-- Performing Test __KDE_HAVE_GCC_VISIBILITY - Success
-- Found KDE 4.8 include dir: /usr/include
-- Found KDE 4.8 library dir: /usr/lib
-- Found the KDE4 kconfig_compiler preprocessor: /usr/bin/kconfig_compiler
-- Found automoc4: /usr/bin/automoc4
-- Found Qt-Version 4.8.2 (using /usr/bin/qmake)
-- Found X11: /usr/lib/i386-linux-gnu/libX11.so
-- Looking for getpeereid
-- Looking for getpeereid - not found
-- checking for module 'gtk+-2.0>=2.6'
-- found gtk+-2.0, version 2.24.10
** INFORMATION: Gtk2 LD_PRELOAD library will be built.
-- checking for module 'gtk+-3.0>=3.0'
-- found gtk+-3.0, version 3.4.2
** INFORMATION: Gtk3 LD_PRELOAD library will be built.
-- Found xgettext: /usr/bin/xgettext
** INFORMATION: Using installation prefix: /usr
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pablo/Descargas/KGtk-0.11.0/build
2) $ make
Scanning dependencies of target kgtk2
[ 7%] Building C object gtk2/CMakeFiles/kgtk2.dir/kgtk.o
In file included from /home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c:74:0:
/home/pablo/Descargas/KGtk-0.11.0/common/connect.h: In function ‘createSocketConnectionReal’:
/home/pablo/Descargas/KGtk-0.11.0/common/connect.h:121:5: warning: #warning "Using sloppy security checks" [-Wcpp]
/home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c: In function ‘handleGtkFileChooserButtonClicked’:
/home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c:2600:58: warning: unused parameter ‘button’ [-Wunused-parameter]
/home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c: In function ‘kgtk_g_module_check_init’:
/home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c:2744:49: warning: unused parameter ‘module’ [-Wunused-parameter]
/home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c: At top level:
/home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c:2750:37: warning: ‘struct PR_LoadLibrary’ declared inside parameter list [enabled by default]
/home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c:2750:37: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
Linking C shared library ../lib/libkgtk2.so
[ 7%] Built target kgtk2
Scanning dependencies of target kgtk3
[ 15%] Building C object gtk3/CMakeFiles/kgtk3.dir/__/gtk2/kgtk.o
In file included from /home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c:74:0:
/home/pablo/Descargas/KGtk-0.11.0/common/connect.h: In function ‘createSocketConnectionReal’:
/home/pablo/Descargas/KGtk-0.11.0/common/connect.h:121:5: warning: #warning "Using sloppy security checks" [-Wcpp]
/home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c: In function ‘handleGtkFileChooserButtonClicked’:
/home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c:2600:58: warning: unused parameter ‘button’ [-Wunused-parameter]
/home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c: In function ‘kgtk_g_module_check_init’:
/home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c:2744:49: warning: unused parameter ‘module’ [-Wunused-parameter]
/home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c: At top level:
/home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c:2750:37: warning: ‘struct PR_LoadLibrary’ declared inside parameter list [enabled by default]
/home/pablo/Descargas/KGtk-0.11.0/gtk2/kgtk.c:2750:37: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
Linking C shared library ../lib/libkgtk3.so
[ 15%] Built target kgtk3
Scanning dependencies of target kdialogd4_bin_automoc
Generating kdialogd.moc
[ 15%] Built target kdialogd4_bin_automoc
Scanning dependencies of target kdialogd4_bin
[ 23%] Building CXX object kdialogd4/CMakeFiles/kdialogd4_bin.dir/kdialogd4_bin_automoc.o
[ 30%] Building CXX object kdialogd4/CMakeFiles/kdialogd4_bin.dir/kdialogd.o
Linking CXX executable kdialogd4
[ 30%] Built target kdialogd4_bin
Scanning dependencies of target pofiles
[ 38%] Generating zh_CN.gmo
/home/pablo/Descargas/KGtk-0.11.0/kdialogd4/po/zh_CN.po: atención: El conjunto de caracteres "CHARSET" no es un nombre de codificación portátil.
La conversión de mensajes al conjunto de caracteres del usuario podrÃa no funcionar.
[ 46%] Generating de.gmo
[ 53%] Generating fr.gmo
/home/pablo/Descargas/KGtk-0.11.0/kdialogd4/po/fr.po: atención: El conjunto de caracteres "CHARSET" no es un nombre de codificación portátil.
La conversión de mensajes al conjunto de caracteres del usuario podrÃa no funcionar.
[ 61%] Generating es.gmo
/home/pablo/Descargas/KGtk-0.11.0/kdialogd4/po/es.po: atención: El conjunto de caracteres "CHARSET" no es un nombre de codificación portátil.
La conversión de mensajes al conjunto de caracteres del usuario podrÃa no funcionar.
[ 69%] Generating ru.gmo
[ 76%] Generating cs.gmo
[ 84%] Generating pt_BR.gmo
[ 92%] Generating it.gmo
[100%] Generating en_GB.gmo
[100%] Built target pofiles
3) # make install
[ 7%] Built target kgtk2
[ 15%] Built target kgtk3
[ 15%] Built target kdialogd4_bin_automoc
[ 30%] Built target kdialogd4_bin
[100%] Built target pofiles
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/bin/kgtk-wrapper
-- Installing: /usr/lib/kgtk/libkgtk2.so
-- Installing: /usr/lib/kgtk/libkgtk3.so
-- Installing: /usr/lib/kde4/libexec/kdialogd4
-- Installing: /usr/share/locale/zh_CN/LC_MESSAGES/kdialogd4.mo
-- Installing: /usr/share/locale/de/LC_MESSAGES/kdialogd4.mo
-- Installing: /usr/share/locale/fr/LC_MESSAGES/kdialogd4.mo
-- Installing: /usr/share/locale/es/LC_MESSAGES/kdialogd4.mo
-- Installing: /usr/share/locale/ru/LC_MESSAGES/kdialogd4.mo
-- Installing: /usr/share/locale/cs/LC_MESSAGES/kdialogd4.mo
-- Installing: /usr/share/locale/pt_BR/LC_MESSAGES/kdialogd4.mo
-- Installing: /usr/share/locale/it/LC_MESSAGES/kdialogd4.mo
-- Installing: /usr/share/locale/en_GB/LC_MESSAGES/kdialogd4.mo
4) Run with GIMP:
$ kgtk-wrapper gimp
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
(gimp:11336): Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
/usr/bin/kgtk-wrapper: lÃnea 88: 11336 `trap' para punto de parada/seguimiento LD_PRELOAD=/usr/lib/kgtk/libk${toolkit}.so:$LD_PRELOAD "$@"
QSocketNotifier: Invalid socket 11 and type 'Read', disabling...
Report
Murz
8 years ago
So will be good if anybody can provide ppa with kgk packages, because install from ppa is very easier that compiling from sources.
In launchpad there are already exist KGTK package team: https://launchpad.net/~kgtk/+archive/ppa but version is too old. Is there any problems to compile updated version for Kubuntu 12.04?
Report
Murz
8 years ago
Report
johu
9 years ago
https://bugs.gentoo.org/show_bug.cgi?id=401697
Report
CraigD
9 years ago
Why not use the firefox-kde support created by openSUSE? This works much better, and is packaged with KUbuntu as well.
Report
gravy
8 years ago
Report
negora
8 years ago
Surprisingly it's listed as an existing Ubuntu 12.04 package, although it can't be downloaded from the official Ubuntu repositories.
I've installed the package but it seems to have no effect on the file dialog window of the most recent version of Firefox.
Report
Murz
8 years ago
Report
gnumdk
9 years ago
(firefox:2483): Gtk-CRITICAL **: IA__gtk_entry_get_text: assertion `GTK_IS_ENTRY (entry)' failed
Report
gnumdk
9 years ago
Report
unikum111
9 years ago
Report
-luk-
9 years ago
Is there a way to use kgtk?
Report
unikum111
9 years ago
Report
gcala
9 years ago
QSocketNotifier: Invalid socket 12 and type 'Read', disabling...
comparing when closing wrapped bluefish.
Report
CraigD
9 years ago
[Apps]
bluefish=gtk2
Does that help?
Report
gcala
9 years ago
$ file /usr/bin/bluefish
/usr/bin/bluefish: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.27, stripped
ldd output: http://paste.kde.org/143666/
Report
gcala
9 years ago
* truecrypt
* gnome-mplayer
Regards
Report
unikum111
9 years ago
Report
jospoortvliet_double
9 years ago
Gimp and Inkscape work perfectly. LibreOffice and Firefox have KDE file dialogs in openSUSE anyway so no need for those with kgtk2 btw.
I just wish there was an easier way of using this (for all gtk apps, maybe with a whitelist) than editing the global files which conflicts with package management...
Report
mkyral
10 years ago
I'm not able to compile it under KDE 4.5.2. It seems like they removed some files under this minor release:
[100%] Building CXX object kdialogd4/CMakeFiles/kdialogd4_bin.dir/kdialogd.o
In file included from /usr/include/kfileitem.h:32,
from /usr/include/kdirlister.h:24,
from /usr/include/kdiroperator.h:30,
from /var/tmp/portage/kde-misc/kgtk-0.10.1/work/KGtk-0.10.1/kdialogd4/kdialogd.cpp:5:
/usr/include/kdatetime.h:32:21: error: QMetaType: No such file or directory
Report
mkyral
10 years ago
Report
k4in
10 years ago
Report
tigerfoot
10 years ago
make
Scanning dependencies of target kdialogd4_bin_automoc
Generating kdialogd.moc
[ 0%] Built target kdialogd4_bin_automoc
Scanning dependencies of target kdialogd4_bin
[ 8%] Building CXX object kdialogd4/CMakeFiles/kdialogd4_bin.dir/kdialogd4_bin_automoc.o
[ 16%] Building CXX object kdialogd4/CMakeFiles/kdialogd4_bin.dir/kdialogd.o
/home/bruno/src_tmp/KGtk-0.10.1/kdialogd4/kdialogd.cpp: In member function ‘void KDialogD::deleteConnection(KDialogDClient*)’:
/home/bruno/src_tmp/KGtk-0.10.1/kdialogd4/kdialogd.cpp:257: warning: suggest explicit braces to avoid ambiguous ‘else’
/home/bruno/src_tmp/KGtk-0.10.1/kdialogd4/kdialogd.cpp: In member function ‘void KDialogD::timeout()’:
/home/bruno/src_tmp/KGtk-0.10.1/kdialogd4/kdialogd.cpp:268: warning: suggest explicit braces to avoid ambiguous ‘else’
/home/bruno/src_tmp/KGtk-0.10.1/kdialogd4/kdialogd.cpp: At global scope:
/home/bruno/src_tmp/KGtk-0.10.1/kdialogd4/kdialogd.cpp:667: warning: unused parameter ‘modal’
Linking CXX executable kdialogd4
[ 16%] Built target kdialogd4_bin
Scanning dependencies of target pofiles
[ 16%] Generating es.gmo
/home/bruno/src_tmp/KGtk-0.10.1/kdialogd4/po/es.po: AVERTISSEMENT : Le jeu de caractères « CHARSET » n'est pas un nom d'encodage portable.
La conversion vers le jeu de caractères de l'utilisateur peut ne pas fonctionner.
[ 16%] Generating en_GB.gmo
[ 16%] Generating cs.gmo
[ 16%] Generating fr.gmo
/home/bruno/src_tmp/KGtk-0.10.1/kdialogd4/po/fr.po: AVERTISSEMENT : Le jeu de caractères « CHARSET » n'est pas un nom d'encodage portable.
La conversion vers le jeu de caractères de l'utilisateur peut ne pas fonctionner.
[ 16%] Generating de.gmo
[ 16%] Generating ru.gmo
[ 16%] Generating pt_BR.gmo
[ 16%] Generating zh_CN.gmo
/home/bruno/src_tmp/KGtk-0.10.1/kdialogd4/po/zh_CN.po: AVERTISSEMENT : Le jeu de caractères « CHARSET » n'est pas un nom d'encodage portable.
La conversion vers le jeu de caractères de l'utilisateur peut ne pas fonctionner.
[ 83%] Built target pofiles
[ 91%] Generating mangled.h
Scanning dependencies of target kqt4
[100%] Building CXX object qt4/CMakeFiles/kqt4.dir/kqt4.o
In file included from /home/bruno/src_tmp/KGtk-0.10.1/qt4/kqt4.cpp:54:
/home/bruno/src_tmp/KGtk-0.10.1/common/connect.h:98:5: warning: #warning "Using sloppy security checks"
/home/bruno/src_tmp/KGtk-0.10.1/qt4/kqt4.cpp: In function ‘const char* getAppName(bool)’:
/home/bruno/src_tmp/KGtk-0.10.1/qt4/kqt4.cpp:112: error: invalid conversion from ‘const char*’ to ‘char*’
make[2]: *** [qt4/CMakeFiles/kqt4.dir/kqt4.o] Erreur 1
make[1]: *** [qt4/CMakeFiles/kqt4.dir/all] Erreur 2
make: *** [all] Erreur 2
Did you have an idea ?
Nota for the po, they are not all utf-8 that why we get warnings
Report
tigerfoot
10 years ago
-char *slash
+const char *slash
compile now under kde4.4.4
Report
SurJector
11 years ago
you miss two bytes in the malloc in getPidFilename() and kdialogd4 crashes reliably.
Could you apply the following (or similar) patch (sorry, space is garbled) ?
--- common/common.h.orig 2009-11-25 10:09:23.000000000 +0100
+++ common/common.h 2009-11-25 10:14:10.000000000 +0100
@@ -49,7 +49,7 @@
if(!tmp || !tmp[0])
tmp=(char *)"/tmp";
- pidfile=(char *)malloc(strlen(tmp)+strlen(PID_DIR)+strlen(user)+strlen(PID_NAME)+1);
+ pidfile=(char *)malloc(strlen(tmp)+strlen("/")+strlen(PID_DIR)+strlen(user)+strlen("/")+strlen(PID_NAME)+1);
#ifdef __KDIALOGD_H__
// We are kdialogd - so create socket folder if it does not exist...
@@ -57,7 +57,7 @@
KStandardDirs::makeDir(QString::fromAscii(pidfile));
#endif
- /* CPD: TODO get dispaly number! */
+ /* CPD: TODO get display number! */
sprintf(pidfile, "%s/%s%s/%s", tmp, PID_DIR, user, PID_NAME);
}
}
@@ -89,7 +89,8 @@
if(!tmp || !tmp[0])
tmp=(char *)"/tmp";
- sock=(char *)malloc(strlen(tmp)+strlen(SOCK_DIR)+strlen(user)+strlen(SOCK_NAME)+4+32);
+ /* 18446744073709551616 = 2 to the 64 = enough for display nr */
+ sock=(char *)malloc(strlen(tmp)+strlen("/")+strlen(SOCK_DIR)+strlen(user)+strlen("/")+strlen(SOCK_NAME)+strlen("18446744073709551616")+1);
#ifdef __KDIALOGD_H__
// We are kdialogd - so create socket folder if it does not exist...
@@ -97,7 +98,7 @@
KStandardDirs::makeDir(QString::fromAscii(sock));
#endif
- /* CPD: TODO get dispaly number! */
+ /* CPD: TODO get display number! */
sprintf(sock, "%s/%s%s/%s-%d", tmp, SOCK_DIR, user, SOCK_NAME, 1);
}
}
Report