Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
28ae7fe7
Commit
28ae7fe7
authored
May 11, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/app): add a `ConferenceHelperModel` component
parent
6b2bd19f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
0 deletions
+93
-0
CMakeLists.txt
linphone-desktop/CMakeLists.txt
+2
-0
App.cpp
linphone-desktop/src/app/App.cpp
+1
-0
Components.hpp
linphone-desktop/src/components/Components.hpp
+1
-0
ConferenceHelperModel.cpp
...sktop/src/components/conference/ConferenceHelperModel.cpp
+48
-0
ConferenceHelperModel.hpp
...sktop/src/components/conference/ConferenceHelperModel.hpp
+41
-0
No files found.
linphone-desktop/CMakeLists.txt
View file @
28ae7fe7
...
...
@@ -106,6 +106,7 @@ set(SOURCES
src/components/codecs/AbstractCodecsModel.cpp
src/components/codecs/AudioCodecsModel.cpp
src/components/codecs/VideoCodecsModel.cpp
src/components/conference/ConferenceHelperModel.cpp
src/components/contact/ContactModel.cpp
src/components/contact/VcardModel.cpp
src/components/contacts/ContactsListModel.cpp
...
...
@@ -147,6 +148,7 @@ set(HEADERS
src/components/codecs/AudioCodecsModel.hpp
src/components/codecs/VideoCodecsModel.hpp
src/components/Components.hpp
src/components/conference/ConferenceHelperModel.hpp
src/components/contact/ContactModel.hpp
src/components/contact/VcardModel.hpp
src/components/contacts/ContactsListModel.hpp
...
...
linphone-desktop/src/app/App.cpp
View file @
28ae7fe7
...
...
@@ -343,6 +343,7 @@ void App::registerTypes () {
registerType
<
CameraPreview
>
(
"CameraPreview"
);
registerType
<
ChatModel
>
(
"ChatModel"
);
registerType
<
ChatProxyModel
>
(
"ChatProxyModel"
);
registerType
<
ConferenceHelperModel
>
(
"ConferenceHelperModel"
);
registerType
<
ContactsListProxyModel
>
(
"ContactsListProxyModel"
);
registerType
<
SmartSearchBarModel
>
(
"SmartSearchBarModel"
);
registerType
<
SoundPlayer
>
(
"SoundPlayer"
);
...
...
linphone-desktop/src/components/Components.hpp
View file @
28ae7fe7
...
...
@@ -31,6 +31,7 @@
#include "chat/ChatProxyModel.hpp"
#include "codecs/AudioCodecsModel.hpp"
#include "codecs/VideoCodecsModel.hpp"
#include "conference/ConferenceHelperModel.hpp"
#include "contacts/ContactsListProxyModel.hpp"
#include "core/CoreManager.hpp"
#include "presence/OwnPresenceModel.hpp"
...
...
linphone-desktop/src/components/conference/ConferenceHelperModel.cpp
0 → 100644
View file @
28ae7fe7
/*
* ConferenceHelperModel.cpp
* Copyright (C) 2017 Belledonne Communications, Grenoble, France
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Created on: May 11, 2017
* Author: Ronan Abhamon
*/
#include "../../Utils.hpp"
#include "../core/CoreManager.hpp"
#include "ConferenceHelperModel.hpp"
// =============================================================================
ConferenceHelperModel
::
ConferenceHelperModel
(
QObject
*
parent
)
:
QSortFilterProxyModel
(
parent
)
{
setSourceModel
(
CoreManager
::
getInstance
()
->
getSipAddressesModel
());
for
(
const
auto
&
participant
:
CoreManager
::
getInstance
()
->
getCore
()
->
getConference
()
->
getParticipants
())
mInConference
<<
::
Utils
::
linphoneStringToQString
(
participant
->
asStringUriOnly
());
}
QHash
<
int
,
QByteArray
>
ConferenceHelperModel
::
roleNames
()
const
{
QHash
<
int
,
QByteArray
>
roles
;
roles
[
Qt
::
DisplayRole
]
=
"$sipAddress"
;
return
roles
;
}
bool
ConferenceHelperModel
::
filterAcceptsRow
(
int
sourceRow
,
const
QModelIndex
&
sourceParent
)
const
{
const
QModelIndex
&
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
const
QVariantMap
&
data
=
index
.
data
().
toMap
();
return
!
mInConference
.
contains
(
data
[
"sipAddress"
].
toString
());
}
linphone-desktop/src/components/conference/ConferenceHelperModel.hpp
0 → 100644
View file @
28ae7fe7
/*
* ConferenceHelperModel.hpp
* Copyright (C) 2017 Belledonne Communications, Grenoble, France
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Created on: May 11, 2017
* Author: Ronan Abhamon
*/
#include <QSortFilterProxyModel>
// =============================================================================
class
ConferenceHelperModel
:
public
QSortFilterProxyModel
{
Q_OBJECT
;
public:
ConferenceHelperModel
(
QObject
*
parent
=
Q_NULLPTR
);
~
ConferenceHelperModel
()
=
default
;
QHash
<
int
,
QByteArray
>
roleNames
()
const
override
;
protected:
bool
filterAcceptsRow
(
int
sourceRow
,
const
QModelIndex
&
sourceParent
)
const
override
;
private:
QStringList
mInConference
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment