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

List:       kde-commits
Subject:    [kdev-ninja] /: Fix crash when compiling something that's not configured
From:       Aleix Pol <aleixpol () kde ! org>
Date:       2012-10-23 14:38:17
Message-ID: 20121023143817.BFC71A6078 () git ! kde ! org
[Download RAW message or body]

Git commit 4ad172aca9ca8577b0c8d529792d5ea9d6e09545 by Aleix Pol.
Committed on 23/10/2012 at 16:36.
Pushed by apol into branch 'master'.

Fix crash when compiling something that's not configured

Don't use isEmpty because KUrl("file:///").upUrl() returns the same
url so this lead to an infinite loop.

M  +1    -1    kdevninjabuilderplugin.cpp

http://commits.kde.org/kdev-ninja/4ad172aca9ca8577b0c8d529792d5ea9d6e09545

diff --git a/kdevninjabuilderplugin.cpp b/kdevninjabuilderplugin.cpp
index e0cda02..03d0a8e 100644
--- a/kdevninjabuilderplugin.cpp
+++ b/kdevninjabuilderplugin.cpp
@@ -78,7 +78,7 @@ static QStringList argumentsForItem(KDevelop::ProjectBaseItem* item)
 KUrl KDevNinjaBuilderPlugin::findNinjaFile(KDevelop::IProject* p)
 {
     KUrl ret = p->buildSystemManager()->buildDirectory(p->projectItem());
-    while(!QFile::exists(ret.toLocalFile(KUrl::AddTrailingSlash)+"build.ninja")) {
+    while(!QFile::exists(ret.toLocalFile(KUrl::AddTrailingSlash)+"build.ninja") && ret!=ret.upUrl()) {
         ret = ret.upUrl();
     }
     
[prev in list] [next in list] [prev in thread] [next in thread] 

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