[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: hl config trouble (PATCH)
From:       Anders Lund <anders () alweb ! dk>
Date:       2002-03-13 1:06:31
[Download RAW message or body]

On Tuesday 12 March 2002 04:25, Anders Lund wrote:
> Hi,
> I fell over this once again, and decided to start investigate a bit.
> Problems:
>
> Changes to the hl configuration does not get saved to disk.
>
> Changes to the style data makes it to the current session, changes to
> extensions or mime types not even there.
>
> The kconfig file (katesyntaxhighlightingrc) does not get sync()ed except by
> the SyntaxDocument class, which appearently does that each time it is
> constructed.
>
> The config object is kept as a static object by the hlManager, could that
> be the reason? sync()ing it in the hlmanager destructor has no effect.
>
> The data would be saved (if the sync() succeded) in a group "<hl name>
> Highlight" which is only read (by Highlight::getData()) for the sake of the
> configuration page, not when the document sets the hl mode - afaics,
> correct me if i'm wrong (jowenn)
>
> I am too tired right now to figure out how to solve these problems, still
> dizzy from a flue, but i will try again tomorrow - but please do not
> hesitate to help. I think this is a bad one, if we can't solve it we should
> not display the hl config page at all, but replace it with an excuse.
>
> -anders

Hmm, feeling a bit better today: it wasn't that hard.
Jowenn, can you confirm that this is ok?

["hlconfig.diff" (text/x-diff)]

Index: katedialogs.cpp
===================================================================
RCS file: /home/kde/kdelibs/kate/part/katedialogs.cpp,v
retrieving revision 1.17
diff -u -r1.17 katedialogs.cpp
--- katedialogs.cpp	2002/02/02 11:52:20	1.17
+++ katedialogs.cpp	2002/03/13 01:03:02
@@ -101,9 +101,9 @@
 
 void HlConfigPage::apply ()
 {
+  page->saveData();
   hlManager->setHlDataList(hlDataList);
   hlManager->setDefaults(defaultStyleList);
-  page->saveData();
 }
 
 void HlConfigPage::reload ()
Index: katehighlight.cpp
===================================================================
RCS file: /home/kde/kdelibs/kate/part/katehighlight.cpp,v
retrieving revision 1.43
diff -u -r1.43 katehighlight.cpp
--- katehighlight.cpp	2002/02/26 04:16:40	1.43
+++ katehighlight.cpp	2002/03/13 01:03:07
@@ -911,7 +911,6 @@
   KConfig *config;
 
   config = getKConfig();
-
 //  iWildcards = hlData->wildcards;
 //  iMimetypes = hlData->mimetypes;
 
@@ -1854,6 +1853,8 @@
   for (z = 0; z < (int) hlList.count(); z++) {
     hlList.at(z)->setData(list.at(z));
   }
+  // anders: this actually works - changes from config box gets saved :-)))
+  getKConfig()->sync();
   //notify documents about changes in highlight configuration
   emit changed();
 }

_______________________________________________
kwrite-devel mailing list
kwrite-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/kwrite-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic