--===============0397865966==
Content-Type: multipart/signed;
boundary="nextPart2714127.TsA6txbu4u";
protocol="application/pgp-signature";
micalg=pgp-sha1
Content-Transfer-Encoding: 7bit

--nextPart2714127.TsA6txbu4u
Content-Type: text/plain;
charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Wed, 22 Mar 2006 18:17, Andr=E9 W=F6bbeking wrote:
>
> I did the same change on 05.11.2005 and it was reverted too. It's a
> console application and must not use X11. The crash seems to happen
> if you've a [Shortcuts] group in your kdeglobals file (e.g. for me
> it was shortcut for the close action).


Ah! Now that's a useful piece of information, thanks. I tested it,
and I observe the same behaviour here.

>
> Would it be a solution to ignore/remove the [Shortcuts] group in
> genshortcutents.cpp?


I don't think that can be done in genshortcutents... read on for
the offending code.

One of the relevant pieces of code now is:
(approx line 144, kdecore/kstdaccel.cpp)

static void initialize( StdAccel id )
{
KConfigGroup cg( KGlobal::config(), "Shortcuts" );
KStdAccelInfo* pInfo =3D infoPtr( id );

if( !pInfo ) {
kWarning(125) << "KStdAccel: id not found!" << endl; // -- ellis
return;
}

if( cg.hasKey( pInfo->psName ) ) {
QString s =3D cg.readEntry( pInfo->psName );
if( s !=3D "none" )
pInfo->cut.init( s );
else
pInfo->cut.clear();
} else
pInfo->cut =3D shortcutDefault( id );
pInfo->bInitialized =3D true;
}


More specifically, and with annotations:

// If we have a settings entry for this accel...
if( cg.hasKey( pInfo->psName ) ) {
QString s =3D cg.readEntry( pInfo->psName );
if( s !=3D "none" )
// This call is what leads to the QX11Info::display() call,
// and hence the crash!
pInfo->cut.init( s );
else
pInfo->cut.clear();
} else
// If we don't have a settings entry for the accel, we safely
// set a default without calling QX11Info::display()
pInfo->cut =3D shortcutDefault( id );

I can think of a crude but effective solution:

=2D-- kstdaccel.cpp (revision 521221)
+++ kstdaccel.cpp (working copy)
@@ -31,6 +31,7 @@
#include "kshortcutlist.h"

#include
+#include

namespace KStdAccel
{
@@ -151,7 +152,7 @@
return;
}

=2D if( cg.hasKey( pInfo->psName ) ) {
+ if( QX11Info::display() && cg.hasKey( pInfo->psName ) ) {
QString s =3D cg.readEntry( pInfo->psName );
if( s !=3D "none" )
pInfo->cut.init( s );

This would, however, mean that no command-line KDE application can
accurately know about all global shortcuts. But I can't think of
any cases where one wants to do so (genshortcutents certainly
doesn't care and it is the only command-line KDE app I know which
uses KStdAccel).

Does anyone have any objections to me committing this fix?

Rohan

--nextPart2714127.TsA6txbu4u
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQBEITSv9TboT4GjxRwRAorXAJ92sm3NC0gOyK3KMcmeGS vjtIUXEQCg20Wi
lpLKaJPUnVZvpSrDXSgrRPk=
=6jeV
-----END PGP SIGNATURE-----

--nextPart2714127.TsA6txbu4u--

--===============0397865966==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


--===============0397865966==--