File: pe.patch

package info (click to toggle)
kdevelop 4%3A4.3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 18,844 kB
  • sloc: cpp: 91,758; python: 1,095; lex: 422; ruby: 120; sh: 114; xml: 42; makefile: 38
file content (84 lines) | stat: -rw-r--r-- 4,070 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
diff --git a/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp b/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp
index 6b22574..a0ebf6f 100644
--- a/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp
+++ b/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp
@@ -1400,11 +1400,7 @@ int CMakeProjectVisitor::visit(const FileAst *file)
             QFile f(filename.toLocalFile());
             if (!f.open(QIODevice::ReadOnly | QIODevice::Text))
                 return 1;
-            QString output;
-            while (!f.atEnd()) {
-                QByteArray line = f.readLine();
-                output += line;
-            }
+            QString output=f.readAll();
             m_vars->insert(file->variable(), QStringList(output));
             kDebug(9042) << "FileAst: read ";
         }
@@ -1416,30 +1412,13 @@ int CMakeProjectVisitor::visit(const FileAst *file)
             {
                 if (expr.isEmpty())
                     continue;
-                QString pathPrefix;
-                if (QDir::isRelativePath(expr))
+                QString pathPrefix=file->path();
+                if (QDir::isRelativePath(expr) && pathPrefix.isEmpty())
                     pathPrefix = m_vars->value("CMAKE_CURRENT_SOURCE_DIR").first();
-                // pathPrefix must start from '/' if not empty when calling traverseRecursiveGlob()
-                if (expr[0] == '/')
-                {
-                    //moving slash to pathPrefix (it should be empty before)
-                    expr = expr.mid(1);
-                    pathPrefix += '/';
-                }
-                else
-                {
-                    if (!pathPrefix.isEmpty())
-                        pathPrefix += '/';
-                }
-                if (file->type() == FileAst::Glob)
-                {
-                    matches.append(traverseGlob(pathPrefix, expr));
-                }
-                else
-                {
-                    matches.append(traverseGlob(pathPrefix, expr, true, file->isFollowingSymlinks()));
-                }
+                
+                matches.append(traverseGlob(pathPrefix, expr, file->type() == FileAst::GlobRecurse, file->isFollowingSymlinks()));
             }
+            
             if (!file->path().isEmpty())
             {
                 // RELATIVE was specified, so we need to make all paths relative to file->path()
@@ -1451,15 +1430,11 @@ int CMakeProjectVisitor::visit(const FileAst *file)
                 }
             }
             m_vars->insert(file->variable(), matches);
-            QString kind = file->type() == FileAst::Glob ? "file glob" : "file glob_recurse";
-            QString followSymlinksMsg;
-            QString relativeMsg;
-            if (file->type() == FileAst::GlobRecurse && file->isFollowingSymlinks())
-                followSymlinksMsg = " FOLLOW_SYMLINKS: true";
-            if (!file->path().isEmpty())
-                relativeMsg = " RELATIVE " + file->path();
-            kDebug(9042) << kind << relativeMsg << followSymlinksMsg << " " << file->globbingExpressions()
-                << ": " << matches;
+            
+            kDebug(9042) << "glob. recurse:" << (file->type() == FileAst::GlobRecurse)
+                         << "RELATIVE: " << file->path()
+                         << "FOLLOW_SYMLINKS: " << file->isFollowingSymlinks()
+                         << ", " << file->globbingExpressions() << ": " << matches;
         }
             break;
         case FileAst::Remove:
@@ -2298,8 +2273,7 @@ QStringList CMakeProjectVisitor::resolveDependencies(const QStringList & files)
     return ret;
 }
 
-QStringList CMakeProjectVisitor::traverseGlob(const QString& startPath,
-    const QString& expression, bool recursive, bool followSymlinks)
+QStringList CMakeProjectVisitor::traverseGlob(const QString& startPath, const QString& expression, bool recursive, bool followSymlinks)
 {
     kDebug(9042) << "Starting from (" << startPath << ", " << expression << ", " << followSymlinks << ")";
     QString expr = expression;