Version: unknown (using KDE 3.5.4, Debian Package 4:3.5.4-3 (testing/unstable)) OS: Linux Hi, kxkb creates {layoutname}.xkm files in /tmp. Now think of a multi-usersystem as with xdmcp. Since those *.xkm files won't be deleted, only one user can create them. For all other users there's a problem. I have a patch for kdebase-3.3.2 of Debian Sarge adding a .username to the filename. However, it looks rather C stylish. Thanks, Bernd
Created attachment 17429 [details] patch to fix the problem patch for kde 3.5.4
I don't have any *.xkm files in my /tmp directory. It seems your configuration is broken, temporary directory is taken from KDE configuration: KGlobal::dirs()->findDirs ( "tmp", "")
On Thursday 24 August 2006 16:41, Krzysztof Lichota wrote: [bugs.kde.org quoted mail] That means its broken for about 50 users of our group, my home workstation and my laptop. I tend to see this as a bug of whatever kind. Maybe debian specific? > configuration: KGlobal::dirs()->findDirs ( "tmp", "") Well, apperently that fails and doesn't return anything. QStringList dirs = KGlobal::dirs()->findDirs ( "tmp", "" ); m_tempDir = dirs.count() == 0 ? "/tmp/" : dirs[0]; Don't ask me why, I'm just tracing trough the sources and I don't see why findDirs() fails. In principle its only a list provided by KStandardDirs::resourceDirs(). To to further unstand that, I would need libs with gdb symbols or many couts (if it only wouldn't take ages to compile c++ sources), there's even already a debug statement for resourceDirs(). Anyway may I ask why not simply "m_tempDir = KTempDir::name();" is used? Cheers, Bernd
> > Anyway may I ask why not simply "m_tempDir = KTempDir::name();" is used? > Ah, stupid me, that can't work of course, without creating a KTemDir object first.
> Well, apperently that fails and doesn't return anything. > > QStringList dirs = KGlobal::dirs()->findDirs ( "tmp", "" ); > m_tempDir = dirs.count() == 0 ? "/tmp/" : dirs[0]; Ok, I just run through it with gdb and see that KGlobal::dirs()->findDirs ( "tmp", "") returns proper directories. Unfortunately dirs[0] = "/tmp/" and dirs[1] = "/tmp/kde-bernd/". So my question, should I find out why /tmp/ is at the first place or should I write a patch inserting an iterator searching for the next dir not being "/tmp/"? Thanks, Bernd
On Friday 25 August 2006 01:58, Bernd Schubert wrote: > > Well, apperently that fails and doesn't return anything. > > > > QStringList dirs = KGlobal::dirs()->findDirs ( "tmp", "" ); > > m_tempDir = dirs.count() == 0 ? "/tmp/" : dirs[0]; > > Ok, I just run through it with gdb and see that > KGlobal::dirs()->findDirs ( "tmp", "") returns proper directories. > Unfortunately dirs[0] = "/tmp/" and dirs[1] = "/tmp/kde-bernd/". > > So my question, should I find out why /tmp/ is at the first place or should > I write a patch inserting an iterator searching for the next dir not being > "/tmp/"? I further read the sources and see that apperently kxkb is the only application in kdelibs and kdebase using findDirs("tmp", ...). All other tmp files are created by KTempFile(locateLocal("tmp", prefix), extension) or at least locateLocal() is used to return the tmp directory. I think for kde-3.5 at least this patch should be used --- extension.cpp.old 2006-03-17 11:17:41.000000000 +0100 +++ extension.cpp 2006-08-25 10:34:12.000000000 +0200 @@ -40,8 +40,7 @@ d = qt_xdisplay(); m_dpy = d; - QStringList dirs = KGlobal::dirs()->findDirs ( "tmp", "" ); - m_tempDir = dirs.count() == 0 ? "/tmp/" : dirs[0]; + m_tempDir = locateLocal("tmp", ""); } Would it make sense to remove findDirs ( "tmp", ...) support in kde-4.0? So far I havn't checked in detail if locateLocal() is using it. Cheers, Bernd
SVN commit 577258 by rysin: BUG: 132421 Use locateLocal() to find tmp directory M +3 -2 extension.cpp --- branches/KDE/3.5/kdebase/kxkb/extension.cpp #577257:577258 @@ -40,8 +40,9 @@ d = qt_xdisplay(); m_dpy = d; - QStringList dirs = KGlobal::dirs()->findDirs ( "tmp", "" ); - m_tempDir = dirs.count() == 0 ? "/tmp/" : dirs[0]; +// QStringList dirs = KGlobal::dirs()->findDirs ( "tmp", "" ); +// m_tempDir = dirs.count() == 0 ? "/tmp/" : dirs[0]; + m_tempDir = locateLocal("tmp", ""); } bool XKBExtension::init()
In my distro tmp chosen is always in home directory so I never seen this as a problem, but I applied the patch and it worked fine so I've commited it. Thanks for the research Bernd!