-Identity::Identity(IdentityId id, QObject *parent) : SyncableObject(parent), _identityId(id) {
- init();
- setToDefaults();
-}
-
-Identity::Identity(const Identity &other, QObject *parent) : SyncableObject(parent),
- _identityId(other.id()),
- _identityName(other.identityName()),
- _realName(other.realName()),
- _nicks(other.nicks()),
- _awayNick(other.awayNick()),
- _awayNickEnabled(other.awayNickEnabled()),
- _awayReason(other.awayReason()),
- _awayReasonEnabled(other.awayReasonEnabled()),
- _returnMessage(other.returnMessage()),
- _returnMessageEnabled(other.returnMessageEnabled()),
- _autoAwayEnabled(other.autoAwayEnabled()),
- _autoAwayTime(other.autoAwayTime()),
- _autoAwayReason(other.autoAwayReason()),
- _autoAwayReasonEnabled(other.autoAwayReasonEnabled()),
- _autoReturnMessage(other.autoReturnMessage()),
- _autoReturnMessageEnabled(other.autoReturnMessageEnabled()),
- _ident(other.ident()),
- _kickReason(other.kickReason()),
- _partReason(other.partReason()),
- _quitReason(other.quitReason())
-
-{
- init();
-}
-
-void Identity::init() {
- _initialized = false;
- setObjectName(QString::number(id()));
-}
-
-void Identity::setToDefaults() {
- setIdentityName(tr("Default Identity"));
- setRealName(tr("Quassel IRC User"));
- QStringList n;
- n << QString("quassel%1").arg(qrand() & 0xff); // FIXME provide more sensible default nicks
- setNicks(n);
- setAwayNick("");
- setAwayNickEnabled(false);
- setAwayReason(tr("Gone fishing."));
- setAwayReasonEnabled(true);
- setReturnMessage(tr("Brought fish."));
- setReturnMessageEnabled(false);
- setAutoAwayEnabled(false);
- setAutoAwayTime(10);
- setAutoAwayReason(tr("Not here. No, really. not here!"));
- setAutoAwayReasonEnabled(false);
- setAutoReturnMessage(tr("Back in action again!"));
- setAutoReturnMessageEnabled(false);
- setIdent("quassel");
- 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;
-}
-
-IdentityId Identity::id() const {
- return _identityId;
-}
-
-QString Identity::identityName() const {
- return _identityName;
-}
-
-QString Identity::realName() const {
- return _realName;
-}
-
-QStringList Identity::nicks() const {
- return _nicks;
-}
-
-QString Identity::awayNick() const {
- return _awayNick;
-}
-
-bool Identity::awayNickEnabled() const {
- return _awayNickEnabled;
-}
-
-QString Identity::awayReason() const {
- return _awayReason;
-}