+#ifdef Q_OS_WIN
+# include <windows.h>
+# include <Winbase.h>
+# define SECURITY_WIN32
+# include <Security.h>
+#endif
+
+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())
+ , _autoAwayEnabled(other.autoAwayEnabled())
+ , _autoAwayTime(other.autoAwayTime())
+ , _autoAwayReason(other.autoAwayReason())
+ , _autoAwayReasonEnabled(other.autoAwayReasonEnabled())
+ , _detachAwayEnabled(other.detachAwayEnabled())
+ , _detachAwayReason(other.detachAwayReason())
+ , _detachAwayReasonEnabled(other.detachAwayReasonEnabled())
+ , _ident(other.ident())
+ , _kickReason(other.kickReason())
+ , _partReason(other.partReason())
+ , _quitReason(other.quitReason())
+{
+ init();
+}
+
+#ifdef Q_OS_WIN
+# ifdef UNICODE
+QString tcharToQString(TCHAR* tchar)
+{
+ return QString::fromUtf16(reinterpret_cast<ushort*>(tchar));
+}
+
+# else
+QString tcharToQString(TCHAR* tchar)
+{
+ return QString::fromLocal8Bit(tchar);
+}
+
+# endif
+