Skip to content
Snippets Groups Projects
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: default avatarSébastien Blin <sebastien.blin@savoirfairelinux.com>
parent 1facaff2
Branches
Tags
No related merge requests found
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "api/newaccountmodel.h" #include "api/newaccountmodel.h"
#include "database.h" #include "database.h"
#include "callbackshandler.h" #include "callbackshandler.h"
#include "dbus/instancemanager.h"
namespace lrc namespace lrc
{ {
...@@ -41,8 +42,11 @@ public: ...@@ -41,8 +42,11 @@ public:
}; };
Lrc::Lrc() 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() Lrc::~Lrc()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment