1
0
forked from blue/squawk

trying linter settings

This commit is contained in:
Blue 2023-11-17 21:52:33 -03:00
parent 8f5325b291
commit 93c5be412e
Signed by untrusted user: blue
GPG Key ID: 9B203B252A63EE38
3 changed files with 3903 additions and 294 deletions

3640
.uncrustify.cfg Normal file

File diff suppressed because it is too large Load Diff

View File

@ -17,13 +17,13 @@
*/
#include "info.h"
Shared::Info::Info (const QString& addr, EntryType tp):
type(tp),
address(addr),
vcard(nullptr),
activeKeys(nullptr),
inactiveKeys(nullptr) {
inactiveKeys(nullptr)
{
switch (type) {
case EntryType::none:
break;
@ -50,7 +50,8 @@ type(other.type),
address(other.address),
vcard(nullptr),
activeKeys(nullptr),
inactiveKeys(nullptr) {
inactiveKeys(nullptr)
{
switch (type) {
case EntryType::none:
break;
@ -70,7 +71,8 @@ type(other.type),
address(other.address),
vcard(other.vcard),
activeKeys(other.activeKeys),
inactiveKeys(other.inactiveKeys) {
inactiveKeys(other.inactiveKeys)
{
other.type = EntryType::none;
}
@ -80,16 +82,13 @@ Shared::Info &Shared::Info::operator=(Info &&other) {
vcard = other.vcard;
activeKeys = other.activeKeys;
inactiveKeys = other.inactiveKeys;
other.type = EntryType::none;
return *this;
}
Shared::Info& Shared::Info::operator = (const Info& other) {
type = other.type;
address = other.address;
switch (type) {
case EntryType::none:
break;
@ -102,11 +101,11 @@ Shared::Info &Shared::Info::operator=(const Info &other) {
default:
throw 351;
}
return *this;
}
Shared::Info::~Info() {
Shared::Info::~Info ()
{
turnIntoNone();
}
@ -129,9 +128,7 @@ void Shared::Info::turnIntoNone() {
type = EntryType::none;
}
void Shared::Info::turnIntoContact(
const Shared::VCard &crd, const std::list<KeyInfo> &aks, const std::list<KeyInfo> &iaks
) {
void Shared::Info::turnIntoContact (const Shared::VCard& crd, const std::list<KeyInfo>& aks, const std::list<KeyInfo>& iaks) {
switch (type) {
case EntryType::none:
vcard = new VCard(crd);
@ -147,7 +144,6 @@ void Shared::Info::turnIntoContact(
default:
break;
}
type = EntryType::contact;
}
@ -167,13 +163,10 @@ void Shared::Info::turnIntoContact(Shared::VCard *crd, std::list<KeyInfo> *aks,
default:
break;
}
type = EntryType::contact;
}
void Shared::Info::turnIntoOwnAccount(
const Shared::VCard &crd, const std::list<KeyInfo> &aks, const std::list<KeyInfo> &iaks
) {
void Shared::Info::turnIntoOwnAccount (const Shared::VCard& crd, const std::list<KeyInfo>& aks, const std::list<KeyInfo>& iaks) {
switch (type) {
case EntryType::none:
vcard = new VCard(crd);
@ -189,7 +182,6 @@ void Shared::Info::turnIntoOwnAccount(
default:
break;
}
type = EntryType::ownAccount;
}
@ -209,7 +201,6 @@ void Shared::Info::turnIntoOwnAccount(Shared::VCard *crd, std::list<KeyInfo> *ak
default:
break;
}
type = EntryType::ownAccount;
}

View File

@ -25,62 +25,41 @@
#include <list>
namespace Shared {
/**
* This class should contain all nessesary data to display
* roster element info (contact, or out of roster contact, or MUC, or MIX in the future)
*
* under development yet
*/
class Info {
class Info : public QObject, public VCard {
public:
Info ();
Info (const QString& address, EntryType = EntryType::none);
Info (const Info& other);
Info (Info&& other);
virtual ~Info ();
Info& operator = (const Info& other);
Info& operator = (Info&& other);
QString getAddress () const;
const QString& getAddressRef () const;
void setAddress (const QString& address);
EntryType getType () const;
void turnIntoNone ();
void turnIntoContact(
const VCard& card = VCard(),
const std::list<KeyInfo>& activeKeys = {},
const std::list<KeyInfo>& inactiveKeys = {}
);
void turnIntoContact(
VCard* card = new VCard,
std::list<KeyInfo>* activeKeys = new std::list<KeyInfo>,
std::list<KeyInfo>* inactiveKeys = new std::list<KeyInfo>
);
void turnIntoOwnAccount(
const VCard& card = VCard(),
const std::list<KeyInfo>& activeKeys = {},
const std::list<KeyInfo>& inactiveKeys = {}
);
void turnIntoOwnAccount(
VCard* card = new VCard,
std::list<KeyInfo>* activeKeys = new std::list<KeyInfo>,
std::list<KeyInfo>* inactiveKeys = new std::list<KeyInfo>
);
void turnIntoContact (const VCard& card = VCard(), const std::list<KeyInfo>& activeKeys = {}, const std::list<KeyInfo>& inactiveKeys = {});
void turnIntoContact (VCard* card = new VCard, std::list<KeyInfo>* activeKeys = new std::list<KeyInfo>, std::list<KeyInfo>* inactiveKeys = new std::list<KeyInfo>);
void turnIntoOwnAccount (const VCard& card = VCard(), const std::list<KeyInfo>& activeKeys = {}, const std::list<KeyInfo>& inactiveKeys = {});
void turnIntoOwnAccount (VCard* card = new VCard, std::list<KeyInfo>* activeKeys = new std::list<KeyInfo>, std::list<KeyInfo>* inactiveKeys = new std::list<KeyInfo>);
const VCard& getVCardRef () const;
VCard& getVCardRef ();
const VCard* getVCard () const;
VCard* getVCard ();
void setVCard (Shared::VCard* card);
const std::list<KeyInfo>& getActiveKeysRef () const;
std::list<KeyInfo>& getActiveKeysRef ();
const std::list<KeyInfo>* getActiveKeys () const;
std::list<KeyInfo>* getActiveKeys ();
void setActiveKeys (std::list<KeyInfo>* keys);
const std::list<KeyInfo>& getInactiveKeysRef () const;
std::list<KeyInfo>& getInactiveKeysRef ();
const std::list<KeyInfo>* getInactiveKeys () const;
@ -89,7 +68,6 @@ public:
private:
EntryType type;
QString address;
VCard* vcard;
std::list<KeyInfo>* activeKeys;
std::list<KeyInfo>* inactiveKeys;