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
15aaff8a
Commit
15aaff8a
authored
Jun 23, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(app): use Q_CHECK_PTR when it's possible
parent
2e1a802d
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
33 additions
and
31 deletions
+33
-31
AssistantModel.cpp
src/components/assistant/AssistantModel.cpp
+3
-3
CallModel.cpp
src/components/call/CallModel.cpp
+1
-1
ConferenceAddModel.cpp
src/components/conference/ConferenceAddModel.cpp
+2
-2
ContactModel.cpp
src/components/contact/ContactModel.cpp
+8
-8
VcardModel.cpp
src/components/contact/VcardModel.cpp
+1
-1
CoreManager.cpp
src/components/core/CoreManager.cpp
+1
-1
CoreManager.hpp
src/components/core/CoreManager.hpp
+11
-9
Notifier.cpp
src/components/notifier/Notifier.cpp
+2
-2
AccountSettingsModel.cpp
src/components/settings/AccountSettingsModel.cpp
+4
-4
No files found.
src/components/assistant/AssistantModel.cpp
View file @
15aaff8a
...
...
@@ -64,7 +64,7 @@ private:
)
override
{
if
(
status
==
linphone
::
AccountCreatorStatusAccountExist
||
status
==
linphone
::
AccountCreatorStatusAccountExistWithAlias
)
{
shared_ptr
<
linphone
::
ProxyConfig
>
proxyConfig
=
creator
->
createProxyConfig
();
Q_
ASSERT
(
proxyConfig
!=
nullptr
);
Q_
CHECK_PTR
(
proxyConfig
);
emit
mAssistant
->
loginStatusChanged
(
""
);
}
else
{
...
...
@@ -86,7 +86,7 @@ private:
)
{
if
(
creator
->
getEmail
().
empty
())
{
shared_ptr
<
linphone
::
ProxyConfig
>
proxyConfig
=
creator
->
createProxyConfig
();
Q_
ASSERT
(
proxyConfig
!=
nullptr
);
Q_
CHECK_PTR
(
proxyConfig
);
}
emit
mAssistant
->
activateStatusChanged
(
""
);
...
...
@@ -105,7 +105,7 @@ private:
)
override
{
if
(
status
==
linphone
::
AccountCreatorStatusAccountActivated
)
{
shared_ptr
<
linphone
::
ProxyConfig
>
proxyConfig
=
creator
->
createProxyConfig
();
Q_
ASSERT
(
proxyConfig
!=
nullptr
);
Q_
CHECK_PTR
(
proxyConfig
);
emit
mAssistant
->
activateStatusChanged
(
""
);
}
else
{
...
...
src/components/call/CallModel.cpp
View file @
15aaff8a
...
...
@@ -38,7 +38,7 @@ using namespace std;
// =============================================================================
CallModel
::
CallModel
(
shared_ptr
<
linphone
::
Call
>
call
)
{
Q_
ASSERT
(
call
!=
nullptr
);
Q_
CHECK_PTR
(
call
);
mCall
=
call
;
mCall
->
setData
(
"call-model"
,
*
this
);
...
...
src/components/conference/ConferenceAddModel.cpp
View file @
15aaff8a
...
...
@@ -31,7 +31,7 @@ using namespace std;
ConferenceHelperModel
::
ConferenceAddModel
::
ConferenceAddModel
(
QObject
*
parent
)
:
QAbstractListModel
(
parent
)
{
mConferenceHelperModel
=
qobject_cast
<
ConferenceHelperModel
*>
(
parent
);
Q_
ASSERT
(
mConferenceHelperModel
!=
nullptr
);
Q_
CHECK_PTR
(
mConferenceHelperModel
);
CoreManager
*
coreManager
=
CoreManager
::
getInstance
();
...
...
@@ -134,7 +134,7 @@ void ConferenceHelperModel::ConferenceAddModel::update () {
list
<
shared_ptr
<
linphone
::
Address
>
>
linphoneAddresses
;
for
(
const
auto
&
map
:
mRefs
)
{
shared_ptr
<
linphone
::
Address
>
linphoneAddress
=
map
->
value
(
"__linphoneAddress"
).
value
<
shared_ptr
<
linphone
::
Address
>
>
();
Q_
ASSERT
(
linphoneAddress
!=
nullptr
);
Q_
CHECK_PTR
(
linphoneAddress
);
linphoneAddresses
.
push_back
(
linphoneAddress
);
}
...
...
src/components/contact/ContactModel.cpp
View file @
15aaff8a
...
...
@@ -31,7 +31,7 @@ using namespace std;
// =============================================================================
ContactModel
::
ContactModel
(
QObject
*
parent
,
shared_ptr
<
linphone
::
Friend
>
linphoneFriend
)
:
QObject
(
parent
)
{
Q_
ASSERT
(
linphoneFriend
!=
nullptr
);
Q_
CHECK_PTR
(
linphoneFriend
);
mLinphoneFriend
=
linphoneFriend
;
mLinphoneFriend
->
setData
(
"contact-model"
,
*
this
);
...
...
@@ -40,8 +40,8 @@ ContactModel::ContactModel (QObject *parent, shared_ptr<linphone::Friend> linpho
}
ContactModel
::
ContactModel
(
QObject
*
parent
,
VcardModel
*
vcardModel
)
:
QObject
(
parent
)
{
Q_
ASSERT
(
vcardModel
!=
nullptr
);
Q_
ASSERT
(
vcardModel
->
mVcard
!=
nullptr
);
Q_
CHECK_PTR
(
vcardModel
);
Q_
CHECK_PTR
(
vcardModel
->
mVcard
);
Q_ASSERT
(
!
vcardModel
->
mIsReadOnly
);
mLinphoneFriend
=
linphone
::
Friend
::
newFromVcard
(
vcardModel
->
mVcard
);
...
...
@@ -86,7 +86,7 @@ void ContactModel::setVcardModel (VcardModel *vcardModel) {
}
void
ContactModel
::
setVcardModelInternal
(
VcardModel
*
vcardModel
)
{
Q_
ASSERT
(
vcardModel
!=
nullptr
);
Q_
CHECK_PTR
(
vcardModel
);
Q_ASSERT
(
vcardModel
!=
mVcardModel
);
mVcardModel
=
vcardModel
;
...
...
@@ -100,7 +100,7 @@ void ContactModel::setVcardModelInternal (VcardModel *vcardModel) {
}
void
ContactModel
::
updateSipAddresses
(
VcardModel
*
oldVcardModel
)
{
Q_
ASSERT
(
oldVcardModel
!=
nullptr
);
Q_
CHECK_PTR
(
oldVcardModel
);
QVariantList
oldSipAddresses
=
oldVcardModel
->
getSipAddresses
();
QVariantList
sipAddresses
=
mVcardModel
->
getSipAddresses
();
...
...
@@ -139,7 +139,7 @@ next:
// -----------------------------------------------------------------------------
void
ContactModel
::
mergeVcardModel
(
VcardModel
*
vcardModel
)
{
Q_
ASSERT
(
vcardModel
!=
nullptr
);
Q_
CHECK_PTR
(
vcardModel
);
qInfo
()
<<
QStringLiteral
(
"Merge vcard into contact:"
)
<<
this
<<
vcardModel
;
...
...
@@ -184,8 +184,8 @@ void ContactModel::mergeVcardModel (VcardModel *vcardModel) {
VcardModel
*
ContactModel
::
cloneVcardModel
()
const
{
shared_ptr
<
linphone
::
Vcard
>
vcard
=
mVcardModel
->
mVcard
->
clone
();
Q_
ASSERT
(
vcard
!=
nullptr
);
Q_
ASSERT
(
vcard
->
getVcard
()
!=
nullptr
);
Q_
CHECK_PTR
(
vcard
);
Q_
CHECK_PTR
(
vcard
->
getVcard
()
);
mLinphoneFriend
->
edit
();
...
...
src/components/contact/VcardModel.cpp
View file @
15aaff8a
...
...
@@ -112,7 +112,7 @@ static string interpretSipAddress (const QString &sipAddress) {
// -----------------------------------------------------------------------------
VcardModel
::
VcardModel
(
shared_ptr
<
linphone
::
Vcard
>
vcard
,
bool
isReadOnly
)
{
Q_
ASSERT
(
vcard
!=
nullptr
);
Q_
CHECK_PTR
(
vcard
);
mVcard
=
vcard
;
mIsReadOnly
=
isReadOnly
;
}
...
...
src/components/core/CoreManager.cpp
View file @
15aaff8a
...
...
@@ -86,7 +86,7 @@ void CoreManager::uninit () {
// -----------------------------------------------------------------------------
VcardModel
*
CoreManager
::
createDetachedVcardModel
()
{
VcardModel
*
CoreManager
::
createDetachedVcardModel
()
const
{
VcardModel
*
vcardModel
=
new
VcardModel
(
linphone
::
Factory
::
get
()
->
createVcard
(),
false
);
qInfo
()
<<
QStringLiteral
(
"Create detached vcard:"
)
<<
vcardModel
;
return
vcardModel
;
...
...
src/components/core/CoreManager.hpp
View file @
15aaff8a
...
...
@@ -49,12 +49,12 @@ public:
~
CoreManager
()
=
default
;
std
::
shared_ptr
<
linphone
::
Core
>
getCore
()
{
Q_
ASSERT
(
mCore
!=
nullptr
);
Q_
CHECK_PTR
(
mCore
);
return
mCore
;
}
std
::
shared_ptr
<
CoreHandlers
>
getHandlers
()
{
Q_
ASSERT
(
mHandlers
!=
nullptr
);
Q_
CHECK_PTR
(
mHandlers
);
return
mHandlers
;
}
...
...
@@ -75,27 +75,27 @@ public:
// ---------------------------------------------------------------------------
CallsListModel
*
getCallsListModel
()
const
{
Q_
ASSERT
(
mCallsListModel
!=
nullptr
);
Q_
CHECK_PTR
(
mCallsListModel
);
return
mCallsListModel
;
}
ContactsListModel
*
getContactsListModel
()
const
{
Q_
ASSERT
(
mContactsListModel
!=
nullptr
);
Q_
CHECK_PTR
(
mContactsListModel
);
return
mContactsListModel
;
}
SipAddressesModel
*
getSipAddressesModel
()
const
{
Q_
ASSERT
(
mSipAddressesModel
!=
nullptr
);
Q_
CHECK_PTR
(
mSipAddressesModel
);
return
mSipAddressesModel
;
}
SettingsModel
*
getSettingsModel
()
const
{
Q_
ASSERT
(
mSettingsModel
!=
nullptr
);
Q_
CHECK_PTR
(
mSettingsModel
);
return
mSettingsModel
;
}
AccountSettingsModel
*
getAccountSettingsModel
()
const
{
Q_
ASSERT
(
mAccountSettingsModel
!=
nullptr
);
Q_
CHECK_PTR
(
mAccountSettingsModel
);
return
mAccountSettingsModel
;
}
...
...
@@ -107,7 +107,7 @@ public:
static
void
uninit
();
static
CoreManager
*
getInstance
()
{
Q_
ASSERT
(
mInstance
!=
nullptr
);
Q_
CHECK_PTR
(
mInstance
);
return
mInstance
;
}
...
...
@@ -115,10 +115,12 @@ public:
// Must be used in a qml scene.
// Warning: The ownership of `VcardModel` is `QQmlEngine::JavaScriptOwnership` by default.
Q_INVOKABLE
VcardModel
*
createDetachedVcardModel
();
Q_INVOKABLE
VcardModel
*
createDetachedVcardModel
()
const
;
Q_INVOKABLE
void
forceRefreshRegisters
();
Q_INVOKABLE
void
sendLogs
()
const
;
signals:
void
coreCreated
();
void
coreStarted
();
...
...
src/components/notifier/Notifier.cpp
View file @
15aaff8a
...
...
@@ -134,10 +134,10 @@ QObject *Notifier::createNotification (Notifier::NotificationType type) {
{
QQuickWindow
*
window
=
instance
->
findChild
<
QQuickWindow
*>
(
NOTIFICATION_PROPERTY_WINDOW
);
Q_
ASSERT
(
window
!=
nullptr
);
Q_
CHECK_PTR
(
window
);
QScreen
*
screen
=
window
->
screen
();
Q_
ASSERT
(
screen
!=
nullptr
);
Q_
CHECK_PTR
(
screen
);
QRect
geometry
=
screen
->
availableGeometry
();
...
...
src/components/settings/AccountSettingsModel.cpp
View file @
15aaff8a
...
...
@@ -60,7 +60,7 @@ AccountSettingsModel::AccountSettingsModel (QObject *parent) : QObject(parent) {
// -----------------------------------------------------------------------------
bool
AccountSettingsModel
::
addOrUpdateProxyConfig
(
const
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxyConfig
)
{
Q_
ASSERT
(
proxyConfig
!=
nullptr
);
Q_
CHECK_PTR
(
proxyConfig
);
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
...
...
@@ -83,7 +83,7 @@ bool AccountSettingsModel::addOrUpdateProxyConfig (const shared_ptr<linphone::Pr
}
QVariantMap
AccountSettingsModel
::
getProxyConfigDescription
(
const
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxyConfig
)
{
Q_
ASSERT
(
proxyConfig
!=
nullptr
);
Q_
CHECK_PTR
(
proxyConfig
);
QVariantMap
map
;
...
...
@@ -114,7 +114,7 @@ void AccountSettingsModel::setDefaultProxyConfig (const shared_ptr<linphone::Pro
}
void
AccountSettingsModel
::
removeProxyConfig
(
const
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxyConfig
)
{
Q_
ASSERT
(
proxyConfig
!=
nullptr
);
Q_
CHECK_PTR
(
proxyConfig
);
CoreManager
::
getInstance
()
->
getCore
()
->
removeProxyConfig
(
proxyConfig
);
emit
accountSettingsUpdated
();
...
...
@@ -124,7 +124,7 @@ bool AccountSettingsModel::addOrUpdateProxyConfig (
const
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxyConfig
,
const
QVariantMap
&
data
)
{
Q_
ASSERT
(
proxyConfig
!=
nullptr
);
Q_
CHECK_PTR
(
proxyConfig
);
QString
literal
=
data
[
"sipAddress"
].
toString
();
...
...
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