X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fidentity.cpp;h=3ce1d10e9341482ee53de6f2c668b283c495d8a1;hp=a45eb7579af265024c3ee7a67f8d69e91327ef85;hb=c8a1817d1843e987794f95f66ef2da93fa75286f;hpb=b797e5f581b10a517c30f78cb53f813af741e261 diff --git a/src/common/identity.cpp b/src/common/identity.cpp index a45eb757..3ce1d10e 100644 --- a/src/common/identity.cpp +++ b/src/common/identity.cpp @@ -55,12 +55,11 @@ Identity::Identity(const Identity &other, QObject *parent) : SyncableObject(pare } void Identity::init() { - _initialized = false; - setObjectName(QString::number(id())); + setObjectName(QString::number(id().toInt())); } void Identity::setToDefaults() { - setIdentityName(tr("Default Identity")); + setIdentityName(tr("")); setRealName(tr("Quassel IRC User")); QStringList n; n << QString("quassel%1").arg(qrand() & 0xff); // FIXME provide more sensible default nicks @@ -81,19 +80,10 @@ void Identity::setToDefaults() { setKickReason(tr("Kindergarten is elsewhere!")); setPartReason(tr("http://quassel-irc.org - Chat comfortably. Anywhere.")); setQuitReason(tr("http://quassel-irc.org - Chat comfortably. Anywhere.")); - } bool Identity::isValid() const { - return (id() > 0); -} - -bool Identity::initialized() const { - return _initialized; -} - -void Identity::setInitialized() { - _initialized = true; + return (id().toInt() > 0); } IdentityId Identity::id() const { @@ -180,7 +170,7 @@ QString Identity::quitReason() const { // NOTE: DO NOT USE ON SYNCHRONIZED OBJECTS! void Identity::setId(IdentityId _id) { _identityId = _id; - setObjectName(QString::number(id())); + setObjectName(QString::number(id().toInt())); //emit idSet(id); } @@ -296,8 +286,8 @@ bool Identity::operator==(const Identity &other) { QMetaProperty metaProp = metaObject()->property(idx); Q_ASSERT(metaProp.isValid()); QVariant v1 = this->property(metaProp.name()); - QVariant v2 = other.property(metaProp.name()); //qDebug() << v1 << v2; - // QVariant cannot compare custom types, so we need to check for this case + QVariant v2 = other.property(metaProp.name()); // qDebug() << v1 << v2; + // QVariant cannot compare custom types, so we need to check for this special case if(QString(v1.typeName()) == "IdentityId") { if(v1.value() != v2.value()) return false; } else {