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

List:       kde-commits
Subject:    KDE/kdeplasma-addons/applets/notes
From:       Alex Merry <kde () randomguy3 ! me ! uk>
Date:       2008-08-06 22:10:35
Message-ID: 1218060635.689572.22936.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 843300 by alexmerry:

constraintsUpdated() can be called before init().



 M  +10 -7     notes.cpp  


--- trunk/KDE/kdeplasma-addons/applets/notes/notes.cpp #843299:843300
@@ -33,6 +33,8 @@
 Notes::Notes(QObject *parent, const QVariantList &args)
     : Plasma::Applet(parent, args)
     , m_notes_theme(this)
+    , m_layout(0)
+    , m_textEdit(0)
 {
     setAspectRatioMode(Plasma::IgnoreAspectRatio);
     setHasConfigurationInterface(true);
@@ -110,13 +112,14 @@
 
 void Notes::updateTextGeometry()
 {
-    const qreal xpad = geometry().width() / 15;
-    const qreal ypad = geometry().height() / 15;
-    m_layout->setSpacing(xpad);
-    m_layout->setContentsMargins(xpad, ypad, xpad, ypad);
-    m_font.setPointSize(fontSize());
-    m_textEdit->nativeWidget()->setFont(m_font);
-    
+    if (m_layout) {
+        const qreal xpad = geometry().width() / 15;
+        const qreal ypad = geometry().height() / 15;
+        m_layout->setSpacing(xpad);
+        m_layout->setContentsMargins(xpad, ypad, xpad, ypad);
+        m_font.setPointSize(fontSize());
+        m_textEdit->nativeWidget()->setFont(m_font);
+    }
 }
 
 int Notes::fontSize()
[prev in list] [next in list] [prev in thread] [next in thread] 

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