Better error messages

Show better error message in some cirsumstances. This is most notable
when dropping a (database) file onto the structure tree view when no
database file is opened.
This commit is contained in:
Martin Kleusberg
2017-10-20 17:13:34 +02:00
parent 92a868132b
commit 9cff69f534
+6
View File
@@ -685,7 +685,10 @@ bool DBBrowserDB::dump(const QString& filename,
bool DBBrowserDB::executeSQL(QString statement, bool dirtyDB, bool logsql)
{
if (!isOpen())
{
lastErrorMessage = tr("No database file opened");
return false;
}
statement = statement.trimmed();
@@ -715,7 +718,10 @@ bool DBBrowserDB::executeMultiSQL(const QString& statement, bool dirty, bool log
{
// First check if a DB is opened
if(!isOpen())
{
lastErrorMessage = tr("No database file opened");
return false;
}
QString query = statement.trimmed();