Fix default button behavior in CoreConnectDlg.
[quassel.git] / src / common / identity.cpp
index a45eb75..3ce1d10 100644 (file)
@@ -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("<empty>"));
   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<IdentityId>() != v2.value<IdentityId>()) return false;
     } else {