aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/coreplugin/mainwindow.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2022-11-21 13:24:40 +0100
committerhjk <hjk@qt.io>2022-11-21 12:46:11 +0000
commite567cb313bde692f888ab4968fbd784a42f3a761 (patch)
treee8637a0bbaebf573797397e4d981c8bd3b0236f8 /src/plugins/coreplugin/mainwindow.cpp
parentfbc2da621caba3984ec6431e75da39a5b486ae14 (diff)
Core: Use FilePath for working dir in MainWindow::openFiles()
Change-Id: Ifc8e167a1734115fa7a23f7aefa45fc52e4a70cc Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/coreplugin/mainwindow.cpp')
-rw-r--r--src/plugins/coreplugin/mainwindow.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
index 9c63e36e70..ee9bffe3a9 100644
--- a/src/plugins/coreplugin/mainwindow.cpp
+++ b/src/plugins/coreplugin/mainwindow.cpp
@@ -973,20 +973,20 @@ static IDocumentFactory *findDocumentFactory(const QList<IDocumentFactory*> &fil
*/
IDocument *MainWindow::openFiles(const FilePaths &filePaths,
ICore::OpenFilesFlags flags,
- const QString &workingDirectory)
+ const FilePath &workingDirectory)
{
const QList<IDocumentFactory*> documentFactories = IDocumentFactory::allDocumentFactories();
IDocument *res = nullptr;
- const QString workingDirBase = workingDirectory.isEmpty() ? QDir::currentPath() : workingDirectory;
+ const FilePath workingDirBase =
+ workingDirectory.isEmpty() ? FilePath::currentWorkingPath() : workingDirectory;
for (const FilePath &filePath : filePaths) {
- const FilePath workingDir = filePath.withNewPath(workingDirBase);
FilePath absoluteFilePath;
if (filePath.isAbsolutePath()) {
absoluteFilePath = filePath;
} else {
QTC_CHECK(!filePath.needsDevice());
- absoluteFilePath = FilePath::fromString(workingDirBase).resolvePath(filePath.path());
+ absoluteFilePath = workingDirBase.resolvePath(filePath.path());
}
if (IDocumentFactory *documentFactory = findDocumentFactory(documentFactories, filePath)) {
IDocument *document = documentFactory->open(absoluteFilePath);