mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 06:36:55 +02:00
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.
This commit is contained in:
@@ -39,6 +39,7 @@ QDataStream& operator<<( QDataStream &out, const ACLRegistry::User &user )
|
|||||||
{
|
{
|
||||||
out << ACLUSERVERSION;
|
out << ACLUSERVERSION;
|
||||||
out << user.uuid;
|
out << user.uuid;
|
||||||
|
out << user.friendlyName;
|
||||||
out << user.knownDbids.length();
|
out << user.knownDbids.length();
|
||||||
foreach( QString knownDbid, user.knownDbids )
|
foreach( QString knownDbid, user.knownDbids )
|
||||||
out << knownDbid;
|
out << knownDbid;
|
||||||
@@ -56,6 +57,7 @@ QDataStream& operator>>( QDataStream &in, ACLRegistry::User &user )
|
|||||||
if ( ver == ACLUSERVERSION )
|
if ( ver == ACLUSERVERSION )
|
||||||
{
|
{
|
||||||
in >> user.uuid;
|
in >> user.uuid;
|
||||||
|
in >> user.friendlyName;
|
||||||
int dbidsLength;
|
int dbidsLength;
|
||||||
in >> dbidsLength;
|
in >> dbidsLength;
|
||||||
QString knownDbid;
|
QString knownDbid;
|
||||||
|
@@ -54,12 +54,14 @@ public:
|
|||||||
|
|
||||||
struct User {
|
struct User {
|
||||||
QString uuid;
|
QString uuid;
|
||||||
|
QString friendlyName;
|
||||||
QStringList knownDbids;
|
QStringList knownDbids;
|
||||||
QStringList knownAccountIds;
|
QStringList knownAccountIds;
|
||||||
ACLRegistry::ACL acl;
|
ACLRegistry::ACL acl;
|
||||||
|
|
||||||
User()
|
User()
|
||||||
: uuid( QUuid::createUuid().toString() )
|
: uuid( QUuid::createUuid().toString() )
|
||||||
|
, friendlyName()
|
||||||
, knownDbids()
|
, knownDbids()
|
||||||
, knownAccountIds()
|
, knownAccountIds()
|
||||||
, acl( ACLRegistry::NotFound )
|
, acl( ACLRegistry::NotFound )
|
||||||
@@ -68,8 +70,9 @@ public:
|
|||||||
~User()
|
~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 )
|
: uuid( p_uuid )
|
||||||
|
, friendlyName( p_friendlyName )
|
||||||
, knownDbids( p_knownDbids )
|
, knownDbids( p_knownDbids )
|
||||||
, knownAccountIds( p_knownAccountIds )
|
, knownAccountIds( p_knownAccountIds )
|
||||||
, acl( p_acl )
|
, acl( p_acl )
|
||||||
@@ -77,6 +80,7 @@ public:
|
|||||||
|
|
||||||
User( const User &other )
|
User( const User &other )
|
||||||
: uuid( other.uuid )
|
: uuid( other.uuid )
|
||||||
|
, friendlyName( other.friendlyName )
|
||||||
, knownDbids( other.knownDbids )
|
, knownDbids( other.knownDbids )
|
||||||
, knownAccountIds( other.knownAccountIds )
|
, knownAccountIds( other.knownAccountIds )
|
||||||
, acl( other.acl )
|
, acl( other.acl )
|
||||||
|
Reference in New Issue
Block a user