Changeset View
Changeset View
Standalone View
Standalone View
plugins/cmake/settings/cmakecachemodel.cpp
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 47 | { | |||
---|---|---|---|---|---|
66 | int currentIdx=0; | 66 | int currentIdx=0; | ||
67 | QStringList currentComment; | 67 | QStringList currentComment; | ||
68 | QTextStream in(&file); | 68 | QTextStream in(&file); | ||
69 | QHash<QString, int> variablePos; | 69 | QHash<QString, int> variablePos; | ||
70 | while (!in.atEnd()) | 70 | while (!in.atEnd()) | ||
71 | { | 71 | { | ||
72 | QString line = in.readLine().trimmed(); | 72 | QString line = in.readLine().trimmed(); | ||
73 | if(line.startsWith(QLatin1String("//"))) | 73 | if(line.startsWith(QLatin1String("//"))) | ||
74 | currentComment += line.mid(2); | 74 | { | ||
75 | else if(!line.isEmpty() && !line.startsWith(QLatin1Char('#'))) //it is a variable | 75 | line.remove(0, 2); | ||
76 | currentComment += line; | ||||
mwolff: would be easier to just write
currentComment += line.midRef(2); | |||||
Since "line" itself goes away after this loop there isn't anything to ref anymore, and I honestly don't know if this will work then. currentComment is a QStringList, no QString. dakon: Since "line" itself goes away after this loop there isn't anything to ref anymore, and I… | |||||
77 | } else if(!line.isEmpty() && !line.startsWith(QLatin1Char('#'))) //it is a variable | ||||
76 | { | 78 | { | ||
77 | CacheLine c; | 79 | CacheLine c; | ||
78 | c.readLine(line); | 80 | c.readLine(line); | ||
79 | 81 | | |||
80 | if(c.isCorrect()) | 82 | if(c.isCorrect()) | ||
81 | { | 83 | { | ||
82 | QString name=c.name(), flag=c.flag(); | 84 | QString name=c.name(), flag=c.flag(); | ||
83 | 85 | | |||
▲ Show 20 Lines • Show All 143 Lines • Show Last 20 Lines |
would be easier to just write