Save Core settings synchronously and report errors.
[quassel.git] / src / core / core.h
index 2015f70..f974645 100644 (file)
@@ -504,6 +504,19 @@ public:
 
     static QVariantList backendInfo();
 
+    /**
+     * Checks if a storage backend is the default storage backend. This
+     * hardcodes this information into the core (not the client).
+     *
+     * \param backend    The backend to check.
+     *
+     * @return True if storage backend is default, false otherwise.
+     */
+    static inline bool isStorageBackendDefault(const Storage *backend)
+    {
+        return (backend->displayName() == "SQLite") ? true : false;
+    }
+
     static QString setup(const QString &adminUser, const QString &adminPassword, const QString &backend, const QVariantMap &setupData);
 
     static inline QTimer &syncTimer() { return instance()->_storageSyncTimer; }
@@ -560,7 +573,7 @@ private:
     void unregisterStorageBackend(Storage *);
     bool selectBackend(const QString &backend);
     bool createUser();
-    void saveBackendSettings(const QString &backend, const QVariantMap &settings);
+    bool saveBackendSettings(const QString &backend, const QVariantMap &settings);
     QVariantMap promptForSettings(const Storage *storage);
 
 private: