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

List:       kde-commits
Subject:    [kdev-python/frameworks] duchain: fix completion not picking up the current file's directory
From:       Sven Brauch <svenbrauch () googlemail ! com>
Date:       2014-12-25 22:39:05
Message-ID: E1Y4H3h-0001Zd-3O () scm ! kde ! org
[Download RAW message or body]

Git commit b9a7d13e145db7876a2ca568143f751209e48666 by Sven Brauch.
Committed on 25/12/2014 at 22:19.
Pushed by brauch into branch 'frameworks'.

fix completion not picking up the current file's directory

M  +3    -3    duchain/helpers.cpp

http://commits.kde.org/kdev-python/b9a7d13e145db7876a2ca568143f751209e48666

diff --git a/duchain/helpers.cpp b/duchain/helpers.cpp
index 533775c..95fc6a1 100644
--- a/duchain/helpers.cpp
+++ b/duchain/helpers.cpp
@@ -445,10 +445,10 @@ QList<QUrl> Helper::getSearchPaths(QUrl workingOnDocument)
     
     searchPaths.append(cachedSearchPaths);
     
-    auto currentDir = QDir(workingOnDocument.path());
-    if ( ! currentDir.path().isEmpty() ) {
+    auto dir = workingOnDocument.adjusted(QUrl::RemoveFilename);
+    if ( ! dir.isEmpty() ) {
         // search in the current packages
-        searchPaths.append(QUrl::fromLocalFile(currentDir.path()));
+        searchPaths.append(dir);
     }
     
     return searchPaths;

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

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