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

List:       kde-commits
Subject:    extragear/multimedia/amarok/src/contextview
From:       Leo Franchi <angel666 () myrealbox ! com>
Date:       2007-06-30 21:40:15
Message-ID: 1183239615.329547.27478.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 681932 by lfranchi:

various code cleanups

 M  +1 -1      GenericInfoBox.cpp  
 M  +0 -3      items/ContextItemManager.cpp  
 M  +7 -14     items/ContextItemManagerWidget.cpp  
 M  +0 -1      items/ContextItemManagerWidget.h  


--- trunk/extragear/multimedia/amarok/src/contextview/GenericInfoBox.cpp \
#681931:681932 @@ -29,6 +29,7 @@
 void GenericInfoBox::setContents( const QString& html )
 {
     m_content = new QGraphicsTextItem( "", m_contentRect );
+    m_content->setTextWidth( m_contentRect->rect().width() );// respect the \
boundaries given to us by the parent!  m_content->setHtml( html );
     init();
 	
@@ -36,7 +37,6 @@
 
 void GenericInfoBox::init()
 {
-    m_content->setTextWidth( m_contentRect->rect().width() );// respect the \
boundaries given to us by the parent!  m_content->setTextInteractionFlags( \
Qt::TextSelectableByMouse |  Qt::LinksAccessibleByMouse );
     connect( m_content, SIGNAL( linkActivated ( QString ) ), this, SLOT( \
                externalUrl( QString ) ) );
--- trunk/extragear/multimedia/amarok/src/contextview/items/ContextItemManager.cpp \
#681931:681932 @@ -42,7 +42,6 @@
 : m_visible( false )
 {
     
-    DEBUG_BLOCK
         
     s_instance = this;
     // NOTE if you want to add a context item, you MUST add it to this map, or
@@ -59,7 +58,6 @@
 
 void ContextItemManager::applyConfig()
 {
-    DEBUG_BLOCK
     //read in the config data, and start the enabled items
     m_itemsOrder = Amarok::config( "ContextItemManager" ).readEntry( "Items", \
                QStringList() );
     int i = m_startBox; // start the counting from the last context box owned 
@@ -80,7 +78,6 @@
 //workhorse method: shows the ContextItemManagerWidget, updates the ContextView with \
changes  void ContextItemManager::showDialog()
 {
-    DEBUG_BLOCK
         
     if( ContextItemManagerWidget::instance() )
     {
--- trunk/extragear/multimedia/amarok/src/contextview/items/ContextItemManagerWidget.cpp \
#681931:681932 @@ -108,7 +108,7 @@
 #endif
     
     kapp->setTopWidget( this );
-    setCaption( KDialog::makeStandardCaption( i18n("ContextItemManager") ) );
+    setCaption( KDialog::makeStandardCaption( i18n("Context Item Manager") ) );
     setInitialSize( QSize( 400, 260 ) );
     
     KVBox *mainBox = new KVBox( this );
@@ -125,7 +125,7 @@
     
     m_up->setToolTip(     i18n( "Move Context Item up" ) );
     m_down->setToolTip(   i18n( "Move Context Item down" ) );
-    m_toggle->setToolTip( i18n( "Enable Context Item" ) );
+    m_toggle->setToolTip( i18n( "Toggle Context Item" ) );
     
     connect( m_up,     SIGNAL( clicked() ), m_listview, SLOT( moveSelectedUp() ) );
     connect( m_down,   SIGNAL( clicked() ), m_listview, SLOT( moveSelectedDown() ) \
); @@ -139,10 +139,10 @@
     
     enableButtonApply(false);
     
-    insertItems();
-    
     m_disabled = QBrush( QColor( 255, 0, 0, 127 ), Qt::SolidPattern );
     m_enabled =  QBrush( Qt::white, Qt::SolidPattern  );
+    
+    insertItems();
 }
     
 
@@ -153,20 +153,13 @@
     QList< ContextItem* > keys = m_contextItems->keys();
     foreach( QString item, m_itemsOrder )
     {
-        debug() << "inserting context item into widget: " << item << "with value: " \
<< findInContextMap( item ) << endl; +        debug() << "inserting context item into \
                widget: " << item << " with value: " << findInContextMap( item ) << \
                endl;
         QListWidgetItem* qitem = new QListWidgetItem( item, m_listview, \
QListWidgetItem::Type );  findInContextMap( item ) ? qitem->setBackground( m_enabled \
                )
                                      : qitem->setBackground( m_disabled );
     }
 }
 
-void ContextItemManagerWidget::insertItem( const QString& name, bool enabled )
-{
-    QListWidgetItem* item = new QListWidgetItem( name, m_listview, \
                QListWidgetItem::Type );
-    enabled ? item->setBackground( m_enabled )
-            : item->setBackground( m_disabled );
-}
-    
 void ContextItemManagerWidget::toggleState()
 {
     DEBUG_BLOCK
@@ -177,11 +170,11 @@
         if( findInContextMap( item->text() ) == true ) // item is currently enabled, \
so we disable it  {
             insertInContextMap( item->text(), false );
-            item->setBackground( QBrush( Qt::darkRed, Qt::SolidPattern  ) );
+            item->setBackground( m_disabled );
         } else
         {
             insertInContextMap( item->text(), true );
-            item->setBackground( QBrush( Qt::white, Qt::SolidPattern  ) );
+            item->setBackground( m_enabled );
         }
     }
     
--- trunk/extragear/multimedia/amarok/src/contextview/items/ContextItemManagerWidget.h \
#681931:681932 @@ -71,7 +71,6 @@
 private:
     
     void insertItems();
-    void insertItem( const QString& name, bool enabled );
     
     bool findInContextMap( const QString name );
     void insertInContextMap( const QString name, bool val );


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

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