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
3ff2508f
Commit
3ff2508f
authored
Apr 26, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/components/assistant/AssistantModel): supports a `configFilename` property
parent
9d056093
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
126 additions
and
86 deletions
+126
-86
Logger.cpp
linphone-desktop/src/app/logger/Logger.cpp
+1
-1
Paths.cpp
linphone-desktop/src/app/paths/Paths.cpp
+60
-51
Paths.hpp
linphone-desktop/src/app/paths/Paths.hpp
+16
-15
AvatarProvider.cpp
linphone-desktop/src/app/providers/AvatarProvider.cpp
+1
-1
ThumbnailProvider.cpp
linphone-desktop/src/app/providers/ThumbnailProvider.cpp
+1
-1
AssistantModel.cpp
linphone-desktop/src/components/assistant/AssistantModel.cpp
+22
-0
AssistantModel.hpp
linphone-desktop/src/components/assistant/AssistantModel.hpp
+8
-0
ChatModel.cpp
linphone-desktop/src/components/chat/ChatModel.cpp
+2
-2
VcardModel.cpp
linphone-desktop/src/components/contact/VcardModel.cpp
+3
-3
CoreManager.cpp
linphone-desktop/src/components/core/CoreManager.cpp
+9
-9
SettingsModel.cpp
linphone-desktop/src/components/settings/SettingsModel.cpp
+2
-2
linphone
submodules/linphone
+1
-1
No files found.
linphone-desktop/src/app/logger/Logger.cpp
View file @
3ff2508f
...
...
@@ -164,7 +164,7 @@ void Logger::init () {
}
);
linphone_core_set_log_collection_path
(
Paths
::
getLogsDir
p
ath
().
c_str
());
linphone_core_set_log_collection_path
(
Paths
::
getLogsDir
P
ath
().
c_str
());
linphone_core_set_log_collection_max_file_size
(
MAX_LOGS_COLLECTION_SIZE
);
linphone_core_enable_log_collection
(
LinphoneLogCollectionEnabled
);
}
linphone-desktop/src/app/paths/Paths.cpp
View file @
3ff2508f
...
...
@@ -31,6 +31,7 @@
#include "Paths.hpp"
#include "config.h"
#define PATH_ASSISTANT_CONFIG "/assistant/"
#define PATH_AVATARS "/avatars/"
#define PATH_CAPTURES "/captures/"
#define PATH_LOGS "/logs/"
...
...
@@ -49,14 +50,14 @@ using namespace std;
// =============================================================================
inline
bool
dir
ectory
PathExists
(
const
QString
&
path
)
{
inline
bool
dirPathExists
(
const
QString
&
path
)
{
QDir
dir
(
path
);
return
dir
.
exists
();
}
inline
bool
filePathExists
(
const
QString
&
path
)
{
QFileInfo
info
(
path
);
if
(
!
dir
ectory
PathExists
(
info
.
path
()))
if
(
!
dirPathExists
(
info
.
path
()))
return
false
;
QFile
file
(
path
);
...
...
@@ -67,7 +68,7 @@ inline bool filePathExists (const string &path) {
return
filePathExists
(
Utils
::
linphoneStringToQString
(
path
));
}
inline
void
ensureDir
ectory
PathExists
(
const
QString
&
path
)
{
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
());
...
...
@@ -75,20 +76,20 @@ inline void ensureDirectoryPathExists (const QString &path) {
inline
void
ensureFilePathExists
(
const
QString
&
path
)
{
QFileInfo
info
(
path
);
ensureDir
ectory
PathExists
(
info
.
path
());
ensureDirPathExists
(
info
.
path
());
QFile
file
(
path
);
if
(
!
file
.
exists
()
&&
!
file
.
open
(
QIODevice
::
ReadWrite
))
qFatal
(
"Unable to access at path: `%s`"
,
path
.
toStdString
().
c_str
());
}
inline
string
getReadableDir
ectory
Path
(
const
QString
&
dirname
)
{
inline
string
getReadableDirPath
(
const
QString
&
dirname
)
{
return
Utils
::
qStringToLinphoneString
(
QDir
::
toNativeSeparators
(
dirname
));
}
inline
string
getWritableDir
ectory
Path
(
const
QString
&
dirname
)
{
ensureDir
ectory
PathExists
(
dirname
);
return
getReadableDir
ectory
Path
(
dirname
);
inline
string
getWritableDirPath
(
const
QString
&
dirname
)
{
ensureDirPathExists
(
dirname
);
return
getReadableDirPath
(
dirname
);
}
inline
string
getReadableFilePath
(
const
QString
&
filename
)
{
...
...
@@ -102,7 +103,7 @@ inline string getWritableFilePath (const QString &filename) {
// -----------------------------------------------------------------------------
inline
QString
getAppPackageDataDir
p
ath
()
{
inline
QString
getAppPackageDataDir
P
ath
()
{
QDir
dir
(
QCoreApplication
::
applicationDirPath
());
if
(
dir
.
dirName
()
==
"MacOS"
)
{
dir
.
cdUp
();
...
...
@@ -114,7 +115,7 @@ inline QString getAppPackageDataDirpath () {
return
dir
.
absolutePath
();
}
inline
QString
getAppPackageMsPluginsDir
p
ath
()
{
inline
QString
getAppPackageMsPluginsDir
P
ath
()
{
QDir
dir
(
QCoreApplication
::
applicationDirPath
());
if
(
dir
.
dirName
()
==
"MacOS"
)
{
dir
.
cdUp
();
...
...
@@ -126,91 +127,99 @@ inline QString getAppPackageMsPluginsDirpath () {
return
dir
.
absolutePath
();
}
inline
QString
getAppConfigFilepath
()
{
inline
QString
getAppAssistantConfigDirPath
()
{
return
getAppPackageDataDirPath
()
+
PATH_ASSISTANT_CONFIG
;
}
inline
QString
getAppConfigFilePath
()
{
if
(
QSysInfo
::
productType
()
==
"macos"
)
return
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_CONFIG
;
return
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppConfigLocation
)
+
PATH_CONFIG
;
}
inline
QString
getAppCallHistoryFile
p
ath
()
{
inline
QString
getAppCallHistoryFile
P
ath
()
{
return
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_CALL_HISTORY_LIST
;
}
inline
QString
getAppFactoryConfigFile
p
ath
()
{
return
getAppPackageDataDir
p
ath
()
+
PATH_FACTORY_CONFIG
;
inline
QString
getAppFactoryConfigFile
P
ath
()
{
return
getAppPackageDataDir
P
ath
()
+
PATH_FACTORY_CONFIG
;
}
inline
QString
getAppRootCaFile
p
ath
()
{
return
getAppPackageDataDir
p
ath
()
+
PATH_ROOT_CA
;
inline
QString
getAppRootCaFile
P
ath
()
{
return
getAppPackageDataDir
P
ath
()
+
PATH_ROOT_CA
;
}
inline
QString
getAppFriendsFile
p
ath
()
{
inline
QString
getAppFriendsFile
P
ath
()
{
return
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_FRIENDS_LIST
;
}
inline
QString
getAppMessageHistoryFile
p
ath
()
{
inline
QString
getAppMessageHistoryFile
P
ath
()
{
return
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_MESSAGE_HISTORY_LIST
;
}
// -----------------------------------------------------------------------------
string
Paths
::
getAvatarsDirpath
()
{
return
getWritableDirectoryPath
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_AVATARS
);
string
Paths
::
getAssistantConfigDirPath
()
{
return
getReadableDirPath
(
getAppAssistantConfigDirPath
());
}
string
Paths
::
getAvatarsDirPath
()
{
return
getWritableDirPath
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_AVATARS
);
}
string
Paths
::
getCallHistoryFile
p
ath
()
{
return
getWritableFilePath
(
getAppCallHistoryFile
p
ath
());
string
Paths
::
getCallHistoryFile
P
ath
()
{
return
getWritableFilePath
(
getAppCallHistoryFile
P
ath
());
}
string
Paths
::
getCapturesDir
p
ath
()
{
return
getWritableDir
ectory
Path
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_CAPTURES
);
string
Paths
::
getCapturesDir
P
ath
()
{
return
getWritableDirPath
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_CAPTURES
);
}
string
Paths
::
getConfigFile
p
ath
(
const
QString
&
configPath
)
{
string
Paths
::
getConfigFile
P
ath
(
const
QString
&
configPath
)
{
if
(
!
configPath
.
isEmpty
())
return
getWritableFilePath
(
QFileInfo
(
configPath
).
absoluteFilePath
());
return
getWritableFilePath
(
getAppConfigFile
p
ath
());
return
getWritableFilePath
(
getAppConfigFile
P
ath
());
}
string
Paths
::
getFactoryConfigFile
p
ath
()
{
return
getReadableFilePath
(
getAppFactoryConfigFile
p
ath
());
string
Paths
::
getFactoryConfigFile
P
ath
()
{
return
getReadableFilePath
(
getAppFactoryConfigFile
P
ath
());
}
string
Paths
::
getFriendsListFile
p
ath
()
{
return
getWritableFilePath
(
getAppFriendsFile
p
ath
());
string
Paths
::
getFriendsListFile
P
ath
()
{
return
getWritableFilePath
(
getAppFriendsFile
P
ath
());
}
string
Paths
::
getLogsDir
p
ath
()
{
return
getWritableDir
ectory
Path
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_LOGS
);
string
Paths
::
getLogsDir
P
ath
()
{
return
getWritableDirPath
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_LOGS
);
}
string
Paths
::
getMessageHistoryFile
p
ath
()
{
return
getWritableFilePath
(
getAppMessageHistoryFile
p
ath
());
string
Paths
::
getMessageHistoryFile
P
ath
()
{
return
getWritableFilePath
(
getAppMessageHistoryFile
P
ath
());
}
string
Paths
::
getPackageDataDir
p
ath
()
{
return
getReadableDir
ectoryPath
(
getAppPackageDataDirp
ath
());
string
Paths
::
getPackageDataDir
P
ath
()
{
return
getReadableDir
Path
(
getAppPackageDataDirP
ath
());
}
string
Paths
::
getPackageMsPluginsDir
p
ath
()
{
return
getReadableDir
ectoryPath
(
getAppPackageMsPluginsDirp
ath
());
string
Paths
::
getPackageMsPluginsDir
P
ath
()
{
return
getReadableDir
Path
(
getAppPackageMsPluginsDirP
ath
());
}
string
Paths
::
getRootCaFile
p
ath
()
{
return
getReadableFilePath
(
getAppRootCaFile
p
ath
());
string
Paths
::
getRootCaFile
P
ath
()
{
return
getReadableFilePath
(
getAppRootCaFile
P
ath
());
}
string
Paths
::
getThumbnailsDir
p
ath
()
{
return
getWritableDir
ectory
Path
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_THUMBNAILS
);
string
Paths
::
getThumbnailsDir
P
ath
()
{
return
getWritableDirPath
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_THUMBNAILS
);
}
string
Paths
::
getUserCertificatesDir
p
ath
()
{
return
getWritableDir
ectory
Path
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_USER_CERTIFICATES
);
string
Paths
::
getUserCertificatesDir
P
ath
()
{
return
getWritableDirPath
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_USER_CERTIFICATES
);
}
string
Paths
::
getZrtpSecretsFile
p
ath
()
{
string
Paths
::
getZrtpSecretsFile
P
ath
()
{
return
getWritableFilePath
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
+
PATH_ZRTP_SECRETS
);
}
...
...
@@ -218,7 +227,7 @@ string Paths::getZrtpSecretsFilepath () {
static
void
migrateFile
(
const
QString
&
oldPath
,
const
QString
&
newPath
)
{
QFileInfo
info
(
newPath
);
ensureDir
ectory
PathExists
(
info
.
path
());
ensureDirPathExists
(
info
.
path
());
if
(
QFile
::
copy
(
oldPath
,
newPath
))
{
QFile
::
remove
(
oldPath
);
...
...
@@ -230,7 +239,7 @@ static void migrateFile (const QString &oldPath, const QString &newPath) {
static
void
migrateConfigurationFile
(
const
QString
&
oldPath
,
const
QString
&
newPath
)
{
QFileInfo
info
(
newPath
);
ensureDir
ectory
PathExists
(
info
.
path
());
ensureDirPathExists
(
info
.
path
());
if
(
QFile
::
copy
(
oldPath
,
newPath
))
{
QFile
oldFile
(
oldPath
);
...
...
@@ -247,7 +256,7 @@ static void migrateConfigurationFile (const QString &oldPath, const QString &new
}
void
Paths
::
migrate
()
{
QString
newPath
=
getAppConfigFile
p
ath
();
QString
newPath
=
getAppConfigFile
P
ath
();
QString
oldBaseDir
=
QSysInfo
::
productType
()
==
"windows"
?
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppLocalDataLocation
)
:
QStandardPaths
::
writableLocation
(
QStandardPaths
::
HomeLocation
);
...
...
@@ -256,19 +265,19 @@ void Paths::migrate () {
if
(
!
filePathExists
(
newPath
)
&&
filePathExists
(
oldPath
))
migrateConfigurationFile
(
oldPath
,
newPath
);
newPath
=
getAppCallHistoryFile
p
ath
();
newPath
=
getAppCallHistoryFile
P
ath
();
oldPath
=
oldBaseDir
+
"/.linphone-call-history.db"
;
if
(
!
filePathExists
(
newPath
)
&&
filePathExists
(
oldPath
))
migrateFile
(
oldPath
,
newPath
);
newPath
=
getAppFriendsFile
p
ath
();
newPath
=
getAppFriendsFile
P
ath
();
oldPath
=
oldBaseDir
+
"/.linphone-friends.db"
;
if
(
!
filePathExists
(
newPath
)
&&
filePathExists
(
oldPath
))
migrateFile
(
oldPath
,
newPath
);
newPath
=
getAppMessageHistoryFile
p
ath
();
newPath
=
getAppMessageHistoryFile
P
ath
();
oldPath
=
oldBaseDir
+
"/.linphone-history.db"
;
if
(
!
filePathExists
(
newPath
)
&&
filePathExists
(
oldPath
))
...
...
linphone-desktop/src/app/paths/Paths.hpp
View file @
3ff2508f
...
...
@@ -30,21 +30,22 @@
// =============================================================================
namespace
Paths
{
std
::
string
getAvatarsDirpath
();
std
::
string
getCallHistoryFilepath
();
std
::
string
getCapturesDirpath
();
std
::
string
getConfigFilepath
(
const
QString
&
configPath
=
QString
());
std
::
string
getFactoryConfigFilepath
();
std
::
string
getFriendsListFilepath
();
std
::
string
getLogsDirpath
();
std
::
string
getMessageHistoryFilepath
();
std
::
string
getPackageDataDirpath
();
std
::
string
getPackageMsPluginsDirpath
();
std
::
string
getRootCaFilepath
();
std
::
string
getThumbnailsDirpath
();
std
::
string
getUserCertificatesDirpath
();
std
::
string
getZrtpDataFilepath
();
std
::
string
getZrtpSecretsFilepath
();
std
::
string
getAssistantConfigDirPath
();
std
::
string
getAvatarsDirPath
();
std
::
string
getCallHistoryFilePath
();
std
::
string
getCapturesDirPath
();
std
::
string
getConfigFilePath
(
const
QString
&
configPath
=
QString
());
std
::
string
getFactoryConfigFilePath
();
std
::
string
getFriendsListFilePath
();
std
::
string
getLogsDirPath
();
std
::
string
getMessageHistoryFilePath
();
std
::
string
getPackageDataDirPath
();
std
::
string
getPackageMsPluginsDirPath
();
std
::
string
getRootCaFilePath
();
std
::
string
getThumbnailsDirPath
();
std
::
string
getUserCertificatesDirPath
();
std
::
string
getZrtpDataFilePath
();
std
::
string
getZrtpSecretsFilePath
();
void
migrate
();
}
...
...
linphone-desktop/src/app/providers/AvatarProvider.cpp
View file @
3ff2508f
...
...
@@ -33,7 +33,7 @@ AvatarProvider::AvatarProvider () : QQuickImageProvider(
QQmlImageProviderBase
::
Image
,
QQmlImageProviderBase
::
ForceAsynchronousImageLoading
)
{
mAvatarsPath
=
Utils
::
linphoneStringToQString
(
Paths
::
getAvatarsDir
p
ath
());
mAvatarsPath
=
Utils
::
linphoneStringToQString
(
Paths
::
getAvatarsDir
P
ath
());
}
QImage
AvatarProvider
::
requestImage
(
const
QString
&
id
,
QSize
*
,
const
QSize
&
)
{
...
...
linphone-desktop/src/app/providers/ThumbnailProvider.cpp
View file @
3ff2508f
...
...
@@ -33,7 +33,7 @@ ThumbnailProvider::ThumbnailProvider () : QQuickImageProvider(
QQmlImageProviderBase
::
Image
,
QQmlImageProviderBase
::
ForceAsynchronousImageLoading
)
{
mThumbnailsPath
=
Utils
::
linphoneStringToQString
(
Paths
::
getThumbnailsDir
p
ath
());
mThumbnailsPath
=
Utils
::
linphoneStringToQString
(
Paths
::
getThumbnailsDir
P
ath
());
}
QImage
ThumbnailProvider
::
requestImage
(
const
QString
&
id
,
QSize
*
,
const
QSize
&
)
{
...
...
linphone-desktop/src/components/assistant/AssistantModel.cpp
View file @
3ff2508f
...
...
@@ -20,6 +20,7 @@
* Author: Ronan Abhamon
*/
#include "../../app/paths/Paths.hpp"
#include "../../Utils.hpp"
#include "../core/CoreManager.hpp"
...
...
@@ -287,6 +288,27 @@ void AssistantModel::setDisplayName (const QString &displayName) {
// -----------------------------------------------------------------------------
QString
AssistantModel
::
getConfigFilename
()
const
{
return
mConfigFilename
;
}
void
AssistantModel
::
setConfigFilename
(
const
QString
&
configFilename
)
{
mConfigFilename
=
configFilename
;
QString
configPath
=
::
Utils
::
linphoneStringToQString
(
Paths
::
getAssistantConfigDirPath
())
+
configFilename
;
qInfo
()
<<
QStringLiteral
(
"Set config on assistant: `%1`."
).
arg
(
configPath
);
CoreManager
::
getInstance
()
->
getCore
()
->
getConfig
()
->
loadFromXmlFile
(
::
Utils
::
qStringToLinphoneString
(
configPath
),
nullptr
,
nullptr
);
emit
configFilenameChanged
(
configFilename
);
}
// -----------------------------------------------------------------------------
QString
AssistantModel
::
mapAccountCreatorUsernameStatusToString
(
linphone
::
AccountCreatorUsernameStatus
status
)
const
{
shared_ptr
<
linphone
::
Config
>
config
=
CoreManager
::
getInstance
()
->
getCore
()
->
getConfig
();
QString
error
;
...
...
linphone-desktop/src/components/assistant/AssistantModel.hpp
View file @
3ff2508f
...
...
@@ -38,6 +38,7 @@ class AssistantModel : public QObject {
Q_PROPERTY
(
QString
phoneNumber
READ
getPhoneNumber
WRITE
setPhoneNumber
NOTIFY
phoneNumberChanged
);
Q_PROPERTY
(
QString
username
READ
getUsername
WRITE
setUsername
NOTIFY
usernameChanged
);
Q_PROPERTY
(
QString
displayName
READ
getDisplayName
WRITE
setDisplayName
NOTIFY
displayNameChanged
);
Q_PROPERTY
(
QString
configFilename
READ
getConfigFilename
WRITE
setConfigFilename
NOTIFY
configFilenameChanged
);
public:
AssistantModel
(
QObject
*
parent
=
Q_NULLPTR
);
...
...
@@ -59,6 +60,8 @@ signals:
void
createStatusChanged
(
const
QString
&
error
);
void
loginStatusChanged
(
const
QString
&
error
);
void
configFilenameChanged
(
const
QString
&
configFilename
);
private:
QString
getEmail
()
const
;
void
setEmail
(
const
QString
&
email
);
...
...
@@ -75,8 +78,13 @@ private:
QString
getDisplayName
()
const
;
void
setDisplayName
(
const
QString
&
displayName
);
QString
getConfigFilename
()
const
;
void
setConfigFilename
(
const
QString
&
configFilename
);
QString
mapAccountCreatorUsernameStatusToString
(
linphone
::
AccountCreatorUsernameStatus
status
)
const
;
QString
mConfigFilename
;
std
::
shared_ptr
<
linphone
::
AccountCreator
>
mAccountCreator
;
std
::
shared_ptr
<
Handlers
>
mHandlers
;
};
...
...
linphone-desktop/src/components/chat/ChatModel.cpp
View file @
3ff2508f
...
...
@@ -73,7 +73,7 @@ inline void createThumbnail (const shared_ptr<linphone::ChatMessage> &message) {
QString
uuid
=
QUuid
::
createUuid
().
toString
();
QString
fileId
=
QStringLiteral
(
"%1.jpg"
).
arg
(
uuid
.
mid
(
1
,
uuid
.
length
()
-
2
));
if
(
!
thumbnail
.
save
(
::
Utils
::
linphoneStringToQString
(
Paths
::
getThumbnailsDir
p
ath
())
+
fileId
,
"jpg"
,
100
))
{
if
(
!
thumbnail
.
save
(
::
Utils
::
linphoneStringToQString
(
Paths
::
getThumbnailsDir
P
ath
())
+
fileId
,
"jpg"
,
100
))
{
qWarning
()
<<
QStringLiteral
(
"Unable to create thumbnail of: `%1`."
).
arg
(
thumbnailPath
);
return
;
}
...
...
@@ -87,7 +87,7 @@ inline void removeFileMessageThumbnail (const shared_ptr<linphone::ChatMessage>
string
fileId
=
message
->
getAppdata
();
if
(
!
fileId
.
empty
())
{
QString
thumbnailPath
=
::
Utils
::
linphoneStringToQString
(
Paths
::
getThumbnailsDir
p
ath
()
+
fileId
);
QString
thumbnailPath
=
::
Utils
::
linphoneStringToQString
(
Paths
::
getThumbnailsDir
P
ath
()
+
fileId
);
if
(
!
QFile
::
remove
(
thumbnailPath
))
qWarning
()
<<
QStringLiteral
(
"Unable to remove `%1`."
).
arg
(
thumbnailPath
);
}
...
...
linphone-desktop/src/components/contact/VcardModel.cpp
View file @
3ff2508f
...
...
@@ -80,7 +80,7 @@ VcardModel::~VcardModel () {
QString
imagePath
(
::
Utils
::
linphoneStringToQString
(
Paths
::
getAvatarsDir
p
ath
()
+
Paths
::
getAvatarsDir
P
ath
()
+
photo
->
getValue
().
substr
(
sizeof
(
VCARD_SCHEME
)
-
1
)
)
);
...
...
@@ -134,7 +134,7 @@ bool VcardModel::setAvatar (const QString &path) {
.
arg
(
uuid
.
mid
(
1
,
uuid
.
length
()
-
2
))
// Remove `{}`.
.
arg
(
info
.
suffix
());
QString
dest
=
::
Utils
::
linphoneStringToQString
(
Paths
::
getAvatarsDir
p
ath
())
+
fileId
;
QString
dest
=
::
Utils
::
linphoneStringToQString
(
Paths
::
getAvatarsDir
P
ath
())
+
fileId
;
if
(
!
file
.
copy
(
dest
))
return
false
;
...
...
@@ -150,7 +150,7 @@ bool VcardModel::setAvatar (const QString &path) {
if
(
oldPhoto
)
{
QString
imagePath
(
::
Utils
::
linphoneStringToQString
(
Paths
::
getAvatarsDir
p
ath
()
+
oldPhoto
->
getValue
().
substr
(
sizeof
(
VCARD_SCHEME
)
-
1
)
Paths
::
getAvatarsDir
P
ath
()
+
oldPhoto
->
getValue
().
substr
(
sizeof
(
VCARD_SCHEME
)
-
1
)
)
);
...
...
linphone-desktop/src/components/core/CoreManager.cpp
View file @
3ff2508f
...
...
@@ -87,26 +87,26 @@ void CoreManager::forceRefreshRegisters () {
// -----------------------------------------------------------------------------
void
CoreManager
::
setDatabasesPaths
()
{
mCore
->
setFriendsDatabasePath
(
Paths
::
getFriendsListFile
p
ath
());
mCore
->
setCallLogsDatabasePath
(
Paths
::
getCallHistoryFile
p
ath
());
mCore
->
setChatDatabasePath
(
Paths
::
getMessageHistoryFile
p
ath
());
mCore
->
setFriendsDatabasePath
(
Paths
::
getFriendsListFile
P
ath
());
mCore
->
setCallLogsDatabasePath
(
Paths
::
getCallHistoryFile
P
ath
());
mCore
->
setChatDatabasePath
(
Paths
::
getMessageHistoryFile
P
ath
());
}
void
CoreManager
::
setOtherPaths
()
{
if
(
mCore
->
getZrtpSecretsFile
().
empty
())
mCore
->
setZrtpSecretsFile
(
Paths
::
getZrtpSecretsFile
p
ath
());
mCore
->
setZrtpSecretsFile
(
Paths
::
getZrtpSecretsFile
P
ath
());
if
(
mCore
->
getUserCertificatesPath
().
empty
())
mCore
->
setUserCertificatesPath
(
Paths
::
getUserCertificatesDir
p
ath
());
mCore
->
setUserCertificatesPath
(
Paths
::
getUserCertificatesDir
P
ath
());
if
(
mCore
->
getRootCa
().
empty
())
mCore
->
setRootCa
(
Paths
::
getRootCaFile
p
ath
());
mCore
->
setRootCa
(
Paths
::
getRootCaFile
P
ath
());
}
void
CoreManager
::
setResourcesPaths
()
{
shared_ptr
<
linphone
::
Factory
>
factory
=
linphone
::
Factory
::
get
();
factory
->
setMspluginsDir
(
Paths
::
getPackageMsPluginsDir
p
ath
());
factory
->
setTopResourcesDir
(
Paths
::
getPackageDataDir
p
ath
());
factory
->
setMspluginsDir
(
Paths
::
getPackageMsPluginsDir
P
ath
());
factory
->
setTopResourcesDir
(
Paths
::
getPackageDataDir
P
ath
());
}
// -----------------------------------------------------------------------------
...
...
@@ -119,7 +119,7 @@ void CoreManager::createLinphoneCore (const QString &configPath) {
setResourcesPaths
();
mCore
=
linphone
::
Factory
::
get
()
->
createCore
(
mHandlers
,
Paths
::
getConfigFile
path
(
configPath
),
Paths
::
getFactoryConfigFilep
ath
());
mCore
=
linphone
::
Factory
::
get
()
->
createCore
(
mHandlers
,
Paths
::
getConfigFile
Path
(
configPath
),
Paths
::
getFactoryConfigFileP
ath
());
mCore
->
setVideoDisplayFilter
(
"MSOGL"
);
mCore
->
usePreviewWindow
(
true
);
...
...
linphone-desktop/src/components/settings/SettingsModel.cpp
View file @
3ff2508f
...
...
@@ -617,7 +617,7 @@ void SettingsModel::setDscpVideo (int dscp) {
QString
SettingsModel
::
getSavedScreenshotsFolder
()
const
{
return
QDir
::
cleanPath
(
::
Utils
::
linphoneStringToQString
(
mConfig
->
getString
(
UI_SECTION
,
"saved_screenshots_folder"
,
Paths
::
getCapturesDir
p
ath
())
mConfig
->
getString
(
UI_SECTION
,
"saved_screenshots_folder"
,
Paths
::
getCapturesDir
P
ath
())
)
)
+
QDir
::
separator
();
}
...
...
@@ -634,7 +634,7 @@ void SettingsModel::setSavedScreenshotsFolder (const QString &folder) {
QString
SettingsModel
::
getSavedVideosFolder
()
const
{
return
QDir
::
cleanPath
(
::
Utils
::
linphoneStringToQString
(
mConfig
->
getString
(
UI_SECTION
,
"saved_videos_folder"
,
Paths
::
getCapturesDir
p
ath
())
mConfig
->
getString
(
UI_SECTION
,
"saved_videos_folder"
,
Paths
::
getCapturesDir
P
ath
())
)
)
+
QDir
::
separator
();
}
...
...
linphone
@
fa2dad63
Subproject commit
b3df86baf28d846a98b19983a6b28cb93ad9bdb7
Subproject commit
fa2dad63d40078b423bfd9c2a56c59a606e81ed5
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