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
8572347b
Commit
8572347b
authored
Jun 19, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(App): remove reference on `const var &foo = expr`
parent
64b45e2d
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
41 additions
and
44 deletions
+41
-44
App.cpp
src/app/App.cpp
+1
-1
Cli.cpp
src/app/cli/Cli.cpp
+2
-2
Paths.cpp
src/app/paths/Paths.cpp
+1
-1
AssistantModel.cpp
src/components/assistant/AssistantModel.cpp
+1
-1
CallsListProxyModel.cpp
src/components/calls/CallsListProxyModel.cpp
+3
-5
ChatModel.cpp
src/components/chat/ChatModel.cpp
+8
-8
ChatProxyModel.cpp
src/components/chat/ChatProxyModel.cpp
+1
-1
ConferenceAddModel.cpp
src/components/conference/ConferenceAddModel.cpp
+3
-3
ConferenceHelperModel.cpp
src/components/conference/ConferenceHelperModel.cpp
+2
-2
ConferenceModel.cpp
src/components/conference/ConferenceModel.cpp
+2
-3
ContactModel.cpp
src/components/contact/ContactModel.cpp
+3
-3
ContactsListProxyModel.cpp
src/components/contacts/ContactsListProxyModel.cpp
+1
-1
AccountSettingsModel.cpp
src/components/settings/AccountSettingsModel.cpp
+1
-1
SettingsModel.cpp
src/components/settings/SettingsModel.cpp
+1
-1
SipAddressesModel.cpp
src/components/sip-addresses/SipAddressesModel.cpp
+3
-3
SipAddressesProxyModel.cpp
src/components/sip-addresses/SipAddressesProxyModel.cpp
+5
-5
TimelineModel.cpp
src/components/timeline/TimelineModel.cpp
+1
-1
Utils.cpp
src/utils/Utils.cpp
+2
-2
No files found.
src/app/App.cpp
View file @
8572347b
...
...
@@ -524,7 +524,7 @@ void App::openAppAfterInit () {
// Execute command argument if needed.
{
const
QString
&
commandArgument
=
getCommandArgument
();
const
QString
commandArgument
=
getCommandArgument
();
if
(
!
commandArgument
.
isEmpty
())
executeCommand
(
commandArgument
);
}
...
...
src/app/cli/Cli.cpp
View file @
8572347b
...
...
@@ -89,7 +89,7 @@ void Cli::addCommand (const QString &functionName, const QString &description, F
// -----------------------------------------------------------------------------
void
Cli
::
executeCommand
(
const
QString
&
command
)
noexcept
{
const
QString
&
functionName
=
parseFunctionName
(
command
);
const
QString
functionName
=
parseFunctionName
(
command
);
if
(
functionName
.
isEmpty
())
return
;
...
...
@@ -106,7 +106,7 @@ void Cli::executeCommand (const QString &command) noexcept {
const
QString
Cli
::
parseFunctionName
(
const
QString
&
command
)
noexcept
{
mRegExpFunctionName
.
indexIn
(
command
);
const
QStringList
&
texts
=
mRegExpFunctionName
.
capturedTexts
();
const
QStringList
texts
=
mRegExpFunctionName
.
capturedTexts
();
if
(
texts
.
size
()
<
2
)
{
qWarning
()
<<
QStringLiteral
(
"Unable to parse function name of command: `%1`."
).
arg
(
command
);
return
QString
(
""
);
...
...
src/app/paths/Paths.cpp
View file @
8572347b
...
...
@@ -176,7 +176,7 @@ string Paths::getCapturesDirPath () {
}
string
Paths
::
getConfigFilePath
(
const
QString
&
configPath
,
bool
writable
)
{
const
QString
&
path
=
configPath
.
isEmpty
()
const
QString
path
=
configPath
.
isEmpty
()
?
::
getAppConfigFilePath
()
:
QFileInfo
(
configPath
).
absoluteFilePath
();
...
...
src/components/assistant/AssistantModel.cpp
View file @
8572347b
...
...
@@ -188,7 +188,7 @@ bool AssistantModel::addOtherSipAccount (const QVariantMap &map) {
shared_ptr
<
linphone
::
Core
>
core
=
coreManager
->
getCore
();
shared_ptr
<
linphone
::
ProxyConfig
>
proxyConfig
=
core
->
createProxyConfig
();
const
QString
&
domain
=
map
[
"sipDomain"
].
toString
();
const
QString
domain
=
map
[
"sipDomain"
].
toString
();
QString
sipAddress
=
QStringLiteral
(
"sip:%1@%2"
)
.
arg
(
map
[
"username"
].
toString
()).
arg
(
domain
);
...
...
src/components/calls/CallsListProxyModel.cpp
View file @
8572347b
...
...
@@ -31,17 +31,15 @@ using namespace std;
CallsListProxyModel
::
CallsListProxyModel
(
QObject
*
parent
)
:
QSortFilterProxyModel
(
parent
)
{
CallsListModel
*
callsListModel
=
CoreManager
::
getInstance
()
->
getCallsListModel
();
QObject
::
connect
(
callsListModel
,
&
CallsListModel
::
callRunning
,
this
,
[
this
](
int
index
,
CallModel
*
callModel
)
{
QObject
::
connect
(
callsListModel
,
&
CallsListModel
::
callRunning
,
this
,
[
this
](
int
index
,
CallModel
*
callModel
)
{
emit
callRunning
(
index
,
callModel
);
}
);
});
setSourceModel
(
callsListModel
);
sort
(
0
);
}
bool
CallsListProxyModel
::
filterAcceptsRow
(
int
sourceRow
,
const
QModelIndex
&
sourceParent
)
const
{
const
QModelIndex
&
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
const
QModelIndex
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
return
!
index
.
data
().
value
<
CallModel
*>
()
->
isInConference
();
}
src/components/chat/ChatModel.cpp
View file @
8572347b
...
...
@@ -58,7 +58,7 @@ inline QString getDownloadPath (const shared_ptr<linphone::ChatMessage> &message
}
inline
bool
fileWasDownloaded
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
const
QString
&
path
=
::
getDownloadPath
(
message
);
const
QString
path
=
::
getDownloadPath
(
message
);
return
!
path
.
isEmpty
()
&&
QFileInfo
(
path
).
isFile
();
}
...
...
@@ -354,8 +354,8 @@ void ChatModel::resendMessage (int id) {
return
;
}
const
ChatEntryData
&
entry
=
mEntries
[
id
];
const
QVariantMap
&
map
=
entry
.
first
;
const
ChatEntryData
entry
=
mEntries
[
id
];
const
QVariantMap
map
=
entry
.
first
;
if
(
map
[
"type"
]
!=
EntryType
::
MessageEntry
)
{
qWarning
()
<<
QStringLiteral
(
"Unable to resend entry %1. It's not a message."
).
arg
(
id
);
...
...
@@ -413,7 +413,7 @@ void ChatModel::sendFileMessage (const QString &path) {
// -----------------------------------------------------------------------------
void
ChatModel
::
downloadFile
(
int
id
)
{
const
ChatEntryData
&
entry
=
getFileMessageEntry
(
id
);
const
ChatEntryData
entry
=
getFileMessageEntry
(
id
);
if
(
!
entry
.
second
)
return
;
...
...
@@ -432,7 +432,7 @@ void ChatModel::downloadFile (int id) {
}
bool
soFarSoGood
;
const
QString
&
safeFilePath
=
::
Utils
::
getSafeFilePath
(
const
QString
safeFilePath
=
::
Utils
::
getSafeFilePath
(
QStringLiteral
(
"%1%2"
)
.
arg
(
CoreManager
::
getInstance
()
->
getSettingsModel
()
->
getDownloadFolder
())
.
arg
(
entry
.
first
[
"fileName"
].
toString
()),
...
...
@@ -452,7 +452,7 @@ void ChatModel::downloadFile (int id) {
}
void
ChatModel
::
openFile
(
int
id
,
bool
showDirectory
)
{
const
ChatEntryData
&
entry
=
getFileMessageEntry
(
id
);
const
ChatEntryData
entry
=
getFileMessageEntry
(
id
);
if
(
!
entry
.
second
)
return
;
...
...
@@ -469,7 +469,7 @@ void ChatModel::openFile (int id, bool showDirectory) {
}
bool
ChatModel
::
fileWasDownloaded
(
int
id
)
{
const
ChatEntryData
&
entry
=
getFileMessageEntry
(
id
);
const
ChatEntryData
entry
=
getFileMessageEntry
(
id
);
return
entry
.
second
&&
::
fileWasDownloaded
(
static_pointer_cast
<
linphone
::
ChatMessage
>
(
entry
.
second
));
}
...
...
@@ -484,7 +484,7 @@ const ChatModel::ChatEntryData ChatModel::getFileMessageEntry (int id) {
return
ChatEntryData
();
}
const
ChatEntryData
&
entry
=
mEntries
[
id
];
const
ChatEntryData
entry
=
mEntries
[
id
];
if
(
entry
.
first
[
"type"
]
!=
EntryType
::
MessageEntry
)
{
qWarning
()
<<
QStringLiteral
(
"Unable to download entry %1. It's not a message."
).
arg
(
id
);
return
ChatEntryData
();
...
...
src/components/chat/ChatProxyModel.cpp
View file @
8572347b
...
...
@@ -48,7 +48,7 @@ protected:
return
true
;
QModelIndex
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
QModelIndex
());
const
QVariantMap
&
data
=
index
.
data
().
toMap
();
const
QVariantMap
data
=
index
.
data
().
toMap
();
return
data
[
"type"
].
toInt
()
==
mEntryTypeFilter
;
}
...
...
src/components/conference/ConferenceAddModel.cpp
View file @
8572347b
...
...
@@ -71,7 +71,7 @@ QVariant ConferenceHelperModel::ConferenceAddModel::data (const QModelIndex &ind
// -----------------------------------------------------------------------------
bool
ConferenceHelperModel
::
ConferenceAddModel
::
addToConference
(
const
shared_ptr
<
const
linphone
::
Address
>
&
linphoneAddress
)
{
const
QString
&
sipAddress
=
::
Utils
::
coreStringToAppString
(
linphoneAddress
->
asStringUriOnly
());
const
QString
sipAddress
=
::
Utils
::
coreStringToAppString
(
linphoneAddress
->
asStringUriOnly
());
if
(
mSipAddresses
.
contains
(
sipAddress
))
return
false
;
...
...
@@ -145,7 +145,7 @@ void ConferenceHelperModel::ConferenceAddModel::update () {
if
(
!
call
->
getParams
()
->
getLocalConferenceMode
())
continue
;
const
QString
&
sipAddress
=
::
Utils
::
coreStringToAppString
(
call
->
getRemoteAddress
()
->
asStringUriOnly
());
const
QString
sipAddress
=
::
Utils
::
coreStringToAppString
(
call
->
getRemoteAddress
()
->
asStringUriOnly
());
if
(
!
mSipAddresses
.
contains
(
sipAddress
))
call
->
terminate
();
}
...
...
@@ -180,7 +180,7 @@ void ConferenceHelperModel::ConferenceAddModel::handleDataChanged (
int
limit
=
bottomRight
.
row
();
for
(
int
row
=
topLeft
.
row
();
row
<=
limit
;
++
row
)
{
const
QVariantMap
&
map
=
sipAddressesModel
->
data
(
sipAddressesModel
->
index
(
row
,
0
)).
toMap
();
const
QVariantMap
map
=
sipAddressesModel
->
data
(
sipAddressesModel
->
index
(
row
,
0
)).
toMap
();
auto
it
=
mSipAddresses
.
find
(
map
[
"sipAddress"
].
toString
());
if
(
it
!=
mSipAddresses
.
end
())
{
...
...
src/components/conference/ConferenceHelperModel.cpp
View file @
8572347b
...
...
@@ -67,8 +67,8 @@ void ConferenceHelperModel::setFilter (const QString &pattern) {
// -----------------------------------------------------------------------------
bool
ConferenceHelperModel
::
filterAcceptsRow
(
int
sourceRow
,
const
QModelIndex
&
sourceParent
)
const
{
const
QModelIndex
&
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
const
QVariantMap
&
data
=
index
.
data
().
toMap
();
const
QModelIndex
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
const
QVariantMap
data
=
index
.
data
().
toMap
();
return
!
mConferenceAddModel
->
contains
(
data
[
"sipAddress"
].
toString
());
}
...
...
src/components/conference/ConferenceModel.cpp
View file @
8572347b
...
...
@@ -45,12 +45,11 @@ ConferenceModel::ConferenceModel (QObject *parent) : QSortFilterProxyModel(paren
QObject
::
connect
(
CoreManager
::
getInstance
()
->
getHandlers
().
get
(),
&
CoreHandlers
::
callStateChanged
,
this
,
[
this
]
{
emit
conferenceChanged
();
}
);
this
,
[
this
]
{
emit
conferenceChanged
();
});
}
bool
ConferenceModel
::
filterAcceptsRow
(
int
sourceRow
,
const
QModelIndex
&
sourceParent
)
const
{
const
QModelIndex
&
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
const
QModelIndex
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
const
CallModel
*
callModel
=
index
.
data
().
value
<
CallModel
*>
();
return
callModel
->
getCall
()
->
getParams
()
->
getLocalConferenceMode
();
...
...
src/components/contact/ContactModel.cpp
View file @
8572347b
...
...
@@ -108,7 +108,7 @@ void ContactModel::updateSipAddresses (VcardModel *oldVcardModel) {
for
(
const
auto
&
variantA
:
oldSipAddresses
)
{
next:
const
QString
&
sipAddress
=
variantA
.
toString
();
const
QString
sipAddress
=
variantA
.
toString
();
if
(
done
.
contains
(
sipAddress
))
continue
;
done
.
insert
(
sipAddress
);
...
...
@@ -125,7 +125,7 @@ next:
oldSipAddresses
.
clear
();
for
(
const
auto
&
variant
:
sipAddresses
)
{
const
QString
&
sipAddress
=
variant
.
toString
();
const
QString
sipAddress
=
variant
.
toString
();
if
(
done
.
contains
(
sipAddress
))
continue
;
done
.
insert
(
sipAddress
);
...
...
@@ -159,7 +159,7 @@ void ContactModel::mergeVcardModel (VcardModel *vcardModel) {
// 3. Merge address.
{
const
QVariantMap
&
oldAddress
=
vcardModel
->
getAddress
();
const
QVariantMap
oldAddress
=
vcardModel
->
getAddress
();
QVariantMap
newAddress
=
vcardModel
->
getAddress
();
static
const
char
*
attributes
[
4
]
=
{
"street"
,
"locality"
,
"postalCode"
,
"country"
};
...
...
src/components/contacts/ContactsListProxyModel.cpp
View file @
8572347b
...
...
@@ -73,7 +73,7 @@ bool ContactsListProxyModel::filterAcceptsRow (
int
sourceRow
,
const
QModelIndex
&
sourceParent
)
const
{
const
QModelIndex
&
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
const
QModelIndex
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
const
ContactModel
*
contact
=
index
.
data
().
value
<
ContactModel
*>
();
mWeights
[
contact
]
=
static_cast
<
unsigned
int
>
(
round
(
computeContactWeight
(
contact
)));
...
...
src/components/settings/AccountSettingsModel.cpp
View file @
8572347b
...
...
@@ -188,7 +188,7 @@ void AccountSettingsModel::eraseAllPasswords () {
QString
AccountSettingsModel
::
getUsername
()
const
{
shared_ptr
<
const
linphone
::
Address
>
address
=
getUsedSipAddress
();
const
string
&
displayName
=
address
->
getDisplayName
();
const
string
displayName
=
address
->
getDisplayName
();
return
::
Utils
::
coreStringToAppString
(
displayName
.
empty
()
?
address
->
getUsername
()
:
displayName
...
...
src/components/settings/SettingsModel.cpp
View file @
8572347b
...
...
@@ -589,7 +589,7 @@ void SettingsModel::setTurnPassword (const QString &password) {
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
shared_ptr
<
linphone
::
NatPolicy
>
natPolicy
=
core
->
getNatPolicy
();
const
string
&
username
=
natPolicy
->
getStunServerUsername
();
const
string
username
=
natPolicy
->
getStunServerUsername
();
shared_ptr
<
const
linphone
::
AuthInfo
>
authInfo
=
core
->
findAuthInfo
(
username
,
""
,
""
);
if
(
authInfo
)
{
...
...
src/components/sip-addresses/SipAddressesModel.cpp
View file @
8572347b
...
...
@@ -130,7 +130,7 @@ SipAddressObserver *SipAddressesModel::getSipAddressObserver (const QString &sip
mObservers
.
insert
(
sipAddress
,
model
);
QObject
::
connect
(
model
,
&
SipAddressObserver
::
destroyed
,
this
,
[
this
,
model
]()
{
const
QString
&
sipAddress
=
model
->
getSipAddress
();
const
QString
sipAddress
=
model
->
getSipAddress
();
if
(
mObservers
.
remove
(
sipAddress
,
model
)
==
0
)
qWarning
()
<<
QStringLiteral
(
"Unable to remove sip address `%1` from observers."
).
arg
(
sipAddress
);
});
...
...
@@ -255,7 +255,7 @@ void SipAddressesModel::handleSipAddressRemoved (ContactModel *contact, const QS
}
void
SipAddressesModel
::
handleMessageReceived
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
const
QString
&
sipAddress
=
::
Utils
::
coreStringToAppString
(
message
->
getFromAddress
()
->
asStringUriOnly
());
const
QString
sipAddress
=
::
Utils
::
coreStringToAppString
(
message
->
getFromAddress
()
->
asStringUriOnly
());
addOrUpdateSipAddress
(
sipAddress
,
message
);
}
...
...
@@ -459,7 +459,7 @@ void SipAddressesModel::initSipAddresses () {
// Get sip addresses from calls.
QSet
<
QString
>
addressDone
;
for
(
const
auto
&
callLog
:
core
->
getCallLogs
())
{
const
QString
&
sipAddress
=
::
Utils
::
coreStringToAppString
(
callLog
->
getRemoteAddress
()
->
asStringUriOnly
());
const
QString
sipAddress
=
::
Utils
::
coreStringToAppString
(
callLog
->
getRemoteAddress
()
->
asStringUriOnly
());
if
(
addressDone
.
contains
(
sipAddress
))
continue
;
// Already used.
...
...
src/components/sip-addresses/SipAddressesProxyModel.cpp
View file @
8572347b
...
...
@@ -51,16 +51,16 @@ void SipAddressesProxyModel::setFilter (const QString &pattern) {
// -----------------------------------------------------------------------------
bool
SipAddressesProxyModel
::
filterAcceptsRow
(
int
sourceRow
,
const
QModelIndex
&
sourceParent
)
const
{
const
QModelIndex
&
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
const
QModelIndex
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
return
computeEntryWeight
(
index
.
data
().
toMap
())
>
0
;
}
bool
SipAddressesProxyModel
::
lessThan
(
const
QModelIndex
&
left
,
const
QModelIndex
&
right
)
const
{
const
QVariantMap
&
mapA
=
sourceModel
()
->
data
(
left
).
toMap
();
const
QVariantMap
&
mapB
=
sourceModel
()
->
data
(
right
).
toMap
();
const
QVariantMap
mapA
=
sourceModel
()
->
data
(
left
).
toMap
();
const
QVariantMap
mapB
=
sourceModel
()
->
data
(
right
).
toMap
();
const
QString
&
sipAddressA
=
mapA
[
"sipAddress"
].
toString
();
const
QString
&
sipAddressB
=
mapB
[
"sipAddress"
].
toString
();
const
QString
sipAddressA
=
mapA
[
"sipAddress"
].
toString
();
const
QString
sipAddressB
=
mapB
[
"sipAddress"
].
toString
();
// TODO: Use a cache, do not compute the same value as `filterAcceptsRow`.
int
weightA
=
computeEntryWeight
(
mapA
);
...
...
src/components/timeline/TimelineModel.cpp
View file @
8572347b
...
...
@@ -42,7 +42,7 @@ QHash<int, QByteArray> TimelineModel::roleNames () const {
// -----------------------------------------------------------------------------
bool
TimelineModel
::
filterAcceptsRow
(
int
sourceRow
,
const
QModelIndex
&
sourceParent
)
const
{
const
QModelIndex
&
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
const
QModelIndex
index
=
sourceModel
()
->
index
(
sourceRow
,
0
,
sourceParent
);
return
index
.
data
().
toMap
().
contains
(
"timestamp"
);
}
...
...
src/utils/Utils.cpp
View file @
8572347b
...
...
@@ -53,8 +53,8 @@ QString Utils::getSafeFilePath (const QString &filePath, bool *soFarSoGood) {
if
(
!
info
.
exists
())
return
filePath
;
const
QString
&
prefix
=
QStringLiteral
(
"%1/%2"
).
arg
(
info
.
absolutePath
()).
arg
(
info
.
baseName
());
const
QString
&
ext
=
info
.
completeSuffix
();
const
QString
prefix
=
QStringLiteral
(
"%1/%2"
).
arg
(
info
.
absolutePath
()).
arg
(
info
.
baseName
());
const
QString
ext
=
info
.
completeSuffix
();
for
(
int
i
=
1
;
i
<
SAFE_FILE_PATH_LIMIT
;
++
i
)
{
QString
safePath
=
QStringLiteral
(
"%1 (%3).%4"
).
arg
(
prefix
).
arg
(
i
).
arg
(
ext
);
...
...
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