Patch: Amarok's global shortcut handling

Seb Ruiz ruiz at kde.org
Tue Oct 7 23:07:39 CEST 2008


2008/10/8 Alex Merry <kde at randomguy3.me.uk>:
> On Saturday 04 October 2008 09:08:50 Seb Ruiz wrote:
>> Mike,
>> Have you had a chance to look at this? Another developer has
>> experienced the same crashing kded4 problem with stock KDE 4.1.
>
> Michael fixed it in trunk, and I think he's backporting to 4.1.

Yep, I've seen this, thanks. The good news is that there is a
workaround by manually removing conflicting shortcuts.

>
> Alex
>
>
>>
>> Cheers,
>> Seb
>>
>> 2008/10/1 Seb Ruiz <ruiz at kde.org>:
>> > 2008/10/1 Seb Ruiz <ruiz at kde.org>:
>> >> 2008/10/1 Michael Jansen <kde at michael-jansen.biz>:
>> >>> Zitat von Seb Ruiz <ruiz at kde.org>:
>> >>>> 2008/9/28 Michael Jansen <kde at michael-jansen.biz>:
>> >>>>> Hi
>> >>>>>
>> >>>>> I noticed that amarok has a problem with the way it creates global
>> >>>>> shortcuts.
>> >>>>> In general it's never a good idea to change the object name of a
>> >>>>> action. The
>> >>>>> identifier is used to save/restore local and global shortcuts.
>> >>>>>
>> >>>>> The problematic code looked like that:
>> >>>>>
>> >>>>>   KAction *action = new KAction(  ... );
>> >>>>>   action->setObjectName("playlist-add")
>> >>>>>   action->setGlobalShortcut( ... );
>> >>>>>   connect( ... );
>> >>>>>   ac->addAction( "playlist_add", action );
>> >>>>>
>> >>>>> The action get's a different objectName when added to the collection
>> >>>>> with addAction. That bring two problems.
>> >>>>>
>> >>>>> 1. Global Shortcuts only work as long as you do not try to change
>> >>>>> them. In
>> >>>>> that exact moment they stop to work.
>> >>>>> 2. "kcmshell4 keys" shows some shortcuts from amarok twice.
>> >>>>>
>> >>>>> The patch not only corrects the code regarding global shortcuts
>> >>>>> registration.
>> >>>>> It cleans up the global shortcuts registration too.
>> >>>>>
>> >>>>> Mike
>> >>>>
>> >>>> I've started having some problems with kded4 crashing after applying
>> >>>> this patch. I'm using kdelibs 4.1 from ubuntu reps.
>> >>>>
>> >>>> Console output:
>> >>>> ASSERT: "d->keyToAction.value(key) == ad" in file
>> >>>>
>> >>>> /build/buildd/kde4libs-4.1.1+really4.1.1/kdeui/shortcuts/kdedglobalacc
>> >>>>el.cpp, line 412
>> >>>> KCrash: crashing... crashRecursionCounter = 2
>> >>>> KCrash: Application Name = kded4 path = <unknown> pid = 13189
>> >>>> sock_file=/home/seb/.kde4/socket-hammerhead/kdeinit4__0
>> >>>> kded(13188): Communication problem with  "kded" , it probably crashed.
>> >>>> Error message was:  "org.freedesktop.DBus.Error.NoReply" : " "Message
>> >>>> did not receive a reply (timeout by message bus)" "
>> >>>>
>> >>>> Crash occurs in
>> >>>> QList<int> KdedGlobalAccel::setShortcut(const QStringList &actionId,
>> >>>> const QList<int> &keys, uint flags)
>> >>>>
>> >>>>
>> >>>> http://websvn.kde.org/branches/KDE/4.1/kdelibs/kdeui/shortcuts/kdedglo
>> >>>>balaccel.cpp?annotate=829867
>> >>>>
>> >>>> Reverting your patch doesn't fix the problem however.
>> >>>>
>> >>>> --
>> >>>> Seb Ruiz
>> >>>>
>> >>>> http://www.sebruiz.net/
>> >>>> http://amarok.kde.org/
>> >>>
>> >>> Yeah. I'm on it. I have no idea how to reproduce tho. There is a bug
>> >>> 171870 for that problem. I'm currently on it. Could you send me you
>> >>> kglobalshortcutsrc?
>> >>>
>> >>> Perhaps there is something in there.
>> >>
>> >> http://websvn.kde.org/*checkout*/branches/KDE/4.1/kdelibs/kdeui/shortcut
>> >>s/kdedglobalaccel.cpp?revision=829867&content-type=text%2Fplain
>> >
>> > Sorry, stupidly misread what you asked for.
>> >
>> >
>> > --
>> > Seb Ruiz
>> >
>> > http://www.sebruiz.net/
>> > http://amarok.kde.org/
>
> --
> Proud KDE hacker: http://www.kde.org
> Get KDE 4.1 - out now!
>
>



-- 
Seb Ruiz

http://www.sebruiz.net/
http://amarok.kde.org/


More information about the Amarok-devel mailing list