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

List:       kde-commits
Subject:    extragear/plasma/applets/notes
From:       Sebastian Kügler <sebas () kde ! nl>
Date:       2008-02-11 13:23:11
Message-ID: 1202736191.770141.25430.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 773587 by sebas:

- codingstyle cleanups
- Remove Notes-internal size handling, that's done by plasma itself
- Remove unecessary saveNote(), we can do just fine with only one method saving the \
content

Result: 
-1 String
- 3 methods
- 1 member var
- ~80 LOC


 M  +2 -15     config.ui  
 M  +2 -12     notes.cpp  
 M  +0 -4      notes.h  


--- trunk/extragear/plasma/applets/notes/config.ui #773586:773587
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>229</width>
-    <height>138</height>
+    <width>167</width>
+    <height>72</height>
    </rect>
   </property>
   <layout class="QVBoxLayout" >
@@ -24,19 +24,6 @@
      </property>
     </widget>
    </item>
-   <item>
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>221</width>
-       <height>64</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
   </layout>
  </widget>
  <customwidgets>
--- trunk/extragear/plasma/applets/notes/notes.cpp #773586:773587
@@ -56,8 +56,6 @@
     m_textColor = cg.readEntry("textcolor", QColor());
     m_textArea->setDefaultTextColor(m_textColor);
     connect(m_textArea, SIGNAL(editingFinished()), this, SLOT(saveNote())); // \
                FIXME: Doesn't work? This could make the following unnecessary ...
-    connect(m_textArea, SIGNAL(textChanged(const QString &)), this, \
                SLOT(saveText(const QString &)));
-
 }
 
 void Notes::constraintsUpdated(Plasma::Constraints constraints)
@@ -72,7 +70,7 @@
 void Notes::updateTextGeometry()
 {
     //note: we're using a custom bg so we have no 'border': using boundingrect here \
                is ok
-    //FIXME there's no way to force the height on a qgraohicstextitem :(
+    //FIXME there's no way to force the height on a qgraphicstextitem :(
     const qreal xpad = boundingRect().width() / 10;
     const qreal ypad = boundingRect().height() / 10;
     m_textArea->setGeometry(QRectF(xpad, ypad, boundingRect().width() - 2 * xpad, \
boundingRect().height() - 2 * ypad)); @@ -81,15 +79,6 @@
 void Notes::saveNote()
 {
     KConfigGroup cg = config();
-    cg.writeEntry("autoSave",m_textArea->toPlainText());
-    emit configNeedsSaving();
-}
-
-void Notes::saveText(const QString& text)
-{
-    Q_UNUSED(text);
-
-    KConfigGroup cg = config();
     cg.writeEntry("autoSave", m_textArea->toPlainText());
     emit configNeedsSaving();
 }
@@ -133,6 +122,7 @@
 
     m_dialog->show();
 }
+
 //FIXME those two dialogs give the cancel button issues.
 void Notes::showFontSelectDlg()
 {
--- trunk/extragear/plasma/applets/notes/notes.h #773586:773587
@@ -50,11 +50,7 @@
         void showFontSelectDlg();
         void showColorSelectDlg();
         void saveNote();
-        void saveText(const QString& text);
 
-//    protected:
-//        void saveNote();
-
     private:
         void updateTextGeometry();
         Plasma::Svg m_notes_theme;


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

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