Skip to content
Snippets Groups Projects
Commit 53b4032a authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee Committed by gerrit2
Browse files

account: Add missing property names

This issue was found when using this API to bind the KDE
client dialogs. Nobody really fully used this API before.

Refs #74665

Change-Id: Id677e38e0318667a0a79d0328495750a6696a9e0
parent 4affbea2
Branches
Tags
No related merge requests found
...@@ -900,6 +900,11 @@ QString Account::turnServer() const ...@@ -900,6 +900,11 @@ QString Account::turnServer() const
return d_ptr->accountDetail(DRing::Account::ConfProperties::TURN::SERVER); return d_ptr->accountDetail(DRing::Account::ConfProperties::TURN::SERVER);
} }
bool Account::hasProxy() const
{
return proxy().size();
}
#define CAST(item) static_cast<int>(item) #define CAST(item) static_cast<int>(item)
QVariant Account::roleData(int role) const QVariant Account::roleData(int role) const
{ {
...@@ -1015,6 +1020,38 @@ QVariant Account::roleData(int role) const ...@@ -1015,6 +1020,38 @@ QVariant Account::roleData(int role) const
return turnServer(); return turnServer();
case CAST(Account::Role::SipTurnEnabled): case CAST(Account::Role::SipTurnEnabled):
return isTurnEnabled(); return isTurnEnabled();
case CAST(Account::Role::UserAgent):
return userAgent();
case CAST(Account::Role::Password):
return password();
case CAST(Account::Role::SupportPresencePublish ):
return supportPresencePublish();
case CAST(Account::Role::SupportPresenceSubscribe ):
return supportPresenceSubscribe();
case CAST(Account::Role::PresenceEnabled ):
return presenceEnabled();
case CAST(Account::Role::IsVideoEnabled ):
return isVideoEnabled();
case CAST(Account::Role::VideoPortMax ):
return videoPortMax();
case CAST(Account::Role::VideoPortMin ):
return videoPortMin();
case CAST(Account::Role::AudioPortMin ):
return audioPortMin();
case CAST(Account::Role::AudioPortMax ):
return audioPortMax();
case CAST(Account::Role::IsUpnpEnabled ):
return isUpnpEnabled();
case CAST(Account::Role::HasCustomUserAgent ):
return hasCustomUserAgent();
case CAST(Account::Role::LastTransportErrorCode ):
return lastTransportErrorCode();
case CAST(Account::Role::LastTransportErrorMessage):
return lastTransportErrorMessage();
case CAST(Account::Role::TurnServer ):
return turnServer();
case CAST(Account::Role::HasProxy ):
return hasProxy();
default: default:
return QVariant(); return QVariant();
} }
...@@ -1664,6 +1701,49 @@ void Account::setRoleData(int role, const QVariant& value) ...@@ -1664,6 +1701,49 @@ void Account::setRoleData(int role, const QVariant& value)
case CAST(Account::Role::Id): case CAST(Account::Role::Id):
setId(value.toByteArray()); setId(value.toByteArray());
break; break;
case CAST(Account::Role::UserAgent):
setUserAgent(value.toString());
break;
case CAST(Account::Role::Password):
setPassword(value.toString());
break;
case CAST(Account::Role::SupportPresencePublish ):
break;
case CAST(Account::Role::SupportPresenceSubscribe ):
break;
case CAST(Account::Role::PresenceEnabled ):
setPresenceEnabled(value.toBool());
break;
case CAST(Account::Role::IsVideoEnabled ):
break;
case CAST(Account::Role::VideoPortMax ):
setVideoPortMax(value.toInt());
break;
case CAST(Account::Role::VideoPortMin ):
setVideoPortMin(value.toInt());
break;
case CAST(Account::Role::AudioPortMin ):
setAudioPortMin(value.toInt());
break;
case CAST(Account::Role::AudioPortMax ):
setAudioPortMax(value.toInt());
break;
case CAST(Account::Role::IsUpnpEnabled ):
setUpnpEnabled(value.toBool());
break;
case CAST(Account::Role::HasCustomUserAgent ):
setHasCustomUserAgent(value.toBool());
break;
case CAST(Account::Role::LastTransportErrorCode ):
break;
case CAST(Account::Role::LastTransportErrorMessage):
break;
case CAST(Account::Role::SipTurnEnabled ):
setTurnEnabled(value.toBool());
break;
case CAST(Account::Role::TurnServer ):
setTurnServer(value.toString());
break;
} }
} }
#undef CAST #undef CAST
......
...@@ -238,6 +238,22 @@ class LIB_EXPORT Account : public QObject { ...@@ -238,6 +238,22 @@ class LIB_EXPORT Account : public QObject {
LastUsed = 150, LastUsed = 150,
SipTurnServer = 151, SipTurnServer = 151,
SipTurnEnabled = 152, SipTurnEnabled = 152,
UserAgent = 153,
Password = 154,
SupportPresencePublish = 155,
SupportPresenceSubscribe = 156,
PresenceEnabled = 165,
IsVideoEnabled = 169,
VideoPortMax = 157,
VideoPortMin = 158,
AudioPortMin = 159,
AudioPortMax = 160,
IsUpnpEnabled = 161,
HasCustomUserAgent = 162,
LastTransportErrorCode = 163,
LastTransportErrorMessage = 164,
TurnServer = 168,
HasProxy = 170,
}; };
///@enum RoleState Whether a role can be used in a certain context ///@enum RoleState Whether a role can be used in a certain context
...@@ -344,6 +360,7 @@ class LIB_EXPORT Account : public QObject { ...@@ -344,6 +360,7 @@ class LIB_EXPORT Account : public QObject {
bool useDefaultPort () const; bool useDefaultPort () const;
bool isTurnEnabled () const; bool isTurnEnabled () const;
QString turnServer () const; QString turnServer () const;
bool hasProxy () const;
RegistrationState registrationState () const; RegistrationState registrationState () const;
Protocol protocol () const; Protocol protocol () const;
ContactMethod* contactMethod () const; ContactMethod* contactMethod () const;
......
...@@ -146,7 +146,25 @@ QHash<int,QByteArray> AccountModel::roleNames() const ...@@ -146,7 +146,25 @@ QHash<int,QByteArray> AccountModel::roleNames() const
roles.insert(CAST(Account::Role::TrimesterCallCount ) ,QByteArray("trimesterCallCount" )); roles.insert(CAST(Account::Role::TrimesterCallCount ) ,QByteArray("trimesterCallCount" ));
roles.insert(CAST(Account::Role::LastUsed ) ,QByteArray("lastUsed" )); roles.insert(CAST(Account::Role::LastUsed ) ,QByteArray("lastUsed" ));
roles.insert(CAST(Account::Role::SipTurnServer ) ,QByteArray("sipTurnServer" )); roles.insert(CAST(Account::Role::SipTurnServer ) ,QByteArray("sipTurnServer" ));
roles.insert(CAST(Account::Role::SipTurnEnabled ) ,QByteArray("sipTurnEnabled" )); roles.insert(CAST(Account::Role::SipTurnEnabled ) ,QByteArray("turnEnabled" ));
roles.insert(CAST(Account::Role::UserAgent ) ,QByteArray("userAgent" ));
roles.insert(CAST(Account::Role::Password ) ,QByteArray("password" ));
roles.insert(CAST(Account::Role::SupportPresencePublish ) ,QByteArray("supportPresencePublish" ));
roles.insert(CAST(Account::Role::SupportPresenceSubscribe ) ,QByteArray("supportPresenceSubscribe" ));
roles.insert(CAST(Account::Role::PresenceEnabled ) ,QByteArray("presenceEnabled" ));
roles.insert(CAST(Account::Role::IsVideoEnabled ) ,QByteArray("isVideoEnabled" ));
roles.insert(CAST(Account::Role::VideoPortMax ) ,QByteArray("videoPortMax" ));
roles.insert(CAST(Account::Role::VideoPortMin ) ,QByteArray("videoPortMin" ));
roles.insert(CAST(Account::Role::AudioPortMin ) ,QByteArray("audioPortMin" ));
roles.insert(CAST(Account::Role::AudioPortMax ) ,QByteArray("audioPortMax" ));
roles.insert(CAST(Account::Role::IsUpnpEnabled ) ,QByteArray("upnpEnabled" ));
roles.insert(CAST(Account::Role::HasCustomUserAgent ) ,QByteArray("hasCustomUserAgent" ));
roles.insert(CAST(Account::Role::LastTransportErrorCode ) ,QByteArray("lastTransportErrorCode" ));
roles.insert(CAST(Account::Role::LastTransportErrorMessage ) ,QByteArray("lastTransportErrorMessage" ));
roles.insert(CAST(Account::Role::UserAgent ) ,QByteArray("userAgent" ));
roles.insert(CAST(Account::Role::UseDefaultPort ) ,QByteArray("useDefaultPort" ));
roles.insert(CAST(Account::Role::TurnServer ) ,QByteArray("turnServer" ));
roles.insert(CAST(Account::Role::HasProxy ) ,QByteArray("hasProxy" ));
} }
return roles; return roles;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment