Skip to content

Commit dac47f9

Browse files
sandman7920lucydodo
authored andcommitted
If we have file passed from the cli, skip autoLoadLastDBFileAtStartup
1 parent 2b4dea7 commit dac47f9

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/Application.cpp

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

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

src/MainWindow.cpp

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

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

0 commit comments

Comments
 (0)