Qtification "lite" - first round

This commit is contained in:
miodragpop
2020-06-15 13:11:39 +02:00
parent efa216a131
commit e20efde2ed
29 changed files with 859 additions and 19772 deletions

View File

@@ -184,17 +184,17 @@ QString ChatItem::toChatLine()
return line;
}
json ChatItem::toJson()
QJsonValue ChatItem::toJson()
{
json j;
j["_timestamp"] = _timestamp;
j["_address"] = _address.toStdString();
j["_contact"] = _contact.toStdString();
j["_memo"] = _memo.toStdString();
j["_requestZaddr"] = _requestZaddr.toStdString();
j["_type"] = _type.toStdString();
j["_cid"] = _cid.toStdString();
j["_txid"] = _txid.toStdString();
QJsonObject j;
j["_timestamp"] = (qint64)_timestamp;
j["_address"] = _address;
j["_contact"] = _contact;
j["_memo"] = _memo;
j["_requestZaddr"] = _requestZaddr;
j["_type"] = _type;
j["_cid"] = _cid;
j["_txid"] = _txid;
j["_confirmations"] = _confirmations;
j["_outgoing"] = _outgoing;
return j;
@@ -203,4 +203,4 @@ json ChatItem::toJson()
ChatItem::~ChatItem()
{
}
}

View File

@@ -5,7 +5,6 @@
#define CHATITEM_H
#include <QString>
using json = nlohmann::json;
class ChatItem
{
@@ -53,8 +52,8 @@ class ChatItem
void notarized();
void contact(bool iscontact);
QString toChatLine();
json toJson();
QJsonValue toJson();
~ChatItem();
};
#endif
#endif

View File

@@ -86,13 +86,13 @@ QString ContactItem::toQTString()
return _name + "|" + _partnerAddress + "|" + _myAddress + "|" + _cid + "|" + _avatar;
}
json ContactItem::toJson()
QJsonValue ContactItem::toJson()
{
json j;
j["_myAddress"] = _myAddress.toStdString();
j["_partnerAddress"] = _partnerAddress.toStdString();
j["_name"] = _name.toStdString();
j["_cid"] = _cid.toStdString();
j["_avatar"] = _avatar.toStdString();
QJsonObject j;
j["_myAddress"] = _myAddress;
j["_partnerAddress"] = _partnerAddress;
j["_name"] = _name;
j["_cid"] = _cid;
j["_avatar"] = _avatar;
return j;
}
}

View File

@@ -6,7 +6,6 @@
#include <vector>
#include <QString>
#include "mainwindow.h"
using json = nlohmann::json;
class ContactItem
{
@@ -34,7 +33,7 @@ public:
void setcid(QString cid);
void setAvatar(QString avatar);
QString toQTString();
json toJson();
QJsonValue toJson();
};
#endif
#endif

View File

@@ -93,4 +93,4 @@ void ContactRequest::clear()
ContactRequest::~ContactRequest()
{
clear();
}
}

View File

@@ -5,7 +5,6 @@
#define CONTACTREQUEST_H
#include <QString>
using json = nlohmann::json;
class ContactRequest
{
@@ -37,4 +36,4 @@ class ContactRequest
~ContactRequest();
};
#endif
#endif