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

List:       kde-commits
Subject:    KDE/kdevplatform/plugins/projectmanagerview
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2009-07-11 7:59:27
Message-ID: 1247299167.426566.4793.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 994691 by apaku:

Try to prevent a crash when people have invalid/broken configs (not sure
how the config got messed up though):
- check the result of findItem() for 0-pointer
- adjust the key a bit to make sure we're not trying to read old
  formatted entries.
BUG:199701


 M  +6 -3      projectbuildsetmodel.cpp  


--- trunk/KDE/kdevplatform/plugins/projectmanagerview/projectbuildsetmodel.cpp #994690:994691
@@ -117,7 +117,10 @@
                 break;
         }
     } else if(role == Qt::DecorationRole && idx.column()==0) {
-        return m_items.at( idx.row() ).findItem()->icon();
+        KDevelop::ProjectBaseItem* item = m_items.at( idx.row() ).findItem();
+        if( item ) {
+            return item->icon();
+        }
     }
     return QVariant();
 }
@@ -204,14 +207,14 @@
             paths.append(item.itemPath());
     }
     KConfigGroup base = project->projectConfiguration()->group("Buildset");
-    base.writeEntry("Builditems", paths);
+    base.writeEntry("BuildItems", paths);
     base.sync();
 }
 
 void ProjectBuildSetModel::loadFromProject( KDevelop::IProject* project )
 {
     KConfigGroup base = project->projectConfiguration()->group("Buildset");
-    QVariantList items = base.readEntry("Builditems", QVariantList());
+    QVariantList items = base.readEntry("BuildItems", QVariantList());
     
     foreach(const QVariant& path, items)
     {
[prev in list] [next in list] [prev in thread] [next in thread] 

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