aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/sqlitestudiocli/cli.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2015-02-22 14:06:29 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2015-02-22 14:06:29 -0500
commit306d6d3ca9c9ad774d19135681a7f9805f77035f (patch)
treea3e36ac2cc769162c30a1bcc33e126f7a4f4ccea /SQLiteStudio3/sqlitestudiocli/cli.cpp
parent016003905ca0e8e459e3dc33e786beda8ec92f45 (diff)
Imported Upstream version 3.0.3upstream/3.0.3
Diffstat (limited to 'SQLiteStudio3/sqlitestudiocli/cli.cpp')
-rw-r--r--SQLiteStudio3/sqlitestudiocli/cli.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/SQLiteStudio3/sqlitestudiocli/cli.cpp b/SQLiteStudio3/sqlitestudiocli/cli.cpp
index a663e84..0f527ac 100644
--- a/SQLiteStudio3/sqlitestudiocli/cli.cpp
+++ b/SQLiteStudio3/sqlitestudiocli/cli.cpp
@@ -222,13 +222,20 @@ void CLI::applyHistoryLimit()
void CLI::openDbFile(const QString& path)
{
+ Db* db = DBLIST->getByPath(path);
+ if (db)
+ {
+ println(tr("Database passed in command line parameters (%1) was already on the list under name: %2").arg(path, db->getName()));
+ return;
+ }
+
QString name = DBLIST->quickAddDb(path, QHash<QString,QVariant>());
if (name.isNull())
{
println(tr("Could not add database %1 to list.").arg(path));
return;
}
- Db* db = DBLIST->getByName(name);
+ db = DBLIST->getByName(name);
setCurrentDb(db);
}