Commit 2069e990 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Main/MainWindow): add a hidden button to refresh registers

parent dd09e6d3
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "CoreManager.hpp" #include "CoreManager.hpp"
#include <QCoreApplication> #include <QCoreApplication>
#include <QDebug>
#include <QDir> #include <QDir>
#include <QTimer> #include <QTimer>
...@@ -77,10 +78,19 @@ void CoreManager::init (QObject *parent, const QString &config_path) { ...@@ -77,10 +78,19 @@ void CoreManager::init (QObject *parent, const QString &config_path) {
); );
} }
// -----------------------------------------------------------------------------
VcardModel *CoreManager::createDetachedVcardModel () { VcardModel *CoreManager::createDetachedVcardModel () {
return new VcardModel(linphone::Factory::get()->createVcard()); return new VcardModel(linphone::Factory::get()->createVcard());
} }
void CoreManager::forceRefreshRegisters () {
qInfo() << QStringLiteral("Refresh registers.");
m_instance->m_core->refreshRegisters();
}
// -----------------------------------------------------------------------------
void CoreManager::setDatabasesPaths () { void CoreManager::setDatabasesPaths () {
m_core->setFriendsDatabasePath(Paths::getFriendsListFilepath()); m_core->setFriendsDatabasePath(Paths::getFriendsListFilepath());
m_core->setCallLogsDatabasePath(Paths::getCallHistoryFilepath()); m_core->setCallLogsDatabasePath(Paths::getCallHistoryFilepath());
......
...@@ -100,6 +100,8 @@ public: ...@@ -100,6 +100,8 @@ public:
// Warning: The ownership of `VcardModel` is `QQmlEngine::JavaScriptOwnership` by default. // Warning: The ownership of `VcardModel` is `QQmlEngine::JavaScriptOwnership` by default.
Q_INVOKABLE VcardModel *createDetachedVcardModel (); Q_INVOKABLE VcardModel *createDetachedVcardModel ();
Q_INVOKABLE void forceRefreshRegisters ();
private: private:
CoreManager (QObject *parent, const QString &config_path); CoreManager (QObject *parent, const QString &config_path);
......
...@@ -272,4 +272,26 @@ Controls1.ApplicationWindow { ...@@ -272,4 +272,26 @@ Controls1.ApplicationWindow {
} }
} }
} }
// ---------------------------------------------------------------------------
// Hiden button to force registration.
// ---------------------------------------------------------------------------
Button {
anchors {
top: parent.top
left: parent.left
}
background: Rectangle {
color: 'transparent' // Not a style.
}
flat: true
height: accountStatus.height
width: MainWindowStyle.toolBar.leftMargin
onClicked: CoreManager.forceRefreshRegisters()
}
} }
Markdown is supported
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