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

List:       kde-commits
Subject:    branches/work/kde4/kdelibs/kutils
From:       Wilco Greven <greven () kde ! org>
Date:       2005-05-15 9:28:23
Message-ID: 1116149303.178587.7416.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 414075 by wgreven:

qt_cast -> qobject_cast
QObjectList* -> QObjectList


 M  +4 -9      branches/work/kde4/kdelibs/kutils/kpluginselector.cpp  


--- branches/work/kde4/kdelibs/kutils/kpluginselector.cpp #414074:414075
@@ -696,8 +696,7 @@
     // tabwidget - defaults() will be called for all of them)
 
     QWidget * pluginconfig = d->widgetstack->visibleWidget();
-    KCModuleProxy * kcm = ( KCModuleProxy* )pluginconfig->qt_cast(
-            "KCModuleProxy" );
+    KCModuleProxy * kcm = qobject_cast<KCModuleProxy *>( pluginconfig );
     if( kcm )
     {
         kdDebug( 702 ) << "call KCModule::defaults() for the plugins KCM"
@@ -708,16 +707,12 @@
 
     // if we get here the visible Widget must be a tabwidget holding more than
     // one KCM
-    QObjectList * kcms = pluginconfig->queryList( "KCModuleProxy",
+    QObjectList kcms = pluginconfig->queryList( "KCModuleProxy",
             0, false, false );
-    QObjectListIt it( *kcms );
-    QObject * obj;
-    while( ( obj = it.current() ) != 0 )
+    foreach ( QObject * obj,  kcms )
     {
-        ++it;
-        ( ( KCModule* )obj )->defaults();
+        static_cast<KCModule*>( obj )->defaults();
     }
-    delete kcms;
     // FIXME: update changed state
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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