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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/quicklaunch
From:       Dmitry Suzdalev <dimsuz () gmail ! com>
Date:       2008-12-17 21:41:44
Message-ID: 1229550104.744824.24689.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 898288 by dimsuz:

Don't crash if size happens to be 0 (for example during plasma startup)



 M  +4 -0      quicklaunchApplet.cpp  


--- trunk/KDE/kdebase/workspace/plasma/applets/quicklaunch/quicklaunchApplet.cpp #898287:898288
@@ -165,9 +165,13 @@
     int iconWidth;
     if (formFactor() == Plasma::Vertical) {
         rowCount = qMin(m_rowCount, int(size().width()) / (s_defaultIconSize + s_defaultSpacing));
+        // prevent possible division by zero if size().width() is 0
+        rowCount = (rowCount == 0) ? 1 : rowCount;
         iconWidth = size().width() / rowCount;
     } else {
         rowCount = qMin(m_rowCount, int(size().height()) / (s_defaultIconSize + s_defaultSpacing));
+        // prevent possible division by zero if size().height() is 0
+        rowCount = (rowCount == 0) ? 1 : rowCount;
         iconWidth = qMax(s_defaultIconSize, int(size().height()) / rowCount);
     }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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