ProjectModel::pathToIndex assert when path not found?

Niko Sams niko.sams at gmail.com
Sat Jul 25 08:28:42 UTC 2009


Hi,

When editing in a launch config the project target
ProjectModel::pathToIndex is called to
find the project item. As it's a lineedit invalid paths are possible
and while typing an assertion
in ProjectModel::pathToIndex triggers.

solution would be to simply remove the assertion and return an invalid
QModelIndex if the item
can't be found. (ProjectItemValidator actually checks already for that)

diff --git a/kdevplatform/project/projectmodel.cpp
b/kdevplatform/project/projectmodel.cpp
index 181445e..435fb7f 100644
--- a/kdevplatform/project/projectmodel.cpp
+++ b/kdevplatform/project/projectmodel.cpp
@@ -471,7 +471,6 @@ QModelIndex ProjectModel::pathToIndex(const
QStringList& tofetch_) const
             }
         }
     }
-    Q_ASSERT(!ret.isValid() || data(ret).toString()==tofetch.last());
     return ret;
 }

Ok to commit?

Niko




More information about the KDevelop-devel mailing list