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
20d06c58
Commit
20d06c58
authored
Aug 25, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(app): use static inline
parent
fca63cdf
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
45 additions
and
45 deletions
+45
-45
App.cpp
src/app/App.cpp
+4
-4
Logger.cpp
src/app/logger/Logger.cpp
+1
-1
Paths.cpp
src/app/paths/Paths.cpp
+19
-19
CallModel.cpp
src/components/call/CallModel.cpp
+1
-1
CallsListModel.cpp
src/components/calls/CallsListModel.cpp
+3
-3
ChatModel.cpp
src/components/chat/ChatModel.cpp
+6
-6
AbstractCodecsModel.cpp
src/components/codecs/AbstractCodecsModel.cpp
+1
-1
VcardModel.cpp
src/components/contact/VcardModel.cpp
+5
-5
Colors.cpp
src/components/other/colors/Colors.cpp
+1
-1
OwnPresenceModel.cpp
src/components/presence/OwnPresenceModel.cpp
+1
-1
AccountSettingsModel.cpp
src/components/settings/AccountSettingsModel.cpp
+1
-1
SettingsModel.cpp
src/components/settings/SettingsModel.cpp
+2
-2
No files found.
src/app/App.cpp
View file @
20d06c58
...
...
@@ -61,11 +61,11 @@ using namespace std;
// =============================================================================
inline
bool
installLocale
(
App
&
app
,
QTranslator
&
translator
,
const
QLocale
&
locale
)
{
static
inline
bool
installLocale
(
App
&
app
,
QTranslator
&
translator
,
const
QLocale
&
locale
)
{
return
translator
.
load
(
locale
,
LANGUAGES_PATH
)
&&
app
.
installTranslator
(
&
translator
);
}
inline
shared_ptr
<
linphone
::
Config
>
getConfigIfExists
(
const
QCommandLineParser
&
parser
)
{
static
inline
shared_ptr
<
linphone
::
Config
>
getConfigIfExists
(
const
QCommandLineParser
&
parser
)
{
string
configPath
=
Paths
::
getConfigFilePath
(
parser
.
value
(
"config"
),
false
);
if
(
Paths
::
filePathExists
(
configPath
))
return
linphone
::
Config
::
newWithFactory
(
configPath
,
""
);
...
...
@@ -114,7 +114,7 @@ App::~App () {
// -----------------------------------------------------------------------------
inline
QQuickWindow
*
createSubWindow
(
QQmlApplicationEngine
*
engine
,
const
char
*
path
)
{
static
QQuickWindow
*
createSubWindow
(
QQmlApplicationEngine
*
engine
,
const
char
*
path
)
{
QQmlComponent
component
(
engine
,
QUrl
(
path
));
if
(
component
.
isError
())
{
qWarning
()
<<
component
.
errors
();
...
...
@@ -130,7 +130,7 @@ inline QQuickWindow *createSubWindow (QQmlApplicationEngine *engine, const char
// -----------------------------------------------------------------------------
inline
void
activeSplashScreen
(
QQmlApplicationEngine
*
engine
)
{
static
void
activeSplashScreen
(
QQmlApplicationEngine
*
engine
)
{
qInfo
()
<<
QStringLiteral
(
"Open splash screen..."
);
QQuickWindow
*
splashScreen
=
::
createSubWindow
(
engine
,
QML_VIEW_SPLASH_SCREEN
);
QObject
::
connect
(
CoreManager
::
getInstance
()
->
getHandlers
().
get
(),
&
CoreHandlers
::
coreStarted
,
splashScreen
,
[
splashScreen
]
{
...
...
src/app/logger/Logger.cpp
View file @
20d06c58
...
...
@@ -62,7 +62,7 @@ Logger *Logger::mInstance = nullptr;
// -----------------------------------------------------------------------------
inline
QByteArray
getFormattedCurrentTime
()
{
static
inline
QByteArray
getFormattedCurrentTime
()
{
return
QDateTime
::
currentDateTime
().
toString
(
"HH:mm:ss:zzz"
).
toLocal8Bit
();
}
...
...
src/app/paths/Paths.cpp
View file @
20d06c58
...
...
@@ -52,12 +52,12 @@ using namespace std;
// =============================================================================
inline
bool
dirPathExists
(
const
QString
&
path
)
{
static
inline
bool
dirPathExists
(
const
QString
&
path
)
{
QDir
dir
(
path
);
return
dir
.
exists
();
}
inline
bool
filePathExists
(
const
QString
&
path
)
{
static
inline
bool
filePathExists
(
const
QString
&
path
)
{
QFileInfo
info
(
path
);
if
(
!::
dirPathExists
(
info
.
path
()))
return
false
;
...
...
@@ -66,13 +66,13 @@ inline bool filePathExists (const QString &path) {
return
file
.
exists
();
}
inline
void
ensureDirPathExists
(
const
QString
&
path
)
{
static
inline
void
ensureDirPathExists
(
const
QString
&
path
)
{
QDir
dir
(
path
);
if
(
!
dir
.
exists
()
&&
!
dir
.
mkpath
(
path
))
qFatal
(
"Unable to access at directory: `%s`"
,
path
.
toStdString
().
c_str
());
}
inline
void
ensureFilePathExists
(
const
QString
&
path
)
{
static
inline
void
ensureFilePathExists
(
const
QString
&
path
)
{
QFileInfo
info
(
path
);
::
ensureDirPathExists
(
info
.
path
());
...
...
@@ -81,27 +81,27 @@ inline void ensureFilePathExists (const QString &path) {
qFatal
(
"Unable to access at path: `%s`"
,
path
.
toStdString
().
c_str
());
}
inline
string
getReadableDirPath
(
const
QString
&
dirname
)
{
static
inline
string
getReadableDirPath
(
const
QString
&
dirname
)
{
return
::
Utils
::
appStringToCoreString
(
QDir
::
toNativeSeparators
(
dirname
));
}
inline
string
getWritableDirPath
(
const
QString
&
dirname
)
{
static
inline
string
getWritableDirPath
(
const
QString
&
dirname
)
{
::
ensureDirPathExists
(
dirname
);
return
::
getReadableDirPath
(
dirname
);
}
inline
string
getReadableFilePath
(
const
QString
&
filename
)
{
static
inline
string
getReadableFilePath
(
const
QString
&
filename
)
{
return
::
Utils
::
appStringToCoreString
(
QDir
::
toNativeSeparators
(
filename
));
}
inline
string
getWritableFilePath
(
const
QString
&
filename
)
{
static
inline
string
getWritableFilePath
(
const
QString
&
filename
)
{
::
ensureFilePathExists
(
filename
);
return
::
getReadableFilePath
(
filename
);
}
// -----------------------------------------------------------------------------
inline
QDir
getAppPackageDir
()
{
static
inline
QDir
getAppPackageDir
()
{
QDir
dir
(
QCoreApplication
::
applicationDirPath
());
if
(
dir
.
dirName
()
==
"MacOS"
)
{
dir
.
cdUp
();
...
...
@@ -111,47 +111,47 @@ inline QDir getAppPackageDir () {
return
dir
;
}
inline
QString
getAppPackageDataDirPath
()
{
static
inline
QString
getAppPackageDataDirPath
()
{
QDir
dir
=
::
getAppPackageDir
();
dir
.
cd
(
"share"
);
return
dir
.
absolutePath
();
}
inline
QString
getAppPackageMsPluginsDirPath
()
{
static
inline
QString
getAppPackageMsPluginsDirPath
()
{
QDir
dir
=
::
getAppPackageDir
();
dir
.
cd
(
MSPLUGINS_DIR
);
return
dir
.
absolutePath
();
}
inline
QString
getAppAssistantConfigDirPath
()
{
static
inline
QString
getAppAssistantConfigDirPath
()
{
return
::
getAppPackageDataDirPath
()
+
PATH_ASSISTANT_CONFIG
;
}
inline
QString
getAppConfigFilePath
()
{
static
inline
QString
getAppConfigFilePath
()
{
return
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppConfigLocation
)
+
PATH_CONFIG
;
}
inline
QString
getAppCallHistoryFilePath
()
{
static
inline
QString
getAppCallHistoryFilePath
()
{
return
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_CALL_HISTORY_LIST
;
}
inline
QString
getAppFactoryConfigFilePath
()
{
static
inline
QString
getAppFactoryConfigFilePath
()
{
return
::
getAppPackageDataDirPath
()
+
PATH_FACTORY_CONFIG
;
}
inline
QString
getAppPluginsDirPath
()
{
static
inline
QString
getAppPluginsDirPath
()
{
return
::
getAppPackageDataDirPath
()
+
PATH_PLUGINS
;
}
inline
QString
getAppRootCaFilePath
()
{
static
inline
QString
getAppRootCaFilePath
()
{
return
::
getAppPackageDataDirPath
()
+
PATH_ROOT_CA
;
}
inline
QString
getAppFriendsFilePath
()
{
static
inline
QString
getAppFriendsFilePath
()
{
return
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_FRIENDS_LIST
;
}
inline
QString
getAppMessageHistoryFilePath
()
{
static
inline
QString
getAppMessageHistoryFilePath
()
{
return
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_MESSAGE_HISTORY_LIST
;
}
...
...
src/components/call/CallModel.cpp
View file @
20d06c58
...
...
@@ -589,7 +589,7 @@ QVariantList CallModel::getVideoStats () const {
// -----------------------------------------------------------------------------
inline
QVariantMap
createStat
(
const
QString
&
key
,
const
QString
&
value
)
{
static
inline
QVariantMap
createStat
(
const
QString
&
key
,
const
QString
&
value
)
{
QVariantMap
m
;
m
[
"key"
]
=
key
;
m
[
"value"
]
=
value
;
...
...
src/components/calls/CallsListModel.cpp
View file @
20d06c58
...
...
@@ -37,7 +37,7 @@ using namespace std;
// =============================================================================
inline
int
findCallIndex
(
QList
<
CallModel
*>
&
list
,
const
shared_ptr
<
linphone
::
Call
>
&
call
)
{
static
inline
int
findCallIndex
(
QList
<
CallModel
*>
&
list
,
const
shared_ptr
<
linphone
::
Call
>
&
call
)
{
auto
it
=
find_if
(
list
.
begin
(),
list
.
end
(),
[
call
](
CallModel
*
callModel
)
{
return
call
==
callModel
->
getCall
();
});
...
...
@@ -47,7 +47,7 @@ inline int findCallIndex (QList<CallModel *> &list, const shared_ptr<linphone::C
return
static_cast
<
int
>
(
distance
(
list
.
begin
(),
it
));
}
inline
int
findCallIndex
(
QList
<
CallModel
*>
&
list
,
const
CallModel
&
callModel
)
{
static
inline
int
findCallIndex
(
QList
<
CallModel
*>
&
list
,
const
CallModel
&
callModel
)
{
return
::
findCallIndex
(
list
,
callModel
.
getCall
());
}
...
...
@@ -143,7 +143,7 @@ void CallsListModel::terminateAllCalls () const {
// -----------------------------------------------------------------------------
inline
void
joinConference
(
const
shared_ptr
<
linphone
::
Call
>
&
call
)
{
static
void
joinConference
(
const
shared_ptr
<
linphone
::
Call
>
&
call
)
{
if
(
call
->
getToHeader
(
"method"
)
!=
"join-conference"
)
return
;
...
...
src/components/chat/ChatModel.cpp
View file @
20d06c58
...
...
@@ -53,27 +53,27 @@ using namespace std;
// =============================================================================
inline
QString
getFileId
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
static
inline
QString
getFileId
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
return
::
Utils
::
coreStringToAppString
(
message
->
getAppdata
()).
section
(
':'
,
0
,
0
);
}
inline
QString
getDownloadPath
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
static
inline
QString
getDownloadPath
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
return
::
Utils
::
coreStringToAppString
(
message
->
getAppdata
()).
section
(
':'
,
1
);
}
inline
bool
fileWasDownloaded
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
static
inline
bool
fileWasDownloaded
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
const
QString
path
=
::
getDownloadPath
(
message
);
return
!
path
.
isEmpty
()
&&
QFileInfo
(
path
).
isFile
();
}
inline
void
fillThumbnailProperty
(
QVariantMap
&
dest
,
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
static
inline
void
fillThumbnailProperty
(
QVariantMap
&
dest
,
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
QString
fileId
=
::
getFileId
(
message
);
if
(
!
fileId
.
isEmpty
()
&&
!
dest
.
contains
(
"thumbnail"
))
dest
[
"thumbnail"
]
=
QStringLiteral
(
"image://%1/%2"
)
.
arg
(
ThumbnailProvider
::
PROVIDER_ID
).
arg
(
fileId
);
}
inline
void
createThumbnail
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
static
inline
void
createThumbnail
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
if
(
!
message
->
getAppdata
().
empty
())
return
;
...
...
@@ -117,7 +117,7 @@ inline void createThumbnail (const shared_ptr<linphone::ChatMessage> &message) {
message
->
setAppdata
(
::
Utils
::
appStringToCoreString
(
fileId
));
}
inline
void
removeFileMessageThumbnail
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
static
inline
void
removeFileMessageThumbnail
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
if
(
message
&&
message
->
getFileTransferInformation
())
{
message
->
cancelFileTransfer
();
...
...
src/components/codecs/AbstractCodecsModel.cpp
View file @
20d06c58
...
...
@@ -29,7 +29,7 @@ using namespace std;
// =============================================================================
inline
shared_ptr
<
linphone
::
PayloadType
>
getCodecFromMap
(
const
QVariantMap
&
map
)
{
static
inline
shared_ptr
<
linphone
::
PayloadType
>
getCodecFromMap
(
const
QVariantMap
&
map
)
{
return
map
.
value
(
"__codec"
).
value
<
shared_ptr
<
linphone
::
PayloadType
>
>
();
}
...
...
src/components/contact/VcardModel.cpp
View file @
20d06c58
...
...
@@ -42,7 +42,7 @@ using namespace std;
// =============================================================================
template
<
class
T
>
inline
shared_ptr
<
T
>
findBelCardValue
(
const
list
<
shared_ptr
<
T
>
>
&
list
,
const
string
&
value
)
{
static
inline
shared_ptr
<
T
>
findBelCardValue
(
const
list
<
shared_ptr
<
T
>
>
&
list
,
const
string
&
value
)
{
auto
it
=
find_if
(
list
.
cbegin
(),
list
.
cend
(),
[
&
value
](
const
shared_ptr
<
T
>
&
entry
)
{
return
value
==
entry
->
getValue
();
});
...
...
@@ -51,11 +51,11 @@ inline shared_ptr<T> findBelCardValue (const list<shared_ptr<T> > &list, const s
}
template
<
class
T
>
inline
shared_ptr
<
T
>
findBelCardValue
(
const
list
<
shared_ptr
<
T
>
>
&
list
,
const
QString
&
value
)
{
static
inline
shared_ptr
<
T
>
findBelCardValue
(
const
list
<
shared_ptr
<
T
>
>
&
list
,
const
QString
&
value
)
{
return
::
findBelCardValue
(
list
,
::
Utils
::
appStringToCoreString
(
value
));
}
inline
bool
isLinphoneDesktopPhoto
(
const
shared_ptr
<
belcard
::
BelCardPhoto
>
&
photo
)
{
static
inline
bool
isLinphoneDesktopPhoto
(
const
shared_ptr
<
belcard
::
BelCardPhoto
>
&
photo
)
{
return
!
photo
->
getValue
().
compare
(
0
,
sizeof
(
VCARD_SCHEME
)
-
1
,
VCARD_SCHEME
);
}
...
...
@@ -126,7 +126,7 @@ QString VcardModel::getAvatar () const {
);
}
inline
QString
getFileIdFromAppPath
(
const
QString
&
path
)
{
static
inline
QString
getFileIdFromAppPath
(
const
QString
&
path
)
{
const
static
QString
appPrefix
=
QStringLiteral
(
"image://%1/"
).
arg
(
AvatarProvider
::
PROVIDER_ID
);
return
path
.
mid
(
appPrefix
.
length
());
}
...
...
@@ -202,7 +202,7 @@ void VcardModel::setUsername (const QString &username) {
// -----------------------------------------------------------------------------
inline
shared_ptr
<
belcard
::
BelCardAddress
>
getOrCreateBelCardAddress
(
shared_ptr
<
belcard
::
BelCard
>
belcard
)
{
static
inline
shared_ptr
<
belcard
::
BelCardAddress
>
getOrCreateBelCardAddress
(
shared_ptr
<
belcard
::
BelCard
>
belcard
)
{
list
<
shared_ptr
<
belcard
::
BelCardAddress
>
>
addresses
=
belcard
->
getAddresses
();
shared_ptr
<
belcard
::
BelCardAddress
>
address
;
...
...
src/components/other/colors/Colors.cpp
View file @
20d06c58
...
...
@@ -38,7 +38,7 @@ using namespace std;
#if LINPHONE_FRIDAY
inline
bool
isLinphoneFriday
()
{
static
inline
bool
isLinphoneFriday
()
{
return
QDate
::
currentDate
().
dayOfWeek
()
==
5
;
}
...
...
src/components/presence/OwnPresenceModel.cpp
View file @
20d06c58
...
...
@@ -45,7 +45,7 @@ void OwnPresenceModel::setPresenceStatus (Presence::PresenceStatus status) {
// -----------------------------------------------------------------------------
inline
void
addBuildStatus
(
QVariantList
&
list
,
Presence
::
PresenceStatus
status
)
{
static
inline
void
addBuildStatus
(
QVariantList
&
list
,
Presence
::
PresenceStatus
status
)
{
Presence
::
PresenceLevel
level
=
Presence
::
getPresenceLevel
(
status
);
QVariantMap
map
;
...
...
src/components/settings/AccountSettingsModel.cpp
View file @
20d06c58
...
...
@@ -30,7 +30,7 @@ using namespace std;
// =============================================================================
inline
AccountSettingsModel
::
RegistrationState
mapLinphoneRegistrationStateToUi
(
linphone
::
RegistrationState
state
)
{
static
inline
AccountSettingsModel
::
RegistrationState
mapLinphoneRegistrationStateToUi
(
linphone
::
RegistrationState
state
)
{
switch
(
state
)
{
case
linphone
:
:
RegistrationStateNone
:
case
linphone
:
:
RegistrationStateCleared
:
...
...
src/components/settings/SettingsModel.cpp
View file @
20d06c58
...
...
@@ -200,7 +200,7 @@ void SettingsModel::setVideoFramerate (int framerate) {
// -----------------------------------------------------------------------------
inline
QVariantMap
createMapFromVideoDefinition
(
const
shared_ptr
<
const
linphone
::
VideoDefinition
>
&
definition
)
{
static
inline
QVariantMap
createMapFromVideoDefinition
(
const
shared_ptr
<
const
linphone
::
VideoDefinition
>
&
definition
)
{
QVariantMap
map
;
if
(
!
definition
)
{
...
...
@@ -298,7 +298,7 @@ bool SettingsModel::getLimeIsSupported () const {
// -----------------------------------------------------------------------------
inline
QVariant
buildEncryptionDescription
(
SettingsModel
::
MediaEncryption
encryption
,
const
char
*
description
)
{
static
inline
QVariant
buildEncryptionDescription
(
SettingsModel
::
MediaEncryption
encryption
,
const
char
*
description
)
{
return
QVariantList
()
<<
encryption
<<
description
;
}
...
...
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