forked from qt-creator/qt-creator
Utils: add FilePath::completeBaseName
Removing some FilePath::toFileInfo() calls again. Change-Id: I6610beebf2c30754fde525b71f4c4a34ceb5e30b Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -205,7 +205,7 @@ public:
|
||||
PythonProjectNode(const Utils::FilePath &path)
|
||||
: ProjectNode(path)
|
||||
{
|
||||
setDisplayName(path.toFileInfo().completeBaseName());
|
||||
setDisplayName(path.completeBaseName());
|
||||
setAddFileFilter("*.py");
|
||||
}
|
||||
};
|
||||
@@ -215,7 +215,7 @@ PythonProject::PythonProject(const FilePath &fileName)
|
||||
{
|
||||
setId(PythonProjectId);
|
||||
setProjectLanguages(Context(ProjectExplorer::Constants::PYTHON_LANGUAGE_ID));
|
||||
setDisplayName(fileName.toFileInfo().completeBaseName());
|
||||
setDisplayName(fileName.completeBaseName());
|
||||
|
||||
setNeedsBuildConfigurations(false);
|
||||
setBuildSystemCreator([](Target *t) { return new PythonBuildSystem(t); });
|
||||
|
||||
@@ -504,9 +504,8 @@ static QStringList replImportArgs(const FilePath &pythonFile, ReplType type)
|
||||
if (type == ReplType::Unmodified || !isPython)
|
||||
return {};
|
||||
const auto import = type == ReplType::Import
|
||||
? QString("import %1").arg(pythonFile.toFileInfo().completeBaseName())
|
||||
: QString("from %1 import *")
|
||||
.arg(pythonFile.toFileInfo().completeBaseName());
|
||||
? QString("import %1").arg(pythonFile.completeBaseName())
|
||||
: QString("from %1 import *").arg(pythonFile.completeBaseName());
|
||||
return {"-c", QString("%1; print('Running \"%1\"')").arg(import)};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user