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

List:       kde-commits
Subject:    [Amarok]  Minor code cleanup, added debug.
From:       Mark Kretschmann <kretschmann () kde ! org>
Date:       2009-12-02 9:45:48
Message-ID: 200912020945.nB29jmsM007504 () Wurst ! kollide ! net
[Download RAW message or body]

commit bcae7afd1e3c54ed39c05bd26b8a5b1fe183f96c
Author:     Mark Kretschmann <kretschmann@kde.org>
AuthorDate: Wed Dec 2 10:09:06 2009 +0100
Commit:     Mark Kretschmann <kretschmann@kde.org>
CommitDate: Wed Dec 2 10:35:47 2009 +0100

    Minor code cleanup, added debug.

diff --git a/src/context/widgets/appletsexplorer/AppletsExplorer.cpp \
b/src/context/widgets/appletsexplorer/AppletsExplorer.cpp index 6d2e491..46280f7 \
                100644
--- a/src/context/widgets/appletsexplorer/AppletsExplorer.cpp
+++ b/src/context/widgets/appletsexplorer/AppletsExplorer.cpp
@@ -25,6 +25,7 @@
 #include "AppletsExplorer.h"
 
 #include "AppletIcon.h"
+#include "Debug.h"
 #include "PaletteHandler.h"
 
 #include <plasma/containment.h>
@@ -40,6 +41,7 @@
 #define HEIGHT 140
 #define ICON_SIZE 16
 
+
 namespace Context
 {
     
@@ -58,9 +60,7 @@ void
 AppletsExplorer::addApplet( AppletItem *appletItem )
 {
     if( appletItem && !appletItem->pluginName().isEmpty() && containment() )
-    {
         emit( addAppletToContainment( appletItem->pluginName() ) );
-    }
 }
 
 void
@@ -100,7 +100,6 @@ AppletsExplorer::init()
     setMinimumHeight( HEIGHT );
 
     setLayout( m_mainLayout );
-   
 }
 
 void
@@ -137,6 +136,8 @@ AppletsExplorer::containment() const
 void
 AppletsExplorer::resizeEvent( QGraphicsSceneResizeEvent *event )
 {
+    DEBUG_BLOCK
+
     m_mainLayout->setGeometry( QRectF( QPointF( 0, 0 ), event->newSize() ) );
 }
 
diff --git a/src/context/widgets/appletsexplorer/AppletsExplorer.h \
b/src/context/widgets/appletsexplorer/AppletsExplorer.h index 407ce98..96110e3 100644
--- a/src/context/widgets/appletsexplorer/AppletsExplorer.h
+++ b/src/context/widgets/appletsexplorer/AppletsExplorer.h
@@ -21,7 +21,6 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
  ****************************************************************************************/
  
-
 #ifndef WIDGET_EXPLORER_H
 #define WIDGET_EXPLORER_H
 
@@ -43,13 +42,11 @@ namespace Context
 
 class AMAROK_EXPORT AppletsExplorer: public QGraphicsWidget
 {
-
     Q_OBJECT
 
     public:
-
         AppletsExplorer( QGraphicsItem *parent = 0 );
-        ~AppletsExplorer();
+        virtual ~AppletsExplorer();
 
         void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, \
QWidget *widget = 0 );  
@@ -67,12 +64,9 @@ class AMAROK_EXPORT AppletsExplorer: public QGraphicsWidget
         void hideMenu();
         
     protected:
-
         virtual void resizeEvent( QGraphicsSceneResizeEvent *event );
 
-
     private:
-
         void init();
         
         Containment *m_containment;
@@ -81,7 +75,6 @@ class AMAROK_EXPORT AppletsExplorer: public QGraphicsWidget
         AppletItemModel m_model;
         AppletsListWidget *m_appletsListWidget;
         Plasma::IconWidget *m_hideIcon;
-        
 };
 
 }// namespace Context
diff --git a/src/context/widgets/appletsexplorer/AppletsList.cpp \
b/src/context/widgets/appletsexplorer/AppletsList.cpp index 062efe8..46f6c87 100644
--- a/src/context/widgets/appletsexplorer/AppletsList.cpp
+++ b/src/context/widgets/appletsexplorer/AppletsList.cpp
@@ -81,7 +81,6 @@ AppletsListWidget::init()
     m_mainLayout->setAlignment( m_rightArrow, Qt::AlignVCenter | Qt::AlignHCenter );
     m_mainLayout->setAlignment( m_appletsListWindow, Qt::AlignVCenter | \
Qt::AlignHCenter );  setLayout( m_mainLayout );
-    
 }
 
 void
@@ -121,6 +120,7 @@ AppletsListWidget::maximumVisibleAppletsOnList()
     debug() << "icon average size: " << iconAverageSize;
     debug() << "visible rect size: " << visibleRectSize;
     debug() << "listTotalSize: " << listTotalSize;
+    
     return floor( visibleRectSize / iconAverageSize );
 }
 
@@ -150,7 +150,6 @@ AppletsListWidget::setModel( QStandardItemModel *model )
         m_applets->insert( appletItem->pluginName(), createAppletIcon( appletItem ) \
);  }
     updateList();
-
 }
 
 
@@ -182,4 +181,4 @@ AppletsListWidget::updateList()
 
 }
 
-#include "AppletsList.moc"
\ No newline at end of file
+#include "AppletsList.moc"
diff --git a/src/context/widgets/appletsexplorer/AppletsList.h \
b/src/context/widgets/appletsexplorer/AppletsList.h index b9a1ac0..913b970 100644
--- a/src/context/widgets/appletsexplorer/AppletsList.h
+++ b/src/context/widgets/appletsexplorer/AppletsList.h
@@ -42,7 +42,7 @@ class AMAROK_EXPORT AppletsListWidget: public QGraphicsWidget
     Q_OBJECT
     public:
         AppletsListWidget( QGraphicsItem *parent = 0 );
-        ~AppletsListWidget();
+        virtual ~AppletsListWidget();
 
         void setModel( QStandardItemModel *model );
 
@@ -61,8 +61,7 @@ class AMAROK_EXPORT AppletsListWidget: public QGraphicsWidget
         int maximumVisibleAppletsOnList();
 
     protected:
-        void resizeEvent( QGraphicsSceneResizeEvent *event );
-
+        virtual void resizeEvent( QGraphicsSceneResizeEvent *event );
 
     private:
         QGraphicsLinearLayout *m_mainLayout;
@@ -74,8 +73,8 @@ class AMAROK_EXPORT AppletsListWidget: public QGraphicsWidget
 
         Plasma::IconWidget *m_leftArrow;
         Plasma::IconWidget *m_rightArrow;
-
 };
 
 }//namespace Context
-#endif
\ No newline at end of file
+
+#endif


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

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