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
Show 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:
...
@@ -33,8 +33,7 @@ public:
return
&
m_engine
;
return
&
m_engine
;
}
}
public
slots
:
Q_INVOKABLE
QString
locale
()
const
{
QString
locale
()
const
{
return
m_locale
;
return
m_locale
;
}
}
...
...
tests/src/components/chat/ChatModel.hpp
View file @
555bf660
...
@@ -56,9 +56,8 @@ public:
...
@@ -56,9 +56,8 @@ public:
QString
getSipAddress
()
const
;
QString
getSipAddress
()
const
;
void
setSipAddress
(
const
QString
&
sip_address
);
void
setSipAddress
(
const
QString
&
sip_address
);
public
slots
:
Q_INVOKABLE
void
removeEntry
(
int
id
);
void
removeEntry
(
int
id
);
Q_INVOKABLE
void
removeAllEntries
();
void
removeAllEntries
();
signals:
signals:
void
sipAddressChanged
(
const
QString
&
sip_address
);
void
sipAddressChanged
(
const
QString
&
sip_address
);
...
...
tests/src/components/chat/ChatProxyModel.hpp
View file @
555bf660
...
@@ -43,12 +43,11 @@ class ChatProxyModel : public QSortFilterProxyModel {
...
@@ -43,12 +43,11 @@ class ChatProxyModel : public QSortFilterProxyModel {
public:
public:
ChatProxyModel
(
QObject
*
parent
=
Q_NULLPTR
);
ChatProxyModel
(
QObject
*
parent
=
Q_NULLPTR
);
public
slots
:
Q_INVOKABLE
void
loadMoreEntries
();
void
loadMoreEntries
();
Q_INVOKABLE
void
setEntryTypeFilter
(
ChatModel
::
EntryType
type
);
void
setEntryTypeFilter
(
ChatModel
::
EntryType
type
);
Q_INVOKABLE
void
removeEntry
(
int
id
);
void
removeEntry
(
int
id
);
void
removeAllEntries
()
{
Q_INVOKABLE
void
removeAllEntries
()
{
static_cast
<
ChatModel
*>
(
m_chat_model_filter
.
sourceModel
())
->
removeAllEntries
();
static_cast
<
ChatModel
*>
(
m_chat_model_filter
.
sourceModel
())
->
removeAllEntries
();
}
}
...
...
tests/src/components/contact/ContactModel.hpp
View file @
555bf660
...
@@ -26,10 +26,9 @@ public:
...
@@ -26,10 +26,9 @@ public:
return
m_vcard
;
return
m_vcard
;
}
}
public
slots
:
Q_INVOKABLE
void
startEdit
();
void
startEdit
();
Q_INVOKABLE
void
endEdit
();
void
endEdit
();
Q_INVOKABLE
void
abortEdit
();
void
abortEdit
();
signals:
signals:
void
contactUpdated
();
void
contactUpdated
();
...
...
tests/src/components/contact/VcardModel.hpp
View file @
555bf660
...
@@ -27,27 +27,26 @@ public:
...
@@ -27,27 +27,26 @@ public:
QString
getUsername
()
const
;
QString
getUsername
()
const
;
QVariantList
getSipAddresses
()
const
;
QVariantList
getSipAddresses
()
const
;
public
slots
:
Q_INVOKABLE
bool
addSipAddress
(
const
QString
&
sip_address
);
bool
addSipAddress
(
const
QString
&
sip_address
);
Q_INVOKABLE
void
removeSipAddress
(
const
QString
&
sip_address
);
void
removeSipAddress
(
const
QString
&
sip_address
);
Q_INVOKABLE
bool
updateSipAddress
(
const
QString
&
old_sip_address
,
const
QString
&
sip_address
);
bool
updateSipAddress
(
const
QString
&
old_sip_address
,
const
QString
&
sip_address
);
Q_INVOKABLE
bool
addCompany
(
const
QString
&
company
);
bool
addCompany
(
const
QString
&
company
);
Q_INVOKABLE
void
removeCompany
(
const
QString
&
company
);
void
removeCompany
(
const
QString
&
company
);
Q_INVOKABLE
bool
updateCompany
(
const
QString
&
old_company
,
const
QString
&
company
);
bool
updateCompany
(
const
QString
&
old_company
,
const
QString
&
company
);
Q_INVOKABLE
bool
addEmail
(
const
QString
&
email
);
bool
addEmail
(
const
QString
&
email
);
Q_INVOKABLE
void
removeEmail
(
const
QString
&
email
);
void
removeEmail
(
const
QString
&
email
);
Q_INVOKABLE
bool
updateEmail
(
const
QString
&
old_email
,
const
QString
&
email
);
bool
updateEmail
(
const
QString
&
old_email
,
const
QString
&
email
);
Q_INVOKABLE
bool
addUrl
(
const
QString
&
url
);
bool
addUrl
(
const
QString
&
url
);
Q_INVOKABLE
void
removeUrl
(
const
QString
&
url
);
void
removeUrl
(
const
QString
&
url
);
Q_INVOKABLE
bool
updateUrl
(
const
QString
&
old_url
,
const
QString
&
url
);
bool
updateUrl
(
const
QString
&
old_url
,
const
QString
&
url
);
Q_INVOKABLE
void
setStreet
(
const
QString
&
street
);
void
setStreet
(
const
QString
&
street
);
Q_INVOKABLE
void
setLocality
(
const
QString
&
locality
);
void
setLocality
(
const
QString
&
locality
);
Q_INVOKABLE
void
setPostalCode
(
const
QString
&
postal_code
);
void
setPostalCode
(
const
QString
&
postal_code
);
Q_INVOKABLE
void
setCountry
(
const
QString
&
country
);
void
setCountry
(
const
QString
&
country
);
signals:
signals:
void
vcardUpdated
();
void
vcardUpdated
();
...
...
tests/src/components/contacts/ContactsListModel.hpp
View file @
555bf660
...
@@ -25,9 +25,8 @@ public:
...
@@ -25,9 +25,8 @@ public:
bool
removeRow
(
int
row
,
const
QModelIndex
&
parent
=
QModelIndex
());
bool
removeRow
(
int
row
,
const
QModelIndex
&
parent
=
QModelIndex
());
bool
removeRows
(
int
row
,
int
count
,
const
QModelIndex
&
parent
=
QModelIndex
())
override
;
bool
removeRows
(
int
row
,
int
count
,
const
QModelIndex
&
parent
=
QModelIndex
())
override
;
public
slots
:
Q_INVOKABLE
ContactModel
*
addContact
(
VcardModel
*
vcard
);
ContactModel
*
addContact
(
VcardModel
*
vcard
);
Q_INVOKABLE
void
removeContact
(
ContactModel
*
contact
);
void
removeContact
(
ContactModel
*
contact
);
signals:
signals:
void
contactAdded
(
ContactModel
*
contact
);
void
contactAdded
(
ContactModel
*
contact
);
...
...
tests/src/components/contacts/ContactsListProxyModel.hpp
View file @
555bf660
...
@@ -22,8 +22,7 @@ public:
...
@@ -22,8 +22,7 @@ public:
ContactsListProxyModel
(
QObject
*
parent
=
Q_NULLPTR
);
ContactsListProxyModel
(
QObject
*
parent
=
Q_NULLPTR
);
~
ContactsListProxyModel
()
=
default
;
~
ContactsListProxyModel
()
=
default
;
public
slots
:
Q_INVOKABLE
void
setFilter
(
const
QString
&
pattern
);
void
setFilter
(
const
QString
&
pattern
);
protected:
protected:
bool
filterAcceptsRow
(
int
source_row
,
const
QModelIndex
&
source_parent
)
const
override
;
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:
...
@@ -34,10 +34,9 @@ public:
return
m_instance
;
return
m_instance
;
}
}
public
slots
:
// Must be used in a qml scene.
// Must be used in a qml scene.
// Warning: The ownership of `VcardModel` is `QQmlEngine::JavaScriptOwnership` by default.
// Warning: The ownership of `VcardModel` is `QQmlEngine::JavaScriptOwnership` by default.
VcardModel
*
createDetachedVcardModel
();
Q_INVOKABLE
VcardModel
*
createDetachedVcardModel
();
private:
private:
CoreManager
(
QObject
*
parent
=
Q_NULLPTR
);
CoreManager
(
QObject
*
parent
=
Q_NULLPTR
);
...
...
tests/src/components/notifier/Notifier.hpp
View file @
555bf660
...
@@ -20,8 +20,7 @@ public:
...
@@ -20,8 +20,7 @@ public:
MaxNbTypes
MaxNbTypes
};
};
public
slots
:
Q_INVOKABLE
void
showCallMessage
(
int
timeout
,
const
QString
&
sip_address
);
void
showCallMessage
(
int
timeout
,
const
QString
&
sip_address
);
private:
private:
QObject
*
createNotification
(
NotificationType
type
);
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
...
@@ -83,6 +83,26 @@ ContactModel *SipAddressesModel::mapSipAddressToContact (const QString &sip_addr
return
it
->
value
(
"contact"
).
value
<
ContactModel
*>
();
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
()
{
void
SipAddressesModel
::
handleAllHistoryEntriesRemoved
()
{
QObject
*
sender
=
QObject
::
sender
();
QObject
*
sender
=
QObject
::
sender
();
if
(
!
sender
)
if
(
!
sender
)
...
@@ -115,24 +135,6 @@ void SipAddressesModel::handleAllHistoryEntriesRemoved () {
...
@@ -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
)
{
bool
SipAddressesModel
::
removeRow
(
int
row
,
const
QModelIndex
&
parent
)
{
return
removeRows
(
row
,
1
,
parent
);
return
removeRows
(
row
,
1
,
parent
);
}
}
...
...
tests/src/components/sip-addresses/SipAddressesModel.hpp
View file @
555bf660
...
@@ -20,11 +20,10 @@ public:
...
@@ -20,11 +20,10 @@ public:
QHash
<
int
,
QByteArray
>
roleNames
()
const
override
;
QHash
<
int
,
QByteArray
>
roleNames
()
const
override
;
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
override
;
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
override
;
public
slots
:
Q_INVOKABLE
ContactModel
*
mapSipAddressToContact
(
const
QString
&
sip_address
)
const
;
ContactModel
*
mapSipAddressToContact
(
const
QString
&
sip_address
)
const
;
Q_INVOKABLE
ContactObserver
*
getContactObserver
(
const
QString
&
sip_address
);
void
handleAllHistoryEntriesRemoved
();
ContactObserver
*
getContactObserver
(
const
QString
&
sip_address
);
Q_INVOKABLE
void
handleAllHistoryEntriesRemoved
(
);
private:
private:
bool
removeRow
(
int
row
,
const
QModelIndex
&
parent
=
QModelIndex
());
bool
removeRow
(
int
row
,
const
QModelIndex
&
parent
=
QModelIndex
());
...
...
tests/src/components/smart-search-bar/SmartSearchBarModel.hpp
View file @
555bf660
...
@@ -16,8 +16,7 @@ public:
...
@@ -16,8 +16,7 @@ public:
QHash
<
int
,
QByteArray
>
roleNames
()
const
override
;
QHash
<
int
,
QByteArray
>
roleNames
()
const
override
;
public
slots
:
Q_INVOKABLE
void
setFilter
(
const
QString
&
pattern
);
void
setFilter
(
const
QString
&
pattern
);
protected:
protected:
bool
filterAcceptsRow
(
int
source_row
,
const
QModelIndex
&
source_parent
)
const
override
;
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