File indexing completed on 2025-01-05 03:53:37
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2011-03-22 0007 * Description : a Iface C++ interface 0008 * 0009 * SPDX-FileCopyrightText: 2011-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * SPDX-FileCopyrightText: 2011 by Remi Benoit <r3m1 dot benoit at gmail dot com> 0011 * 0012 * SPDX-License-Identifier: GPL-2.0-or-later 0013 * 0014 * ============================================================ */ 0015 0016 #include "mediawiki_usergroup.h" 0017 0018 // C++ includes 0019 0020 #include <algorithm> 0021 0022 namespace MediaWiki 0023 { 0024 0025 class Q_DECL_HIDDEN UserGroup::Private 0026 { 0027 public: 0028 0029 unsigned int number; 0030 0031 QString name; 0032 0033 QList<QString> rights; 0034 }; 0035 0036 UserGroup::UserGroup() 0037 : d(new Private()) 0038 { 0039 d->number = -1; 0040 } 0041 0042 UserGroup::UserGroup(const UserGroup& other) 0043 : d(new Private(*(other.d))) 0044 { 0045 } 0046 0047 UserGroup::~UserGroup() 0048 { 0049 delete d; 0050 } 0051 0052 UserGroup& UserGroup::operator=(const UserGroup& other) 0053 { 0054 *d = *other.d; 0055 0056 return *this; 0057 } 0058 0059 bool UserGroup::operator==(const UserGroup& other) const 0060 { 0061 return ( 0062 (number() == other.number()) && 0063 (rights() == other.rights()) && 0064 (name() == other.name()) 0065 ); 0066 } 0067 0068 QString UserGroup::name() const 0069 { 0070 return d->name; 0071 } 0072 0073 void UserGroup::setName(const QString& name) 0074 { 0075 d->name = name; 0076 } 0077 0078 const QList<QString>& UserGroup::rights() const 0079 { 0080 return d->rights; 0081 } 0082 0083 QList<QString>& UserGroup::rights() 0084 { 0085 return d->rights; 0086 } 0087 0088 void UserGroup::setRights(const QList<QString>& rights) 0089 { 0090 d->rights = rights; 0091 } 0092 0093 qint64 UserGroup::number() const 0094 { 0095 return d->number; 0096 } 0097 0098 void UserGroup::setNumber(qint64 number) 0099 { 0100 d->number = number; 0101 } 0102 0103 } // namespace MediaWiki