Commit 386f1130 authored by Ronan's avatar Ronan

feat(App): register FileExtractor

parent 5c05229f
......@@ -298,12 +298,12 @@ QQuickWindow *App::getSettingsWindow () {
if (!mSettingsWindow) {
mSettingsWindow = ::createSubWindow(mEngine, cQmlViewSettingsWindow);
QObject::connect(mSettingsWindow, &QWindow::visibilityChanged, this, [](QWindow::Visibility visibility) {
if (visibility == QWindow::Hidden) {
qInfo() << QStringLiteral("Update nat policy.");
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
core->setNatPolicy(core->getNatPolicy());
}
});
if (visibility == QWindow::Hidden) {
qInfo() << QStringLiteral("Update nat policy.");
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
core->setNatPolicy(core->getNatPolicy());
}
});
}
return mSettingsWindow;
......@@ -377,8 +377,8 @@ void registerType (const char *name) {
template<class T>
void registerToolType (const char *name) {
qmlRegisterSingletonType<T>(name, 1, 0, name, [](QQmlEngine *engine, QJSEngine *) -> QObject *{
return new T(engine);
});
return new T(engine);
});
}
#define registerSharedToolType(TYPE, NAME, METHOD) qmlRegisterSingletonType<TYPE>( \
......@@ -405,6 +405,7 @@ void App::registerTypes () {
registerType<ConferenceHelperModel>("ConferenceHelperModel");
registerType<ConferenceModel>("ConferenceModel");
registerType<ContactsListProxyModel>("ContactsListProxyModel");
registerType<FileExtractor>("FileExtractor");
registerType<SipAddressesProxyModel>("SipAddressesProxyModel");
registerType<SoundPlayer>("SoundPlayer");
registerType<TelephoneNumbersModel>("TelephoneNumbersModel");
......@@ -472,15 +473,15 @@ void App::setTrayIcon () {
// trayIcon: Left click actions.
QMenu *menu = new QMenu();
root->connect(systemTrayIcon, &QSystemTrayIcon::activated, [root](
QSystemTrayIcon::ActivationReason reason
) {
if (reason == QSystemTrayIcon::Trigger) {
if (root->visibility() == QWindow::Hidden)
smartShowWindow(root);
else
root->hide();
QSystemTrayIcon::ActivationReason reason
) {
if (reason == QSystemTrayIcon::Trigger) {
if (root->visibility() == QWindow::Hidden)
smartShowWindow(root);
else
root->hide();
}
});
});
// Build trayIcon menu.
menu->addAction(restoreAction);
......
......@@ -36,6 +36,7 @@
#include "conference/ConferenceModel.hpp"
#include "contacts/ContactsListProxyModel.hpp"
#include "core/CoreManager.hpp"
#include "file/FileExtractor.hpp"
#include "presence/OwnPresenceModel.hpp"
#include "settings/AccountSettingsModel.hpp"
#include "sip-addresses/SipAddressesProxyModel.hpp"
......
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