X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fcoreaccount.cpp;fp=src%2Fclient%2Fcoreaccount.cpp;h=3b98daa3976aaba76cc9aca7b241708ea64e7a8d;hp=ad0dedcd34e0af632ee582717f181b749c93e98d;hb=c1cf157116de7fc3da96203aa6f03c38c7ebb650;hpb=30b159cb876a9495de42e9a3e70ca050516f0805 diff --git a/src/client/coreaccount.cpp b/src/client/coreaccount.cpp index ad0dedcd..3b98daa3 100644 --- a/src/client/coreaccount.cpp +++ b/src/client/coreaccount.cpp @@ -31,101 +31,85 @@ CoreAccount::CoreAccount(AccountId accountId) _proxyPort = 8080; } - void CoreAccount::setAccountId(AccountId id) { _accountId = id; } - -void CoreAccount::setAccountName(const QString &name) +void CoreAccount::setAccountName(const QString& name) { _accountName = name; } - -void CoreAccount::setUuid(const QUuid &uuid) +void CoreAccount::setUuid(const QUuid& uuid) { _uuid = uuid; } - void CoreAccount::setInternal(bool internal) { _internal = internal; } - -void CoreAccount::setUser(const QString &user) +void CoreAccount::setUser(const QString& user) { _user = user; } - -void CoreAccount::setPassword(const QString &password) +void CoreAccount::setPassword(const QString& password) { _password = password; } - void CoreAccount::setStorePassword(bool store) { _storePassword = store; } - -void CoreAccount::setHostName(const QString &hostname) +void CoreAccount::setHostName(const QString& hostname) { _hostName = hostname; } - void CoreAccount::setPort(uint port) { _port = port; } - void CoreAccount::setUseSsl(bool useSsl) { _useSsl = useSsl; } - void CoreAccount::setProxyType(QNetworkProxy::ProxyType type) { _proxyType = type; } - -void CoreAccount::setProxyUser(const QString &proxyUser) +void CoreAccount::setProxyUser(const QString& proxyUser) { _proxyUser = proxyUser; } - -void CoreAccount::setProxyPassword(const QString &proxyPassword) +void CoreAccount::setProxyPassword(const QString& proxyPassword) { _proxyPassword = proxyPassword; } - -void CoreAccount::setProxyHostName(const QString &proxyHostName) +void CoreAccount::setProxyHostName(const QString& proxyHostName) { _proxyHostName = proxyHostName; } - void CoreAccount::setProxyPort(uint proxyPort) { _proxyPort = proxyPort; } - QVariantMap CoreAccount::toVariantMap(bool forcePassword) const { QVariantMap v; - v["AccountId"] = accountId().toInt(); // can't use AccountId because then comparison fails + v["AccountId"] = accountId().toInt(); // can't use AccountId because then comparison fails v["AccountName"] = accountName(); v["Uuid"] = uuid().toString(); v["Internal"] = isInternal(); @@ -146,8 +130,7 @@ QVariantMap CoreAccount::toVariantMap(bool forcePassword) const return v; } - -void CoreAccount::fromVariantMap(const QVariantMap &v) +void CoreAccount::fromVariantMap(const QVariantMap& v) { setAccountId((AccountId)v.value("AccountId").toInt()); setAccountName(v.value("AccountName").toString()); @@ -168,35 +151,32 @@ void CoreAccount::fromVariantMap(const QVariantMap &v) _storePassword = !password().isEmpty(); } - -bool CoreAccount::operator==(const CoreAccount &other) const +bool CoreAccount::operator==(const CoreAccount& other) const { return toVariantMap(true) == other.toVariantMap(true); } - -bool CoreAccount::operator!=(const CoreAccount &other) const +bool CoreAccount::operator!=(const CoreAccount& other) const { return !(*this == other); } - -QDebug operator<<(QDebug dbg, const CoreAccount &acc) +QDebug operator<<(QDebug dbg, const CoreAccount& acc) { dbg.nospace() << qPrintable(QString("CoreAccount(AccountId:")) << acc.accountId() - << qPrintable(QString(", AccountName:")) << acc.accountName() - << qPrintable(QString(", Uuid:")) << acc.uuid() - << qPrintable(QString(", Internal:")) << acc.isInternal() - << qPrintable(QString(", User:")) << acc.user() - << qPrintable(QString(", Password:")) << acc.password() - << qPrintable(QString(", StorePassword:")) << acc.storePassword() - << qPrintable(QString(", HostName:")) << acc.hostName() - << qPrintable(QString(", Port:")) << acc.port() - << qPrintable(QString(", UseSSL:")) << acc.useSsl() - << qPrintable(QString(", ProxyType:")) << acc.proxyType() - << qPrintable(QString(", ProxyUser:")) << acc.proxyUser() - << qPrintable(QString(", ProxyPassword:")) << acc.proxyPassword() - << qPrintable(QString(", ProxyHostName:")) << acc.proxyHostName() - << qPrintable(QString(", ProxyPort:")) << acc.proxyPort(); + << qPrintable(QString(", AccountName:")) << acc.accountName() + << qPrintable(QString(", Uuid:")) << acc.uuid() + << qPrintable(QString(", Internal:")) << acc.isInternal() + << qPrintable(QString(", User:")) << acc.user() + << qPrintable(QString(", Password:")) << acc.password() + << qPrintable(QString(", StorePassword:")) << acc.storePassword() + << qPrintable(QString(", HostName:")) << acc.hostName() + << qPrintable(QString(", Port:")) << acc.port() + << qPrintable(QString(", UseSSL:")) << acc.useSsl() + << qPrintable(QString(", ProxyType:")) << acc.proxyType() + << qPrintable(QString(", ProxyUser:")) << acc.proxyUser() + << qPrintable(QString(", ProxyPassword:")) << acc.proxyPassword() + << qPrintable(QString(", ProxyHostName:")) << acc.proxyHostName() + << qPrintable(QString(", ProxyPort:")) << acc.proxyPort(); return dbg.space(); }