MCPcopy Create free account
hub / github.com/KDE/kdevelop / read

Method read

plugins/qmakemanager/qmakefile.cpp:84–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84bool QMakeFile::read()
85{
86 Q_ASSERT(!m_projectFile.isEmpty());
87 QFileInfo fi(m_projectFile);
88 ifDebug(qCDebug(KDEV_QMAKE) << "Is" << m_projectFile << "a dir?" << fi.isDir();) if (fi.isDir())
89 {
90 QDir dir(m_projectFile);
91 QStringList l = dir.entryList(QStringList() << QStringLiteral("*.pro"));
92
93 QString projectfile;
94
95 if (!l.count() || (l.count() && l.indexOf(fi.baseName() + QLatin1String(".pro")) != -1)) {
96 projectfile = fi.baseName() + QLatin1String(".pro");
97 } else {
98 projectfile = l.first();
99 }
100 m_projectFile += QLatin1Char('/') + projectfile;
101 }
102 QMake::Driver d;
103 d.readFile(m_projectFile);
104
105 if (!d.parse(&m_ast)) {
106 qCWarning(KDEV_QMAKE) << "Couldn't parse project:" << m_projectFile;
107 delete m_ast;
108 m_ast = nullptr;
109 m_projectFile = QString();
110 return false;
111 } else {
112 ifDebug(qCDebug(KDEV_QMAKE) << "found ast:" << m_ast->statements.count();) QMakeFileVisitor visitor(this, this);
113 /// TODO: cleanup, re-use m_variableValues directly in the visitor
114 visitor.setVariables(m_variableValues);
115 m_variableValues = visitor.visitFile(m_ast);
116 ifDebug(qCDebug(KDEV_QMAKE) << "Variables found:" << m_variableValues;)
117 }
118 return true;
119}
120
121QMakeFile::~QMakeFile()
122{

Callers 15

sendMessageMethod · 0.45
projectRootItemMethod · 0.45
buildFolderItemMethod · 0.45
slotDirtyMethod · 0.45
visitFunctionCallMethod · 0.45
setDefaultMKSpecFunction · 0.45
varResolutionMethod · 0.45
libTargetMethod · 0.45
definesMethod · 0.45
replaceFunctionsMethod · 0.45
qtIncludeDirsMethod · 0.45
testIncludeMethod · 0.45

Calls 11

QStringListClass · 0.85
baseNameMethod · 0.80
readFileMethod · 0.80
setVariablesMethod · 0.80
visitFileMethod · 0.80
QStringClass · 0.50
isEmptyMethod · 0.45
countMethod · 0.45
indexOfMethod · 0.45
firstMethod · 0.45
parseMethod · 0.45

Tested by 12

setDefaultMKSpecFunction · 0.36
varResolutionMethod · 0.36
libTargetMethod · 0.36
definesMethod · 0.36
replaceFunctionsMethod · 0.36
qtIncludeDirsMethod · 0.36
testIncludeMethod · 0.36
globbingMethod · 0.36
benchGlobbingMethod · 0.36
isAttachForbiddenFunction · 0.36
validatingExecJobFunction · 0.36