Diffstat (limited to 'noncore/apps/tinykate/libkate/document') (more/less context) (show whitespace changes)
5 files changed, 37 insertions, 44 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katedocument.cpp b/noncore/apps/tinykate/libkate/document/katedocument.cpp index df1de8d..6807544 100644 --- a/noncore/apps/tinykate/libkate/document/katedocument.cpp +++ b/noncore/apps/tinykate/libkate/document/katedocument.cpp @@ -281,4 +281,5 @@ KateDocument::~KateDocument() { m_highlight->release(); + writeConfig(); if ( !m_bSingleViewMode ) @@ -597,5 +598,5 @@ bool KateDocument::isModified() const { void KateDocument::readConfig() { - KConfig *config = KGlobal::config(); + KateConfig *config = KGlobal::config(); config->setGroup("Kate Document"); @@ -609,18 +610,17 @@ void KateDocument::readConfig() m_singleSelection = config->readBoolEntry("SingleSelection", false); myEncoding = config->readEntry("Encoding", QString::fromLatin1(QTextCodec::codecForLocale()->name())); - setFont (config->readFontEntry("Font", &myFont)); + setFont (config->readFontEntry("Font", myFont)); - colors[0] = config->readColorEntry("Color Background", &colors[0]); - colors[1] = config->readColorEntry("Color Selected", &colors[1]); + colors[0] = config->readColorEntry("Color Background", colors[0]); + colors[1] = config->readColorEntry("Color Selected", colors[1]); - config->sync(); +// config->sync(); } void KateDocument::writeConfig() { - KConfig *config = KGlobal::config(); + KateConfig *config = KGlobal::config(); config->setGroup("Kate Document"); -#if 0 - cofig->writeEntry("Word Wrap On", myWordWrap); + config->writeEntry("Word Wrap On", myWordWrap); config->writeEntry("Word Wrap At", myWordWrapAt); config->writeEntry("TabWidth", tabChars); @@ -631,9 +631,8 @@ void KateDocument::writeConfig() config->writeEntry("Color Background", colors[0]); config->writeEntry("Color Selected", colors[1]); -#endif - config->sync(); +// config->sync(); } -void KateDocument::readSessionConfig(KConfig *config) +void KateDocument::readSessionConfig(KateConfig *config) { m_url = config->readEntry("URL"); // ### doesn't this break the encoding? (Simon) @@ -649,5 +648,5 @@ void KateDocument::readSessionConfig(KConfig *config) } -void KateDocument::writeSessionConfig(KConfig *config) +void KateDocument::writeSessionConfig(KateConfig *config) { #if 0 diff --git a/noncore/apps/tinykate/libkate/document/katedocument.h b/noncore/apps/tinykate/libkate/document/katedocument.h index 356541f..9d8ec6a 100644 --- a/noncore/apps/tinykate/libkate/document/katedocument.h +++ b/noncore/apps/tinykate/libkate/document/katedocument.h @@ -230,6 +230,6 @@ class KateDocument: public Kate::Document void readConfig(); void writeConfig(); - void readSessionConfig(KConfig *); - void writeSessionConfig(KConfig *); + void readSessionConfig(KateConfig *); + void writeSessionConfig(KateConfig *); bool hasBrowserExtension() const { return m_bBrowserView; } diff --git a/noncore/apps/tinykate/libkate/document/katehighlight.cpp b/noncore/apps/tinykate/libkate/document/katehighlight.cpp index 797968b..0d2c283 100644 --- a/noncore/apps/tinykate/libkate/document/katehighlight.cpp +++ b/noncore/apps/tinykate/libkate/document/katehighlight.cpp @@ -650,6 +650,6 @@ int Highlight::doHighlight(int ctxNum, TextLine *textLine) } -KConfig *Highlight::getKConfig() { - KConfig *config; +KateConfig *Highlight::getKateConfig() { + KateConfig *config; config=KGlobal::config(); config->setGroup(iName + QString(" Highlight")); @@ -658,7 +658,7 @@ KConfig *Highlight::getKConfig() { QString Highlight::getWildcards() { - KConfig *config; + KateConfig *config; - config = getKConfig(); + config = getKateConfig(); //if wildcards not yet in config, then use iWildCards as default @@ -668,7 +668,7 @@ QString Highlight::getWildcards() { QString Highlight::getMimetypes() { - KConfig *config; + KateConfig *config; - config = getKConfig(); + config = getKateConfig(); return config->readEntry("Mimetypes", iMimetypes); @@ -677,8 +677,8 @@ QString Highlight::getMimetypes() { HlData *Highlight::getData() { - KConfig *config; + KateConfig *config; HlData *hlData; - config = getKConfig(); + config = getKateConfig(); // iWildcards = config->readEntry("Wildcards"); @@ -694,7 +694,7 @@ HlData *Highlight::getData() { void Highlight::setData(HlData *hlData) { - KConfig *config; + KateConfig *config; - config = getKConfig(); + config = getKateConfig(); // iWildcards = hlData->wildcards; @@ -708,11 +708,11 @@ void Highlight::setData(HlData *hlData) { void Highlight::getItemDataList(ItemDataList &list) { - KConfig *config; + KateConfig *config; - config = getKConfig(); + config = getKateConfig(); getItemDataList(list, config); } -void Highlight::getItemDataList(ItemDataList &list, KConfig *config) { +void Highlight::getItemDataList(ItemDataList &list, KateConfig *config) { ItemData *p; QString s; @@ -740,5 +740,5 @@ void Highlight::getItemDataList(ItemDataList &list, KConfig *config) { * input: ItemDataList &list :reference to the list, whose * items should be saved - * KConfig *config :Pointer KDE configuration + * KateConfig *config :Pointer KDE configuration * class, which should be used * as storage @@ -749,5 +749,5 @@ void Highlight::getItemDataList(ItemDataList &list, KConfig *config) { *******************************************************************************************/ -void Highlight::setItemDataList(ItemDataList &list, KConfig *config) { +void Highlight::setItemDataList(ItemDataList &list, KateConfig *config) { ItemData *p; QString s; @@ -1267,5 +1267,5 @@ Highlight *HlManager::getHl(int n) { int HlManager::defaultHl() { - KConfig *config; + KateConfig *config; config = KGlobal::config(); config->setGroup("General Options"); @@ -1375,5 +1375,5 @@ QString HlManager::defaultStyleName(int n) void HlManager::getDefaults(ItemStyleList &list) { - KConfig *config; + KateConfig *config; int z; ItemStyle *i; @@ -1411,5 +1411,5 @@ void HlManager::getDefaults(ItemStyleList &list) { void HlManager::setDefaults(ItemStyleList &list) { - KConfig *config; + KateConfig *config; int z; ItemStyle *i; diff --git a/noncore/apps/tinykate/libkate/document/katehighlight.h b/noncore/apps/tinykate/libkate/document/katehighlight.h index 1baddcc..fddf585 100644 --- a/noncore/apps/tinykate/libkate/document/katehighlight.h +++ b/noncore/apps/tinykate/libkate/document/katehighlight.h @@ -237,5 +237,5 @@ typedef QList<HlData> HlDataList; class HlManager; -class KConfig; +class KateConfig; //context @@ -259,5 +259,5 @@ class Highlight int doHighlight(int ctxNum, TextLine *); - KConfig *getKConfig(); + KateConfig *getKateConfig(); QString getWildcards(); QString getMimetypes(); @@ -265,6 +265,6 @@ class Highlight void setData(HlData *); void getItemDataList(ItemDataList &); - void getItemDataList(ItemDataList &, KConfig *); - void setItemDataList(ItemDataList &, KConfig *); + void getItemDataList(ItemDataList &, KateConfig *); + void setItemDataList(ItemDataList &, KateConfig *); QString name() {return iName;} QString section() {return iSection;} diff --git a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp index e45daa4..844f27d 100644 --- a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp +++ b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp @@ -17,4 +17,5 @@ #include "katesyntaxdocument.h" +#include <kateconfig.h> #include <qfile.h> #include <kdebug.h> @@ -23,5 +24,4 @@ #include <kmessagebox.h> #include <qstringlist.h> -#include <kconfig.h> #include <kglobal.h> #include <qpe/qpeapplication.h> @@ -52,5 +52,5 @@ void SyntaxDocument::setupModeList(bool force) if (myModeList.count() > 0) return; - KConfig *config=KGlobal::config(); + KateConfig *config=KGlobal::config(); KStandardDirs *dirs = KGlobal::dirs(); @@ -64,5 +64,4 @@ void SyntaxDocument::setupModeList(bool force) { QString Group="Highlighting_Cache"+path+*it; - if ((config->hasGroup(Group)) && (!force)) { @@ -97,6 +96,4 @@ void SyntaxDocument::setupModeList(bool force) mli->identifier = path+(*it); -#warning fixme -/* config->setGroup(Group); config->writeEntry("name",mli->name); @@ -104,5 +101,4 @@ void SyntaxDocument::setupModeList(bool force) config->writeEntry("mimetype",mli->mimetype); config->writeEntry("extension",mli->extension); -*/ myModeList.append(mli); } @@ -110,6 +106,4 @@ void SyntaxDocument::setupModeList(bool force) } } -// } - // config->sync(); } |