3636#include " notifier.h"
3737#include " soundnotifier.h"
3838#include " Util/runstatehelper.h"
39+ #include " Bridge/Models/contactsmodel.h"
3940
4041MainWindowPanel::MainWindowPanel (HWND hWnd) : QWinView(hWnd)
4142{
@@ -57,6 +58,7 @@ MainWindowPanel::MainWindowPanel(HWND hWnd) : QWinView(hWnd)
5758 rsApi = new LibresapiLocalClient ();
5859 rsApi->openConnection (sockPath);
5960
61+ base64 = new Base64 ();
6062 QQmlContext *ctxt = this ->rootContext ();
6163 ctxt->setContextProperty (" view" , this );
6264 ctxt->setContextProperty (" qMainPanel" , this );
@@ -67,10 +69,37 @@ MainWindowPanel::MainWindowPanel(HWND hWnd) : QWinView(hWnd)
6769 ctxt->setContextProperty (" soundNotifier" , SoundNotifier::getInstance ());
6870 ctxt->setContextProperty (" rsApi" , rsApi);
6971 ctxt->setContextProperty (" runStateHelper" , RunStateHelper::getInstance ());
72+ ctxt->setContextProperty (" base64" , base64);
73+
74+ ctxt->setContextProperty (" gxsModel" , ContactsModel::getInstance ());
75+
76+ contactsModel = new ContactsSortModel ();
77+ contactsModel->setSourceModel (ContactsModel::getInstance ());
78+ ctxt->setContextProperty (" contactsModel" , contactsModel);
79+
80+ identitiesModel = new IdentitiesSortModel ();
81+ identitiesModel->setSourceModel (ContactsModel::getInstance ());
82+ ctxt->setContextProperty (" identitiesModel" , identitiesModel);
83+
7084 this ->setSource (QUrl (" qrc:/Borderless.qml" ));
7185 show ();
7286}
7387
88+ MainWindowPanel::~MainWindowPanel ()
89+ {
90+ if (base64 != NULL )
91+ delete base64;
92+ base64 = NULL ;
93+
94+ if (contactsModel != NULL )
95+ delete contactsModel;
96+ contactsModel = NULL ;
97+
98+ if (identitiesModel != NULL )
99+ delete identitiesModel;
100+ identitiesModel = NULL ;
101+ }
102+
74103// Button events
75104void MainWindowPanel::pushButtonMinimizeClicked ()
76105{
0 commit comments