From da17f467cfa022ce170b21d86e459f49a5230f3e Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Mon, 18 Jun 2012 11:11:11 -0400 Subject: [PATCH] Wanted to get this in there before 0.5 goes wild, as doing this in a cleaner code fashion requires re-authing your peers. Adds a friendyname to Users, so that when there is more fine-grained ACL management you can set/show the friendly name along with the known screen names of a user. --- src/libtomahawk/AclRegistry.cpp | 2 ++ src/libtomahawk/AclRegistry.h | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/AclRegistry.cpp b/src/libtomahawk/AclRegistry.cpp index ef99879fb..93eb595fa 100644 --- a/src/libtomahawk/AclRegistry.cpp +++ b/src/libtomahawk/AclRegistry.cpp @@ -39,6 +39,7 @@ QDataStream& operator<<( QDataStream &out, const ACLRegistry::User &user ) { out << ACLUSERVERSION; out << user.uuid; + out << user.friendlyName; out << user.knownDbids.length(); foreach( QString knownDbid, user.knownDbids ) out << knownDbid; @@ -56,6 +57,7 @@ QDataStream& operator>>( QDataStream &in, ACLRegistry::User &user ) if ( ver == ACLUSERVERSION ) { in >> user.uuid; + in >> user.friendlyName; int dbidsLength; in >> dbidsLength; QString knownDbid; diff --git a/src/libtomahawk/AclRegistry.h b/src/libtomahawk/AclRegistry.h index f2ee66997..f583815b5 100644 --- a/src/libtomahawk/AclRegistry.h +++ b/src/libtomahawk/AclRegistry.h @@ -54,12 +54,14 @@ public: struct User { QString uuid; + QString friendlyName; QStringList knownDbids; QStringList knownAccountIds; ACLRegistry::ACL acl; User() : uuid( QUuid::createUuid().toString() ) + , friendlyName() , knownDbids() , knownAccountIds() , acl( ACLRegistry::NotFound ) @@ -68,8 +70,9 @@ public: ~User() {} - User( QString p_uuid, QStringList p_knownDbids, QStringList p_knownAccountIds, ACLRegistry::ACL p_acl ) + User( QString p_uuid, QString p_friendlyName, QStringList p_knownDbids, QStringList p_knownAccountIds, ACLRegistry::ACL p_acl ) : uuid( p_uuid ) + , friendlyName( p_friendlyName ) , knownDbids( p_knownDbids ) , knownAccountIds( p_knownAccountIds ) , acl( p_acl ) @@ -77,6 +80,7 @@ public: User( const User &other ) : uuid( other.uuid ) + , friendlyName( other.friendlyName ) , knownDbids( other.knownDbids ) , knownAccountIds( other.knownAccountIds ) , acl( other.acl )