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

List:       kde-commits
Subject:    [kdev-python/frameworks] duchain: port KUrl -> QUrl: duchain/
From:       Sven Brauch <svenbrauch () googlemail ! com>
Date:       2014-12-25 23:57:27
Message-ID: E1Y4IHX-00057a-Uf () scm ! kde ! org
[Download RAW message or body]

Git commit 6d7b7f049414562b0869fe86736ad0c69d66e8b0 by Sven Brauch.
Committed on 25/12/2014 at 23:55.
Pushed by brauch into branch 'frameworks'.

port KUrl -> QUrl: duchain/

M  +2    -4    duchain/contextbuilder.cpp
M  +1    -1    duchain/correctionhelper.cpp
M  +0    -2    duchain/correctionhelper.h
M  +1    -3    duchain/declarationbuilder.cpp
M  +3    -6    duchain/tests/pyduchaintest.cpp
M  +3    -3    duchain/typebuilder.cpp
M  +0    -2    duchain/usebuilder.cpp

http://commits.kde.org/kdev-python/6d7b7f049414562b0869fe86736ad0c69d66e8b0

diff --git a/duchain/contextbuilder.cpp b/duchain/contextbuilder.cpp
index 167d420..0b42c55 100644
--- a/duchain/contextbuilder.cpp
+++ b/duchain/contextbuilder.cpp
@@ -28,8 +28,6 @@
 #include "declarationbuilder.h"
 #include "helpers.h"
 
-#include <KUrl>
-
 #include <ktexteditor/document.h>
 
 #include <language/duchain/ducontext.h>
@@ -297,8 +295,8 @@ void ContextBuilder::visitClassDefinition( ClassDefinitionAst* \
node )  }
 
 void ContextBuilder::visitCode(CodeAst* node) {
-    KUrl doc_url = KUrl(Helper::getDocumentationFile());
-    IndexedString doc = IndexedString(doc_url.path());
+    auto doc_url = Helper::getDocumentationFile();
+    IndexedString doc = IndexedString(doc_url);
     Q_ASSERT(currentlyParsedDocument().toUrl().isValid());
     if ( currentlyParsedDocument() != doc ) {
         // Search for the python built-in functions file, and dump its contents into \
                the current file.
diff --git a/duchain/correctionhelper.cpp b/duchain/correctionhelper.cpp
index 1d6a23e..6ad17f2 100644
--- a/duchain/correctionhelper.cpp
+++ b/duchain/correctionhelper.cpp
@@ -41,7 +41,7 @@ namespace Python {
 CorrectionHelper::CorrectionHelper(const IndexedString& _url, DeclarationBuilder* \
builder)  {
     m_contextStack.push(0);
-    KUrl absolutePath = Helper::getCorrectionFile(_url.toUrl());
+    auto absolutePath = Helper::getCorrectionFile(_url.toUrl());
 
     if ( !absolutePath.isValid() || absolutePath.isEmpty() || ! \
QFile::exists(absolutePath.path()) ) {  return;
diff --git a/duchain/correctionhelper.h b/duchain/correctionhelper.h
index ed0a633..f72ecf7 100644
--- a/duchain/correctionhelper.h
+++ b/duchain/correctionhelper.h
@@ -27,8 +27,6 @@
 #include <language/duchain/ducontext.h>
 #include <language/duchain/topducontext.h>
 
-#include <KUrl>
-
 using namespace KDevelop;
 
 namespace Python {
diff --git a/duchain/declarationbuilder.cpp b/duchain/declarationbuilder.cpp
index 19b8de6..c20af72 100644
--- a/duchain/declarationbuilder.cpp
+++ b/duchain/declarationbuilder.cpp
@@ -52,8 +52,6 @@
 #include <QDebug>
 #include "duchaindebug.h"
 
-#include <KUrl>
-
 #include <functional>
 
 using namespace KTextEditor;
@@ -781,7 +779,7 @@ Declaration* \
                DeclarationBuilder::createModuleImportDeclaration(QString moduleNam
                                                                ProblemPointer& \
problemEncountered, Ast* rangeNode)  {
     // Search the disk for a python file which contains the requested declaration
-    QPair<KUrl, QStringList> moduleInfo = findModulePath(moduleName, \
currentlyParsedDocument().toUrl()); +    auto moduleInfo = findModulePath(moduleName, \
currentlyParsedDocument().toUrl());  RangeInRevision \
range(RangeInRevision::invalid());  if ( rangeNode ) {
         range = rangeForNode(rangeNode, false);
diff --git a/duchain/tests/pyduchaintest.cpp b/duchain/tests/pyduchaintest.cpp
index b1d88bd..a31d673 100644
--- a/duchain/tests/pyduchaintest.cpp
+++ b/duchain/tests/pyduchaintest.cpp
@@ -46,8 +46,6 @@
 
 #include <KTextEditor/Range>
 
-#include <KUrl>
-
 #include "parsesession.h"
 #include "pythoneditorintegrator.h"
 #include "declarationbuilder.h"
@@ -123,8 +121,7 @@ void PyDUChainTest::init()
     QList<QString> foundfiles = FindPyFiles(assetModuleDir);
 
     QString correctionFileDir = \
QStandardPaths::locate(QStandardPaths::GenericDataLocation, \
                "kdevpythonsupport/correction_files", \
                QStandardPaths::LocateDirectory);
-    KUrl correctionFileUrl = KUrl(correctionFileDir + \
                "testCorrectionFiles/example.py");
-    correctionFileUrl.cleanPath();
+    auto correctionFileUrl = QUrl(QDir::cleanPath(correctionFileDir + \
"/testCorrectionFiles/example.py"));  foundfiles.prepend(correctionFileUrl.path());
 
     for ( int i = 0; i < 2; i++ ) {
@@ -152,8 +149,8 @@ void PyDUChainTest::initShell()
     TestCore* core = new TestCore();
     core->initialize(KDevelop::Core::NoUi);
     
-    KUrl doc_url = KUrl(QStandardPaths::locate(QStandardPaths::GenericDataLocation, \
                "kdevpythonsupport/documentation_files/builtindocumentation.py"));
-    doc_url.cleanPath(KUrl::SimplifyDirSeparators);
+    auto doc_url = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
+                                          \
"kdevpythonsupport/documentation_files/builtindocumentation.py");  
     qCDebug(KDEV_PYTHON_DUCHAIN) << doc_url;
 
diff --git a/duchain/typebuilder.cpp b/duchain/typebuilder.cpp
index 1d78b42..68c6cef 100644
--- a/duchain/typebuilder.cpp
+++ b/duchain/typebuilder.cpp
@@ -23,13 +23,13 @@
 #include <duchain.h>
 
 using namespace KDevelop;
-TypeBuilder::TypeBuilder(ParseSession* session, const KUrl &url)
+TypeBuilder::TypeBuilder(ParseSession* session, const QUrl& url)
   : TypeBuilderBase(session, url)
 {
 }
 
-TypeBuilder::TypeBuilder(PythonEditorIntegrator * editor, const KUrl &url)
-  : TypeBuilderBase(editor,url)
+TypeBuilder::TypeBuilder(PythonEditorIntegrator * editor, const QUrl& url)
+  : TypeBuilderBase(editor, url)
 {
 }
 
diff --git a/duchain/usebuilder.cpp b/duchain/usebuilder.cpp
index 1906e61..636914c 100644
--- a/duchain/usebuilder.cpp
+++ b/duchain/usebuilder.cpp
@@ -21,8 +21,6 @@
 #include <QDebug>
 #include "duchaindebug.h"
 
-#include <KUrl>
-
 #include <language/duchain/declaration.h>
 #include <language/duchain/use.h>
 #include <language/duchain/topducontext.h>


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

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