X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fidentity.cpp;h=4eadff9e0e39bb4c27259c7cb0d8b3e0d8b7f84a;hb=ef48d209f03f02debf369ff689002f1b32165100;hp=da10fb0db84040f01322fa41df10fd44149fe9f6;hpb=ac21cc48d22f0cf58a98b74754fa94564a8e3f45;p=quassel.git diff --git a/src/common/identity.cpp b/src/common/identity.cpp index da10fb0d..4eadff9e 100644 --- a/src/common/identity.cpp +++ b/src/common/identity.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -184,9 +184,9 @@ void Identity::setQuitReason(const QString &reason) { /*** ***/ -void Identity::update(const Identity &other) { -for(int idx = metaObject()->propertyOffset(); idx < metaObject()->propertyCount(); idx++) { - QMetaProperty metaProp = metaObject()->property(idx); +void Identity::copyFrom(const Identity &other) { + for(int idx = staticMetaObject.propertyOffset(); idx < staticMetaObject.propertyCount(); idx++) { + QMetaProperty metaProp = staticMetaObject.property(idx); Q_ASSERT(metaProp.isValid()); if(this->property(metaProp.name()) != other.property(metaProp.name())) { setProperty(metaProp.name(), other.property(metaProp.name())); @@ -194,9 +194,9 @@ for(int idx = metaObject()->propertyOffset(); idx < metaObject()->propertyCount( } } -bool Identity::operator==(const Identity &other) { - for(int idx = metaObject()->propertyOffset(); idx < metaObject()->propertyCount(); idx++) { - QMetaProperty metaProp = metaObject()->property(idx); +bool Identity::operator==(const Identity &other) const { + for(int idx = staticMetaObject.propertyOffset(); idx < staticMetaObject.propertyCount(); idx++) { + QMetaProperty metaProp = staticMetaObject.property(idx); Q_ASSERT(metaProp.isValid()); QVariant v1 = this->property(metaProp.name()); QVariant v2 = other.property(metaProp.name()); // qDebug() << v1 << v2; @@ -210,7 +210,7 @@ bool Identity::operator==(const Identity &other) { return true; } -bool Identity::operator!=(const Identity &other) { +bool Identity::operator!=(const Identity &other) const { return !(*this == other); }