summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/libkate/document/katedocument.cpp
Unidiff
Diffstat (limited to 'noncore/apps/tinykate/libkate/document/katedocument.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/document/katedocument.cpp23
1 files changed, 11 insertions, 12 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
@@ -280,6 +280,7 @@ void KateDocument::doPreHighlight()
280KateDocument::~KateDocument() 280KateDocument::~KateDocument()
281{ 281{
282 m_highlight->release(); 282 m_highlight->release();
283 writeConfig();
283 284
284 if ( !m_bSingleViewMode ) 285 if ( !m_bSingleViewMode )
285 { 286 {
@@ -596,7 +597,7 @@ bool KateDocument::isModified() const {
596 597
597void KateDocument::readConfig() 598void 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
602 myWordWrap = config->readBoolEntry("Word Wrap On", false); 603 myWordWrap = config->readBoolEntry("Word Wrap On", false);
@@ -608,20 +609,19 @@ void KateDocument::readConfig()
608 setUndoSteps(config->readNumEntry("UndoSteps", 50)); 609 setUndoSteps(config->readNumEntry("UndoSteps", 50));
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
619void KateDocument::writeConfig() 620void 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);
627 config->writeEntry("UndoSteps", undoSteps); 627 config->writeEntry("UndoSteps", undoSteps);
@@ -630,11 +630,10 @@ void KateDocument::writeConfig()
630 config->writeEntry("Font", myFont); 630 config->writeEntry("Font", myFont);
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
637void KateDocument::readSessionConfig(KConfig *config) 636void 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)
640 setHighlight(hlManager->nameFind(config->readEntry("Highlight"))); 639 setHighlight(hlManager->nameFind(config->readEntry("Highlight")));
@@ -648,7 +647,7 @@ void KateDocument::readSessionConfig(KConfig *config)
648 } 647 }
649} 648}
650 649
651void KateDocument::writeSessionConfig(KConfig *config) 650void KateDocument::writeSessionConfig(KateConfig *config)
652{ 651{
653#if 0 652#if 0
654 config->writeEntry("URL", m_url); // ### encoding?? (Simon) 653 config->writeEntry("URL", m_url); // ### encoding?? (Simon)