Bug 223165 - Amarok does not remember shortcuts for functions provided by scripts
Summary: Amarok does not remember shortcuts for functions provided by scripts
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Tools/Script Manager (show other bugs)
Version: 2.2.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 2.3.1
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-17 16:46 UTC by Martin Blumenstingl
Modified: 2010-05-31 03:25 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.3.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Blumenstingl 2010-01-17 16:46:14 UTC
Version:           2.2.2 (using KDE 4.3.4)
Compiler:          gcc (GCC) 4.4.2 20091208 (prerelease) 
OS:                Linux
Installed from:    Archlinux Packages

amarok forgets shortcuts for functions which are provided by scripts

I was able to reproduce this in 2.2.2 and 2.2-GIT (checked out a few hours ago)

steps to reproduce:
1. install the CopySongInfo plugin (http://kde-apps.org/content/show.php?content=114886)
2. go to "Settings" -> "Configure Shortcuts"
3. search the entry "Copy Current Song Info"
4. in the shortcut column add a custom shortcut (I used CTRL+C: http://www.abload.de/img/copyta9f.png)
5. (make sure a track is playing) go to the playlist and press the shortcut (in my case CTRL+C)
6. -> the track information is not in your clipboard
7. restart amarok
8. press the shortcut again -> nothing happens
9. additionally the shortcut is not assigned anymore (by looking at Settings -> Configure Shortcuts)

my amarokrc has the following settings in it:
[Shortcuts]
CopySongInfo=Ctrl+C

if you don't know why this is an amarok bug:
amarok is responsible for shortcut management
a workaround like "tell the script to read the shortcut settings from the config file and re-assign that value on each startup" won't work, since the script has only access to the config group with the script name as name (for that script it only has access to [CopySongInfo])

Regards,
Martin
Comment 1 Martin Blumenstingl 2010-04-11 23:04:48 UTC
I had some time to debug this one:

actions are added to the menu in AmarokWindowScript::addToolsMenu()/addSettingsMenu()

the first "interesting" fact is that (at least it seems like) actions are added twice to the menu
for example in addToolsMenu there is:
            m_ToolsMenu->addAction( ac->action( id ) );
            m_ToolsMenu->addAction( action );

the first one should basicall return a pointer to "action"
in the second one action is added to the menu again.

unfortunately I have no idea how reading shortcuts from the config file works.
it seems this is done by some generic piece of software (not by Amarok itself - I think they are read by KMainWindow, but I'm not sure).
Comment 2 Martin Blumenstingl 2010-04-12 19:08:56 UTC
bug fixed :)
we just need to wait until it's been merged: http://gitorious.org/amarok/amarok/merge_requests/166

Regards,
Martin
Comment 3 Myriam Schweingruber 2010-05-29 16:12:44 UTC
Martin, could you please update your changes in the Merge Request so it can be merged? Thanks.
Comment 4 Martin Blumenstingl 2010-05-30 22:19:21 UTC
Hi,

the merge request contains the latest code (which is still applying cleanly against latest master).
In case you're wondering about Rick's comment on the merge request: he just misunderstood one of my sentences.

Regards,
Martin
Comment 5 Rick W. Chen 2010-05-31 03:25:44 UTC
Merged Martin's MR. Thanks.