Bug 77244 - Kate won't save window layout anymore.
Summary: Kate won't save window layout anymore.
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 2.2.1
Platform: RedHat Enterprise Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 77137 77713 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-11 03:20 UTC by Philippe A
Modified: 2004-04-23 14:36 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe A 2004-03-11 03:20:09 UTC
Version:           2.2.1 (using KDE KDE 3.2.1)
Installed from:    RedHat RPMs
OS:          Linux

In KDE 3.2, Kate would save my window layout without problems. 
It is no longer the case in KDE 3.2.1. Even though the Restore
Window Configuration checkbox is enabled, my window layout
always is the default when opening Kate. This is true for Ideal
and Tab modes.
Comment 1 Philippe A 2004-03-11 03:21:35 UTC
Also wanted to mention I tried kate with different
user accounts. I also tried moving my katerc file
aside. Neither helped nor revealed much. It does not
seem to be a config file issue.
Comment 2 Eugene Onischenko 2004-03-11 09:58:20 UTC
I believe backporting revision 1.83 of the kdebase/kate/app/kateapp.cpp tp 3.2 branch should fix the bug.
Comment 3 Mihai Basa 2004-03-11 20:30:20 UTC
I can confirm this is happening.
Comment 4 Mihai Basa 2004-03-11 21:09:03 UTC
It might be an issue of the lines

KSimpleConfig scfg ("katesessionrc", false);

and

config()->setGroup("General");

(around line 200 in kateapp.cpp) being in the wrong order. I've played around with these, ran make install in kate's source dir and things work now.
How could this be missed in testing?

Here is a patchfile, athough I probably modified more than strictly necessary:


--- app/kateapp.cpp     2004-03-11 19:54:41.000000000 +0000
+++ /home/mihai/work/temp/kdebase-3.2.1/kate/app/kateapp.cpp    2004-02-28 09:43:37.000000000 +0000
@@ -192,13 +192,10 @@
     }
     else
     {
+      KSimpleConfig scfg ("katesessionrc", false);

-      KateMainWindow *win=newMainWindow(false);
-
       config()->setGroup("General");

-      KSimpleConfig scfg ("katesessionrc", false);
-
       // restore our nice projects if wanted
       if (config()->readBoolEntry("Restore Projects", false))
         m_projectManager->restoreProjectList (&scfg);
@@ -206,7 +203,8 @@
       // reopen our nice files if wanted
       if (config()->readBoolEntry("Restore Documents", false))
         m_docManager->restoreDocumentList (&scfg);
-
+
+      KateMainWindow *win=newMainWindow(false);

       // window config
       if (config()->readBoolEntry("Restore Window Configuration", false))


Comment 5 Jesse 2004-03-12 05:05:53 UTC
*** Bug 77137 has been marked as a duplicate of this bug. ***
Comment 6 Jesse 2004-03-12 05:15:15 UTC
Bugs 75860, 76131, and 76882 might be related also. Though they look to be slightly different and may require other config fixing or kmdi fixing.

Also, the change suggested by comment #4 seems to have already been incorporated in cvs head and actually looks very close to Revision 1.81.2.1 which is the backport to kde 3.2.1 over 3 weeks ago.  Is this still an issue?
Comment 7 Anders Lund 2004-03-12 07:34:16 UTC
Frankly, I can't see the order how the order of creatting the katesessionrc config object and setting the group in the global applicatin config object can have anything to do with it -- they are *different* objects.

However, creating the main window at a point where the group of the application config object is set to "General" may be important. At least restoring in Tabbed mode works here since i changed that (for a different reason), as do partly restoring in IDEAL mode: open toolviews gets restored, to the correct size. Remaining problem: hidden tool docks forgets their sizes. 
Comment 8 Philippe A 2004-03-13 17:35:35 UTC
I managed to apply the proposed patch. Now kate restores
my layout but but only if started from the command line.

If I start kate from the command line, the window layout
will be restored ok.

If I start kate through the Kicker menu or Run dialog, it
won't restore the window layout. Unless I start it 
explicitely with /usr/bin/kate.

I checked my environment. It looks sane. I have only one 
kde version installed. I have no other kate binary lying
around. I have no particular kde vars set:

KDEDIR=/usr
QTDIR=/usr/lib/qt-3.3

I installed the binary fedora rpms and used the corresponding
srcrpm to recompile.

I'm puzzled. I use the Run box quite extensively. Any help on
how to solve this would be much appreciated. Thanks!
Comment 9 Philippe A 2004-03-14 04:16:41 UTC
I seem to have a problem with kdeinit. I have found the problem
described in comment 8 above happens only when kate is started 
through kdeinit. 
Comment 10 Anders Lund 2004-03-15 22:36:11 UTC
*** Bug 77713 has been marked as a duplicate of this bug. ***
Comment 11 Philippe A 2004-03-18 04:17:21 UTC
I wanted to verify I wasn't crazy. I reinstalled my kdebase
rpm and ran kate in two different ways : 
$ kdeinit kate
$ kate

Had the layout bug with both.

When I run my patched kate with the same commands, the bug
only reproduce with one of them : the one using kdeinit.

Comment 12 Anders Lund 2004-03-18 08:34:09 UTC
On Thursday 18 March 2004 04:17, Philippe A wrote:
> I wanted to verify I wasn't crazy.

Dear friend,
Noone have indicated they don't believe this bug was there. Neither are we 
proud of it. My reason for not marking this bug as confirmed yet is, that I 
think I have allready commited changes that fixes this to the KDE 3.2 cvs 
branch -- at least fixes it as much as your proposed patch, which as i 
explained in an earlier comment is not 100% correct.

Neither do I have, unfortunately, *any* way of fixing this for "ordinary" 
users before the release of KDE 3.2.2 (scheduled soon).

So keep up hopes -- as soon as I can verify that the issue is solved in the 
branch, you will be notified.

-anders
Comment 13 Anders Lund 2004-03-22 00:02:24 UTC
I believe this is solved to the extend it worked in kde 3.2 by now.
Remaining related issues: 
* We dont't restore the order of the buttons for IDEAI mode
* the size for the toolviews are not restored, if they are collapsed when closed.