From 7d2931baa2521d0b03b3385bddd3e4e413c75123 Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Fri, 5 Jan 2018 16:27:23 +0100 Subject: [PATCH] Add a --read-only command line option Add a new command line option -R / --read-only for opening a database in read-only mode. See issue #1265. --- src/Application.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Application.cpp b/src/Application.cpp index 5b07774e..1c590063 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -75,6 +75,7 @@ Application::Application(int& argc, char** argv) : QString fileToOpen; QString tableToBrowse; QStringList sqlToExecute; + bool readOnly = false; m_dontShowMainWindow = false; for(int i=1;ifileOpen(fileToOpen)) + if(m_mainWindow->fileOpen(fileToOpen, false, readOnly)) { // If database could be opened run the SQL scripts for(const QString& f : sqlToExecute)