Default to sqlite backend in core creation wizard
authorBen Rosser <rosser.bjr@gmail.com>
Mon, 19 Sep 2016 04:41:21 +0000 (00:41 -0400)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 13 Oct 2016 20:02:16 +0000 (22:02 +0200)
commit3867471c05de4c463373c6c4d1c414871c14cdc8
tree5d5311df10facb66e50669338e55cb5b0488b6ef
parentef3e54f6daebeeaa8d6e105a98711cb1760a637d
Default to sqlite backend in core creation wizard

This introduces the notion of a "default" storage backend into
the core by adding a function (Core::isStorageBackendDefault),
which returns true if a given Storage object is 'default' and
false if not. This information is then added to the BackendInfo
dictionary passed through the protocol to the user interface,
which ensures the backend that is default will always be the
one displayed by default.

This change was prompted by conversation in IRC with [Saint]
and @digitalcircuit about making core creation slightly more
intuitive.

This allows us to, potentially, change the default storage
backend shown at core creation time should at some point
another backend be introduced, without having to modify
the interface.

It is a little weird having "isDefault" be an attribute of
*each* storage backend, but this was the simplest way to do
it without modifying the handshake. (Whichever is the last
storage backend to claim to be the default will win).

(As an aside, should this be merged and should #170 be merged
I'll implement something similar for authenticators in a
separate PR).

Resolves GH-250.
src/core/core.cpp
src/core/core.h
src/qtui/coreconfigwizard.cpp