Diffstat (limited to 'noncore/apps/tinykate/libkate/document') (more/less context) (ignore whitespace changes)
5 files changed, 38 insertions, 45 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() | |||
281 | { | 281 | { |
282 | m_highlight->release(); | 282 | m_highlight->release(); |
283 | writeConfig(); | ||
283 | 284 | ||
284 | if ( !m_bSingleViewMode ) | 285 | if ( !m_bSingleViewMode ) |
@@ -597,5 +598,5 @@ bool KateDocument::isModified() const { | |||
597 | void KateDocument::readConfig() | 598 | void KateDocument::readConfig() |
598 | { | 599 | { |
599 | KConfig *config = KGlobal::config(); | 600 | KateConfig *config = KGlobal::config(); |
600 | config->setGroup("Kate Document"); | 601 | config->setGroup("Kate Document"); |
601 | 602 | ||
@@ -609,18 +610,17 @@ void KateDocument::readConfig() | |||
609 | m_singleSelection = config->readBoolEntry("SingleSelection", false); | 610 | m_singleSelection = config->readBoolEntry("SingleSelection", false); |
610 | myEncoding = config->readEntry("Encoding", QString::fromLatin1(QTextCodec::codecForLocale()->name())); | 611 | myEncoding = config->readEntry("Encoding", QString::fromLatin1(QTextCodec::codecForLocale()->name())); |
611 | setFont (config->readFontEntry("Font", &myFont)); | 612 | setFont (config->readFontEntry("Font", myFont)); |
612 | 613 | ||
613 | colors[0] = config->readColorEntry("Color Background", &colors[0]); | 614 | colors[0] = config->readColorEntry("Color Background", colors[0]); |
614 | colors[1] = config->readColorEntry("Color Selected", &colors[1]); | 615 | colors[1] = config->readColorEntry("Color Selected", colors[1]); |
615 | 616 | ||
616 | config->sync(); | 617 | // config->sync(); |
617 | } | 618 | } |
618 | 619 | ||
619 | void KateDocument::writeConfig() | 620 | void KateDocument::writeConfig() |
620 | { | 621 | { |
621 | KConfig *config = KGlobal::config(); | 622 | KateConfig *config = KGlobal::config(); |
622 | config->setGroup("Kate Document"); | 623 | config->setGroup("Kate Document"); |
623 | #if 0 | 624 | config->writeEntry("Word Wrap On", myWordWrap); |
624 | cofig->writeEntry("Word Wrap On", myWordWrap); | ||
625 | config->writeEntry("Word Wrap At", myWordWrapAt); | 625 | config->writeEntry("Word Wrap At", myWordWrapAt); |
626 | config->writeEntry("TabWidth", tabChars); | 626 | config->writeEntry("TabWidth", tabChars); |
@@ -631,9 +631,8 @@ void KateDocument::writeConfig() | |||
631 | config->writeEntry("Color Background", colors[0]); | 631 | config->writeEntry("Color Background", colors[0]); |
632 | config->writeEntry("Color Selected", colors[1]); | 632 | config->writeEntry("Color Selected", colors[1]); |
633 | #endif | 633 | // config->sync(); |
634 | config->sync(); | ||
635 | } | 634 | } |
636 | 635 | ||
637 | void KateDocument::readSessionConfig(KConfig *config) | 636 | void KateDocument::readSessionConfig(KateConfig *config) |
638 | { | 637 | { |
639 | m_url = config->readEntry("URL"); // ### doesn't this break the encoding? (Simon) | 638 | m_url = config->readEntry("URL"); // ### doesn't this break the encoding? (Simon) |
@@ -649,5 +648,5 @@ void KateDocument::readSessionConfig(KConfig *config) | |||
649 | } | 648 | } |
650 | 649 | ||
651 | void KateDocument::writeSessionConfig(KConfig *config) | 650 | void KateDocument::writeSessionConfig(KateConfig *config) |
652 | { | 651 | { |
653 | #if 0 | 652 | #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 | |||
230 | void readConfig(); | 230 | void readConfig(); |
231 | void writeConfig(); | 231 | void writeConfig(); |
232 | void readSessionConfig(KConfig *); | 232 | void readSessionConfig(KateConfig *); |
233 | void writeSessionConfig(KConfig *); | 233 | void writeSessionConfig(KateConfig *); |
234 | 234 | ||
235 | bool hasBrowserExtension() const { return m_bBrowserView; } | 235 | 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) | |||
650 | } | 650 | } |
651 | 651 | ||
652 | KConfig *Highlight::getKConfig() { | 652 | KateConfig *Highlight::getKateConfig() { |
653 | KConfig *config; | 653 | KateConfig *config; |
654 | config=KGlobal::config(); | 654 | config=KGlobal::config(); |
655 | config->setGroup(iName + QString(" Highlight")); | 655 | config->setGroup(iName + QString(" Highlight")); |
@@ -658,7 +658,7 @@ KConfig *Highlight::getKConfig() { | |||
658 | 658 | ||
659 | QString Highlight::getWildcards() { | 659 | QString Highlight::getWildcards() { |
660 | KConfig *config; | 660 | KateConfig *config; |
661 | 661 | ||
662 | config = getKConfig(); | 662 | config = getKateConfig(); |
663 | 663 | ||
664 | //if wildcards not yet in config, then use iWildCards as default | 664 | //if wildcards not yet in config, then use iWildCards as default |
@@ -668,7 +668,7 @@ QString Highlight::getWildcards() { | |||
668 | 668 | ||
669 | QString Highlight::getMimetypes() { | 669 | QString Highlight::getMimetypes() { |
670 | KConfig *config; | 670 | KateConfig *config; |
671 | 671 | ||
672 | config = getKConfig(); | 672 | config = getKateConfig(); |
673 | 673 | ||
674 | return config->readEntry("Mimetypes", iMimetypes); | 674 | return config->readEntry("Mimetypes", iMimetypes); |
@@ -677,8 +677,8 @@ QString Highlight::getMimetypes() { | |||
677 | 677 | ||
678 | HlData *Highlight::getData() { | 678 | HlData *Highlight::getData() { |
679 | KConfig *config; | 679 | KateConfig *config; |
680 | HlData *hlData; | 680 | HlData *hlData; |
681 | 681 | ||
682 | config = getKConfig(); | 682 | config = getKateConfig(); |
683 | 683 | ||
684 | // iWildcards = config->readEntry("Wildcards"); | 684 | // iWildcards = config->readEntry("Wildcards"); |
@@ -694,7 +694,7 @@ HlData *Highlight::getData() { | |||
694 | 694 | ||
695 | void Highlight::setData(HlData *hlData) { | 695 | void Highlight::setData(HlData *hlData) { |
696 | KConfig *config; | 696 | KateConfig *config; |
697 | 697 | ||
698 | config = getKConfig(); | 698 | config = getKateConfig(); |
699 | 699 | ||
700 | // iWildcards = hlData->wildcards; | 700 | // iWildcards = hlData->wildcards; |
@@ -708,11 +708,11 @@ void Highlight::setData(HlData *hlData) { | |||
708 | 708 | ||
709 | void Highlight::getItemDataList(ItemDataList &list) { | 709 | void Highlight::getItemDataList(ItemDataList &list) { |
710 | KConfig *config; | 710 | KateConfig *config; |
711 | 711 | ||
712 | config = getKConfig(); | 712 | config = getKateConfig(); |
713 | getItemDataList(list, config); | 713 | getItemDataList(list, config); |
714 | } | 714 | } |
715 | 715 | ||
716 | void Highlight::getItemDataList(ItemDataList &list, KConfig *config) { | 716 | void Highlight::getItemDataList(ItemDataList &list, KateConfig *config) { |
717 | ItemData *p; | 717 | ItemData *p; |
718 | QString s; | 718 | QString s; |
@@ -740,5 +740,5 @@ void Highlight::getItemDataList(ItemDataList &list, KConfig *config) { | |||
740 | * input: ItemDataList &list :reference to the list, whose | 740 | * input: ItemDataList &list :reference to the list, whose |
741 | * items should be saved | 741 | * items should be saved |
742 | * KConfig *config :Pointer KDE configuration | 742 | * KateConfig *config :Pointer KDE configuration |
743 | * class, which should be used | 743 | * class, which should be used |
744 | * as storage | 744 | * as storage |
@@ -749,5 +749,5 @@ void Highlight::getItemDataList(ItemDataList &list, KConfig *config) { | |||
749 | *******************************************************************************************/ | 749 | *******************************************************************************************/ |
750 | 750 | ||
751 | void Highlight::setItemDataList(ItemDataList &list, KConfig *config) { | 751 | void Highlight::setItemDataList(ItemDataList &list, KateConfig *config) { |
752 | ItemData *p; | 752 | ItemData *p; |
753 | QString s; | 753 | QString s; |
@@ -1267,5 +1267,5 @@ Highlight *HlManager::getHl(int n) { | |||
1267 | 1267 | ||
1268 | int HlManager::defaultHl() { | 1268 | int HlManager::defaultHl() { |
1269 | KConfig *config; | 1269 | KateConfig *config; |
1270 | config = KGlobal::config(); | 1270 | config = KGlobal::config(); |
1271 | config->setGroup("General Options"); | 1271 | config->setGroup("General Options"); |
@@ -1375,5 +1375,5 @@ QString HlManager::defaultStyleName(int n) | |||
1375 | 1375 | ||
1376 | void HlManager::getDefaults(ItemStyleList &list) { | 1376 | void HlManager::getDefaults(ItemStyleList &list) { |
1377 | KConfig *config; | 1377 | KateConfig *config; |
1378 | int z; | 1378 | int z; |
1379 | ItemStyle *i; | 1379 | ItemStyle *i; |
@@ -1411,5 +1411,5 @@ void HlManager::getDefaults(ItemStyleList &list) { | |||
1411 | 1411 | ||
1412 | void HlManager::setDefaults(ItemStyleList &list) { | 1412 | void HlManager::setDefaults(ItemStyleList &list) { |
1413 | KConfig *config; | 1413 | KateConfig *config; |
1414 | int z; | 1414 | int z; |
1415 | ItemStyle *i; | 1415 | 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; | |||
237 | 237 | ||
238 | class HlManager; | 238 | class HlManager; |
239 | class KConfig; | 239 | class KateConfig; |
240 | 240 | ||
241 | //context | 241 | //context |
@@ -259,5 +259,5 @@ class Highlight | |||
259 | int doHighlight(int ctxNum, TextLine *); | 259 | int doHighlight(int ctxNum, TextLine *); |
260 | 260 | ||
261 | KConfig *getKConfig(); | 261 | KateConfig *getKateConfig(); |
262 | QString getWildcards(); | 262 | QString getWildcards(); |
263 | QString getMimetypes(); | 263 | QString getMimetypes(); |
@@ -265,6 +265,6 @@ class Highlight | |||
265 | void setData(HlData *); | 265 | void setData(HlData *); |
266 | void getItemDataList(ItemDataList &); | 266 | void getItemDataList(ItemDataList &); |
267 | void getItemDataList(ItemDataList &, KConfig *); | 267 | void getItemDataList(ItemDataList &, KateConfig *); |
268 | void setItemDataList(ItemDataList &, KConfig *); | 268 | void setItemDataList(ItemDataList &, KateConfig *); |
269 | QString name() {return iName;} | 269 | QString name() {return iName;} |
270 | QString section() {return iSection;} | 270 | 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 @@ | |||
17 | 17 | ||
18 | #include "katesyntaxdocument.h" | 18 | #include "katesyntaxdocument.h" |
19 | #include <kateconfig.h> | ||
19 | #include <qfile.h> | 20 | #include <qfile.h> |
20 | #include <kdebug.h> | 21 | #include <kdebug.h> |
@@ -23,5 +24,4 @@ | |||
23 | #include <kmessagebox.h> | 24 | #include <kmessagebox.h> |
24 | #include <qstringlist.h> | 25 | #include <qstringlist.h> |
25 | #include <kconfig.h> | ||
26 | #include <kglobal.h> | 26 | #include <kglobal.h> |
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
@@ -52,5 +52,5 @@ void SyntaxDocument::setupModeList(bool force) | |||
52 | if (myModeList.count() > 0) return; | 52 | if (myModeList.count() > 0) return; |
53 | 53 | ||
54 | KConfig *config=KGlobal::config(); | 54 | KateConfig *config=KGlobal::config(); |
55 | KStandardDirs *dirs = KGlobal::dirs(); | 55 | KStandardDirs *dirs = KGlobal::dirs(); |
56 | 56 | ||
@@ -64,5 +64,4 @@ void SyntaxDocument::setupModeList(bool force) | |||
64 | { | 64 | { |
65 | QString Group="Highlighting_Cache"+path+*it; | 65 | QString Group="Highlighting_Cache"+path+*it; |
66 | |||
67 | if ((config->hasGroup(Group)) && (!force)) | 66 | if ((config->hasGroup(Group)) && (!force)) |
68 | { | 67 | { |
@@ -97,6 +96,4 @@ void SyntaxDocument::setupModeList(bool force) | |||
97 | 96 | ||
98 | mli->identifier = path+(*it); | 97 | mli->identifier = path+(*it); |
99 | #warning fixme | ||
100 | /* | ||
101 | config->setGroup(Group); | 98 | config->setGroup(Group); |
102 | config->writeEntry("name",mli->name); | 99 | config->writeEntry("name",mli->name); |
@@ -104,12 +101,9 @@ void SyntaxDocument::setupModeList(bool force) | |||
104 | config->writeEntry("mimetype",mli->mimetype); | 101 | config->writeEntry("mimetype",mli->mimetype); |
105 | config->writeEntry("extension",mli->extension); | 102 | config->writeEntry("extension",mli->extension); |
106 | */ | ||
107 | myModeList.append(mli); | 103 | myModeList.append(mli); |
108 | } | 104 | } |
109 | } | 105 | } |
110 | } | ||
111 | } | 106 | } |
112 | // } | 107 | } |
113 | |||
114 | // config->sync(); | 108 | // config->sync(); |
115 | } | 109 | } |