Default to sqlite backend in core creation wizard
[quassel.git] / src / qtui / coreconfigwizard.cpp
index 9dfbc8c..6873528 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2015 by the Quassel Project                        *
+ *   Copyright (C) 2005-2016 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -201,10 +201,16 @@ StorageSelectionPage::StorageSelectionPage(const QHash<QString, QVariant> &backe
 
     registerField("storage.backend", ui.backendList);
 
+    int defaultIndex = 0;
     foreach(QString key, _backends.keys()) {
         ui.backendList->addItem(_backends[key].toMap()["DisplayName"].toString(), key);
+        if (_backends[key].toMap()["IsDefault"].toBool()) {
+            defaultIndex = ui.backendList->count() - 1;
+        }
     }
 
+    ui.backendList->setCurrentIndex(defaultIndex);
+
     on_backendList_currentIndexChanged();
 }