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

List:       kde-commits
Subject:    branches/KDE/4.3/kdeplasma-addons/applets/notes
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2009-07-05 9:51:38
Message-ID: 1246787498.438789.1560.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 991542 by aseigo:

we used to save plain text, now we use rich text. this screws up loading notes from \
4.2. so move to saving in a different key and use that as a transition mechanism


 M  +12 -4     notes.cpp  


--- branches/KDE/4.3/kdeplasma-addons/applets/notes/notes.cpp #991541:991542
@@ -327,9 +327,17 @@
     palette.setColor(QPalette::Text, m_textColor);
     m_textEdit->nativeWidget()->setPalette(palette);
 
-    QString text = cg.readEntry("autoSave", QString());
-    if (!text.isEmpty()) {
-        m_textEdit->nativeWidget()->setHtml(text);
+    QString text = cg.readEntry("autoSaveHtml", QString());
+    if (text.isEmpty()) {
+        // see if the old, plain text version is still there?
+        text = cg.readEntry("autoSave", QString());
+        if (!text.isEmpty()) {
+            m_textEdit->nativeWidget()->setText(text);
+            cg.deleteEntry("autoSave");
+            saveNote();
+        }
+    } else {
+        m_textEdit->setText(text);
     }
 
     int scrollValue = cg.readEntry("scrollValue").toInt();
@@ -440,7 +448,7 @@
 void Notes::saveNote()
 {
     KConfigGroup cg = config();
-    cg.writeEntry("autoSave", m_textEdit->nativeWidget()->toHtml());
+    cg.writeEntry("autoSaveHtml", m_textEdit->text());
     cg.writeEntry("scrollValue", \
QVariant(m_textEdit->nativeWidget()->verticalScrollBar()->value()));  //kDebug() << \
m_textEdit->nativeWidget()->toPlainText();  emit configNeedsSaving();


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

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