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

List:       kde-commits
Subject:    KDE/kdeutils/kregexpeditor/KMultiFormListBox
From:       Rolf Eike Beer <kde () opensource ! sf-tec ! de>
Date:       2007-04-23 7:48:52
Message-ID: 1177314532.576287.28426.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 657098 by dakon:

Fix string compares

Don't use strcmp() to compare an object name to something. This is C++, 
therefore we have operator overloading. Also avoid using the deprecated 
members.


 M  +6 -6      kmultiformlistbox-multivisible.cpp  


--- trunk/KDE/kdeutils/kregexpeditor/KMultiFormListBox/kmultiformlistbox-multivisible.cpp #657097:657098
@@ -62,7 +62,7 @@
 {
   KMultiFormListBoxEntryList res;
   for (QWidget *child = elms->first(); child; child=elms->next()) {
-    if (strcmp(child->name(),"seperator") != 0) {
+    if ( child->objectName() != "seperator" ) {
       res.append((KMultiFormListBoxEntry *) child);
     }
   }
@@ -97,7 +97,7 @@
   // calculate the required size.
   for (QWidget *child = elms->first(); child; child=elms->next()) {
     maxWidth = qMax(maxWidth, child->sizeHint().width());
-    if (strcmp(child->name(), "seperator") != 0) {
+    if ( child->objectName() != "seperator" ) {
       totalHeight += child->sizeHint().height();
       count++;
     }
@@ -117,7 +117,7 @@
   int yPos = 0;
   for (QWidget *child2 = elms->first(); child2; child2=elms->next()) {
     int h;
-    if ( strcmp(child2->name(),"seperator") != 0) {
+    if ( child2->objectName() != "seperator" ) {
       h = child2->sizeHint().height();
       h += extra;
     }
@@ -158,7 +158,7 @@
 {
   int index = elms->find(elm);
   QWidget *next = elms->at(index+1);
-  if (strcmp(next->name(),"seperator") != 0) {
+  if ( next->objectName() != "seperator" ) {
     elms->removeRef(next);
     removeChild(next);
   }
@@ -198,7 +198,7 @@
 
   QWidget *sep = factory->separator(viewport());
   if (sep != 0) {
-    sep->setName("seperator");
+    sep->setObjectName("seperator");
     sep->show();
     addChild(sep,0,0); // updateClipperContent will place the child correctly.
     elms->insert(index+1, sep);
@@ -222,7 +222,7 @@
 
   // Insert the elements into the menu item.
   for (QWidget *child = elms->first(); child; child=elms->next()) {
-    if ( strcmp(child->name(), "seperator") != 0) {
+    if ( child->objectName() != "seperator" ) {
       QString txt = ((KMultiFormListBoxEntry *) child)->idxString();
       menu->insertItem(txt);
     }
[prev in list] [next in list] [prev in thread] [next in thread] 

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