Bug 182599

Summary: Hotkey / shortcut assignment lost ( = back to default) after restart
Product: [Applications] digikam Reporter: Ian Hubbertz <kde_bugs>
Component: Usability-KeyboardAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, marcel.wiesweg
Priority: NOR    
Version: 0.10.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Unspecified   
Latest Commit: Version Fixed In: 0.10.0
Sentry Crash Report:
Attachments: stderr output of digikam
backtrace of shortcut configuration crash

Description Ian Hubbertz 2009-01-31 16:22:13 UTC
Version:           0.10.0-rc1 (using KDE 4.2.0)
Installed from:    Gentoo Packages

The shorcut configuration dialog opens very slowly (2-3 seconds).

Configuration is possible, but after restart, configuration changes are lost.

(Attachment: stderr of digikam)

Furthermore, the configuration dialog crashes sporadically, see attached backtrace.
Comment 1 Ian Hubbertz 2009-01-31 16:22:41 UTC
Created attachment 30785 [details]
stderr output of digikam
Comment 2 Ian Hubbertz 2009-01-31 16:23:07 UTC
Created attachment 30786 [details]
backtrace of shortcut configuration crash
Comment 3 Andi Clemens 2009-01-31 16:32:53 UTC
I can confirm this... changes are lost after restart.
I guess the slowdown comes from querying all the kipi-plugins.
Comment 4 Marcel Wiesweg 2009-01-31 22:47:43 UTC
The "Configure shortcuts" dialog is a service from KMainWindow, I dont see any code related to this in digikam, is this right?
I think we just plug all our actions into the action collection and kdeui provides the configuration.
In this case we have to move the bug to kdelibs / kdeui / XMLGui framework.
Comment 5 Andi Clemens 2009-01-31 22:56:33 UTC
It is working in showFoto / EditorWindow. I tested this with many actions, none of the ones from MainWindow are saved, but all in ImageEditor are.
But I can't find any differences in the code.
Comment 6 Marcel Wiesweg 2009-02-01 00:10:19 UTC
Oh what I forgot in my previous comment: Shortcut saving works beautifully for me. One "unusual shortcut" that I created for testing before restarting digikam several times is still working.
Comment 7 Ian Hubbertz 2009-02-01 16:52:28 UTC
For me, other applications work fine - only digikam has the problem.

What I tried is changing the rating shortcuts from Ctrl-1 to 1, Ctrl-2 to 2 etc..
Comment 8 Andi Clemens 2009-02-01 17:24:04 UTC
I tested it again and it seems to work with all digiKam shortcuts, but if you change the kipi-plugins actions, it is not saved.
So all modified actions in "general" are saved, but the rest is not.
Comment 9 caulier.gilles 2009-02-03 10:23:26 UTC
SVN commit 920568 by cgilles:

digiKam from trunk : ignore some renamed kipi plugins in loaders which can make some troubles with keyboard shortcuts editor.
CCBUG: 182599
CCMAIL: lure@kubuntu.org


 M  +5 -0      digikamapp.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=920568
Comment 10 caulier.gilles 2009-02-03 13:30:48 UTC
This is my tests :

- digiKam for KDE3 save kipi-plugins shortcuts.
- digiKam for KDE4 do not save kipi-plugins shortcuts.
- others digiKam actions shortcuts are saved.

Code relevant :

http://lxr.kde.org/source/extragear/graphics/digikam/digikam/digikamapp.cpp#2029

- tested with Kphotoalbum ==> same problem: kipi shortcuts are not saved.

Code relevant :

http://lxr.kde.org/source/extragear/graphics/kphotoalbum/MainWindow/Window.cpp#1151

The job to save shortcuts is delegate to KDELibs : 

http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/classKShortcutsDialog.html#ae5f3147f22cac3cb9e4743ba8faa0bf

For me this is a KDELibs bug...

PS: tested here with KDE 4.1.3

Gilles Caulier
Comment 11 Andi Clemens 2009-02-03 13:46:18 UTC
Maybe we define something wrong in the plugins?
Is actionCollection() a part of every plugin or is it the action collection from KIPI::Plugin?

Maybe we need to manually save settings here?
Maybe a kmainwindow widget automatically saves all modified actions whereas KIPI::Plugin does not?

If you change a shortcut for a KIPIplugin, quit shortcut editor and come back again, the shortcut is still there. Only after a restart it will be gone.

Andi
Comment 12 caulier.gilles 2009-02-03 13:53:15 UTC
>If you change a shortcut for a KIPIplugin, quit shortcut editor and come back >again, the shortcut is still there. Only after a restart it will be gone. 

It's clear... this job is deleguate to KDELibs and work fine in KDE3. It's a regression. I move this file to KDElibs component now...

Gilles
Comment 13 Andi Clemens 2009-02-04 17:18:23 UTC
SVN commit 921214 by aclemens:

Add one common KIPI-Plugins actionCollection(), to clean up shortcut
editor dialog. Put actions of every plugin in there. If a plugin has
more then 3 actions, generate a dedicated category inside the
actionCollection.

BUG:182599

 M  +22 -2     digikamapp.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=921214
Comment 14 Andi Clemens 2009-02-04 17:39:59 UTC
SVN commit 921247 by aclemens:

The KIPI shortcut settings where only loaded when the shortcut editor
was started. To fix this, we need to make kipiplugins actionCollection
globally available and move the actionCollection setup into
slotKipiPluginPlug()

CCBUG:182599

 M  +24 -29    digikamapp.cpp  
 M  +4 -0      digikamappprivate.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=921247
Comment 15 caulier.gilles 2009-02-04 17:48:59 UTC
Andi,

It doesn't compile with KDE 4.1.3:

[ 17%] Building CXX object digikam/digikam/CMakeFiles/digikam.dir/digikamapp.o
/home/gilles/Documents/devel/SVN/trunk/graphics/digikam/digikam/digikamapp.cpp:42:29: error: kactioncategory.h: No such file or directory
/home/gilles/Documents/devel/SVN/trunk/graphics/digikam/digikam/digikamapp.cpp: In member function ‘void Digikam::DigikamApp::slotKipiPluginPlug()’:
/home/gilles/Documents/devel/SVN/trunk/graphics/digikam/digikam/digikamapp.cpp:2209: error: ‘KActionCategory’ was not declared in this scope
/home/gilles/Documents/devel/SVN/trunk/graphics/digikam/digikam/digikamapp.cpp:2209: error: ‘category’ was not declared in this scope
/home/gilles/Documents/devel/SVN/trunk/graphics/digikam/digikam/digikamapp.cpp:2209: error: expected type-specifier before ‘KActionCategory’
/home/gilles/Documents/devel/SVN/trunk/graphics/digikam/digikam/digikamapp.cpp:2209: error: expected `;' before ‘KActionCategory’
make[2]: *** [digikam/digikam/CMakeFiles/digikam.dir/digikamapp.o] Error 1
make[1]: *** [digikam/digikam/CMakeFiles/digikam.dir/all] Error 2
make: *** [all] Error 2

Gilles
Comment 16 Andi Clemens 2009-02-04 17:55:32 UTC
Damn... I got the idea from gwenview... hmm... I can remove / comment this for now, the bug should still be solved, but the editor dialog will become less readable again.
Comment 17 Andi Clemens 2009-02-04 18:51:33 UTC
SVN commit 921282 by aclemens:

If KDE version is < 4.2, do not use KActionCategory, put all KIPI
actions in one collection instead.

CCBUG:182599

 M  +32 -25    digikamapp.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=921282