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
12636b34
Commit
12636b34
authored
Dec 19, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(app): coding style
parent
2df59f19
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
27 deletions
+24
-27
ChatModel.cpp
tests/src/components/chat/ChatModel.cpp
+4
-4
ChatModel.hpp
tests/src/components/chat/ChatModel.hpp
+8
-6
ChatProxyModel.cpp
tests/src/components/chat/ChatProxyModel.cpp
+3
-5
ChatProxyModel.hpp
tests/src/components/chat/ChatProxyModel.hpp
+8
-9
ContactModel.cpp
tests/src/components/contact/ContactModel.cpp
+0
-2
ContactModel.hpp
tests/src/components/contact/ContactModel.hpp
+1
-1
No files found.
tests/src/components/chat/ChatModel.cpp
View file @
12636b34
...
...
@@ -11,7 +11,7 @@
using
namespace
std
;
// ===================================================================
// ===================================================================
==========
QHash
<
int
,
QByteArray
>
ChatModel
::
roleNames
()
const
{
QHash
<
int
,
QByteArray
>
roles
;
...
...
@@ -62,7 +62,7 @@ bool ChatModel::removeRows (int row, int count, const QModelIndex &parent) {
return
true
;
}
// -------------------------------------------------------------------
// -------------------------------------------------------------------
----------
void
ChatModel
::
removeEntry
(
int
id
)
{
qInfo
()
<<
QStringLiteral
(
"Removing chat entry: %1 of %2."
)
...
...
@@ -85,7 +85,7 @@ void ChatModel::removeAllEntries () {
endResetModel
();
}
// -------------------------------------------------------------------
// -------------------------------------------------------------------
----------
void
ChatModel
::
fillMessageEntry
(
QVariantMap
&
dest
,
...
...
@@ -125,7 +125,7 @@ void ChatModel::fillCallEndEntry (
dest
[
"isStart"
]
=
false
;
}
// -------------------------------------------------------------------
// -------------------------------------------------------------------
----------
void
ChatModel
::
removeEntry
(
ChatEntryData
&
pair
)
{
int
type
=
pair
.
first
[
"type"
].
toInt
();
...
...
tests/src/components/chat/ChatModel.hpp
View file @
12636b34
#ifndef CHAT_MODEL_H_
#define CHAT_MODEL_H_
#include <QAbstractListModel>
#include <linphone++/linphone.hh>
#include <QAbstractListModel>
// ===================================================================
// ===================================================================
==========
// Fetch all N messages of a ChatRoom.
// ===================================================================
// ===================================================================
==========
class
ChatModel
:
public
QAbstractListModel
{
friend
class
ChatProxyModel
;
...
...
@@ -20,9 +20,6 @@ class ChatModel : public QAbstractListModel {
NOTIFY
sipAddressChanged
);
signals:
void
sipAddressChanged
(
const
QString
&
sipAddress
);
public:
typedef
QPair
<
QVariantMap
,
std
::
shared_ptr
<
void
>
>
ChatEntryData
;
...
...
@@ -36,6 +33,7 @@ public:
MessageEntry
,
CallEntry
};
Q_ENUM
(
EntryType
);
enum
CallStatus
{
...
...
@@ -43,6 +41,7 @@ public:
CallStatusMissed
=
linphone
::
CallStatusMissed
,
CallStatusSuccess
=
linphone
::
CallStatusSuccess
};
Q_ENUM
(
CallStatus
);
ChatModel
(
QObject
*
parent
=
Q_NULLPTR
)
:
QAbstractListModel
(
parent
)
{}
...
...
@@ -59,6 +58,9 @@ public slots:
void
removeEntry
(
int
id
);
void
removeAllEntries
();
signals:
void
sipAddressChanged
(
const
QString
&
sipAddress
);
private:
void
fillMessageEntry
(
QVariantMap
&
dest
,
...
...
tests/src/components/chat/ChatProxyModel.cpp
View file @
12636b34
#include "ChatProxyModel.hpp"
// ===================================================================
// ===================================================================
==========
ChatModelFilter
::
ChatModelFilter
(
QObject
*
parent
)
:
QSortFilterProxyModel
(
parent
)
{
setSourceModel
(
&
m_chat_model
);
...
...
@@ -11,9 +11,7 @@ bool ChatModelFilter::filterAcceptsRow (int source_row, const QModelIndex &) con
return
true
;
QModelIndex
index
=
sourceModel
()
->
index
(
source_row
,
0
,
QModelIndex
());
const
QVariantMap
&
data
=
qvariant_cast
<
QVariantMap
>
(
index
.
data
()
);
const
QVariantMap
&
data
=
qvariant_cast
<
QVariantMap
>
(
index
.
data
());
return
data
[
"type"
].
toInt
()
==
m_entry_type_filter
;
}
...
...
@@ -23,7 +21,7 @@ void ChatModelFilter::setEntryTypeFilter (ChatModel::EntryType type) {
invalidateFilter
();
}
// ===================================================================
// ===================================================================
==========
const
unsigned
int
ChatProxyModel
::
ENTRIES_CHUNK_SIZE
=
50
;
...
...
tests/src/components/chat/ChatProxyModel.hpp
View file @
12636b34
...
...
@@ -5,9 +5,9 @@
#include "ChatModel.hpp"
// ===================================================================
// ===================================================================
==========
// Fetch the L last filtered chat entries.
// ===================================================================
// ===================================================================
==========
// Cannot be used as a nested class by Qt and `Q_OBJECT` macro
// must be used in header c++ file.
...
...
@@ -28,7 +28,7 @@ private:
ChatModel
::
EntryType
m_entry_type_filter
=
ChatModel
::
EntryType
::
GenericEntry
;
};
// ===================================================================
// ===================================================================
==========
class
ChatProxyModel
:
public
QSortFilterProxyModel
{
Q_OBJECT
;
...
...
@@ -40,11 +40,6 @@ class ChatProxyModel : public QSortFilterProxyModel {
NOTIFY
sipAddressChanged
);
signals:
void
sipAddressChanged
(
const
QString
&
sipAddress
);
void
moreEntriesLoaded
(
int
n
);
void
entryTypeFilterChanged
(
ChatModel
::
EntryType
type
);
public:
ChatProxyModel
(
QObject
*
parent
=
Q_NULLPTR
);
...
...
@@ -59,6 +54,11 @@ public slots:
static_cast
<
ChatModel
*>
(
m_chat_model_filter
.
sourceModel
())
->
removeAllEntries
();
}
signals:
void
sipAddressChanged
(
const
QString
&
sipAddress
);
void
moreEntriesLoaded
(
int
n
);
void
entryTypeFilterChanged
(
ChatModel
::
EntryType
type
);
protected:
bool
filterAcceptsRow
(
int
source_row
,
const
QModelIndex
&
source_parent
)
const
override
;
...
...
@@ -74,7 +74,6 @@ private:
}
ChatModelFilter
m_chat_model_filter
;
int
m_n_max_displayed_entries
=
ENTRIES_CHUNK_SIZE
;
static
const
unsigned
int
ENTRIES_CHUNK_SIZE
;
...
...
tests/src/components/contact/ContactModel.cpp
View file @
12636b34
#include <QtDebug>
#include "../../app/App.hpp"
#include "ContactModel.hpp"
...
...
tests/src/components/contact/ContactModel.hpp
View file @
12636b34
...
...
@@ -37,7 +37,7 @@ public slots:
}
void
abortEdit
()
{
// TODO.
// TODO
: call linphone friend abort function
.
// m_linphone_friend->abort();
}
...
...
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