Commit 8dc52eae authored by Anthony Léonard's avatar Anthony Léonard Committed by Sébastien Blin
Browse files

ensure daemon is running before Lrc construction



On non-DBus platforms, where the daemon is not running in its own
process, LRC is responsible for its initalization. This patch ensures
it is done in Lrc class constructor before any attempt to grab data
from it (like accounts).

It then makes it possible to use the new models in Win32 and macOS
clients.

Change-Id: Ib587bf86e17ae7f19766ac5bb5d8c91aa05d335c
Reviewed-by: Sébastien Blin's avatarSébastien Blin <sebastien.blin@savoirfairelinux.com>
parent 1facaff2
......@@ -22,6 +22,7 @@
#include "api/newaccountmodel.h"
#include "database.h"
#include "callbackshandler.h"
#include "dbus/instancemanager.h"
namespace lrc
{
......@@ -41,8 +42,11 @@ public:
};
Lrc::Lrc()
: lrcPipmpl_(std::make_unique<LrcPimpl>(*this))
{
// Ensure Daemon is running/loaded (especially on non-DBus platforms)
// before instantiating LRC and its members
InstanceManager::instance();
lrcPipmpl_ = std::make_unique<LrcPimpl>(*this);
}
Lrc::~Lrc()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment