Skip to content

Commit

Permalink
Merge pull request #4450 from TrenchBroom/4348-2
Browse files Browse the repository at this point in the history
4348: Simplify and fix behavior
  • Loading branch information
kduske committed Jan 21, 2024
2 parents 68554d0 + a58c1e5 commit 751acb3
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions common/src/TrenchBroomApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,21 +599,16 @@ bool TrenchBroomApp::event(QEvent* event)

void TrenchBroomApp::openFilesOrWelcomeFrame(const QStringList& fileNames)
{
const auto filesToOpen =
useSDI() && !fileNames.empty() ? QStringList{fileNames.front()} : fileNames;

auto anyDocumentOpened = false;
if (useSDI())
{
if (fileNames.length() > 0)
{
const auto path = IO::pathFromQString(fileNames.at(0));
anyDocumentOpened = !path.empty() && openDocument(path);
}
}
else
for (const auto& fileName : filesToOpen)
{
for (const auto& fileName : fileNames)
const auto path = IO::pathFromQString(fileName);
if (!path.empty() && openDocument(path))
{
const auto path = IO::pathFromQString(fileName);
anyDocumentOpened = anyDocumentOpened || (!path.empty() && openDocument(path));
anyDocumentOpened = true;
}
}

Expand Down

0 comments on commit 751acb3

Please sign in to comment.