Bug 156330 - [PATCH] Fix plugin loading in kate sessions
Summary: [PATCH] Fix plugin loading in kate sessions
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: sessions (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: VHI critical
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 116511 177026 177240 183297 192839 198866 200612 203372 206014 210492 211601 227497 229827 237590 240313 240441 243972 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-01-21 19:45 UTC by Hemant Kumar
Modified: 2016-06-06 13:14 UTC (History)
33 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Save plugin configuration in the active session (1007 bytes, patch)
2008-02-10 14:47 UTC, Paolo Capriotti
Details
Save unnamed sessions to katerc (11.41 KB, patch)
2010-10-25 22:01 UTC, Dominik Haumann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hemant Kumar 2008-01-21 19:45:15 UTC
Version:            (using KDE 4.0.0)
Installed from:    Ubuntu Packages
OS:                Linux

When using Kate4 from Ubuntu Gutsy builds, I enabled couple of plugins, but on restart they are gone.
Comment 1 Winfried Simon 2008-02-05 23:35:21 UTC
Hi,

I agree to that behaviour, but the behaviour is a little bit more complex.

1) I enabled a couple of plugins, Kate crashes when closing (see also #156559)
I deleted ~/.kde4/share/apps/kate/.. Afterwards I could close without crashing.

2) On my Box I can open Kate from Menu and it remembers the enabled plugins. When I open it from e.g. dolphin (by clicking on a text file) kate does not remember the plugins.

Also ubuntu 7.10

Best Regards
Comment 2 Paolo Capriotti 2008-02-10 14:47:19 UTC
Created attachment 23518 [details]
Save plugin configuration in the active session

AFAICT, this happens because plugin configuration is saved in the global
configuration file, but loaded from the session. This patch fixes the problem
for me, by saving plugin configuration into the session file.
Comment 3 Dominik Haumann 2008-02-18 23:26:41 UTC
Thanks for the patch. Needs review wrt session management.
Comment 4 Paulo Fidalgo 2008-08-07 13:07:44 UTC
I confir this bug!
I think the plugin configuration should be independent of sessions. I don't use sessions, but I would like to have the plugin select on my next use.

Best regards
Comment 5 lucas 2008-11-04 07:23:35 UTC
Status on patch review?
Comment 6 Dominik Haumann 2008-12-06 11:34:24 UTC
*** Bug 177026 has been marked as a duplicate of this bug. ***
Comment 7 Steffen Jost 2009-02-20 11:01:07 UTC
I also confirm this bug Suse11.1 64, KDE4.1.3, Kate 3.1.3:

All plugins are deactivated when loading a previously saved session. Highly annoying.
Comment 8 Mark Rose 2009-03-11 17:11:59 UTC
This bug is also present in KDE 4.2.0 (Ubuntu Intrepid 64 bit).
Comment 9 Dominik Haumann 2009-05-17 23:20:33 UTC
*** Bug 192839 has been marked as a duplicate of this bug. ***
Comment 10 Dominik Haumann 2009-05-17 23:25:26 UTC
related: bug #156100
Comment 11 Dominik Haumann 2009-06-07 13:15:53 UTC
*** Bug 183297 has been marked as a duplicate of this bug. ***
Comment 12 Dominik Haumann 2009-07-18 12:57:22 UTC
*** Bug 200612 has been marked as a duplicate of this bug. ***
Comment 13 Ralph Müller-Welt 2009-07-24 23:37:41 UTC
Not sure it's related.

kate started in console gives following output when forgetting plugin kttsd.

Calling appendChild() on a null node does nothing.
Comment 14 Michael.McTernan 2009-08-04 22:00:12 UTC
kdesdk-4.2.4-1.fc11.i586, Fedora Core 11 is also afflicted - Kate rapidly forgets the plugins when using sessions, and also loses the associated keyboard shortcuts.
Comment 15 Michael.McTernan 2009-08-05 10:12:38 UTC
So for kdesdk-4.2.4-1.fc11.i586, I've worked out at least one reproducible cause of plugin's being lost which matches Steffan Jost's report on this bug. 

The problem comes when you login and KDE tries to restore the previous session by running "kate -session <some long number>".  Under this condition the plugin settings are not loaded.  Specifically I find 3 possible locations for the settings, all which have the konsole plugin enabled:

$ locate "*.katesession" | xargs grep plugin=true
/home/mmcternan/.kde/share/apps/kate/default.katesession:kateexternaltoolsplugin=true
/home/mmcternan/.kde/share/apps/kate/default.katesession:katefindinfilesplugin=true
/home/mmcternan/.kde/share/apps/kate/default.katesession:katekonsoleplugin=true
/home/mmcternan/.kde/share/apps/kate/default.katesession:katesnippetsplugin=true
/home/mmcternan/.kde/share/apps/kate/sessions/DPCCH%20Searcher.katesession:kateexternaltoolsplugin=true
/home/mmcternan/.kde/share/apps/kate/sessions/DPCCH%20Searcher.katesession:katefindinfilesplugin=true
/home/mmcternan/.kde/share/apps/kate/sessions/DPCCH%20Searcher.katesession:katekonsoleplugin=true
/home/mmcternan/.kde/share/apps/kate/sessions/DPCCH%20Searcher.katesession:katesnippetsplugin=true
/usr/share/kde4/apps/kate/default.katesession:katefilebrowserplugin=true
/usr/share/kde4/apps/kate/default.katesession:katefindinfilesplugin=true
/usr/share/kde4/apps/kate/default.katesession:katekonsoleplugin=true

Kate doesn't show any plugins when started with -session.  Then, when exiting kate, the defaults are saved back, removing the plugins for subsequent sessions.   

As a workaround I've made my default settings file read-only (chmod a-w).  Now the settings are still not loaded when KDE restores my last desktop session, but exiting kate doesn't nuke my default config; closing and reopening kate gets the plugins back again.

Kate is a really nice editor with great features, but this losing of settings is driving me insane.  I hope it can be fixed soon.
Comment 16 zOOm_ER 2009-08-05 17:29:34 UTC
(In reply to comment #15)
> So for kdesdk-4.2.4-1.fc11.i586, I've worked out at least one reproducible
> cause of plugin's being lost which matches Steffan Jost's report on this bug. 
> 
> The problem comes when you login and KDE tries to restore the previous session
> by running "kate -session <some long number>".  Under this condition the plugin settings are not loaded.  
I can confirm this behavior on KDE 4.3, except that there is no such an option "-session" in kate from KDE 4.3 - there is "-s", which is short form of "--start".
If i start kate from console:
# kate -s "Default Session"
all plugins are loaded ok.
But something intrudes, when session manager tries to restore KDE session on login. Kate session restored, but without plugins. So it is probably not a Kate bug

> Kate doesn't show any plugins when started with -session.  Then, when exiting
> kate, the defaults are saved back, removing the plugins for subsequent
> sessions.   
> 


> As a workaround I've made my default settings file read-only (chmod a-w).  Now
> the settings are still not loaded when KDE restores my last desktop session,
> but exiting kate doesn't nuke my default config; closing and reopening kate
> gets the plugins back again.
> 
> Kate is a really nice editor with great features, but this losing of settings
> is driving me insane.  I hope it can be fixed soon.
Comment 17 Dominik Haumann 2009-08-11 23:33:13 UTC
*** Bug 203372 has been marked as a duplicate of this bug. ***
Comment 18 Dominik Haumann 2009-09-05 11:40:07 UTC
*** Bug 206014 has been marked as a duplicate of this bug. ***
Comment 19 Nuno Zimas 2009-09-13 17:15:36 UTC
On Kate 3.3.1, enabled plugins are *NOT* shown in the UI after a previously saved session is reopen, although the checkboxes to activate them appear ticked in Configure Kate > Plugins.

KDE: 4.3.1
Kate: 3.3.1
Distribution: PCLinuxOS
Comment 20 Anne-Marie Mahfouf 2009-10-24 15:22:28 UTC
It's still there. Having to go to the configuration dialog each time I start my system to enable the terminal plugin is really an annoying bug.
Comment 21 Justin Lawrence 2009-11-10 13:00:46 UTC
am i correct in stating that this bug has been around all the way through intrepid and jaunty?
Comment 22 Wouter Van Hemel 2009-11-10 14:01:33 UTC
I don't know about Ubuntu, but as it's still present in Debian unstable as of today, it might very well be.
Comment 23 Anders Lund 2009-11-10 15:43:31 UTC
AFAICT, the root of this problem is the default session missing.

The solution should be that kate should load a virtual default session, if the user does not select one, and store your settings there.
Comment 24 Michael.McTernan 2010-01-01 18:39:13 UTC
(In reply to comment #23)
> AFAICT, the root of this problem is the default session missing.
> 
> The solution should be that kate should load a virtual default session, if the
> user does not select one, and store your settings there.

I'm not sure this is it.  When I copy my saved session over the default session and then run Kate, the plugins still don't come:

$ pwd
~/.kde/share/apps/kate
$ cp sessions/Kate.katesession default.katesession
$ kate

... still no plugins until I manually load the 'Kate' session through Sessions->Manage... select my 'Kate' session and then click Ok.  

Maybe if it's never going to be fixed, the session stuff can be disabled/removed?  I'd prefer a single config if it can remember my config from the last run.
Comment 25 Justin Lawrence 2010-01-02 08:27:04 UTC
Michael.McTernan.2001: "Maybe if it's never going to be fixed, the session stuff can be disabled/removed?  I'd prefer a single config if it can remember my config from the last run."

I agree 100% with this. This bug has prevented any of our developers from following me to Karmic. I've had no choice but to use KDevelop and pursuit other editors until this is remedied :-(

As with all bugs I'm tracking (eg KNetworkManager), I have seen little to no developer input. Where are the developers?
Comment 26 zOOm_ER 2010-01-02 10:47:19 UTC
(In reply to comment #25)
> As with all bugs I'm tracking (eg KNetworkManager), I have seen little to no
> developer input. Where are the developers?

developers still struggling with vim, no time for some second-league editor :\

(joking, of course. i'm totally agree with free sw's "if you don't like it, fix it youself". This bug is not so irritating for me, due to lack of really useful plugins)
Comment 27 Dominik Haumann 2010-01-03 19:07:57 UTC
In upcoming KDE 4.4 Kate will always save the session config. The options were removed what to do on exit (i.e. no ask, no not-safe).
Comment 28 zOOm_ER 2010-01-04 10:38:20 UTC
(In reply to comment #27)
> In upcoming KDE 4.4 Kate will always save the session config. The options were
> removed what to do on exit (i.e. no ask, no not-safe).

Does it supposed to fix this bug?
An is this change already included in kde 4.4 beta2 ?
Comment 29 Justin Lawrence 2010-01-04 12:54:31 UTC
does anyone know of a kate nightly binary build that we could subscribe to? that would save us *buntu people from 6 months of angst :) thanks
Comment 30 Dominik Haumann 2010-02-21 00:55:10 UTC
*** Bug 177240 has been marked as a duplicate of this bug. ***
Comment 31 Steffen Jost 2010-02-21 10:35:21 UTC
I am confused what reply #27 means.

The bug is still there in KDE 4.4 final as released for openSuse 11.2.
(The version number reads KDE 4.4.00 "release 224".)
Comment 32 gambas 2010-02-21 14:07:32 UTC
I confirm that plugins are still disabled when restoring sessions in KDE 4.4.0 (Mandriva 2010.0).
Comment 33 Dominik Haumann 2010-02-21 17:43:11 UTC
Using name sessions works. When not using sessions, it only works if you invoke Sessions > Save as Default. This is also why the report is still open.
Comment 34 zOOm_ER 2010-02-22 13:19:46 UTC
(In reply to comment #33)
> Using name sessions works. When not using sessions, it only works if you invoke
> Sessions > Save as Default. This is also why the report is still open.

in kde 4.4.0 this still does not work even using sessions:
testcase:
1) open few documents in kate
2) in settings enable some plugins (filebrowser, for ex.)
 - filebrowser tab should appear in one of dockareas
3) save this as a session with some name ('mysession', for ex.)
4) logout and login back
 - kate restored opened files, and session name 'mysession:' can be seen in window title. but no plugins are enabled.
Comment 35 Dominik Haumann 2010-03-08 20:52:23 UTC
*** Bug 229827 has been marked as a duplicate of this bug. ***
Comment 36 Eckhart Wörner 2010-03-10 01:23:43 UTC
*** Bug 210492 has been marked as a duplicate of this bug. ***
Comment 37 Timothée Ravier 2010-03-30 08:30:12 UTC
I've got the same prolem with kate 3.4.1 on KDE 4.4.1 with an Arch Linux box.
Kate should save the session and close when I logout (suspend to ram raises the same problem) and restore previous session at statup.
Comment 38 Nikos Alexandris 2010-04-04 23:00:53 UTC
I can confirm this bug under Kubuntu 9.10 using latest KDE4.4.2.
Comment 39 Dominik Haumann 2010-05-14 13:00:14 UTC
*** Bug 237590 has been marked as a duplicate of this bug. ***
Comment 40 Dominik Haumann 2010-06-03 19:18:29 UTC
*** Bug 240441 has been marked as a duplicate of this bug. ***
Comment 41 Nikos Alexandris 2010-07-04 03:42:58 UTC
This bug still exists using Kate 3.4.5 (under Kubuntu Lucid Lynx, 64-bit).
Comment 42 aphidia 2010-07-04 05:28:39 UTC
Confirming under 3.4.2 64bit Kubuntu Lucid Lynx KDE 4.4.2 Kate Part 3.4
Comment 43 Nikos Alexandris 2010-07-30 18:30:27 UTC
The (old) Bug #173283 reported in <https://bugs.launchpad.net/ubuntu/+source/kdebase/+bug/173283> is I guess related(?). Comment #10 in this report is the solution.

Cheers, Nikos
Comment 44 Nikos Alexandris 2010-07-30 18:34:44 UTC
Just to avoid confusions: apologies for ignoring the auto-linking feature to comments and bug reports within "bugs.kde.org".

All references in (previous) comment number 43 are related to a report in launchpad (in the provided full-link of course).
Comment 45 gambas 2010-07-30 18:38:21 UTC
Not related in my case: all my KDE configuration files have the right
permissions.

With Mandriva 2010.1 and KDE 4.4.3, Kate does not reload plugins at session
restoration. But it does when quitting it and lauching it again.
Comment 46 Nikos Alexandris 2010-07-30 18:49:48 UTC
Sorry to read that gambas. It fixed for me the issue(s).
Comment 47 zOOm_ER 2010-08-10 22:02:47 UTC
(In reply to comment #46)
> Sorry to read that gambas. It fixed for me the issue(s).

In my case this is also unrelated. All permissions are fine.
Comment 48 Murz 2010-08-13 10:36:12 UTC
I have no permission issues, described in https://bugs.launchpad.net/ubuntu/+source/kdebase/+bug/173283 post #10, but have the problem with plugin loading.
System is Kubuntu Lucid, KDE 4.4. KDE 4.5 Beta2 have this issue too.

When I enable plugins and quit kate, starts again - enabled plugins are disabled.

Doing "Sessions > Save Session as Default" solve the problem for me.
Comment 49 Alexander van Loon 2010-10-18 22:56:50 UTC
In comment #27 the developer mentioned that in KDE 4.4 Kate will always save the session config so that this problem will be solved. However, with KDE 4.5.1 I still experience this bug. I was wondering if there is an updated time frame on when this bug is going to get fixed?
Comment 50 Dominik Haumann 2010-10-24 13:53:43 UTC
*** Bug 243972 has been marked as a duplicate of this bug. ***
Comment 51 Dominik Haumann 2010-10-25 22:01:24 UTC
Created attachment 52863 [details]
Save unnamed sessions to katerc

The attached patch is an attempt to eliminate the default.katesession file again. Instead, all config data is saved to katerc. Additionally, "Session > Save as Default" is removed. On Kate exit, an unnamed session is saved to katerc.

Please try this patch:
1. first checkout the development version http://kate-editor.org/get-it/
2. then apply the patch in your checkout with:
   patch -p1 < default-session-in-katerc.patch
3. compile/install kate and then run it with the run.sh script.

Questions:
1. Does that fix the plugin loading bug?
2. Are there other _new_ problems introduced with this change?
Comment 52 Dominik Haumann 2010-10-26 13:50:24 UTC
*** Bug 116511 has been marked as a duplicate of this bug. ***
Comment 53 Dominik Haumann 2010-10-26 15:41:57 UTC
*** Bug 240313 has been marked as a duplicate of this bug. ***
Comment 54 Dominik Haumann 2010-10-26 15:43:53 UTC
*** Bug 211601 has been marked as a duplicate of this bug. ***
Comment 55 Dominik Haumann 2010-10-26 23:09:29 UTC
The patch is committed to gitorious now:
http://gitorious.org/kate/kate/commit/c75047e756e5b2db99d410fdc3ee13a57a4b3060

This removes the default.katesession and merges it back into the katerc config file. Unnamed sessions are read and written back to katerc. This way, changes in the plugin settings and the recent-files-menu are saved.

Please test this thoroughly by simply following http://kate-editor.org/get-it/
, so we can be sure it's working for KDE 4.6!
Comment 56 Dominik Haumann 2010-10-27 00:00:42 UTC
*** Bug 227497 has been marked as a duplicate of this bug. ***
Comment 57 Dominik Haumann 2010-10-27 00:02:07 UTC
*** Bug 198866 has been marked as a duplicate of this bug. ***
Comment 58 Christoph Cullmann 2010-10-31 16:50:23 UTC
SVN commit 1191600 by cullmann:

dhaumann:
    fix bug #156330: lugin loading in kate sessions
    
    This removes the default.katesession and merges it back into the katerc
    config file. Unnamed sessions are read and written back to katerc. This
    way, changes in the plugin settings and the recent-files-menu are saved.
    
    Please test this thoroughly, so we can be sure it's working for KDE 4.6!

BUG: 156330



 M  +2 -2      app/kateapp.cpp  
 M  +4 -1      app/kateconfigdialog.cpp  
 M  +0 -4      app/katemainwindow.cpp  
 M  +10 -41    app/katesession.cpp  
 M  +4 -15     app/katesession.h  
 M  +1 -1      data/CMakeLists.txt  
 D             data/default.katesession  
 M  +0 -4      data/kate.desktop  
 M  +30 -1     data/katerc  
 M  +0 -1      data/kateui.rc  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1191600
Comment 59 ltwilliams58 2013-06-24 03:36:47 UTC
I wonder if I should open a new bug since the behavior that got me here persists in Kate 3.10.3 on KDE 4.10.3
Comment 60 Christoph Feck 2013-07-05 12:26:44 UTC
Yes, please report a new bug, with exact steps to reproduce.
Comment 61 William Ap Brandino 2016-06-06 13:14:23 UTC
This is not solved. Occur with frequence when changes sessions.
Ubuntu 16.04 - Version 15.12.3