Project: Do not save filenames in derived classes

Change-Id: I23960c61676e96c429b59ad8f8247e1b88606b1a
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2016-01-08 12:12:27 +01:00
parent 21d204ad5c
commit 219b2d9c16
12 changed files with 34 additions and 49 deletions

View File

@@ -72,18 +72,17 @@ using namespace AutotoolsProjectManager::Internal;
using namespace ProjectExplorer;
AutotoolsProject::AutotoolsProject(AutotoolsManager *manager, const QString &fileName) :
m_fileName(fileName),
m_fileWatcher(new Utils::FileSystemWatcher(this)),
m_makefileParserThread(0)
{
setId(Constants::AUTOTOOLS_PROJECT_ID);
setProjectManager(manager);
setDocument(new AutotoolsProjectFile(m_fileName));
setDocument(new AutotoolsProjectFile(fileName));
m_rootNode = new AutotoolsProjectNode(projectFilePath());
setProjectContext(Core::Context(Constants::PROJECT_CONTEXT));
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
const QFileInfo fileInfo(m_fileName);
const QFileInfo fileInfo = projectFilePath().toFileInfo();
m_projectName = fileInfo.absoluteDir().dirName();
m_rootNode->setDisplayName(fileInfo.absoluteDir().dirName());
}
@@ -161,7 +160,7 @@ void AutotoolsProject::loadProjectTree()
}
// Parse the makefile asynchronously in a thread
m_makefileParserThread = new MakefileParserThread(m_fileName);
m_makefileParserThread = new MakefileParserThread(projectFilePath().toString());
connect(m_makefileParserThread, &MakefileParserThread::started,
this, &AutotoolsProject::makefileParsingStarted);
@@ -207,7 +206,7 @@ void AutotoolsProject::makefileParsingFinished()
m_watchedFiles.clear();
// Apply sources to m_files, which are returned at AutotoolsProject::files()
const QFileInfo fileInfo(m_fileName);
const QFileInfo fileInfo = projectFilePath().toFileInfo();
const QDir dir = fileInfo.absoluteDir();
QStringList files = m_makefileParserThread->sources();
foreach (const QString& file, files)

View File

@@ -135,8 +135,6 @@ private:
void updateCppCodeModel();
private:
/// File name of the makefile that has been passed in the constructor
QString m_fileName;
QString m_projectName;
/// Return value for AutotoolsProject::files()