Unverified Commit 1e3918e0 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

lrc: add helper to get active calls

Change-Id: I50b8a0c748ab48038b5f5ac6709de8a02225f53a
parent ccc1df52
......@@ -20,6 +20,8 @@
// Std
#include <memory>
#include <vector>
#include <string>
// Lrc
#include "typedefs.h"
......@@ -76,7 +78,12 @@ public:
*/
static bool dbusIsValid();
private:
/**
* Helper: get call list from daemon
*/
static std::vector<std::string> activeCalls();
private:
std::unique_ptr<LrcPimpl> lrcPimpl_;
};
......
......@@ -25,15 +25,15 @@
#endif // !_MSC_VER
// Models and database
#include "api/newaccountmodel.h"
#include "api/avmodel.h"
#include "api/datatransfermodel.h"
#include "api/behaviorcontroller.h"
#include "database.h"
#include "api/datatransfermodel.h"
#include "api/newaccountmodel.h"
#include "callbackshandler.h"
#include "database.h"
#include "dbus/callmanager.h"
#include "dbus/configurationmanager.h"
#include "dbus/instancemanager.h"
#include "dbus/configurationmanager.h"
namespace lrc
{
......@@ -123,6 +123,18 @@ Lrc::dbusIsValid()
#endif
}
std::vector<std::string>
Lrc::activeCalls()
{
QStringList callLists = CallManager::instance().getCallList();
std::vector<std::string> result;
result.reserve(callLists.size());
for (const auto &call : callLists) {
result.emplace_back(call.toStdString());
}
return result;
}
LrcPimpl::LrcPimpl(Lrc& linked)
: linked(linked)
, behaviorController(std::make_unique<BehaviorController>())
......@@ -134,4 +146,4 @@ LrcPimpl::LrcPimpl(Lrc& linked)
{
}
} // namespace lrc
} // namespace lrc
\ No newline at end of file
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