forked from qt-creator/qt-creator
ProjectExplorer: make currentProject static
This saves one function call compared to the instance()->currentProject() pattern and is typically less to type on the caller site. Change-Id: I65568f30205fc90e2aaca7e8e7f0192241df8c85 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -770,18 +770,16 @@ QStringList VcsBaseSubmitEditor::currentProjectFiles(bool nativeSeparators, QStr
|
||||
if (name)
|
||||
name->clear();
|
||||
|
||||
if (ProjectExplorer::ProjectExplorerPlugin *pe = ProjectExplorer::ProjectExplorerPlugin::instance()) {
|
||||
if (const ProjectExplorer::Project *currentProject = pe->currentProject()) {
|
||||
QStringList files = currentProject->files(ProjectExplorer::Project::ExcludeGeneratedFiles);
|
||||
if (name)
|
||||
*name = currentProject->displayName();
|
||||
if (nativeSeparators && !files.empty()) {
|
||||
const QStringList::iterator end = files.end();
|
||||
for (QStringList::iterator it = files.begin(); it != end; ++it)
|
||||
*it = QDir::toNativeSeparators(*it);
|
||||
}
|
||||
return files;
|
||||
if (const ProjectExplorer::Project *currentProject = ProjectExplorer::ProjectExplorerPlugin::currentProject()) {
|
||||
QStringList files = currentProject->files(ProjectExplorer::Project::ExcludeGeneratedFiles);
|
||||
if (name)
|
||||
*name = currentProject->displayName();
|
||||
if (nativeSeparators && !files.empty()) {
|
||||
const QStringList::iterator end = files.end();
|
||||
for (QStringList::iterator it = files.begin(); it != end; ++it)
|
||||
*it = QDir::toNativeSeparators(*it);
|
||||
}
|
||||
return files;
|
||||
}
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user