Skip to content

Commit b19bbb9

Browse files
committed
If we have file passed from the cli, skip autoLoadLastDBFileAtStartup
1 parent 31d2088 commit b19bbb9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Application.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ Application::Application(int& argc, char** argv) :
284284
QScreen *screen = primaryScreen();
285285
setStyle(new DB4SProxyStyle(18, screen != nullptr ? screen->logicalDotsPerInch() : 96, style()));
286286

287+
// Skip db/project autoLoadLastDBFileAtStartup if we have file passed from the cli
288+
Settings::setValue("tmp", "fileWillBeOpenedFromCLI", !fileToOpen.isEmpty(), false);
289+
287290
// Show main window
288291
m_mainWindow = new MainWindow();
289292
m_mainWindow->show();

src/MainWindow.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ MainWindow::MainWindow(QWidget* parent)
9696
populateStructure(old_tables);
9797
};
9898

99-
if (Settings::getValue("General", "autoLoadLastDBFileAtStartup").toBool()) {
99+
if (!Settings::getValue("tmp", "fileWillBeOpenedFromCLI").toBool() &&
100+
Settings::getValue("General", "autoLoadLastDBFileAtStartup").toBool()) {
100101
recentFileActs[0]->trigger();
101102
update_structure();
102103
if (ui->mainTab->currentWidget() == ui->browser)

0 commit comments

Comments
 (0)