diff --git a/linphone-app/src/app/paths/Paths.cpp b/linphone-app/src/app/paths/Paths.cpp index d735977bb..47abe5c85 100644 --- a/linphone-app/src/app/paths/Paths.cpp +++ b/linphone-app/src/app/paths/Paths.cpp @@ -28,6 +28,7 @@ #include "utils/Utils.hpp" #include "utils/Constants.hpp" +#include "components/settings/SettingsModel.hpp" #include "Paths.hpp" @@ -248,7 +249,10 @@ string Paths::getFriendsListFilePath () { } string Paths::getDownloadDirPath () { - return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + QDir::separator()); + if( SettingsModel:: getVfsEncrypted()) + return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)+ Constants::PathVfs); + else + return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + QDir::separator()); } std::string Paths::getLimeDatabasePath (){ diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.cpp b/linphone-app/src/components/chat-room/ChatRoomModel.cpp index 3066475bb..f8b5bb6a8 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.cpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.cpp @@ -836,7 +836,7 @@ void ChatRoomModel::updateNewMessageNotice(const int& count){ int ChatRoomModel::loadTillMessage(ChatMessageModel * message){ if( message){ auto linphoneMessage = message->getChatMessage(); - return loadTillMessage(message); + return loadTillMessage(linphoneMessage); }else return -1; } @@ -1140,7 +1140,7 @@ void ChatRoomModel::handleCallCreated(const shared_ptr &call){ } void ChatRoomModel::handlePresenceStatusReceived(std::shared_ptr contact){ - if(!mDeleteChatRoom && contact){ + if(!mDeleteChatRoom && contact && mChatRoom){ bool canUpdatePresence = false; auto contactAddresses = contact->getAddresses(); for( auto itContactAddress = contactAddresses.begin() ; !canUpdatePresence && itContactAddress != contactAddresses.end() ; ++itContactAddress){ diff --git a/linphone-app/src/components/participant/ParticipantListModel.cpp b/linphone-app/src/components/participant/ParticipantListModel.cpp index 57472043e..471bee422 100644 --- a/linphone-app/src/components/participant/ParticipantListModel.cpp +++ b/linphone-app/src/components/participant/ParticipantListModel.cpp @@ -97,7 +97,8 @@ QString ParticipantListModel::addressesToString()const{ txt << Utils::toDisplayString(Utils::coreStringToAppString(address->asStringUriOnly()), CoreManager::getInstance()->getSettingsModel()->getSipDisplayMode()); } } - txt.removeFirst();// Remove me + if( txt.size() > 0) + txt.removeFirst();// Remove me return txt.join(", "); } @@ -111,7 +112,8 @@ QString ParticipantListModel::displayNamesToString()const{ txt << displayName; } } - txt.removeFirst();// Remove me + if(txt.size() > 0) + txt.removeFirst();// Remove me return txt.join(", "); } @@ -124,7 +126,8 @@ QString ParticipantListModel::usernamesToString()const{ username = participant->getAddress()->getUsername(); txt << Utils::coreStringToAppString(username); } - txt.removeFirst();// Remove me + if(txt.size() > 0) + txt.removeFirst();// Remove me return txt.join(", "); } diff --git a/linphone-app/src/components/settings/SettingsModel.cpp b/linphone-app/src/components/settings/SettingsModel.cpp index 7b501c0be..77db908db 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -2005,6 +2005,8 @@ void SettingsModel::setVfsEncrypted (bool encrypted, const bool deleteUserData){ if(getVfsEncrypted() != encrypted){ if(encrypted) { mVfsUtils.newEncryptionKeyAsync(); + shared_ptr factory = linphone::Factory::get(); + factory->setDownloadDir(Utils::appStringToCoreString(getDownloadFolder())); }else{// Remove key, stop core, delete data and initiate reboot mVfsUtils.needToDeleteUserData(deleteUserData); mVfsUtils.deleteKey(mVfsUtils.getApplicationVfsEncryptionKey()); diff --git a/linphone-app/src/components/settings/SettingsModel.hpp b/linphone-app/src/components/settings/SettingsModel.hpp index 239b7b9d8..1da75a493 100644 --- a/linphone-app/src/components/settings/SettingsModel.hpp +++ b/linphone-app/src/components/settings/SettingsModel.hpp @@ -683,7 +683,7 @@ public: QString getLogsEmail () const; void setLogsEmail (const QString &email); - bool getVfsEncrypted (); + static bool getVfsEncrypted (); Q_INVOKABLE void setVfsEncrypted (bool encrypted, const bool deleteUserData); Q_INVOKABLE bool isLdapAvailable(); diff --git a/linphone-app/src/utils/Constants.cpp b/linphone-app/src/utils/Constants.cpp index 6e929af76..5ae225db2 100644 --- a/linphone-app/src/utils/Constants.cpp +++ b/linphone-app/src/utils/Constants.cpp @@ -58,6 +58,7 @@ constexpr char Constants::PathRootCa[]; constexpr char Constants::PathFriendsList[]; constexpr char Constants::PathLimeDatabase[]; constexpr char Constants::PathMessageHistoryList[]; +constexpr char Constants::PathVfs[]; constexpr char Constants::PathZrtpSecrets[]; constexpr char Constants::PathISpellDicts[]; constexpr char Constants::PathISpellOwnDict[]; diff --git a/linphone-app/src/utils/Constants.hpp b/linphone-app/src/utils/Constants.hpp index 2d14ebb35..d79ea2bc8 100644 --- a/linphone-app/src/utils/Constants.hpp +++ b/linphone-app/src/utils/Constants.hpp @@ -126,6 +126,7 @@ public: static constexpr char PathData[] = "/" EXECUTABLE_NAME; static constexpr char PathTools[] = "/tools/"; static constexpr char PathLogs[] = "/logs/"; + static constexpr char PathVfs[] = "/vfs/"; #ifdef APPLE static constexpr char PathPlugins[] = "/Plugins/"; #else diff --git a/linphone-app/ui/modules/Linphone/Dialog/SipAddressDialog.qml b/linphone-app/ui/modules/Linphone/Dialog/SipAddressDialog.qml index 31b42f721..757ef997b 100644 --- a/linphone-app/ui/modules/Linphone/Dialog/SipAddressDialog.qml +++ b/linphone-app/ui/modules/Linphone/Dialog/SipAddressDialog.qml @@ -40,7 +40,6 @@ DialogPlus { Layout.fillWidth: true Layout.topMargin: SipAddressDialogStyle.spacing - visible: !timeline.isFilterVisible showHeader:false