mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-03 22:56:49 +00:00
Fix crash on setting empty routes on account params.
Fix lime server url check.
This commit is contained in:
parent
ef0a59b26c
commit
94b3501c6b
5 changed files with 8 additions and 8 deletions
|
|
@ -341,7 +341,7 @@ bool AccountSettingsModel::addOrUpdateAccount(
|
|||
accountParams->setExpires(data["registrationDuration"].toInt());
|
||||
if(data.contains("publishDuration"))
|
||||
accountParams->setPublishExpires(data["publishDuration"].toInt());
|
||||
if(data.contains("route")) {
|
||||
if(data.contains("route") && data["route"].toString() != "") {
|
||||
std::list<std::shared_ptr<linphone::Address>> routes;
|
||||
routes.push_back(Utils::interpretUrl(data["route"].toString()));
|
||||
accountParams->setRoutesAddresses(routes);
|
||||
|
|
|
|||
|
|
@ -674,6 +674,10 @@ bool Utils::isUsername(const QString& txt){
|
|||
return match.hasMatch(); // true
|
||||
}
|
||||
|
||||
bool Utils::isValidUrl(const QString& url){
|
||||
return QUrl(url).isValid();
|
||||
}
|
||||
|
||||
QSize Utils::getImageSize(const QString& url){
|
||||
QString path;
|
||||
QUrl urlDecode(url);
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ public:
|
|||
Q_INVOKABLE static bool canHaveThumbnail(const QString& path);
|
||||
Q_INVOKABLE static bool isPhoneNumber(const QString& txt);
|
||||
Q_INVOKABLE static bool isUsername(const QString& txt); // Check with Regex
|
||||
Q_INVOKABLE static bool isValidUrl(const QString& url);
|
||||
Q_INVOKABLE QSize getImageSize(const QString& url);
|
||||
Q_INVOKABLE static QPoint getCursorPosition();
|
||||
Q_INVOKABLE static QString getFileChecksum(const QString& filePath);
|
||||
|
|
|
|||
|
|
@ -134,12 +134,6 @@ function handleVideoConferenceUriChanged (uri) {
|
|||
dialog._videoConferenceUriOk = uri=='' || Linphone.SipAddressesModel.addressIsValid(uri)
|
||||
}
|
||||
|
||||
function handleLimeServerUrlChanged (uri) {
|
||||
dialog._limeServerUrlOk = uri=='' || Linphone.SipAddressesModel.addressIsValid(uri)
|
||||
if(!dialog._limeServerUrlOk)
|
||||
console.log("Bad URI: " +uri)
|
||||
}
|
||||
|
||||
function handleServerAddressChanged (address) {
|
||||
if (address.length === 0) {
|
||||
dialog._serverAddressOk = false
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import QtQuick 2.7
|
|||
import QtQuick.Layouts 1.3
|
||||
|
||||
import Common 1.0
|
||||
import UtilsCpp 1.0
|
||||
|
||||
import App.Styles 1.0
|
||||
|
||||
|
|
@ -177,7 +178,7 @@ DialogPlus {
|
|||
//: "invalid E2E encryption keys server URL" : Error text about E2E encryption keys server URL.
|
||||
error: dialog._limeServerUrlOk ? '' : qsTr("invalidLimeServerUrl")
|
||||
|
||||
onTextChanged: Logic.handleLimeServerUrlChanged(text)
|
||||
onTextChanged: dialog._limeServerUrlOk = text == '' || UtilsCpp.isValidUrl(text)
|
||||
Keys.onEnterPressed: nextItemInFocusChain().forceActiveFocus()
|
||||
Keys.onReturnPressed: nextItemInFocusChain().forceActiveFocus()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue