Bug 187965 - Editing shortcuts remove all shortcuts definitions saved in "kilerc" file
Summary: Editing shortcuts remove all shortcuts definitions saved in "kilerc" file
Status: RESOLVED FIXED
Alias: None
Product: kile
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Michel Ludwig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-24 04:06 UTC by Rafal Lalik
Modified: 2009-06-16 20:05 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Proposed Fix 0.1 (1.35 KB, patch)
2009-04-01 22:44 UTC, Michel Ludwig
Details
Proposed Fix 0.2 (13.13 KB, patch)
2009-04-05 19:04 UTC, Michel Ludwig
Details
Proposed Fix 0.3 (14.25 KB, patch)
2009-04-06 23:07 UTC, Michel Ludwig
Details
Gentoo's ebuild for kile-9999 (870 bytes, application/octet-stream)
2009-05-05 20:12 UTC, Rafal Lalik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafal Lalik 2009-03-24 04:06:39 UTC
Version:           2.0.81 (svn) (using Devel)
Compiler:          Gcc-4.3.3 
OS:                Linux
Installed from:    Compiled sources

When I configure new shortcuts, after pressing OK in dialog window, kilerc in my "~/.kde4.3/share/config/" lost all settings related to shortcuts.

Steps to reproduce:

1. Remove your ~/.kde4.x/share/config/kilerc
2. Open kile and close. New kilerc sholud appear. Inside I have section:
--- CUT HERE ---
[Shortcuts]
tool_BibTeX=Alt+-
tool_DVItoPDF=Alt+9
tool_DVItoPS=Alt+4
tool_LaTeX=Alt+2
tool_MakeIndex=Alt+=
tool_PDFLaTeX=Alt+6
tool_PStoPDF=Alt+8
tool_QuickBuild=Alt+1
tool_ViewDVI=Alt+3
tool_ViewPDF=Alt+7
tool_ViewPS=Alt+5
--- CUT HERE ---

3. Open kile again, choose menu: "Settings -> Configure shortcuts" and add new shortcut (usually I do shortcut for Spelling... <- Shift+F7).
4. After pressing OK and leaving configure window, section [Shortcuts] in kilerc is completly gone - no more old settings and whatmore no more new settings also.
5. Running kile again does not effect anymore - no more shortcuts in this live of kilerc.
6. Until you open first time Shortcuts settings in Kile, you can freely edit it by hand direcly in file.

Notice, other default shortcuts NOT stored in kilerc still are available. Ony these stored localy in $HOME/blah/blah/kilerc are broken.

I tried describe it the best I can. My KDE is 4.2.67.
Regards,

Rafal
Comment 1 Jonas 2009-03-29 14:20:00 UTC
i can confirm this. there is still a shortcuts section in my kilerc, but shortcuts keep vanishing, even the default ones
Comment 2 Jonas 2009-03-29 23:31:25 UTC
i played around a bit more, and it seems that for me, each time i add some new shortcuts, some old ones vanish (are they somehow overwritten?). i then closed kile and copied the shortcuts that vanished before into kilerc by hand, and this worked. when i restarted kile, the shortcuts only got reordered, but this time nothing vanished.
Comment 3 Michel Ludwig 2009-04-01 22:44:25 UTC
Created attachment 32525 [details]
Proposed Fix 0.1

Can you try out this patch please?

Please make sure that you delete the "[Shortcuts]" section from "config/kilerc" before you try it out.
Comment 4 Jonas 2009-04-01 23:23:46 UTC
great, for me it works now. thanks!
Comment 5 Thomas Braun 2009-04-02 20:16:31 UTC
We must then also implement
void Factory::writeStdConfig()
differently. The question is how.
Comment 6 Michel Ludwig 2009-04-05 19:04:57 UTC
Created attachment 32629 [details]
Proposed Fix 0.2

This patch should also take care of default shortcuts for tools.

Please test if you can.
Comment 7 Thomas Braun 2009-04-05 21:58:48 UTC
Tested it here and it works.
Although I'm not sure if it is a good idea to read the shortcuts everytime again from kilestdtools.rc.
This also results in the fact that if we change the shortcuts in kilestdtools.rc one day, the shortcuts in kile are then also changed immediately.
Can't we write the default shortcuts to kileui.rc instead? And remove them from kilestdtools.rc completely?
Comment 8 Michel Ludwig 2009-04-05 22:41:26 UTC
Writing the default shortcuts to "kileui.rc" should work as well and is probably cleaner. But essentially it is the same thing (just as with every other default shortcut): whenever we change it in the code, it will become effective immediately unless the user has changed it before.
Comment 9 Thomas Braun 2009-04-05 23:45:23 UTC
Yes an no. The old approach was including kilestdtools.rc upon request (e.g. reloading default tools) into kilerc and then overwriting the old settings.
But in that scenario changing kilestdtools.rc didn't change anything in kile shortcut settings. But actually this does not matter as we will not change them anytime soon ;)

So just moving the [Shortcuts] group from kilestdtools.rc to kileui.rc might be best. I can also write a config file update script to delete [Shortcuts] in kilerc. I think we don't have to care about current trunk users tool shortcuts which will be defaulted by that action.
Comment 10 Michel Ludwig 2009-04-06 23:07:05 UTC
Created attachment 32666 [details]
Proposed Fix 0.3

A new patch which uses the XMLGUI framework to store the shortcuts. With this approach the shortcuts are copied again to a local XMLGUI file, i.e. if we should modify them, the changes should not propagate immediately.

Please note that the shortcuts are not reset to default when the tools are reset. This requires some more implementation effort.

I'm not shure whether a configure script could work in this case, because the shortcuts would have to be transferred to a XMLGUI file. With the patch the "Shortcuts" group will be deleted when it has been read, and the shortcuts will hence be stored in the XMLGUI file.
Comment 11 Thomas Braun 2009-04-08 15:00:48 UTC
Looks good.

> Please note that the shortcuts are not reset to default when the tools are
> reset. This requires some more implementation effort.

The more I think about that the more I think this new behaviour is a feature rather than a bug.
So from my POV the patch is ready for inclusion.
Comment 12 Michel Ludwig 2009-04-10 21:13:49 UTC
SVN commit 952052 by mludwig:

Let 'KActionCollection' handle the loading and saving of shortcut settings instead of doing it ourselves.
Additionally, the default shortcut settings for tools are now stored in 'kileui.rc'.

BUG: 187965



 M  +0 -12     data/kilestdtools-win.rc  
 M  +0 -13     data/kilestdtools.rc  
 M  +56 -61    kile.cpp  
 M  +1 -1      kile.h  
 M  +19 -6     kilestdtools.cpp  
 M  +8 -5      kilestdtools.h  
 M  +13 -1     kileui.rc  
 M  +5 -3      widgets/toolconfigwidget.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=952052
Comment 13 Rafal Lalik 2009-05-05 19:03:10 UTC
Ok guys, I dont know what have you done, but it is still not working.

I can set shortcuts and it works fine, but after restart kile the shortcuts gone. Kile is now not usable - I don't want to reconfigure my environment every time after restart. It was working before, please do something.

C'mon :-)
Comment 14 Thomas Braun 2009-05-05 19:13:52 UTC
@Rafal: You are using svn trunk? And have updated/recompiled/reinstalled properly?

I know just saying WORKSFORME is not what you want to hear, but it works here.
Comment 15 Rafal Lalik 2009-05-05 19:30:09 UTC
Kile version:

$ kile -v
Qt: 4.5.1
KDE: 4.2.71 (KDE 4.2.71 (KDE 4.3 >= 20090428))
Kile: 2.0.81

SVN version:
 * subversion update start -->
 *      repository: svn://anonsvn.kde.org/home/kde/trunk/extragear/office/kile
At revision 963942.
 *    working copy: /usr/portage/distfiles/svn-src/kile/kile

I am sure it is compiled from latest svn trunk.

Second way is maybe I should remove some config files from my ~/.kde to run with default configuration? But I did it last weekend and it doesn't help.

Any hints?

Rafal
Comment 16 Thomas Braun 2009-05-05 19:35:55 UTC
Well it should be not necessary to remove kilerc from .kde.
Maybe you have mulitple kileui.rc files lying around?
This is the new place where the shortcuts get saved (and as it should be done within KDE).

Maybe we can move the discussion to kile-devel@lists.sourceforge.net?
Comment 17 Rafal Lalik 2009-05-05 19:51:23 UTC
Yes, we can freely move to kile-devel list, please tell me only should I sibscribe first?

I double checked it, removed whole kile installation, compileed and installed again,removed all kileui and kilerc files, run it and result is the same.

It maybe important information for you I use KDE-4.2.71. Maybe problem is in KDE itself?
Comment 18 Thomas Braun 2009-05-05 19:58:32 UTC
Yes you would have to subscribe first.

Well it could be a KDE problem, although then the problem should be in all KDE applications.
Do you have a second linux-OS where you can test that?

If you tell me how to get kile svn trunk on gentoo I can also try that.
I got a virtualized gentoo box here too.
Comment 19 Rafal Lalik 2009-05-05 20:12:12 UTC
Created attachment 33374 [details]
Gentoo's ebuild for kile-9999

Here is live ebuild for kile, I hope you know how to set your own repository, if not, the fastest way is just copy ebuild to /usr/portage/app-editors/kile and run:
# cd /usr/portage/app-editors/kile
# ebuild kile-9999.ebuild digest
# echo "=app-editors/kile-9999" >> /etc/portage/package.unmask

Now you can install it:
# emerge =app-editors/kile-9999 -pv

Remeber that you work then in gentoo main tree and these changes will be lost after first tree-sync, that why is better to use overlays.

This ebuild is taken from kde-testing overlay, only change is added keywords for amd64, if you have x86 please change keywords to x86.

Gentoo overlays guide: http://www.gentoo.org/proj/en/overlays/userguide.xml
Comment 20 Rafal Lalik 2009-05-10 11:13:24 UTC
Well Thomas,

some new observations from my side:

Firstly, I have newest svn-trunkt compiled version.

Secondly, lets play with shortcuts:
when I set 'Tools->Spell checking' shortcut to Shift+F7 it works fine, even after restart. In principle, all shortcuts which are (kate part?) available from 'System Settings->Keyboard and Mouse->Global Shortcuts' work fine after kile restart.

Thirdly,
When set shortcut for 'Build->Compile->Latex' to Alt+2 (or even Shift+F7 to have the same conditions) it work fine until kile restart (this we now already). But what is funny/strange, after setting shortcut again, when I open 'Settings->Configure Kile' and press OK button without changing anything shortcut gone.

Conclusion,
- maybe something is wrong with dialogs and/or settings saving section on Setting dialogs/Kile closing?

Maybe I could send you my binary package of Kile (I use amd64 architecture optimized for Core 2 Duo). Then you could run the same application in different (your) environment and easly crosscheck. If it works for you -> problem is on my side (maybe KDE-4.3_beta1?), if the same -> something other goes wrong.

All the best,
Rafal
Comment 21 Thomas Braun 2009-05-14 00:44:01 UTC
Hi Rafal,

just to let you know we have found another case where the shortcuts are not saved propely. This happens in combination with user tags.
As soon as we have a solution we let you know.
Comment 22 Andy Neitzke 2009-06-03 22:53:15 UTC
I am having similar shortcut trouble here.  This is a Gentoo box on which I installed kile (SVN r977296) following the directions at

http://apps.sourceforge.net/mediawiki/kile/index.php?title=KileForKDE4

The version info is

andy@chirality ~/.kde4/bin $ ./kile -v
Qt: 4.5.1
KDE: 4.2.3 (KDE 4.2.3)
Kile: 2.0.81

After wiping out all kile-related files from .kde4 and making a fresh install of kile, the shortcut list looks rather strange.  There are many duplicated entries, for example "Close" appears three times, and the last two times the shortcut is listed as "Ctrl+Alt+".  Moreover, the build tools such as PDFLaTeX appear initially with an empty shortcut.  If I then set a shortcut for PDFLaTeX, it works until I quit Kile, but it disappears upon quitting and restarting.
Comment 23 Rafal Lalik 2009-06-03 23:01:33 UTC
Yes, it is well known bug.

I have noticed some time ago next strange behaviour. Now kile assigns shortcuts to opened tabs, but without checking if this shortcut is already in use.

To reproduce, please assign Build->Compile->Latex to Alt+2 (for example), and later open files named: dp_01.tex, dp_02.tex, dp_03.tex, .... In my Kile dp_02.tex has shortcut Alt+2 which is in conflict with previous set for LaTeX compilation.
Comment 24 Andy Neitzke 2009-06-03 23:21:39 UTC
A little more information:  the shortcut for PDFLaTeX does get saved in kileui.rc and survives after I quit Kile, but somehow gets wiped out upon restarting.
Comment 25 Rafal Lalik 2009-06-03 23:39:20 UTC
Not only for PDFLatex. All shortcuts from Build menu are stored in
kileui but not restored after restart.
Comment 26 Thomas Braun 2009-06-07 20:14:53 UTC
SVN commit 978621 by tbraun:

rewrite action handling to not use actionLists

This is needed due to bug #194732. The interesting thing is that now
kile seems a bit faster, at least on my machine.

This patch makes it now possible to change any shortcuts you want and
they will be preserved upon restarts.
One not so nice thing is that the shortcuts for tools and user tags are
not the default ones so restoring the default shortcuts removes these
shortcuts completely.

CCBUG: 187965

 M  +114 -87   kile.cpp  
 M  +7 -3      kile.h  
 M  +12 -4     kileactions.cpp  
 M  +7 -14     kileui.rc  


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