mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 14:44:01 +00:00
fix(SettingsSipAccountsEdit): detect correctly sip addresses
This commit is contained in:
parent
ff985c090c
commit
1a31ab06d7
3 changed files with 11 additions and 3 deletions
|
|
@ -175,12 +175,19 @@ QString SipAddressesModel::interpretUrl (const QUrl &sipAddress) {
|
|||
return sipAddress.toString();
|
||||
}
|
||||
|
||||
bool SipAddressesModel::sipAddressIsValid (const QString &sipAddress) {
|
||||
bool SipAddressesModel::addressIsValid (const QString &address) {
|
||||
return !!linphone::Factory::get()->createAddress(
|
||||
::Utils::appStringToCoreString(sipAddress)
|
||||
::Utils::appStringToCoreString(address)
|
||||
);
|
||||
}
|
||||
|
||||
bool SipAddressesModel::sipAddressIsValid (const QString &sipAddress) {
|
||||
shared_ptr<linphone::Address> address = linphone::Factory::get()->createAddress(
|
||||
::Utils::appStringToCoreString(sipAddress)
|
||||
);
|
||||
return address && !address->getUsername().empty();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool SipAddressesModel::removeRow (int row, const QModelIndex &parent) {
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ public:
|
|||
Q_INVOKABLE static QString interpretUrl (const QString &sipAddress);
|
||||
Q_INVOKABLE static QString interpretUrl (const QUrl &sipAddress);
|
||||
|
||||
Q_INVOKABLE static bool addressIsValid (const QString &address);
|
||||
Q_INVOKABLE static bool sipAddressIsValid (const QString &sipAddress);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ function validProxyConfig () {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
function handleRouteChanged (route) {
|
||||
dialog._routeOk = route.length === 0 || Linphone.SipAddressesModel.sipAddressIsValid(route)
|
||||
dialog._routeOk = route.length === 0 || Linphone.SipAddressesModel.addressIsValid(route)
|
||||
}
|
||||
|
||||
function handleServerAddressChanged (address) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue