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