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

List:       kde-commits
Subject:    KDE/kdepim/kontact/src
From:       Tobias Koenig <tokoe () kde ! org>
Date:       2009-09-18 16:17:23
Message-ID: 1253290643.385818.9855.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1025395 by tokoe:

Set the WhatsThis of the KActionMenu correctly and use
convenience methods to add and remove actions.


 M  +6 -4      mainwindow.cpp  


--- trunk/KDE/kdepim/kontact/src/mainwindow.cpp #1025394:1025395
@@ -545,13 +545,13 @@
 
     for ( listIt = actionList.begin(); listIt != actionList.end(); ++listIt ) {
       kDebug() << "Plugging New actions" << (*listIt)->objectName();
-      mNewActions->menu()->addAction( (*listIt) );
+      mNewActions->addAction( (*listIt) );
     }
 
     if ( mSyncActionsEnabled ) {
       Q_FOREACH( KAction *listIt, plugin->syncActions() ) {
         kDebug() << "Plugging Sync actions" << listIt->objectName();
-        mSyncActions->menu()->addAction( listIt );
+        mSyncActions->addAction( listIt );
       }
     }
     addPlugin( plugin );
@@ -599,14 +599,14 @@
 
       for ( listIt = actionList.constBegin(); listIt != actionList.constEnd(); ++listIt ) {
         kDebug() << "Unplugging New actions" << (*listIt)->objectName();
-        mNewActions->menu()->removeAction( *listIt );
+        mNewActions->removeAction( *listIt );
       }
 
       if ( mSyncActionsEnabled ) {
         actionList = plugin->syncActions();
         for ( listIt = actionList.constBegin(); listIt != actionList.constEnd(); ++listIt ) {
             kDebug() << "Unplugging Sync actions" << (*listIt)->objectName();
-            mSyncActions->menu()->removeAction( *listIt );
+            mSyncActions->removeAction( *listIt );
         }
       }
       removeChildClient( plugin );
@@ -836,6 +836,7 @@
     if ( newAction ) {
       mNewActions->setIcon( newAction->icon() );
       static_cast<QAction*>( mNewActions )->setText( newAction->text() );
+      mNewActions->setWhatsThis( newAction->whatsThis() );
     } else { // we'll use the action of the first plugin which offers one
       PluginList::Iterator it;
       for ( it = mPlugins.begin(); it != mPlugins.end(); ++it ) {
@@ -845,6 +846,7 @@
         if ( newAction ) {
           static_cast<QAction*>( mNewActions )->setIcon( newAction->icon() );
           mNewActions->setText( newAction->text() );
+          mNewActions->setWhatsThis( newAction->whatsThis() );
           break;
         }
       }
[prev in list] [next in list] [prev in thread] [next in thread] 

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