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
555bf660
Commit
555bf660
authored
Dec 30, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(app): remove all slots, use `Q_INVOKABLE` instead.
parent
9813baf1
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
59 additions
and
68 deletions
+59
-68
App.hpp
tests/src/app/App.hpp
+1
-2
ChatModel.hpp
tests/src/components/chat/ChatModel.hpp
+2
-3
ChatProxyModel.hpp
tests/src/components/chat/ChatProxyModel.hpp
+4
-5
ContactModel.hpp
tests/src/components/contact/ContactModel.hpp
+3
-4
VcardModel.hpp
tests/src/components/contact/VcardModel.hpp
+20
-21
ContactsListModel.hpp
tests/src/components/contacts/ContactsListModel.hpp
+2
-3
ContactsListProxyModel.hpp
tests/src/components/contacts/ContactsListProxyModel.hpp
+1
-2
CoreManager.hpp
tests/src/components/core/CoreManager.hpp
+1
-2
Notifier.hpp
tests/src/components/notifier/Notifier.hpp
+1
-2
SipAddressesModel.cpp
tests/src/components/sip-addresses/SipAddressesModel.cpp
+20
-18
SipAddressesModel.hpp
tests/src/components/sip-addresses/SipAddressesModel.hpp
+3
-4
SmartSearchBarModel.hpp
...s/src/components/smart-search-bar/SmartSearchBarModel.hpp
+1
-2
No files found.
tests/src/app/App.hpp
View file @
555bf660
...
...
@@ -33,8 +33,7 @@ public:
return
&
m_engine
;
}
public
slots
:
QString
locale
()
const
{
Q_INVOKABLE
QString
locale
()
const
{
return
m_locale
;
}
...
...
tests/src/components/chat/ChatModel.hpp
View file @
555bf660
...
...
@@ -56,9 +56,8 @@ public:
QString
getSipAddress
()
const
;
void
setSipAddress
(
const
QString
&
sip_address
);
public
slots
:
void
removeEntry
(
int
id
);
void
removeAllEntries
();
Q_INVOKABLE
void
removeEntry
(
int
id
);
Q_INVOKABLE
void
removeAllEntries
();
signals:
void
sipAddressChanged
(
const
QString
&
sip_address
);
...
...
tests/src/components/chat/ChatProxyModel.hpp
View file @
555bf660
...
...
@@ -43,12 +43,11 @@ class ChatProxyModel : public QSortFilterProxyModel {
public:
ChatProxyModel
(
QObject
*
parent
=
Q_NULLPTR
);
public
slots
:
void
loadMoreEntries
();
void
setEntryTypeFilter
(
ChatModel
::
EntryType
type
);
void
removeEntry
(
int
id
);
Q_INVOKABLE
void
loadMoreEntries
();
Q_INVOKABLE
void
setEntryTypeFilter
(
ChatModel
::
EntryType
type
);
Q_INVOKABLE
void
removeEntry
(
int
id
);
void
removeAllEntries
()
{
Q_INVOKABLE
void
removeAllEntries
()
{
static_cast
<
ChatModel
*>
(
m_chat_model_filter
.
sourceModel
())
->
removeAllEntries
();
}
...
...
tests/src/components/contact/ContactModel.hpp
View file @
555bf660
...
...
@@ -26,10 +26,9 @@ public:
return
m_vcard
;
}
public
slots
:
void
startEdit
();
void
endEdit
();
void
abortEdit
();
Q_INVOKABLE
void
startEdit
();
Q_INVOKABLE
void
endEdit
();
Q_INVOKABLE
void
abortEdit
();
signals:
void
contactUpdated
();
...
...
tests/src/components/contact/VcardModel.hpp
View file @
555bf660
...
...
@@ -27,27 +27,26 @@ public:
QString
getUsername
()
const
;
QVariantList
getSipAddresses
()
const
;
public
slots
:
bool
addSipAddress
(
const
QString
&
sip_address
);
void
removeSipAddress
(
const
QString
&
sip_address
);
bool
updateSipAddress
(
const
QString
&
old_sip_address
,
const
QString
&
sip_address
);
bool
addCompany
(
const
QString
&
company
);
void
removeCompany
(
const
QString
&
company
);
bool
updateCompany
(
const
QString
&
old_company
,
const
QString
&
company
);
bool
addEmail
(
const
QString
&
email
);
void
removeEmail
(
const
QString
&
email
);
bool
updateEmail
(
const
QString
&
old_email
,
const
QString
&
email
);
bool
addUrl
(
const
QString
&
url
);
void
removeUrl
(
const
QString
&
url
);
bool
updateUrl
(
const
QString
&
old_url
,
const
QString
&
url
);
void
setStreet
(
const
QString
&
street
);
void
setLocality
(
const
QString
&
locality
);
void
setPostalCode
(
const
QString
&
postal_code
);
void
setCountry
(
const
QString
&
country
);
Q_INVOKABLE
bool
addSipAddress
(
const
QString
&
sip_address
);
Q_INVOKABLE
void
removeSipAddress
(
const
QString
&
sip_address
);
Q_INVOKABLE
bool
updateSipAddress
(
const
QString
&
old_sip_address
,
const
QString
&
sip_address
);
Q_INVOKABLE
bool
addCompany
(
const
QString
&
company
);
Q_INVOKABLE
void
removeCompany
(
const
QString
&
company
);
Q_INVOKABLE
bool
updateCompany
(
const
QString
&
old_company
,
const
QString
&
company
);
Q_INVOKABLE
bool
addEmail
(
const
QString
&
email
);
Q_INVOKABLE
void
removeEmail
(
const
QString
&
email
);
Q_INVOKABLE
bool
updateEmail
(
const
QString
&
old_email
,
const
QString
&
email
);
Q_INVOKABLE
bool
addUrl
(
const
QString
&
url
);
Q_INVOKABLE
void
removeUrl
(
const
QString
&
url
);
Q_INVOKABLE
bool
updateUrl
(
const
QString
&
old_url
,
const
QString
&
url
);
Q_INVOKABLE
void
setStreet
(
const
QString
&
street
);
Q_INVOKABLE
void
setLocality
(
const
QString
&
locality
);
Q_INVOKABLE
void
setPostalCode
(
const
QString
&
postal_code
);
Q_INVOKABLE
void
setCountry
(
const
QString
&
country
);
signals:
void
vcardUpdated
();
...
...
tests/src/components/contacts/ContactsListModel.hpp
View file @
555bf660
...
...
@@ -25,9 +25,8 @@ public:
bool
removeRow
(
int
row
,
const
QModelIndex
&
parent
=
QModelIndex
());
bool
removeRows
(
int
row
,
int
count
,
const
QModelIndex
&
parent
=
QModelIndex
())
override
;
public
slots
:
ContactModel
*
addContact
(
VcardModel
*
vcard
);
void
removeContact
(
ContactModel
*
contact
);
Q_INVOKABLE
ContactModel
*
addContact
(
VcardModel
*
vcard
);
Q_INVOKABLE
void
removeContact
(
ContactModel
*
contact
);
signals:
void
contactAdded
(
ContactModel
*
contact
);
...
...
tests/src/components/contacts/ContactsListProxyModel.hpp
View file @
555bf660
...
...
@@ -22,8 +22,7 @@ public:
ContactsListProxyModel
(
QObject
*
parent
=
Q_NULLPTR
);
~
ContactsListProxyModel
()
=
default
;
public
slots
:
void
setFilter
(
const
QString
&
pattern
);
Q_INVOKABLE
void
setFilter
(
const
QString
&
pattern
);
protected:
bool
filterAcceptsRow
(
int
source_row
,
const
QModelIndex
&
source_parent
)
const
override
;
...
...
tests/src/components/core/CoreManager.hpp
View file @
555bf660
...
...
@@ -34,10 +34,9 @@ public:
return
m_instance
;
}
public
slots
:
// Must be used in a qml scene.
// Warning: The ownership of `VcardModel` is `QQmlEngine::JavaScriptOwnership` by default.
VcardModel
*
createDetachedVcardModel
();
Q_INVOKABLE
VcardModel
*
createDetachedVcardModel
();
private:
CoreManager
(
QObject
*
parent
=
Q_NULLPTR
);
...
...
tests/src/components/notifier/Notifier.hpp
View file @
555bf660
...
...
@@ -20,8 +20,7 @@ public:
MaxNbTypes
};
public
slots
:
void
showCallMessage
(
int
timeout
,
const
QString
&
sip_address
);
Q_INVOKABLE
void
showCallMessage
(
int
timeout
,
const
QString
&
sip_address
);
private:
QObject
*
createNotification
(
NotificationType
type
);
...
...
tests/src/components/sip-addresses/SipAddressesModel.cpp
View file @
555bf660
...
...
@@ -83,6 +83,26 @@ ContactModel *SipAddressesModel::mapSipAddressToContact (const QString &sip_addr
return
it
->
value
(
"contact"
).
value
<
ContactModel
*>
();
}
// -----------------------------------------------------------------------------
ContactObserver
*
SipAddressesModel
::
getContactObserver
(
const
QString
&
sip_address
)
{
ContactObserver
*
model
=
new
ContactObserver
(
sip_address
);
model
->
setContact
(
mapSipAddressToContact
(
sip_address
));
m_observers
.
insert
(
sip_address
,
model
);
QObject
::
connect
(
model
,
&
ContactObserver
::
destroyed
,
this
,
[
this
,
model
]()
{
const
QString
&
sip_address
=
model
->
getSipAddress
();
if
(
m_observers
.
remove
(
sip_address
,
model
)
==
0
)
qWarning
()
<<
QStringLiteral
(
"Unable to remove sip address `%1` from observers."
).
arg
(
sip_address
);
}
);
return
model
;
}
// -----------------------------------------------------------------------------
void
SipAddressesModel
::
handleAllHistoryEntriesRemoved
()
{
QObject
*
sender
=
QObject
::
sender
();
if
(
!
sender
)
...
...
@@ -115,24 +135,6 @@ void SipAddressesModel::handleAllHistoryEntriesRemoved () {
// -----------------------------------------------------------------------------
ContactObserver
*
SipAddressesModel
::
getContactObserver
(
const
QString
&
sip_address
)
{
ContactObserver
*
model
=
new
ContactObserver
(
sip_address
);
model
->
setContact
(
mapSipAddressToContact
(
sip_address
));
m_observers
.
insert
(
sip_address
,
model
);
QObject
::
connect
(
model
,
&
ContactObserver
::
destroyed
,
this
,
[
this
,
model
]()
{
const
QString
&
sip_address
=
model
->
getSipAddress
();
if
(
m_observers
.
remove
(
sip_address
,
model
)
==
0
)
qWarning
()
<<
QStringLiteral
(
"Unable to remove sip address `%1` from observers."
).
arg
(
sip_address
);
}
);
return
model
;
}
// -----------------------------------------------------------------------------
bool
SipAddressesModel
::
removeRow
(
int
row
,
const
QModelIndex
&
parent
)
{
return
removeRows
(
row
,
1
,
parent
);
}
...
...
tests/src/components/sip-addresses/SipAddressesModel.hpp
View file @
555bf660
...
...
@@ -20,11 +20,10 @@ public:
QHash
<
int
,
QByteArray
>
roleNames
()
const
override
;
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
override
;
public
slots
:
ContactModel
*
mapSipAddressToContact
(
const
QString
&
sip_address
)
const
;
void
handleAllHistoryEntriesRemoved
();
Q_INVOKABLE
ContactModel
*
mapSipAddressToContact
(
const
QString
&
sip_address
)
const
;
Q_INVOKABLE
ContactObserver
*
getContactObserver
(
const
QString
&
sip_address
);
ContactObserver
*
getContactObserver
(
const
QString
&
sip_address
);
Q_INVOKABLE
void
handleAllHistoryEntriesRemoved
(
);
private:
bool
removeRow
(
int
row
,
const
QModelIndex
&
parent
=
QModelIndex
());
...
...
tests/src/components/smart-search-bar/SmartSearchBarModel.hpp
View file @
555bf660
...
...
@@ -16,8 +16,7 @@ public:
QHash
<
int
,
QByteArray
>
roleNames
()
const
override
;
public
slots
:
void
setFilter
(
const
QString
&
pattern
);
Q_INVOKABLE
void
setFilter
(
const
QString
&
pattern
);
protected:
bool
filterAcceptsRow
(
int
source_row
,
const
QModelIndex
&
source_parent
)
const
override
;
...
...
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