aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/services
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2015-04-04 14:41:10 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2015-04-04 14:41:10 -0400
commitb5f93b05578293d1d233b4920a28a5c2fd826f94 (patch)
tree82332679f647e9c76e331206786d07a58dcfa9b8 /SQLiteStudio3/coreSQLiteStudio/services
parentaf8a7a3e3dccf9c9ad257e3952173d180c8a7421 (diff)
parenta5b034d4a9c44f9bc1e83b01de82530f8fc63013 (diff)
Merge tag 'upstream/3.0.4'
Upstream version 3.0.4 # gpg: Signature made Sat 04 Apr 2015 02:41:09 PM EDT using RSA key ID EBE9BD91 # gpg: Good signature from "Unit 193 <unit193@gmail.com>" # gpg: aka "Unit 193 <unit193@ninthfloor.org>" # gpg: aka "Unit 193 <unit193@ubuntu.com>" # gpg: aka "Unit 193 <unit193@ninthfloor.com>"
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/services')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/services/impl/dbmanagerimpl.cpp17
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/services/impl/dbmanagerimpl.h2
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/services/importmanager.h2
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/services/notifymanager.cpp3
4 files changed, 20 insertions, 4 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/services/impl/dbmanagerimpl.cpp b/SQLiteStudio3/coreSQLiteStudio/services/impl/dbmanagerimpl.cpp
index 70aa568..e96e181 100644
--- a/SQLiteStudio3/coreSQLiteStudio/services/impl/dbmanagerimpl.cpp
+++ b/SQLiteStudio3/coreSQLiteStudio/services/impl/dbmanagerimpl.cpp
@@ -107,9 +107,14 @@ bool DbManagerImpl::updateDb(Db* db, const QString &name, const QString &path, c
result = CFG->removeDb(name);
InvalidDb* invalidDb = dynamic_cast<InvalidDb*>(db);
+ bool wasReloaded = false;
Db* reloadedDb = db;
if (pathDifferent && invalidDb)
- reloadedDb = tryToLoadDb(invalidDb);
+ {
+ reloadedDb = tryToLoadDb(invalidDb, false);
+ if (reloadedDb) // we need to know that, so we can emit dbLoaded() signal later, out of the listLock
+ wasReloaded = true;
+ }
if (reloadedDb) // reloading was not necessary (was not invalid) or it was successful
db = reloadedDb;
@@ -119,6 +124,10 @@ bool DbManagerImpl::updateDb(Db* db, const QString &name, const QString &path, c
listLock.unlock();
+ // If we did reload the db, we need to emit proper signal, because it was suppressed in tryToLoadDb(), because of the listLock
+ if (wasReloaded)
+ emit dbLoaded(db);
+
if (result && reloadedDb)
emit dbUpdated(oldName, db);
else if (reloadedDb) // database reloaded correctly, but update failed
@@ -355,7 +364,7 @@ QList<Db*> DbManagerImpl::getInvalidDatabases() const
});
}
-Db* DbManagerImpl::tryToLoadDb(InvalidDb* invalidDb)
+Db* DbManagerImpl::tryToLoadDb(InvalidDb* invalidDb, bool emitNotifySignal)
{
QUrl url = QUrl::fromUserInput(invalidDb->getPath());
if (url.isLocalFile() && !QFile::exists(invalidDb->getPath()))
@@ -373,7 +382,9 @@ Db* DbManagerImpl::tryToLoadDb(InvalidDb* invalidDb)
if (CFG->getDbGroup(db->getName())->open)
db->open();
- emit dbLoaded(db);
+ if (emitNotifySignal)
+ emit dbLoaded(db);
+
return db;
}
diff --git a/SQLiteStudio3/coreSQLiteStudio/services/impl/dbmanagerimpl.h b/SQLiteStudio3/coreSQLiteStudio/services/impl/dbmanagerimpl.h
index 8e28080..5797ac6 100644
--- a/SQLiteStudio3/coreSQLiteStudio/services/impl/dbmanagerimpl.h
+++ b/SQLiteStudio3/coreSQLiteStudio/services/impl/dbmanagerimpl.h
@@ -94,7 +94,7 @@ class API_EXPORT DbManagerImpl : public DbManager
*/
QList<Db*> getInvalidDatabases() const;
- Db* tryToLoadDb(InvalidDb* invalidDb);
+ Db* tryToLoadDb(InvalidDb* invalidDb, bool emitNotifySignal = true);
/**
* @brief Creates database object.
diff --git a/SQLiteStudio3/coreSQLiteStudio/services/importmanager.h b/SQLiteStudio3/coreSQLiteStudio/services/importmanager.h
index 6f13826..2401e78 100644
--- a/SQLiteStudio3/coreSQLiteStudio/services/importmanager.h
+++ b/SQLiteStudio3/coreSQLiteStudio/services/importmanager.h
@@ -36,6 +36,8 @@ class API_EXPORT ImportManager : public PluginServiceBase
* (for example from a clipboard).
*/
QString inputFileName;
+
+ bool ignoreErrors = false;
};
enum StandardConfigFlag
diff --git a/SQLiteStudio3/coreSQLiteStudio/services/notifymanager.cpp b/SQLiteStudio3/coreSQLiteStudio/services/notifymanager.cpp
index 0980399..f8b7f25 100644
--- a/SQLiteStudio3/coreSQLiteStudio/services/notifymanager.cpp
+++ b/SQLiteStudio3/coreSQLiteStudio/services/notifymanager.cpp
@@ -1,4 +1,5 @@
#include "services/notifymanager.h"
+#include <QDebug>
DEFINE_SINGLETON(NotifyManager)
@@ -71,11 +72,13 @@ QList<QString> NotifyManager::getRecentErrors() const
void notifyError(const QString &msg)
{
+ qDebug() << "Error from notify manager:" << msg;
NotifyManager::getInstance()->error(msg);
}
void notifyWarn(const QString &msg)
{
+ qDebug() << "Warning from notify manager:" << msg;
NotifyManager::getInstance()->warn(msg);
}