Apply clang-format
This commit is contained in:
@@ -7,16 +7,15 @@
|
|||||||
#include "csapi/joining.h"
|
#include "csapi/joining.h"
|
||||||
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <QStringBuilder>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QStringBuilder>
|
||||||
|
|
||||||
ActionsHandler::ActionsHandler(QObject *parent)
|
ActionsHandler::ActionsHandler(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ActionsHandler::~ActionsHandler()
|
ActionsHandler::~ActionsHandler(){};
|
||||||
{};
|
|
||||||
|
|
||||||
NeoChatRoom *ActionsHandler::room() const
|
NeoChatRoom *ActionsHandler::room() const
|
||||||
{
|
{
|
||||||
@@ -48,11 +47,10 @@ void ActionsHandler::setConnection(Connection *connection)
|
|||||||
}
|
}
|
||||||
m_connection = connection;
|
m_connection = connection;
|
||||||
if (m_connection != nullptr) {
|
if (m_connection != nullptr) {
|
||||||
connect(m_connection, &Connection::directChatAvailable,
|
connect(m_connection, &Connection::directChatAvailable, this, [this](Quotient::Room *room) {
|
||||||
this, [this](Quotient::Room *room) {
|
room->setDisplayed(true);
|
||||||
room->setDisplayed(true);
|
Q_EMIT roomJoined(room->id());
|
||||||
Q_EMIT roomJoined(room->id());
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
Q_EMIT connectionChanged();
|
Q_EMIT connectionChanged();
|
||||||
}
|
}
|
||||||
@@ -61,71 +59,82 @@ QVariantList ActionsHandler::commands() const
|
|||||||
{
|
{
|
||||||
QVariantList commands;
|
QVariantList commands;
|
||||||
// Messages commands
|
// Messages commands
|
||||||
commands.append({
|
commands.append({QStringLiteral("prefix"),
|
||||||
QStringLiteral("prefix"), QStringLiteral("/shrug "),
|
QStringLiteral("/shrug "),
|
||||||
QStringLiteral("parameter"), i18nc("@label Parameter of a command", "<message>"),
|
QStringLiteral("parameter"),
|
||||||
QStringLiteral("help"), i18n("Prepends ¯\\_(ツ)_/¯ to a plain-text message")
|
i18nc("@label Parameter of a command", "<message>"),
|
||||||
});
|
QStringLiteral("help"),
|
||||||
|
i18n("Prepends ¯\\_(ツ)_/¯ to a plain-text message")});
|
||||||
|
|
||||||
commands.append({
|
commands.append({QStringLiteral("prefix"),
|
||||||
QStringLiteral("prefix"), QStringLiteral("/lenny "),
|
QStringLiteral("/lenny "),
|
||||||
QStringLiteral("parameter"), i18nc("@label Parameter of a command", "<message>"),
|
QStringLiteral("parameter"),
|
||||||
QStringLiteral("help"), i18n("Prepends ( ͡° ͜ʖ ͡°) to a plain-text message")
|
i18nc("@label Parameter of a command", "<message>"),
|
||||||
});
|
QStringLiteral("help"),
|
||||||
|
i18n("Prepends ( ͡° ͜ʖ ͡°) to a plain-text message")});
|
||||||
|
|
||||||
commands.append({
|
commands.append({QStringLiteral("prefix"),
|
||||||
QStringLiteral("prefix"), QStringLiteral("/plain "),
|
QStringLiteral("/plain "),
|
||||||
QStringLiteral("parameter"), i18nc("@label Parameter of a command", "<message>"),
|
QStringLiteral("parameter"),
|
||||||
QStringLiteral("help"), i18n("Sends a message as plain text, without interpreting it as markdown")
|
i18nc("@label Parameter of a command", "<message>"),
|
||||||
});
|
QStringLiteral("help"),
|
||||||
|
i18n("Sends a message as plain text, without interpreting it as markdown")});
|
||||||
|
|
||||||
commands.append({
|
commands.append({QStringLiteral("prefix"),
|
||||||
QStringLiteral("prefix"), QStringLiteral("/html "),
|
QStringLiteral("/html "),
|
||||||
QStringLiteral("parameter"), i18nc("@label Parameter of a command", "<message>"),
|
QStringLiteral("parameter"),
|
||||||
QStringLiteral("help"), i18n("Sends a message as html, without interpreting it as markdown")
|
i18nc("@label Parameter of a command", "<message>"),
|
||||||
});
|
QStringLiteral("help"),
|
||||||
|
i18n("Sends a message as html, without interpreting it as markdown")});
|
||||||
|
|
||||||
commands.append({
|
commands.append({QStringLiteral("prefix"),
|
||||||
QStringLiteral("prefix"), QStringLiteral("/rainbow "),
|
QStringLiteral("/rainbow "),
|
||||||
QStringLiteral("parameter"), i18nc("@label Parameter of a command", "<message>"),
|
QStringLiteral("parameter"),
|
||||||
QStringLiteral("help"), i18n("Sends the given message coloured as a rainbow")
|
i18nc("@label Parameter of a command", "<message>"),
|
||||||
});
|
QStringLiteral("help"),
|
||||||
|
i18n("Sends the given message coloured as a rainbow")});
|
||||||
|
|
||||||
commands.append({
|
commands.append({QStringLiteral("prefix"),
|
||||||
QStringLiteral("prefix"), QStringLiteral("/rainbowme "),
|
QStringLiteral("/rainbowme "),
|
||||||
QStringLiteral("parameter"), i18nc("@label Parameter of a command", "<message>"),
|
QStringLiteral("parameter"),
|
||||||
QStringLiteral("help"), i18n("Sends the given emote coloured as a rainbow")
|
i18nc("@label Parameter of a command", "<message>"),
|
||||||
});
|
QStringLiteral("help"),
|
||||||
|
i18n("Sends the given emote coloured as a rainbow")});
|
||||||
|
|
||||||
commands.append({
|
commands.append({QStringLiteral("prefix"),
|
||||||
QStringLiteral("prefix"), QStringLiteral("/me "),
|
QStringLiteral("/me "),
|
||||||
QStringLiteral("parameter"), i18nc("@label Parameter of a command", "<message>"),
|
QStringLiteral("parameter"),
|
||||||
QStringLiteral("help"), i18n("Displays action")
|
i18nc("@label Parameter of a command", "<message>"),
|
||||||
});
|
QStringLiteral("help"),
|
||||||
|
i18n("Displays action")});
|
||||||
|
|
||||||
// Actions commands
|
// Actions commands
|
||||||
commands.append({
|
commands.append({QStringLiteral("prefix"),
|
||||||
QStringLiteral("prefix"), QStringLiteral("/join "),
|
QStringLiteral("/join "),
|
||||||
QStringLiteral("parameter"), i18nc("@label Parameter of a command", "<room-address>"),
|
QStringLiteral("parameter"),
|
||||||
QStringLiteral("help"), i18n("Joins room with given address")
|
i18nc("@label Parameter of a command", "<room-address>"),
|
||||||
});
|
QStringLiteral("help"),
|
||||||
|
i18n("Joins room with given address")});
|
||||||
|
|
||||||
commands.append({
|
commands.append({QStringLiteral("prefix"),
|
||||||
QStringLiteral("prefix"), QStringLiteral("/part "),
|
QStringLiteral("/part "),
|
||||||
QStringLiteral("parameter"), i18nc("@label Parameter of a command", "[<room-address>]"),
|
QStringLiteral("parameter"),
|
||||||
QStringLiteral("help"), i18n("Leave room")
|
i18nc("@label Parameter of a command", "[<room-address>]"),
|
||||||
});
|
QStringLiteral("help"),
|
||||||
|
i18n("Leave room")});
|
||||||
|
|
||||||
commands.append({
|
commands.append({QStringLiteral("prefix"),
|
||||||
QStringLiteral("prefix"), QStringLiteral("/invite "),
|
QStringLiteral("/invite "),
|
||||||
QStringLiteral("parameter"), i18nc("@label Parameter of a command", "<user-id>"),
|
QStringLiteral("parameter"),
|
||||||
QStringLiteral("help"), i18n("Invites user with given id to current room")
|
i18nc("@label Parameter of a command", "<user-id>"),
|
||||||
});
|
QStringLiteral("help"),
|
||||||
commands.append({
|
i18n("Invites user with given id to current room")});
|
||||||
QStringLiteral("prefix"), QStringLiteral("/react "),
|
commands.append({QStringLiteral("prefix"),
|
||||||
QStringLiteral("parameter"), i18nc("@label Parameter of a command", "<reaction text>"),
|
QStringLiteral("/react "),
|
||||||
QStringLiteral("help"), i18n("React to this message with a text")
|
QStringLiteral("parameter"),
|
||||||
});
|
i18nc("@label Parameter of a command", "<reaction text>"),
|
||||||
|
QStringLiteral("help"),
|
||||||
|
i18n("React to this message with a text")});
|
||||||
|
|
||||||
// TODO more see elements /help action
|
// TODO more see elements /help action
|
||||||
|
|
||||||
@@ -143,8 +152,7 @@ void ActionsHandler::joinRoom(const QString &alias)
|
|||||||
auto joinRoomJob = m_connection->joinRoom(alias, QStringList{knownServer});
|
auto joinRoomJob = m_connection->joinRoom(alias, QStringList{knownServer});
|
||||||
|
|
||||||
Quotient::JoinRoomJob::connect(joinRoomJob, &JoinRoomJob::failure, [=] {
|
Quotient::JoinRoomJob::connect(joinRoomJob, &JoinRoomJob::failure, [=] {
|
||||||
Q_EMIT showMessage(MessageType::Error, i18n("Server error when joining the room \"%1\": %2",
|
Q_EMIT showMessage(MessageType::Error, i18n("Server error when joining the room \"%1\": %2", joinRoomJob->errorString()));
|
||||||
joinRoomJob->errorString()));
|
|
||||||
});
|
});
|
||||||
Quotient::JoinRoomJob::connect(joinRoomJob, &JoinRoomJob::success, [this, joinRoomJob] {
|
Quotient::JoinRoomJob::connect(joinRoomJob, &JoinRoomJob::success, [this, joinRoomJob] {
|
||||||
Q_EMIT roomJoined(joinRoomJob->roomId());
|
Q_EMIT roomJoined(joinRoomJob->roomId());
|
||||||
@@ -163,16 +171,16 @@ void ActionsHandler::createRoom(const QString &name, const QString &topic)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ActionsHandler::postMessage(const QString &text,
|
void ActionsHandler::postMessage(const QString &text,
|
||||||
const QString &attachementPath, const QString &replyEventId, const QString &editEventId,
|
const QString &attachementPath,
|
||||||
const QVariantMap &usernames)
|
const QString &replyEventId,
|
||||||
|
const QString &editEventId,
|
||||||
|
const QVariantMap &usernames)
|
||||||
{
|
{
|
||||||
QString rawText = text;
|
QString rawText = text;
|
||||||
QString cleanedText = text;
|
QString cleanedText = text;
|
||||||
|
|
||||||
|
|
||||||
for (auto it = usernames.constBegin(); it != usernames.constEnd(); it++) {
|
for (auto it = usernames.constBegin(); it != usernames.constEnd(); it++) {
|
||||||
cleanedText = cleanedText.replace(it.key(),
|
cleanedText = cleanedText.replace(it.key(), "[" + it.key() + "](https://matrix.to/#/" + it.value().toString() + ")");
|
||||||
"[" + it.key() + "](https://matrix.to/#/" + it.value().toString() + ")");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attachementPath.length() > 0) {
|
if (attachementPath.length() > 0) {
|
||||||
@@ -211,13 +219,12 @@ void ActionsHandler::postMessage(const QString &text,
|
|||||||
static const QString msgPrefix = QStringLiteral("/msg "); // TODO
|
static const QString msgPrefix = QStringLiteral("/msg "); // TODO
|
||||||
static const QString reactPrefix = QStringLiteral("/react ");
|
static const QString reactPrefix = QStringLiteral("/react ");
|
||||||
|
|
||||||
// Admin commands
|
// Admin commands
|
||||||
|
|
||||||
static QStringList rainbowColors{"#ff2b00", "#ff5500", "#ff8000", "#ffaa00", "#ffd500",
|
static QStringList rainbowColors{"#ff2b00", "#ff5500", "#ff8000", "#ffaa00", "#ffd500", "#ffff00", "#d4ff00", "#aaff00", "#80ff00",
|
||||||
"#ffff00", "#d4ff00", "#aaff00", "#80ff00", "#55ff00", "#2bff00", "#00ff00", "#00ff2b",
|
"#55ff00", "#2bff00", "#00ff00", "#00ff2b", "#00ff55", "#00ff80", "#00ffaa", "#00ffd5", "#00ffff",
|
||||||
"#00ff55", "#00ff80", "#00ffaa", "#00ffd5", "#00ffff", "#00d4ff", "#00aaff", "#007fff",
|
"#00d4ff", "#00aaff", "#007fff", "#0055ff", "#002bff", "#0000ff", "#2a00ff", "#5500ff", "#7f00ff",
|
||||||
"#0055ff", "#002bff", "#0000ff", "#2a00ff", "#5500ff", "#7f00ff", "#aa00ff", "#d400ff",
|
"#aa00ff", "#d400ff", "#ff00ff", "#ff00d4", "#ff00aa", "#ff0080", "#ff0055", "#ff002b", "#ff0000"};
|
||||||
"#ff00ff", "#ff00d4", "#ff00aa", "#ff0080", "#ff0055", "#ff002b", "#ff0000"};
|
|
||||||
|
|
||||||
if (cleanedText.indexOf(shrugPrefix) == 0) {
|
if (cleanedText.indexOf(shrugPrefix) == 0) {
|
||||||
cleanedText = QStringLiteral("¯\\\\_(ツ)\\_/¯") % cleanedText.remove(0, shrugPrefix.length());
|
cleanedText = QStringLiteral("¯\\\\_(ツ)\\_/¯") % cleanedText.remove(0, shrugPrefix.length());
|
||||||
@@ -237,7 +244,7 @@ void ActionsHandler::postMessage(const QString &text,
|
|||||||
for (int i = 0; i < cleanedText.length(); i++) {
|
for (int i = 0; i < cleanedText.length(); i++) {
|
||||||
rainbowText = rainbowText % QStringLiteral("<font color='") % rainbowColors.at(i % rainbowColors.length()) % "'>" % cleanedText.at(i) % "</font>";
|
rainbowText = rainbowText % QStringLiteral("<font color='") % rainbowColors.at(i % rainbowColors.length()) % "'>" % cleanedText.at(i) % "</font>";
|
||||||
}
|
}
|
||||||
m_room->postHtmlMessage(cleanedText, rainbowText, RoomMessageEvent::MsgType::Notice, replyEventId, editEventId);
|
m_room->postHtmlMessage(cleanedText, rainbowText, RoomMessageEvent::MsgType::Notice, replyEventId, editEventId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,8 +271,7 @@ void ActionsHandler::postMessage(const QString &text,
|
|||||||
} else if (splittedText[0].indexOf(":") != -1) {
|
} else if (splittedText[0].indexOf(":") != -1) {
|
||||||
joinRoom(splittedText[0]);
|
joinRoom(splittedText[0]);
|
||||||
return;
|
return;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
joinRoom(splittedText[0] + ":matrix.org");
|
joinRoom(splittedText[0] + ":matrix.org");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -330,8 +336,8 @@ void ActionsHandler::postMessage(const QString &text,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(rawText.indexOf(reactPrefix) == 0) {
|
if (rawText.indexOf(reactPrefix) == 0) {
|
||||||
if(replyEventId.isEmpty()) {
|
if (replyEventId.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rawText = rawText.remove(0, reactPrefix.length());
|
rawText = rawText.remove(0, reactPrefix.length());
|
||||||
|
|||||||
@@ -71,8 +71,8 @@ public Q_SLOTS:
|
|||||||
/// \brief Post a message.
|
/// \brief Post a message.
|
||||||
///
|
///
|
||||||
/// This also interprets commands if any.
|
/// This also interprets commands if any.
|
||||||
void postMessage(const QString &text, const QString &attachementPath,
|
void
|
||||||
const QString &replyEventId, const QString &editEventId, const QVariantMap &usernames);
|
postMessage(const QString &text, const QString &attachementPath, const QString &replyEventId, const QString &editEventId, const QVariantMap &usernames);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Connection *m_connection = nullptr;
|
Connection *m_connection = nullptr;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ QString ChatBoxHelper::editEventId() const
|
|||||||
return m_editEventId;
|
return m_editEventId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatBoxHelper::setEditEventId(const QString& editEventId)
|
void ChatBoxHelper::setEditEventId(const QString &editEventId)
|
||||||
{
|
{
|
||||||
if (m_editEventId == editEventId) {
|
if (m_editEventId == editEventId) {
|
||||||
return;
|
return;
|
||||||
@@ -35,7 +35,7 @@ QString ChatBoxHelper::editContent() const
|
|||||||
return m_editContent;
|
return m_editContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatBoxHelper::setEditContent(const QString& editContent)
|
void ChatBoxHelper::setEditContent(const QString &editContent)
|
||||||
{
|
{
|
||||||
if (m_editContent == editContent) {
|
if (m_editContent == editContent) {
|
||||||
return;
|
return;
|
||||||
@@ -50,7 +50,7 @@ QString ChatBoxHelper::replyEventId() const
|
|||||||
return m_replyEventId;
|
return m_replyEventId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatBoxHelper::setReplyEventId(const QString& replyEventId)
|
void ChatBoxHelper::setReplyEventId(const QString &replyEventId)
|
||||||
{
|
{
|
||||||
if (m_replyEventId == replyEventId) {
|
if (m_replyEventId == replyEventId) {
|
||||||
return;
|
return;
|
||||||
@@ -65,7 +65,7 @@ QString ChatBoxHelper::replyEventContent() const
|
|||||||
return m_replyEventContent;
|
return m_replyEventContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatBoxHelper::setReplyEventContent(const QString& replyEventContent)
|
void ChatBoxHelper::setReplyEventContent(const QString &replyEventContent)
|
||||||
{
|
{
|
||||||
if (m_replyEventContent == replyEventContent) {
|
if (m_replyEventContent == replyEventContent) {
|
||||||
return;
|
return;
|
||||||
@@ -86,7 +86,7 @@ QString ChatBoxHelper::attachmentPath() const
|
|||||||
return m_attachmentPath;
|
return m_attachmentPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatBoxHelper::setAttachmentPath(const QString& attachmentPath)
|
void ChatBoxHelper::setAttachmentPath(const QString &attachmentPath)
|
||||||
{
|
{
|
||||||
if (m_attachmentPath == attachmentPath) {
|
if (m_attachmentPath == attachmentPath) {
|
||||||
return;
|
return;
|
||||||
@@ -135,7 +135,7 @@ void ChatBoxHelper::clear()
|
|||||||
setReplyUser(QVariant());
|
setReplyUser(QVariant());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatBoxHelper::edit(const QString& message, const QString& formattedBody, const QString& eventId)
|
void ChatBoxHelper::edit(const QString &message, const QString &formattedBody, const QString &eventId)
|
||||||
{
|
{
|
||||||
setEditEventId(eventId);
|
setEditEventId(eventId);
|
||||||
setEditContent(message);
|
setEditContent(message);
|
||||||
@@ -156,7 +156,3 @@ void ChatBoxHelper::clearAttachment()
|
|||||||
{
|
{
|
||||||
setAttachmentPath(QString());
|
setAttachmentPath(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,11 +39,11 @@ public:
|
|||||||
QString attachmentPath() const;
|
QString attachmentPath() const;
|
||||||
bool hasAttachment() const;
|
bool hasAttachment() const;
|
||||||
|
|
||||||
void setEditEventId(const QString& editEventId);
|
void setEditEventId(const QString &editEventId);
|
||||||
void setEditContent(const QString& editContent);
|
void setEditContent(const QString &editContent);
|
||||||
void setReplyEventId(const QString& replyEventId);
|
void setReplyEventId(const QString &replyEventId);
|
||||||
void setReplyEventContent(const QString& replyEventContent);
|
void setReplyEventContent(const QString &replyEventContent);
|
||||||
void setAttachmentPath(const QString& attachmentPath);
|
void setAttachmentPath(const QString &attachmentPath);
|
||||||
void setReplyUser(const QVariant &replyUser);
|
void setReplyUser(const QVariant &replyUser);
|
||||||
|
|
||||||
Q_INVOKABLE void replyToMessage(const QString &replyEventid, const QString &replyEvent, const QVariant &replyUser);
|
Q_INVOKABLE void replyToMessage(const QString &replyEventid, const QString &replyEvent, const QVariant &replyUser);
|
||||||
@@ -54,13 +54,13 @@ public:
|
|||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void isEditingChanged(bool isEditing);
|
void isEditingChanged(bool isEditing);
|
||||||
void editEventIdChanged(const QString& editEventId);
|
void editEventIdChanged(const QString &editEventId);
|
||||||
void editContentChanged();
|
void editContentChanged();
|
||||||
void replyEventIdChanged(const QString& replyEventId);
|
void replyEventIdChanged(const QString &replyEventId);
|
||||||
void replyEventContentChanged(const QString& replyEventContent);
|
void replyEventContentChanged(const QString &replyEventContent);
|
||||||
void replyUserChanged();
|
void replyUserChanged();
|
||||||
void isReplyingChanged(bool isReplying);
|
void isReplyingChanged(bool isReplying);
|
||||||
void attachmentPathChanged(const QString& attachmentPath);
|
void attachmentPathChanged(const QString &attachmentPath);
|
||||||
void hasAttachmentChanged(bool hasAttachment);
|
void hasAttachmentChanged(bool hasAttachment);
|
||||||
void editing(const QString &message, const QString &formattedBody);
|
void editing(const QString &message, const QString &formattedBody);
|
||||||
void shouldClearText();
|
void shouldClearText();
|
||||||
|
|||||||
@@ -10,26 +10,26 @@
|
|||||||
|
|
||||||
#include <KConfig>
|
#include <KConfig>
|
||||||
#include <KConfigGroup>
|
#include <KConfigGroup>
|
||||||
#include <KWindowConfig>
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
|
#include <KWindowConfig>
|
||||||
|
|
||||||
|
#include <QAuthenticator>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
|
#include <QCloseEvent>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QQuickWindow>
|
#include <QDesktopServices>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include <QMovie>
|
||||||
|
#include <QNetworkReply>
|
||||||
|
#include <QPixmap>
|
||||||
|
#include <QQuickWindow>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
#include <QStringBuilder>
|
||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QCloseEvent>
|
|
||||||
#include <QDesktopServices>
|
|
||||||
#include <QMovie>
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QAuthenticator>
|
|
||||||
#include <QNetworkReply>
|
|
||||||
#include <QStringBuilder>
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@@ -61,13 +61,13 @@ Controller::Controller(QObject *parent)
|
|||||||
|
|
||||||
#ifndef Q_OS_ANDROID
|
#ifndef Q_OS_ANDROID
|
||||||
TrayIcon *trayIcon = new TrayIcon(this);
|
TrayIcon *trayIcon = new TrayIcon(this);
|
||||||
if(NeoChatConfig::self()->systemTray()) {
|
if (NeoChatConfig::self()->systemTray()) {
|
||||||
trayIcon->show();
|
trayIcon->show();
|
||||||
connect(trayIcon, &TrayIcon::showWindow, this, &Controller::showWindow);
|
connect(trayIcon, &TrayIcon::showWindow, this, &Controller::showWindow);
|
||||||
QApplication::setQuitOnLastWindowClosed(false);
|
QApplication::setQuitOnLastWindowClosed(false);
|
||||||
}
|
}
|
||||||
connect(NeoChatConfig::self(), &NeoChatConfig::SystemTrayChanged, this, [=](){
|
connect(NeoChatConfig::self(), &NeoChatConfig::SystemTrayChanged, this, [=]() {
|
||||||
if(NeoChatConfig::self()->systemTray()) {
|
if (NeoChatConfig::self()->systemTray()) {
|
||||||
trayIcon->show();
|
trayIcon->show();
|
||||||
connect(trayIcon, &TrayIcon::showWindow, this, &Controller::showWindow);
|
connect(trayIcon, &TrayIcon::showWindow, this, &Controller::showWindow);
|
||||||
} else {
|
} else {
|
||||||
@@ -219,8 +219,8 @@ void Controller::addConnection(Connection *c)
|
|||||||
dropConnection(c);
|
dropConnection(c);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(c, &Connection::requestFailed, this, [=] (BaseJob *job) {
|
connect(c, &Connection::requestFailed, this, [=](BaseJob *job) {
|
||||||
if(job->error() == BaseJob::UserConsentRequiredError) {
|
if (job->error() == BaseJob::UserConsentRequiredError) {
|
||||||
Q_EMIT userConsentRequired(job->errorUrl());
|
Q_EMIT userConsentRequired(job->errorUrl());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -381,7 +381,6 @@ bool Controller::saveAccessTokenToKeyChain(const AccountSettings &account, const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Controller::playAudio(const QUrl &localFile)
|
void Controller::playAudio(const QUrl &localFile)
|
||||||
{
|
{
|
||||||
auto player = new QMediaPlayer;
|
auto player = new QMediaPlayer;
|
||||||
@@ -468,8 +467,7 @@ bool Controller::setAvatar(Connection *connection, const QUrl &avatarSource)
|
|||||||
}
|
}
|
||||||
if (QImageReader(decoded).read().isNull()) {
|
if (QImageReader(decoded).read().isNull()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return localUser->setAvatar(decoded);
|
return localUser->setAvatar(decoded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -553,12 +551,10 @@ void Controller::saveWindowGeometry(QQuickWindow *window)
|
|||||||
dataResource.sync();
|
dataResource.sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NeochatDeleteDeviceJob::NeochatDeleteDeviceJob(const QString &deviceId, const Omittable<QJsonObject> &auth)
|
NeochatDeleteDeviceJob::NeochatDeleteDeviceJob(const QString &deviceId, const Omittable<QJsonObject> &auth)
|
||||||
: Quotient::BaseJob(HttpVerb::Delete, QStringLiteral("DeleteDeviceJob"), QStringLiteral("/_matrix/client/r0/devices/%1").arg(deviceId))
|
: Quotient::BaseJob(HttpVerb::Delete, QStringLiteral("DeleteDeviceJob"), QStringLiteral("/_matrix/client/r0/devices/%1").arg(deviceId))
|
||||||
{
|
{
|
||||||
QJsonObject _data;
|
QJsonObject _data;
|
||||||
addParam<IfNotEmpty>(_data, QStringLiteral("auth"), auth);
|
addParam<IfNotEmpty>(_data, QStringLiteral("auth"), auth);
|
||||||
setRequestData(std::move(_data));
|
setRequestData(std::move(_data));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1296,133 +1296,261 @@ const QVariantList EmojiModel::symbols = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const QVariantList EmojiModel::flags = {
|
const QVariantList EmojiModel::flags = {
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xa8"), ":flag_ac:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xa9"), ":flag_ad:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xa8"), ":flag_ac:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xaa"), ":flag_ae:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xab"), ":flag_af:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xa9"), ":flag_ad:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xac"), ":flag_ag:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xae"), ":flag_ai:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xaa"), ":flag_ae:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb1"), ":flag_al:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb2"), ":flag_am:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xab"), ":flag_af:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb4"), ":flag_ao:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb6"), ":flag_aq:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xac"), ":flag_ag:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb7"), ":flag_ar:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb8"), ":flag_as:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xae"), ":flag_ai:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb9"), ":flag_at:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xba"), ":flag_au:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb1"), ":flag_al:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xbc"), ":flag_aw:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xbd"), ":flag_ax:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb2"), ":flag_am:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xbf"), ":flag_az:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xa6"), ":flag_ba:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb4"), ":flag_ao:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xa7"), ":flag_bb:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xa9"), ":flag_bd:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb6"), ":flag_aq:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xaa"), ":flag_be:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xab"), ":flag_bf:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb7"), ":flag_ar:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xac"), ":flag_bg:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xad"), ":flag_bh:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb8"), ":flag_as:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xae"), ":flag_bi:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xaf"), ":flag_bj:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb9"), ":flag_at:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb1"), ":flag_bl:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb2"), ":flag_bm:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xba"), ":flag_au:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb3"), ":flag_bn:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb4"), ":flag_bo:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xbc"), ":flag_aw:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb6"), ":flag_bq:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb7"), ":flag_br:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xbd"), ":flag_ax:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb8"), ":flag_bs:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb9"), ":flag_bt:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xbf"), ":flag_az:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbb"), ":flag_bv:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbc"), ":flag_bw:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xa6"), ":flag_ba:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbe"), ":flag_by:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbf"), ":flag_bz:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xa7"), ":flag_bb:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xa6"), ":flag_ca:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xa8"), ":flag_cc:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xa9"), ":flag_bd:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xa9"), ":flag_cd:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xab"), ":flag_cf:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xaa"), ":flag_be:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xac"), ":flag_cg:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xad"), ":flag_ch:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xab"), ":flag_bf:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xae"), ":flag_ci:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb0"), ":flag_ck:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xac"), ":flag_bg:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb1"), ":flag_cl:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb2"), ":flag_cm:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xad"), ":flag_bh:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb3"), ":flag_cn:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb4"), ":flag_co:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xae"), ":flag_bi:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb5"), ":flag_cp:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb7"), ":flag_cr:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xaf"), ":flag_bj:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xba"), ":flag_cu:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbb"), ":flag_cv:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb1"), ":flag_bl:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbc"), ":flag_cw:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbd"), ":flag_cx:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb2"), ":flag_bm:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbe"), ":flag_cy:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbf"), ":flag_cz:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb3"), ":flag_bn:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xaa"), ":flag_de:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xac"), ":flag_dg:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb4"), ":flag_bo:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xaf"), ":flag_dj:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xb0"), ":flag_dk:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb6"), ":flag_bq:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xb2"), ":flag_dm:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xb4"), ":flag_do:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb7"), ":flag_br:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xbf"), ":flag_dz:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xa6"), ":flag_ea:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb8"), ":flag_bs:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xa8"), ":flag_ec:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xaa"), ":flag_ee:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb9"), ":flag_bt:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xac"), ":flag_eg:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xad"), ":flag_eh:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbb"), ":flag_bv:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xb7"), ":flag_er:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xb8"), ":flag_es:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbc"), ":flag_bw:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xb9"), ":flag_et:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xba"), ":flag_eu:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbe"), ":flag_by:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xae"), ":flag_fi:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xaf"), ":flag_fj:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbf"), ":flag_bz:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb0"), ":flag_fk:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb2"), ":flag_fm:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xa6"), ":flag_ca:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb4"), ":flag_fo:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb7"), ":flag_fr:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xa8"), ":flag_cc:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xa6"), ":flag_ga:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xa7"), ":flag_gb:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xa9"), ":flag_cd:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xa9"), ":flag_gd:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xaa"), ":flag_ge:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xab"), ":flag_cf:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xab"), ":flag_gf:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xac"), ":flag_gg:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xac"), ":flag_cg:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xad"), ":flag_gh:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xae"), ":flag_gi:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xad"), ":flag_ch:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb1"), ":flag_gl:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb2"), ":flag_gm:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xae"), ":flag_ci:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb3"), ":flag_gn:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb5"), ":flag_gp:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb0"), ":flag_ck:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb6"), ":flag_gq:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb7"), ":flag_gr:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb1"), ":flag_cl:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb8"), ":flag_gs:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb9"), ":flag_gt:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb2"), ":flag_cm:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xba"), ":flag_gu:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xbc"), ":flag_gw:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb3"), ":flag_cn:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xbe"), ":flag_gy:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb0"), ":flag_hk:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb4"), ":flag_co:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb2"), ":flag_hm:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb3"), ":flag_hn:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb5"), ":flag_cp:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb7"), ":flag_hr:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb9"), ":flag_ht:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb7"), ":flag_cr:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xba"), ":flag_hu:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xa8"), ":flag_ic:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xba"), ":flag_cu:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xa9"), ":flag_id:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xaa"), ":flag_ie:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbb"), ":flag_cv:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb1"), ":flag_il:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb2"), ":flag_im:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbc"), ":flag_cw:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb3"), ":flag_in:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb4"), ":flag_io:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbd"), ":flag_cx:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb6"), ":flag_iq:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb7"), ":flag_ir:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbe"), ":flag_cy:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb8"), ":flag_is:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb9"), ":flag_it:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbf"), ":flag_cz:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xaa"), ":flag_je:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xb2"), ":flag_jm:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xaa"), ":flag_de:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xb4"), ":flag_jo:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xb5"), ":flag_jp:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xac"), ":flag_dg:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xaa"), ":flag_ke:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xac"), ":flag_kg:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xaf"), ":flag_dj:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xad"), ":flag_kh:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xae"), ":flag_ki:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xb0"), ":flag_dk:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb2"), ":flag_km:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb3"), ":flag_kn:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xb2"), ":flag_dm:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb5"), ":flag_kp:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb7"), ":flag_kr:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xb4"), ":flag_do:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xbc"), ":flag_kw:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xbe"), ":flag_ky:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xbf"), ":flag_dz:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xbf"), ":flag_kz:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xa6"), ":flag_la:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xa6"), ":flag_ea:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xa7"), ":flag_lb:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xa8"), ":flag_lc:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xa8"), ":flag_ec:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xae"), ":flag_li:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb0"), ":flag_lk:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xaa"), ":flag_ee:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb7"), ":flag_lr:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb8"), ":flag_ls:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xac"), ":flag_eg:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb9"), ":flag_lt:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xba"), ":flag_lu:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xad"), ":flag_eh:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xbb"), ":flag_lv:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xbe"), ":flag_ly:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xb7"), ":flag_er:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xa6"), ":flag_ma:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xa8"), ":flag_mc:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xb8"), ":flag_es:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xa9"), ":flag_md:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xaa"), ":flag_me:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xb9"), ":flag_et:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xab"), ":flag_mf:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xac"), ":flag_mg:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xba"), ":flag_eu:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xad"), ":flag_mh:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb0"), ":flag_mk:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xae"), ":flag_fi:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb1"), ":flag_ml:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb2"), ":flag_mm:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xaf"), ":flag_fj:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb3"), ":flag_mn:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb4"), ":flag_mo:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb0"), ":flag_fk:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb5"), ":flag_mp:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb6"), ":flag_mq:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb2"), ":flag_fm:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb7"), ":flag_mr:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb8"), ":flag_ms:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb4"), ":flag_fo:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb9"), ":flag_mt:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xba"), ":flag_mu:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb7"), ":flag_fr:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbb"), ":flag_mv:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbc"), ":flag_mw:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xa6"), ":flag_ga:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbd"), ":flag_mx:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbe"), ":flag_my:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xa7"), ":flag_gb:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbf"), ":flag_mz:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xa6"), ":flag_na:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xa9"), ":flag_gd:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xa8"), ":flag_nc:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xaa"), ":flag_ne:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xaa"), ":flag_ge:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xab"), ":flag_nf:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xac"), ":flag_ng:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xab"), ":flag_gf:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xae"), ":flag_ni:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb1"), ":flag_nl:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xac"), ":flag_gg:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb4"), ":flag_no:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb5"), ":flag_np:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xad"), ":flag_gh:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb7"), ":flag_nr:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xba"), ":flag_nu:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xae"), ":flag_gi:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xbf"), ":flag_nz:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb4\xf0\x9f\x87\xb2"), ":flag_om:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb1"), ":flag_gl:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xa6"), ":flag_pa:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xaa"), ":flag_pe:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb2"), ":flag_gm:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xab"), ":flag_pf:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xac"), ":flag_pg:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb3"), ":flag_gn:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xad"), ":flag_ph:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb0"), ":flag_pk:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb5"), ":flag_gp:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb1"), ":flag_pl:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb2"), ":flag_pm:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb6"), ":flag_gq:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb3"), ":flag_pn:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb7"), ":flag_pr:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb7"), ":flag_gr:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb8"), ":flag_ps:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb9"), ":flag_pt:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb8"), ":flag_gs:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xbc"), ":flag_pw:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xbe"), ":flag_py:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb9"), ":flag_gt:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb6\xf0\x9f\x87\xa6"), ":flag_qa:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xaa"), ":flag_re:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xba"), ":flag_gu:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xb4"), ":flag_ro:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xb8"), ":flag_rs:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xbc"), ":flag_gw:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xba"), ":flag_ru:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xbc"), ":flag_rw:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xbe"), ":flag_gy:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa6"), ":flag_sa:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa7"), ":flag_sb:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb0"), ":flag_hk:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa8"), ":flag_sc:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa9"), ":flag_sd:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb2"), ":flag_hm:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xaa"), ":flag_se:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xac"), ":flag_sg:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb3"), ":flag_hn:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xad"), ":flag_sh:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xae"), ":flag_si:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb7"), ":flag_hr:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xaf"), ":flag_sj:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb0"), ":flag_sk:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb9"), ":flag_ht:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb1"), ":flag_sl:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb2"), ":flag_sm:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xba"), ":flag_hu:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb3"), ":flag_sn:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb4"), ":flag_so:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xa8"), ":flag_ic:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb7"), ":flag_sr:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb8"), ":flag_ss:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xa9"), ":flag_id:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb9"), ":flag_st:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbb"), ":flag_sv:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xaa"), ":flag_ie:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbd"), ":flag_sx:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbe"), ":flag_sy:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb1"), ":flag_il:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbf"), ":flag_sz:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xa6"), ":flag_ta:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb2"), ":flag_im:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xa8"), ":flag_tc:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xa9"), ":flag_td:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb3"), ":flag_in:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xab"), ":flag_tf:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xac"), ":flag_tg:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb4"), ":flag_io:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xad"), ":flag_th:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xaf"), ":flag_tj:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb6"), ":flag_iq:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb0"), ":flag_tk:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb1"), ":flag_tl:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb7"), ":flag_ir:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb2"), ":flag_tm:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb3"), ":flag_tn:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb8"), ":flag_is:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb4"), ":flag_to:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb7"), ":flag_tr:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb9"), ":flag_it:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb9"), ":flag_tt:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xbb"), ":flag_tv:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xaa"), ":flag_je:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xbc"), ":flag_tw:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xbf"), ":flag_tz:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xb2"), ":flag_jm:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xa6"), ":flag_ua:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xac"), ":flag_ug:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xb4"), ":flag_jo:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xb2"), ":flag_um:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xb8"), ":flag_us:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xb5"), ":flag_jp:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xbe"), ":flag_uy:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xbf"), ":flag_uz:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xaa"), ":flag_ke:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xa6"), ":flag_va:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xa8"), ":flag_vc:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xac"), ":flag_kg:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xaa"), ":flag_ve:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xac"), ":flag_vg:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xad"), ":flag_kh:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xae"), ":flag_vi:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xb3"), ":flag_vn:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xae"), ":flag_ki:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xba"), ":flag_vu:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbc\xf0\x9f\x87\xab"), ":flag_wf:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb2"), ":flag_km:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbc\xf0\x9f\x87\xb8"), ":flag_ws:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbd\xf0\x9f\x87\xb0"), ":flag_xk:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb3"), ":flag_kn:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbe\xf0\x9f\x87\xaa"), ":flag_ye:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbe\xf0\x9f\x87\xb9"), ":flag_yt:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb5"), ":flag_kp:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbf\xf0\x9f\x87\xa6"), ":flag_za:"}), QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbf\xf0\x9f\x87\xb2"), ":flag_zm:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb7"), ":flag_kr:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xbc"), ":flag_kw:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xbe"), ":flag_ky:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xbf"), ":flag_kz:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xa6"), ":flag_la:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xa7"), ":flag_lb:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xa8"), ":flag_lc:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xae"), ":flag_li:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb0"), ":flag_lk:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb7"), ":flag_lr:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb8"), ":flag_ls:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb9"), ":flag_lt:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xba"), ":flag_lu:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xbb"), ":flag_lv:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xbe"), ":flag_ly:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xa6"), ":flag_ma:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xa8"), ":flag_mc:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xa9"), ":flag_md:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xaa"), ":flag_me:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xab"), ":flag_mf:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xac"), ":flag_mg:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xad"), ":flag_mh:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb0"), ":flag_mk:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb1"), ":flag_ml:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb2"), ":flag_mm:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb3"), ":flag_mn:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb4"), ":flag_mo:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb5"), ":flag_mp:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb6"), ":flag_mq:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb7"), ":flag_mr:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb8"), ":flag_ms:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb9"), ":flag_mt:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xba"), ":flag_mu:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbb"), ":flag_mv:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbc"), ":flag_mw:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbd"), ":flag_mx:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbe"), ":flag_my:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbf"), ":flag_mz:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xa6"), ":flag_na:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xa8"), ":flag_nc:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xaa"), ":flag_ne:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xab"), ":flag_nf:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xac"), ":flag_ng:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xae"), ":flag_ni:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb1"), ":flag_nl:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb4"), ":flag_no:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb5"), ":flag_np:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb7"), ":flag_nr:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xba"), ":flag_nu:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xbf"), ":flag_nz:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb4\xf0\x9f\x87\xb2"), ":flag_om:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xa6"), ":flag_pa:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xaa"), ":flag_pe:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xab"), ":flag_pf:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xac"), ":flag_pg:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xad"), ":flag_ph:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb0"), ":flag_pk:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb1"), ":flag_pl:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb2"), ":flag_pm:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb3"), ":flag_pn:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb7"), ":flag_pr:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb8"), ":flag_ps:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb9"), ":flag_pt:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xbc"), ":flag_pw:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xbe"), ":flag_py:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb6\xf0\x9f\x87\xa6"), ":flag_qa:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xaa"), ":flag_re:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xb4"), ":flag_ro:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xb8"), ":flag_rs:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xba"), ":flag_ru:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xbc"), ":flag_rw:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa6"), ":flag_sa:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa7"), ":flag_sb:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa8"), ":flag_sc:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa9"), ":flag_sd:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xaa"), ":flag_se:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xac"), ":flag_sg:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xad"), ":flag_sh:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xae"), ":flag_si:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xaf"), ":flag_sj:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb0"), ":flag_sk:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb1"), ":flag_sl:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb2"), ":flag_sm:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb3"), ":flag_sn:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb4"), ":flag_so:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb7"), ":flag_sr:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb8"), ":flag_ss:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb9"), ":flag_st:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbb"), ":flag_sv:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbd"), ":flag_sx:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbe"), ":flag_sy:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbf"), ":flag_sz:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xa6"), ":flag_ta:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xa8"), ":flag_tc:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xa9"), ":flag_td:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xab"), ":flag_tf:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xac"), ":flag_tg:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xad"), ":flag_th:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xaf"), ":flag_tj:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb0"), ":flag_tk:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb1"), ":flag_tl:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb2"), ":flag_tm:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb3"), ":flag_tn:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb4"), ":flag_to:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb7"), ":flag_tr:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb9"), ":flag_tt:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xbb"), ":flag_tv:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xbc"), ":flag_tw:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xbf"), ":flag_tz:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xa6"), ":flag_ua:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xac"), ":flag_ug:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xb2"), ":flag_um:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xb8"), ":flag_us:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xbe"), ":flag_uy:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xbf"), ":flag_uz:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xa6"), ":flag_va:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xa8"), ":flag_vc:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xaa"), ":flag_ve:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xac"), ":flag_vg:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xae"), ":flag_vi:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xb3"), ":flag_vn:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xba"), ":flag_vu:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbc\xf0\x9f\x87\xab"), ":flag_wf:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbc\xf0\x9f\x87\xb8"), ":flag_ws:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbd\xf0\x9f\x87\xb0"), ":flag_xk:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbe\xf0\x9f\x87\xaa"), ":flag_ye:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbe\xf0\x9f\x87\xb9"), ":flag_yt:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbf\xf0\x9f\x87\xa6"), ":flag_za:"}),
|
||||||
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbf\xf0\x9f\x87\xb2"), ":flag_zm:"}),
|
||||||
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbf\xf0\x9f\x87\xbc"), ":flag_zw:"}),
|
QVariant::fromValue(Emoji{QString::fromUtf8("\xf0\x9f\x87\xbf\xf0\x9f\x87\xbc"), ":flag_zw:"}),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
static QStringList byteArrayListToStringList(const QByteArrayList &byteArrayList)
|
static QStringList byteArrayListToStringList(const QByteArrayList &byteArrayList)
|
||||||
{
|
{
|
||||||
QStringList stringList;
|
QStringList stringList;
|
||||||
for(const QByteArray &byteArray : byteArrayList) {
|
for (const QByteArray &byteArray : byteArrayList) {
|
||||||
stringList.append(QString::fromLocal8Bit(byteArray));
|
stringList.append(QString::fromLocal8Bit(byteArray));
|
||||||
}
|
}
|
||||||
return stringList;
|
return stringList;
|
||||||
@@ -21,17 +21,18 @@ class FileTypeSingletonPrivate
|
|||||||
Q_DISABLE_COPY(FileTypeSingletonPrivate)
|
Q_DISABLE_COPY(FileTypeSingletonPrivate)
|
||||||
public:
|
public:
|
||||||
FileTypeSingletonPrivate(FileTypeSingleton *qq);
|
FileTypeSingletonPrivate(FileTypeSingleton *qq);
|
||||||
FileTypeSingleton * const q_ptr;
|
FileTypeSingleton *const q_ptr;
|
||||||
QMimeDatabase mimetypeDatabase;
|
QMimeDatabase mimetypeDatabase;
|
||||||
QStringList supportedImageFormats = byteArrayListToStringList(QImageReader::supportedImageFormats());
|
QStringList supportedImageFormats = byteArrayListToStringList(QImageReader::supportedImageFormats());
|
||||||
QStringList supportedAnimatedImageFormats = byteArrayListToStringList(QMovie::supportedFormats());
|
QStringList supportedAnimatedImageFormats = byteArrayListToStringList(QMovie::supportedFormats());
|
||||||
};
|
};
|
||||||
|
|
||||||
FileTypeSingletonPrivate::FileTypeSingletonPrivate(FileTypeSingleton* qq) : q_ptr(qq)
|
FileTypeSingletonPrivate::FileTypeSingletonPrivate(FileTypeSingleton *qq)
|
||||||
|
: q_ptr(qq)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
FileTypeSingleton::FileTypeSingleton(QObject* parent)
|
FileTypeSingleton::FileTypeSingleton(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
, d_ptr(new FileTypeSingletonPrivate(this))
|
, d_ptr(new FileTypeSingletonPrivate(this))
|
||||||
{
|
{
|
||||||
@@ -41,61 +42,61 @@ FileTypeSingleton::~FileTypeSingleton() noexcept
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QMimeType FileTypeSingleton::mimeTypeForName(const QString& nameOrAlias) const
|
QMimeType FileTypeSingleton::mimeTypeForName(const QString &nameOrAlias) const
|
||||||
{
|
{
|
||||||
Q_D(const FileTypeSingleton);
|
Q_D(const FileTypeSingleton);
|
||||||
return d->mimetypeDatabase.mimeTypeForName(nameOrAlias);
|
return d->mimetypeDatabase.mimeTypeForName(nameOrAlias);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMimeType FileTypeSingleton::mimeTypeForFile(const QString& fileName, MatchMode mode) const
|
QMimeType FileTypeSingleton::mimeTypeForFile(const QString &fileName, MatchMode mode) const
|
||||||
{
|
{
|
||||||
Q_D(const FileTypeSingleton);
|
Q_D(const FileTypeSingleton);
|
||||||
return d->mimetypeDatabase.mimeTypeForFile(fileName, static_cast<QMimeDatabase::MatchMode>(mode));
|
return d->mimetypeDatabase.mimeTypeForFile(fileName, static_cast<QMimeDatabase::MatchMode>(mode));
|
||||||
}
|
}
|
||||||
|
|
||||||
QMimeType FileTypeSingleton::mimeTypeForFile(const QFileInfo& fileInfo, MatchMode mode) const
|
QMimeType FileTypeSingleton::mimeTypeForFile(const QFileInfo &fileInfo, MatchMode mode) const
|
||||||
{
|
{
|
||||||
Q_D(const FileTypeSingleton);
|
Q_D(const FileTypeSingleton);
|
||||||
return d->mimetypeDatabase.mimeTypeForFile(fileInfo, static_cast<QMimeDatabase::MatchMode>(mode));
|
return d->mimetypeDatabase.mimeTypeForFile(fileInfo, static_cast<QMimeDatabase::MatchMode>(mode));
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QMimeType> FileTypeSingleton::mimeTypesForFileName(const QString& fileName) const
|
QList<QMimeType> FileTypeSingleton::mimeTypesForFileName(const QString &fileName) const
|
||||||
{
|
{
|
||||||
Q_D(const FileTypeSingleton);
|
Q_D(const FileTypeSingleton);
|
||||||
return d->mimetypeDatabase.mimeTypesForFileName(fileName);
|
return d->mimetypeDatabase.mimeTypesForFileName(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMimeType FileTypeSingleton::mimeTypeForData(const QByteArray& data) const
|
QMimeType FileTypeSingleton::mimeTypeForData(const QByteArray &data) const
|
||||||
{
|
{
|
||||||
Q_D(const FileTypeSingleton);
|
Q_D(const FileTypeSingleton);
|
||||||
return d->mimetypeDatabase.mimeTypeForData(data);
|
return d->mimetypeDatabase.mimeTypeForData(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMimeType FileTypeSingleton::mimeTypeForData(QIODevice* device) const
|
QMimeType FileTypeSingleton::mimeTypeForData(QIODevice *device) const
|
||||||
{
|
{
|
||||||
Q_D(const FileTypeSingleton);
|
Q_D(const FileTypeSingleton);
|
||||||
return d->mimetypeDatabase.mimeTypeForData(device);
|
return d->mimetypeDatabase.mimeTypeForData(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMimeType FileTypeSingleton::mimeTypeForUrl(const QUrl& url) const
|
QMimeType FileTypeSingleton::mimeTypeForUrl(const QUrl &url) const
|
||||||
{
|
{
|
||||||
Q_D(const FileTypeSingleton);
|
Q_D(const FileTypeSingleton);
|
||||||
return d->mimetypeDatabase.mimeTypeForUrl(url);
|
return d->mimetypeDatabase.mimeTypeForUrl(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMimeType FileTypeSingleton::mimeTypeForFileNameAndData(const QString& fileName, QIODevice* device) const
|
QMimeType FileTypeSingleton::mimeTypeForFileNameAndData(const QString &fileName, QIODevice *device) const
|
||||||
{
|
{
|
||||||
Q_D(const FileTypeSingleton);
|
Q_D(const FileTypeSingleton);
|
||||||
return d->mimetypeDatabase.mimeTypeForFileNameAndData(fileName, device);
|
return d->mimetypeDatabase.mimeTypeForFileNameAndData(fileName, device);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMimeType FileTypeSingleton::mimeTypeForFileNameAndData(const QString& fileName, const QByteArray& data) const
|
QMimeType FileTypeSingleton::mimeTypeForFileNameAndData(const QString &fileName, const QByteArray &data) const
|
||||||
{
|
{
|
||||||
Q_D(const FileTypeSingleton);
|
Q_D(const FileTypeSingleton);
|
||||||
return d->mimetypeDatabase.mimeTypeForFileNameAndData(fileName, data);
|
return d->mimetypeDatabase.mimeTypeForFileNameAndData(fileName, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FileTypeSingleton::suffixForFileName(const QString& fileName) const
|
QString FileTypeSingleton::suffixForFileName(const QString &fileName) const
|
||||||
{
|
{
|
||||||
Q_D(const FileTypeSingleton);
|
Q_D(const FileTypeSingleton);
|
||||||
return d->mimetypeDatabase.suffixForFileName(fileName);
|
return d->mimetypeDatabase.suffixForFileName(fileName);
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <QMimeDatabase>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <qqml.h>
|
#include <qqml.h>
|
||||||
#include <QMimeDatabase>
|
|
||||||
|
|
||||||
class FileTypeSingletonPrivate;
|
class FileTypeSingletonPrivate;
|
||||||
|
|
||||||
@@ -27,11 +27,7 @@ public:
|
|||||||
// Most of the code in this public section was copy/pasted from qmimedatabase.h
|
// Most of the code in this public section was copy/pasted from qmimedatabase.h
|
||||||
Q_INVOKABLE QMimeType mimeTypeForName(const QString &nameOrAlias) const;
|
Q_INVOKABLE QMimeType mimeTypeForName(const QString &nameOrAlias) const;
|
||||||
|
|
||||||
enum MatchMode {
|
enum MatchMode { MatchDefault, MatchExtension, MatchContent };
|
||||||
MatchDefault,
|
|
||||||
MatchExtension,
|
|
||||||
MatchContent
|
|
||||||
};
|
|
||||||
Q_ENUM(MatchMode)
|
Q_ENUM(MatchMode)
|
||||||
|
|
||||||
Q_INVOKABLE QMimeType mimeTypeForFile(const QString &fileName, MatchMode mode = MatchDefault) const;
|
Q_INVOKABLE QMimeType mimeTypeForFile(const QString &fileName, MatchMode mode = MatchDefault) const;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ void Login::init()
|
|||||||
m_supportsPassword = false;
|
m_supportsPassword = false;
|
||||||
m_ssoUrl = QUrl();
|
m_ssoUrl = QUrl();
|
||||||
|
|
||||||
connect(this, &Login::matrixIdChanged, this, [=](){
|
connect(this, &Login::matrixIdChanged, this, [=]() {
|
||||||
setHomeserverReachable(false);
|
setHomeserverReachable(false);
|
||||||
|
|
||||||
if (m_connection) {
|
if (m_connection) {
|
||||||
@@ -37,7 +37,7 @@ void Login::init()
|
|||||||
m_connection = nullptr;
|
m_connection = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_matrixId == "@") {
|
if (m_matrixId == "@") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ void Login::init()
|
|||||||
Q_EMIT testingChanged();
|
Q_EMIT testingChanged();
|
||||||
m_connection = new Connection(this);
|
m_connection = new Connection(this);
|
||||||
m_connection->resolveServer(m_matrixId);
|
m_connection->resolveServer(m_matrixId);
|
||||||
connect(m_connection, &Connection::loginFlowsChanged, this, [=](){
|
connect(m_connection, &Connection::loginFlowsChanged, this, [=]() {
|
||||||
setHomeserverReachable(true);
|
setHomeserverReachable(true);
|
||||||
m_testing = false;
|
m_testing = false;
|
||||||
Q_EMIT testingChanged();
|
Q_EMIT testingChanged();
|
||||||
@@ -75,7 +75,7 @@ QString Login::matrixId() const
|
|||||||
void Login::setMatrixId(const QString &matrixId)
|
void Login::setMatrixId(const QString &matrixId)
|
||||||
{
|
{
|
||||||
m_matrixId = matrixId;
|
m_matrixId = matrixId;
|
||||||
if(!m_matrixId.startsWith('@')) {
|
if (!m_matrixId.startsWith('@')) {
|
||||||
m_matrixId.prepend('@');
|
m_matrixId.prepend('@');
|
||||||
}
|
}
|
||||||
Q_EMIT matrixIdChanged();
|
Q_EMIT matrixIdChanged();
|
||||||
@@ -108,7 +108,8 @@ void Login::login()
|
|||||||
m_isLoggingIn = true;
|
m_isLoggingIn = true;
|
||||||
Q_EMIT isLoggingInChanged();
|
Q_EMIT isLoggingInChanged();
|
||||||
|
|
||||||
setDeviceName("NeoChat " + QSysInfo::machineHostName() + " " + QSysInfo::productType() + " " + QSysInfo::productVersion() + " " + QSysInfo::currentCpuArchitecture());
|
setDeviceName("NeoChat " + QSysInfo::machineHostName() + " " + QSysInfo::productType() + " " + QSysInfo::productVersion() + " "
|
||||||
|
+ QSysInfo::currentCpuArchitecture());
|
||||||
|
|
||||||
m_connection = new Connection(this);
|
m_connection = new Connection(this);
|
||||||
m_connection->resolveServer(m_matrixId);
|
m_connection->resolveServer(m_matrixId);
|
||||||
@@ -171,23 +172,24 @@ QUrl Login::ssoUrl() const
|
|||||||
|
|
||||||
void Login::loginWithSso()
|
void Login::loginWithSso()
|
||||||
{
|
{
|
||||||
SsoSession *session = m_connection->prepareForSso("NeoChat " + QSysInfo::machineHostName() + " " + QSysInfo::productType() + " " + QSysInfo::productVersion() + " " + QSysInfo::currentCpuArchitecture());
|
SsoSession *session = m_connection->prepareForSso("NeoChat " + QSysInfo::machineHostName() + " " + QSysInfo::productType() + " "
|
||||||
|
+ QSysInfo::productVersion() + " " + QSysInfo::currentCpuArchitecture());
|
||||||
m_ssoUrl = session->ssoUrl();
|
m_ssoUrl = session->ssoUrl();
|
||||||
Q_EMIT ssoUrlChanged();
|
Q_EMIT ssoUrlChanged();
|
||||||
connect(m_connection, &Connection::connected, [=](){
|
connect(m_connection, &Connection::connected, [=]() {
|
||||||
Q_EMIT connected();
|
Q_EMIT connected();
|
||||||
AccountSettings account(m_connection->userId());
|
AccountSettings account(m_connection->userId());
|
||||||
account.setKeepLoggedIn(true);
|
account.setKeepLoggedIn(true);
|
||||||
account.clearAccessToken(); // Drop the legacy - just in case
|
account.clearAccessToken(); // Drop the legacy - just in case
|
||||||
account.setHomeserver(m_connection->homeserver());
|
account.setHomeserver(m_connection->homeserver());
|
||||||
account.setDeviceId(m_connection->deviceId());
|
account.setDeviceId(m_connection->deviceId());
|
||||||
account.setDeviceName(m_deviceName);
|
account.setDeviceName(m_deviceName);
|
||||||
if (!Controller::instance().saveAccessTokenToKeyChain(account, m_connection->accessToken())) {
|
if (!Controller::instance().saveAccessTokenToKeyChain(account, m_connection->accessToken())) {
|
||||||
qWarning() << "Couldn't save access token";
|
qWarning() << "Couldn't save access token";
|
||||||
}
|
}
|
||||||
account.sync();
|
account.sync();
|
||||||
Controller::instance().addConnection(m_connection);
|
Controller::instance().addConnection(m_connection);
|
||||||
Controller::instance().setActiveConnection(m_connection);
|
Controller::instance().setActiveConnection(m_connection);
|
||||||
});
|
});
|
||||||
connect(m_connection, &Connection::syncDone, this, [=]() {
|
connect(m_connection, &Connection::syncDone, this, [=]() {
|
||||||
Q_EMIT initialSyncFinished();
|
Q_EMIT initialSyncFinished();
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#include "csapi/wellknown.h"
|
|
||||||
#include "connection.h"
|
#include "connection.h"
|
||||||
|
#include "csapi/wellknown.h"
|
||||||
|
|
||||||
using namespace Quotient;
|
using namespace Quotient;
|
||||||
|
|
||||||
|
|||||||
24
src/main.cpp
24
src/main.cpp
@@ -24,6 +24,8 @@
|
|||||||
#include "neochat-version.h"
|
#include "neochat-version.h"
|
||||||
|
|
||||||
#include "accountlistmodel.h"
|
#include "accountlistmodel.h"
|
||||||
|
#include "actionshandler.h"
|
||||||
|
#include "chatboxhelper.h"
|
||||||
#include "chatdocumenthandler.h"
|
#include "chatdocumenthandler.h"
|
||||||
#include "clipboard.h"
|
#include "clipboard.h"
|
||||||
#include "controller.h"
|
#include "controller.h"
|
||||||
@@ -46,8 +48,6 @@
|
|||||||
#include "sortfilterroomlistmodel.h"
|
#include "sortfilterroomlistmodel.h"
|
||||||
#include "userdirectorylistmodel.h"
|
#include "userdirectorylistmodel.h"
|
||||||
#include "userlistmodel.h"
|
#include "userlistmodel.h"
|
||||||
#include "actionshandler.h"
|
|
||||||
#include "chatboxhelper.h"
|
|
||||||
|
|
||||||
using namespace Quotient;
|
using namespace Quotient;
|
||||||
|
|
||||||
@@ -85,7 +85,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
QApplication::setOrganizationName("KDE");
|
QApplication::setOrganizationName("KDE");
|
||||||
|
|
||||||
KAboutData about(QStringLiteral("neochat"), i18n("NeoChat"), QStringLiteral(NEOCHAT_VERSION_STRING), i18n("Matrix client"), KAboutLicense::GPL_V3, i18n("© 2018-2020 Black Hat, 2020 KDE Community"));
|
KAboutData about(QStringLiteral("neochat"),
|
||||||
|
i18n("NeoChat"),
|
||||||
|
QStringLiteral(NEOCHAT_VERSION_STRING),
|
||||||
|
i18n("Matrix client"),
|
||||||
|
KAboutLicense::GPL_V3,
|
||||||
|
i18n("© 2018-2020 Black Hat, 2020 KDE Community"));
|
||||||
about.addAuthor(i18n("Black Hat"), QString(), QStringLiteral("bhat@encom.eu.org"));
|
about.addAuthor(i18n("Black Hat"), QString(), QStringLiteral("bhat@encom.eu.org"));
|
||||||
about.addAuthor(i18n("Carl Schwan"), QString(), QStringLiteral("carl@carlschwan.eu"));
|
about.addAuthor(i18n("Carl Schwan"), QString(), QStringLiteral("carl@carlschwan.eu"));
|
||||||
about.addAuthor(i18n("Tobias Fella"), QString(), QStringLiteral("fella@posteo.de"));
|
about.addAuthor(i18n("Tobias Fella"), QString(), QStringLiteral("fella@posteo.de"));
|
||||||
@@ -126,12 +131,11 @@ int main(int argc, char *argv[])
|
|||||||
qmlRegisterType<MessageFilterModel>("org.kde.neochat", 1, 0, "MessageFilterModel");
|
qmlRegisterType<MessageFilterModel>("org.kde.neochat", 1, 0, "MessageFilterModel");
|
||||||
qmlRegisterType<PublicRoomListModel>("org.kde.neochat", 1, 0, "PublicRoomListModel");
|
qmlRegisterType<PublicRoomListModel>("org.kde.neochat", 1, 0, "PublicRoomListModel");
|
||||||
qmlRegisterType<UserDirectoryListModel>("org.kde.neochat", 1, 0, "UserDirectoryListModel");
|
qmlRegisterType<UserDirectoryListModel>("org.kde.neochat", 1, 0, "UserDirectoryListModel");
|
||||||
qmlRegisterSingletonType<EmojiModel>("org.kde.neochat", 1, 0, "EmojiModel", [](QQmlEngine *engine2, QJSEngine *scriptEngine) -> QObject *
|
qmlRegisterSingletonType<EmojiModel>("org.kde.neochat", 1, 0, "EmojiModel", [](QQmlEngine *engine2, QJSEngine *scriptEngine) -> QObject * {
|
||||||
{
|
Q_UNUSED(scriptEngine);
|
||||||
Q_UNUSED(scriptEngine);
|
Q_UNUSED(engine2);
|
||||||
Q_UNUSED(engine2);
|
return new EmojiModel();
|
||||||
return new EmojiModel();
|
});
|
||||||
});
|
|
||||||
qmlRegisterType<SortFilterRoomListModel>("org.kde.neochat", 1, 0, "SortFilterRoomListModel");
|
qmlRegisterType<SortFilterRoomListModel>("org.kde.neochat", 1, 0, "SortFilterRoomListModel");
|
||||||
qmlRegisterType<DevicesModel>("org.kde.neochat", 1, 0, "DevicesModel");
|
qmlRegisterType<DevicesModel>("org.kde.neochat", 1, 0, "DevicesModel");
|
||||||
qmlRegisterUncreatableType<RoomMessageEvent>("org.kde.neochat", 1, 0, "RoomMessageEvent", "ENUM");
|
qmlRegisterUncreatableType<RoomMessageEvent>("org.kde.neochat", 1, 0, "RoomMessageEvent", "ENUM");
|
||||||
@@ -187,7 +191,7 @@ int main(int argc, char *argv[])
|
|||||||
});
|
});
|
||||||
const auto rootObjects = engine.rootObjects();
|
const auto rootObjects = engine.rootObjects();
|
||||||
for (auto obj : rootObjects) {
|
for (auto obj : rootObjects) {
|
||||||
auto view = qobject_cast<QQuickWindow*>(obj);
|
auto view = qobject_cast<QQuickWindow *>(obj);
|
||||||
if (view) {
|
if (view) {
|
||||||
KConfig dataResource("data", KConfig::SimpleConfig, QStandardPaths::AppDataLocation);
|
KConfig dataResource("data", KConfig::SimpleConfig, QStandardPaths::AppDataLocation);
|
||||||
KConfigGroup windowGroup(&dataResource, "Window");
|
KConfigGroup windowGroup(&dataResource, "Window");
|
||||||
|
|||||||
@@ -21,7 +21,11 @@ using Quotient::BaseJob;
|
|||||||
ThumbnailResponse::ThumbnailResponse(QString id, QSize size)
|
ThumbnailResponse::ThumbnailResponse(QString id, QSize size)
|
||||||
: mediaId(std::move(id))
|
: mediaId(std::move(id))
|
||||||
, requestedSize(size)
|
, requestedSize(size)
|
||||||
, localFile(QStringLiteral("%1/image_provider/%2-%3x%4.png").arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation), mediaId, QString::number(requestedSize.width()), QString::number(requestedSize.height())))
|
, localFile(QStringLiteral("%1/image_provider/%2-%3x%4.png")
|
||||||
|
.arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation),
|
||||||
|
mediaId,
|
||||||
|
QString::number(requestedSize.width()),
|
||||||
|
QString::number(requestedSize.height())))
|
||||||
, errorStr("Image request hasn't started")
|
, errorStr("Image request hasn't started")
|
||||||
{
|
{
|
||||||
if (requestedSize.isEmpty()) {
|
if (requestedSize.isEmpty()) {
|
||||||
|
|||||||
@@ -363,7 +363,8 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
|
|||||||
if (role == Qt::DisplayRole) {
|
if (role == Qt::DisplayRole) {
|
||||||
if (evt.isRedacted()) {
|
if (evt.isRedacted()) {
|
||||||
auto reason = evt.redactedBecause()->reason();
|
auto reason = evt.redactedBecause()->reason();
|
||||||
return (reason.isEmpty()) ? i18n("<i>[This message was deleted]</i>") : i18n("<i>[This message was deleted: %1]</i>").arg(evt.redactedBecause()->reason());
|
return (reason.isEmpty()) ? i18n("<i>[This message was deleted]</i>")
|
||||||
|
: i18n("<i>[This message was deleted: %1]</i>").arg(evt.redactedBecause()->reason());
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_currentRoom->eventToString(evt, Qt::RichText);
|
return m_currentRoom->eventToString(evt, Qt::RichText);
|
||||||
@@ -505,7 +506,8 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
|
|||||||
|
|
||||||
if (role == IsEditedRole) {
|
if (role == IsEditedRole) {
|
||||||
if (auto e = eventCast<const RoomMessageEvent>(&evt)) {
|
if (auto e = eventCast<const RoomMessageEvent>(&evt)) {
|
||||||
return !e->unsignedJson().isEmpty() && e->unsignedJson().contains("m.relations") && e->unsignedJson()["m.relations"].toObject().contains("m.replace");
|
return !e->unsignedJson().isEmpty() && e->unsignedJson().contains("m.relations")
|
||||||
|
&& e->unsignedJson()["m.relations"].toObject().contains("m.replace");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -559,14 +561,17 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
|
|||||||
};
|
};
|
||||||
const auto &replyEvt = **replyIt;
|
const auto &replyEvt = **replyIt;
|
||||||
|
|
||||||
return QVariantMap{{"eventId", replyEventId}, {"display", m_currentRoom->eventToString(replyEvt, Qt::RichText)}, {"author", userAtEvent(static_cast<NeoChatUser *>(m_currentRoom->user(replyEvt.senderId())), m_currentRoom, evt)}};
|
return QVariantMap{{"eventId", replyEventId},
|
||||||
|
{"display", m_currentRoom->eventToString(replyEvt, Qt::RichText)},
|
||||||
|
{"author", userAtEvent(static_cast<NeoChatUser *>(m_currentRoom->user(replyEvt.senderId())), m_currentRoom, evt)}};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (role == ShowAuthorRole) {
|
if (role == ShowAuthorRole) {
|
||||||
for (auto r = row + 1; r < rowCount(); ++r) {
|
for (auto r = row + 1; r < rowCount(); ++r) {
|
||||||
auto i = index(r);
|
auto i = index(r);
|
||||||
if (data(i, SpecialMarksRole) != EventStatus::Hidden) {
|
if (data(i, SpecialMarksRole) != EventStatus::Hidden) {
|
||||||
return data(i, AuthorRole) != data(idx, AuthorRole) || data(i, EventTypeRole) != data(idx, EventTypeRole) || data(idx, TimeRole).toDateTime().msecsTo(data(i, TimeRole).toDateTime()) > 600000;
|
return data(i, AuthorRole) != data(idx, AuthorRole) || data(i, EventTypeRole) != data(idx, EventTypeRole)
|
||||||
|
|| data(idx, TimeRole).toDateTime().msecsTo(data(i, TimeRole).toDateTime()) > 600000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -653,7 +658,7 @@ QVariant MessageEventModel::getLastLocalUserMessageEventId()
|
|||||||
if (content.contains("m.relates_to")) {
|
if (content.contains("m.relates_to")) {
|
||||||
// the message has been edited once
|
// the message has been edited once
|
||||||
// so we have to return the id of the related' message instead
|
// so we have to return the id of the related' message instead
|
||||||
targetMessage.insert("event_id",content["m.relates_to"].toObject()["event_id"].toString());
|
targetMessage.insert("event_id", content["m.relates_to"].toObject()["event_id"].toString());
|
||||||
targetMessage.insert("body", content["formatted_body"].toString());
|
targetMessage.insert("body", content["formatted_body"].toString());
|
||||||
return targetMessage;
|
return targetMessage;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,5 +12,4 @@ class MessageFilterModel : public QSortFilterProxyModel
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
|
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -27,11 +27,11 @@
|
|||||||
#include "events/roomcanonicalaliasevent.h"
|
#include "events/roomcanonicalaliasevent.h"
|
||||||
#include "events/roommessageevent.h"
|
#include "events/roommessageevent.h"
|
||||||
#include "events/roompowerlevelsevent.h"
|
#include "events/roompowerlevelsevent.h"
|
||||||
#include "stickerevent.h"
|
|
||||||
#include "events/typingevent.h"
|
#include "events/typingevent.h"
|
||||||
#include "jobs/downloadfilejob.h"
|
#include "jobs/downloadfilejob.h"
|
||||||
#include "neochatconfig.h"
|
#include "neochatconfig.h"
|
||||||
#include "notificationsmanager.h"
|
#include "notificationsmanager.h"
|
||||||
|
#include "stickerevent.h"
|
||||||
#include "user.h"
|
#include "user.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ NeoChatRoom::NeoChatRoom(Connection *connection, QString roomId, JoinState joinS
|
|||||||
connect(this, &Quotient::Room::eventsHistoryJobChanged, this, &NeoChatRoom::lastActiveTimeChanged);
|
connect(this, &Quotient::Room::eventsHistoryJobChanged, this, &NeoChatRoom::lastActiveTimeChanged);
|
||||||
|
|
||||||
connect(this, &Room::joinStateChanged, this, [=](JoinState oldState, JoinState newState) {
|
connect(this, &Room::joinStateChanged, this, [=](JoinState oldState, JoinState newState) {
|
||||||
if(oldState == JoinState::Invite && newState != JoinState::Invite) {
|
if (oldState == JoinState::Invite && newState != JoinState::Invite) {
|
||||||
Q_EMIT isInviteChanged();
|
Q_EMIT isInviteChanged();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -101,7 +101,7 @@ QVariantList NeoChatRoom::getUsersTyping() const
|
|||||||
users.removeAll(localUser());
|
users.removeAll(localUser());
|
||||||
QVariantList userVariants;
|
QVariantList userVariants;
|
||||||
for (User *user : users) {
|
for (User *user : users) {
|
||||||
userVariants.append(QVariantMap {
|
userVariants.append(QVariantMap{
|
||||||
{"id", user->id()},
|
{"id", user->id()},
|
||||||
{"avatarMediaId", user->avatarMediaId(this)},
|
{"avatarMediaId", user->avatarMediaId(this)},
|
||||||
{"displayName", user->displayname(this)},
|
{"displayName", user->displayname(this)},
|
||||||
@@ -128,7 +128,8 @@ const RoomMessageEvent *NeoChatRoom::lastEvent(bool ignoreStateEvent) const
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event->isStateEvent() && (ignoreStateEvent || !NeoChatConfig::self()->showLeaveJoinEvent() || static_cast<const StateEventBase &>(*event).repeatsState())) {
|
if (event->isStateEvent()
|
||||||
|
&& (ignoreStateEvent || !NeoChatConfig::self()->showLeaveJoinEvent() || static_cast<const StateEventBase &>(*event).repeatsState())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,12 +253,10 @@ QVariantList NeoChatRoom::getUsers(const QString &keyword) const
|
|||||||
for (const auto u : userList) {
|
for (const auto u : userList) {
|
||||||
if (u->displayname(this).contains(keyword, Qt::CaseInsensitive)) {
|
if (u->displayname(this).contains(keyword, Qt::CaseInsensitive)) {
|
||||||
NeoChatUser user(u->id(), u->connection());
|
NeoChatUser user(u->id(), u->connection());
|
||||||
QVariantMap userVariant {
|
QVariantMap userVariant{{QStringLiteral("id"), user.id()},
|
||||||
{ QStringLiteral("id"), user.id() },
|
{QStringLiteral("displayName"), user.displayname(this)},
|
||||||
{ QStringLiteral("displayName"), user.displayname(this) },
|
{QStringLiteral("avatarMediaId"), user.avatarMediaId(this)},
|
||||||
{ QStringLiteral("avatarMediaId"), user.avatarMediaId(this) },
|
{QStringLiteral("color"), user.color()}};
|
||||||
{ QStringLiteral("color"), user.color() }
|
|
||||||
};
|
|
||||||
|
|
||||||
matchedList.append(QVariant::fromValue(userVariant));
|
matchedList.append(QVariant::fromValue(userVariant));
|
||||||
}
|
}
|
||||||
@@ -357,14 +356,12 @@ QString NeoChatRoom::eventToString(const RoomEvent &evt, Qt::TextFormat format,
|
|||||||
}
|
}
|
||||||
Q_FALLTHROUGH();
|
Q_FALLTHROUGH();
|
||||||
case MembershipType::Join: {
|
case MembershipType::Join: {
|
||||||
QString text {};
|
QString text{};
|
||||||
// Part 1: invites and joins
|
// Part 1: invites and joins
|
||||||
if (e.repeatsState()) {
|
if (e.repeatsState()) {
|
||||||
text = i18n("joined the room (repeated)");
|
text = i18n("joined the room (repeated)");
|
||||||
} else if (e.changesMembership()) {
|
} else if (e.changesMembership()) {
|
||||||
text = e.membership() == MembershipType::Invite
|
text = e.membership() == MembershipType::Invite ? i18n("invited %1 to the room", subjectName) : i18n("joined the room");
|
||||||
? i18n("invited %1 to the room", subjectName)
|
|
||||||
: i18n("joined the room");
|
|
||||||
}
|
}
|
||||||
if (!text.isEmpty()) {
|
if (!text.isEmpty()) {
|
||||||
if (!e.reason().isEmpty()) {
|
if (!e.reason().isEmpty()) {
|
||||||
@@ -402,9 +399,12 @@ QString NeoChatRoom::eventToString(const RoomEvent &evt, Qt::TextFormat format,
|
|||||||
if (e.prevContent() && e.prevContent()->membership == MembershipType::Ban) {
|
if (e.prevContent() && e.prevContent()->membership == MembershipType::Ban) {
|
||||||
return (e.senderId() != e.userId()) ? i18n("unbanned %1", subjectName) : i18n("self-unbanned");
|
return (e.senderId() != e.userId()) ? i18n("unbanned %1", subjectName) : i18n("self-unbanned");
|
||||||
}
|
}
|
||||||
return (e.senderId() != e.userId()) ? i18n("has put %1 out of the room: %2", subjectName, e.contentJson()["reason"_ls].toString().toHtmlEscaped()) : i18n("left the room");
|
return (e.senderId() != e.userId())
|
||||||
|
? i18n("has put %1 out of the room: %2", subjectName, e.contentJson()["reason"_ls].toString().toHtmlEscaped())
|
||||||
|
: i18n("left the room");
|
||||||
case MembershipType::Ban:
|
case MembershipType::Ban:
|
||||||
return (e.senderId() != e.userId()) ? i18n("banned %1 from the room: %2", subjectName, e.contentJson()["reason"_ls].toString().toHtmlEscaped()) : i18n("self-banned from the room");
|
return (e.senderId() != e.userId()) ? i18n("banned %1 from the room: %2", subjectName, e.contentJson()["reason"_ls].toString().toHtmlEscaped())
|
||||||
|
: i18n("self-banned from the room");
|
||||||
case MembershipType::Knock:
|
case MembershipType::Knock:
|
||||||
return i18n("knocked");
|
return i18n("knocked");
|
||||||
default:;
|
default:;
|
||||||
@@ -427,11 +427,14 @@ QString NeoChatRoom::eventToString(const RoomEvent &evt, Qt::TextFormat format,
|
|||||||
return i18n("activated End-to-End Encryption");
|
return i18n("activated End-to-End Encryption");
|
||||||
},
|
},
|
||||||
[](const RoomCreateEvent &e) {
|
[](const RoomCreateEvent &e) {
|
||||||
return e.isUpgrade() ? i18n("upgraded the room to version %1", e.version().isEmpty() ? "1" : e.version().toHtmlEscaped()) : i18n("created the room, version %1", e.version().isEmpty() ? "1" : e.version().toHtmlEscaped());
|
return e.isUpgrade() ? i18n("upgraded the room to version %1", e.version().isEmpty() ? "1" : e.version().toHtmlEscaped())
|
||||||
|
: i18n("created the room, version %1", e.version().isEmpty() ? "1" : e.version().toHtmlEscaped());
|
||||||
},
|
},
|
||||||
[](const StateEventBase &e) {
|
[](const StateEventBase &e) {
|
||||||
// A small hack for state events from TWIM bot
|
// A small hack for state events from TWIM bot
|
||||||
return e.stateKey() == "twim" ? i18n("updated the database") : e.stateKey().isEmpty() ? i18n("updated %1 state", e.matrixType()) : i18n("updated %1 state for %2", e.matrixType(), e.stateKey().toHtmlEscaped());
|
return e.stateKey() == "twim" ? i18n("updated the database")
|
||||||
|
: e.stateKey().isEmpty() ? i18n("updated %1 state", e.matrixType())
|
||||||
|
: i18n("updated %1 state for %2", e.matrixType(), e.stateKey().toHtmlEscaped());
|
||||||
},
|
},
|
||||||
i18n("Unknown event"));
|
i18n("Unknown event"));
|
||||||
}
|
}
|
||||||
@@ -531,29 +534,15 @@ void NeoChatRoom::postHtmlMessage(const QString &text, const QString &html, Mess
|
|||||||
isReply = false;
|
isReply = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (isEdit) {
|
if (isEdit) {
|
||||||
QJsonObject json {
|
QJsonObject json{
|
||||||
{"type", "m.room.message"},
|
{"type", "m.room.message"},
|
||||||
{"msgtype", msgTypeToString(type)},
|
{"msgtype", msgTypeToString(type)},
|
||||||
{"body", "* " + text},
|
{"body", "* " + text},
|
||||||
{"format", "org.matrix.custom.html"},
|
{"format", "org.matrix.custom.html"},
|
||||||
{"formatted_body", html},
|
{"formatted_body", html},
|
||||||
{"m.new_content",
|
{"m.new_content", QJsonObject{{"body", text}, {"msgtype", msgTypeToString(type)}, {"format", "org.matrix.custom.html"}, {"formatted_body", html}}},
|
||||||
QJsonObject {
|
{"m.relates_to", QJsonObject{{"rel_type", "m.replace"}, {"event_id", relateToEventId}}}};
|
||||||
{"body", text},
|
|
||||||
{"msgtype", msgTypeToString(type)},
|
|
||||||
{"format", "org.matrix.custom.html"},
|
|
||||||
{"formatted_body", html}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{"m.relates_to",
|
|
||||||
QJsonObject {
|
|
||||||
{"rel_type", "m.replace"},
|
|
||||||
{"event_id", relateToEventId}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
postJson("m.room.message", json);
|
postJson("m.room.message", json);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -141,8 +141,16 @@ public Q_SLOTS:
|
|||||||
void sendTypingNotification(bool isTyping);
|
void sendTypingNotification(bool isTyping);
|
||||||
/// @param rawText The text as it was typed.
|
/// @param rawText The text as it was typed.
|
||||||
/// @param cleanedText The text with link to the users.
|
/// @param cleanedText The text with link to the users.
|
||||||
void postMessage(const QString &rawText, const QString &cleanedText, Quotient::MessageEventType type = Quotient::MessageEventType::Text, const QString &replyEventId = QString(), const QString &relateToEventId = QString());
|
void postMessage(const QString &rawText,
|
||||||
void postHtmlMessage(const QString &text, const QString &html, Quotient::MessageEventType type = Quotient::MessageEventType::Text, const QString &replyEventId = QString(), const QString &relateToEventId = QString());
|
const QString &cleanedText,
|
||||||
|
Quotient::MessageEventType type = Quotient::MessageEventType::Text,
|
||||||
|
const QString &replyEventId = QString(),
|
||||||
|
const QString &relateToEventId = QString());
|
||||||
|
void postHtmlMessage(const QString &text,
|
||||||
|
const QString &html,
|
||||||
|
Quotient::MessageEventType type = Quotient::MessageEventType::Text,
|
||||||
|
const QString &replyEventId = QString(),
|
||||||
|
const QString &relateToEventId = QString());
|
||||||
void changeAvatar(const QUrl &localFile);
|
void changeAvatar(const QUrl &localFile);
|
||||||
void addLocalAlias(const QString &alias);
|
void addLocalAlias(const QString &alias);
|
||||||
void removeLocalAlias(const QString &alias);
|
void removeLocalAlias(const QString &alias);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#include "controller.h"
|
#include "controller.h"
|
||||||
|
|
||||||
static Kirigami::PlatformTheme * s_theme = nullptr;
|
static Kirigami::PlatformTheme *s_theme = nullptr;
|
||||||
|
|
||||||
NeoChatUser::NeoChatUser(QString userId, Connection *connection)
|
NeoChatUser::NeoChatUser(QString userId, Connection *connection)
|
||||||
: User(std::move(userId), connection)
|
: User(std::move(userId), connection)
|
||||||
@@ -44,5 +44,8 @@ void NeoChatUser::setColor(const QColor &color)
|
|||||||
void NeoChatUser::polishColor()
|
void NeoChatUser::polishColor()
|
||||||
{
|
{
|
||||||
// https://github.com/quotient-im/libQuotient/wiki/User-color-coding-standard-draft-proposal
|
// https://github.com/quotient-im/libQuotient/wiki/User-color-coding-standard-draft-proposal
|
||||||
setColor(QColor::fromHslF(hueF(), 1 - s_theme->alternateBackgroundColor().saturationF(), -0.7 * s_theme->alternateBackgroundColor().lightnessF() + 0.9, s_theme->textColor().alphaF()));
|
setColor(QColor::fromHslF(hueF(),
|
||||||
|
1 - s_theme->alternateBackgroundColor().saturationF(),
|
||||||
|
-0.7 * s_theme->alternateBackgroundColor().lightnessF() + 0.9,
|
||||||
|
s_theme->textColor().alphaF()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
|
|
||||||
|
#include "knotifications_version.h"
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KNotification>
|
#include <KNotification>
|
||||||
#include "knotifications_version.h"
|
|
||||||
#if KNOTIFICATIONS_VERSION >= QT_VERSION_CHECK(5, 81, 0)
|
#if KNOTIFICATIONS_VERSION >= QT_VERSION_CHECK(5, 81, 0)
|
||||||
#include <KNotificationReplyAction>
|
#include <KNotificationReplyAction>
|
||||||
#endif
|
#endif
|
||||||
@@ -31,7 +31,12 @@ NotificationsManager::NotificationsManager(QObject *parent)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotificationsManager::postNotification(NeoChatRoom *room, const QString &roomName, const QString &sender, const QString &text, const QImage &icon, const QString &replyEventId)
|
void NotificationsManager::postNotification(NeoChatRoom *room,
|
||||||
|
const QString &roomName,
|
||||||
|
const QString &sender,
|
||||||
|
const QString &text,
|
||||||
|
const QImage &icon,
|
||||||
|
const QString &replyEventId)
|
||||||
{
|
{
|
||||||
if (!NeoChatConfig::self()->showNotifications()) {
|
if (!NeoChatConfig::self()->showNotifications()) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ class NotificationsManager : public QObject
|
|||||||
public:
|
public:
|
||||||
static NotificationsManager &instance();
|
static NotificationsManager &instance();
|
||||||
|
|
||||||
Q_INVOKABLE void postNotification(NeoChatRoom *room, const QString &roomName, const QString &sender, const QString &text, const QImage &icon, const QString &replyEventId);
|
Q_INVOKABLE void
|
||||||
|
postNotification(NeoChatRoom *room, const QString &roomName, const QString &sender, const QString &text, const QImage &icon, const QString &replyEventId);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NotificationsManager(QObject *parent = nullptr);
|
NotificationsManager(QObject *parent = nullptr);
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#ifndef Q_OS_ANDROID
|
#ifndef Q_OS_ANDROID
|
||||||
#include <QDBusConnection>
|
#include <QDBusConnection>
|
||||||
#include <QDBusMessage>
|
|
||||||
#include <QDBusInterface>
|
#include <QDBusInterface>
|
||||||
|
#include <QDBusMessage>
|
||||||
#endif
|
#endif
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
|
||||||
@@ -28,10 +28,9 @@
|
|||||||
#include "notificationsmanager.h"
|
#include "notificationsmanager.h"
|
||||||
|
|
||||||
#ifndef Q_OS_ANDROID
|
#ifndef Q_OS_ANDROID
|
||||||
bool useUnityCounter() {
|
bool useUnityCounter()
|
||||||
static const auto Result = QDBusInterface(
|
{
|
||||||
"com.canonical.Unity",
|
static const auto Result = QDBusInterface("com.canonical.Unity", "/").isValid();
|
||||||
"/").isValid();
|
|
||||||
|
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
@@ -61,15 +60,9 @@ RoomListModel::RoomListModel(QObject *parent)
|
|||||||
dbusUnityProperties["count-visible"] = false;
|
dbusUnityProperties["count-visible"] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto signal = QDBusMessage::createSignal(
|
auto signal = QDBusMessage::createSignal("/com/canonical/unity/launcherentry/neochat", "com.canonical.Unity.LauncherEntry", "Update");
|
||||||
"/com/canonical/unity/launcherentry/neochat",
|
|
||||||
"com.canonical.Unity.LauncherEntry",
|
|
||||||
"Update");
|
|
||||||
|
|
||||||
signal.setArguments({
|
signal.setArguments({launcherUrl, dbusUnityProperties});
|
||||||
launcherUrl,
|
|
||||||
dbusUnityProperties
|
|
||||||
});
|
|
||||||
|
|
||||||
QDBusConnection::sessionBus().send(signal);
|
QDBusConnection::sessionBus().send(signal);
|
||||||
}
|
}
|
||||||
@@ -211,9 +204,9 @@ void RoomListModel::handleNotifications()
|
|||||||
static QStringList oldNotifications;
|
static QStringList oldNotifications;
|
||||||
auto job = m_connection->callApi<GetNotificationsJob>();
|
auto job = m_connection->callApi<GetNotificationsJob>();
|
||||||
|
|
||||||
connect(job, &BaseJob::success, this, [=](){
|
connect(job, &BaseJob::success, this, [=]() {
|
||||||
const auto notifications = job->jsonData()["notifications"].toArray();
|
const auto notifications = job->jsonData()["notifications"].toArray();
|
||||||
if(initial) {
|
if (initial) {
|
||||||
initial = false;
|
initial = false;
|
||||||
for (const auto &n : notifications) {
|
for (const auto &n : notifications) {
|
||||||
oldNotifications += n.toObject()["event"].toObject()["event_id"].toString();
|
oldNotifications += n.toObject()["event"].toObject()["event_id"].toString();
|
||||||
@@ -239,7 +232,12 @@ void RoomListModel::handleNotifications()
|
|||||||
} else {
|
} else {
|
||||||
avatar_image = room->avatar(128);
|
avatar_image = room->avatar(128);
|
||||||
}
|
}
|
||||||
NotificationsManager::instance().postNotification(dynamic_cast<NeoChatRoom *>(room), room->displayName(), sender->displayname(room), notification["event"].toObject()["content"].toObject()["body"].toString(), avatar_image, notification["event"].toObject()["event_id"].toString());
|
NotificationsManager::instance().postNotification(dynamic_cast<NeoChatRoom *>(room),
|
||||||
|
room->displayName(),
|
||||||
|
sender->displayname(room),
|
||||||
|
notification["event"].toObject()["content"].toObject()["body"].toString(),
|
||||||
|
avatar_image,
|
||||||
|
notification["event"].toObject()["event_id"].toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -454,8 +452,8 @@ bool RoomListModel::categoryVisible(int category) const
|
|||||||
|
|
||||||
NeoChatRoom *RoomListModel::roomByAliasOrId(const QString &aliasOrId)
|
NeoChatRoom *RoomListModel::roomByAliasOrId(const QString &aliasOrId)
|
||||||
{
|
{
|
||||||
for(const auto &room : m_rooms) {
|
for (const auto &room : m_rooms) {
|
||||||
if(room->aliases().contains(aliasOrId) || room->id() == aliasOrId) {
|
if (room->aliases().contains(aliasOrId) || room->id() == aliasOrId) {
|
||||||
return room;
|
return room;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ bool SortFilterRoomListModel::lessThan(const QModelIndex &source_left, const QMo
|
|||||||
const auto categoryRight = static_cast<RoomType::Types>(sourceModel()->data(source_right, RoomListModel::CategoryRole).toInt());
|
const auto categoryRight = static_cast<RoomType::Types>(sourceModel()->data(source_right, RoomListModel::CategoryRole).toInt());
|
||||||
|
|
||||||
if (categoryLeft == RoomType::Types::Favorite && categoryRight == RoomType::Types::Favorite) {
|
if (categoryLeft == RoomType::Types::Favorite && categoryRight == RoomType::Types::Favorite) {
|
||||||
return sourceModel()->data(source_left, RoomListModel::LastActiveTimeRole).toDateTime() > sourceModel()->data(source_right, RoomListModel::LastActiveTimeRole).toDateTime();
|
return sourceModel()->data(source_left, RoomListModel::LastActiveTimeRole).toDateTime()
|
||||||
|
> sourceModel()->data(source_right, RoomListModel::LastActiveTimeRole).toDateTime();
|
||||||
}
|
}
|
||||||
if (categoryLeft == RoomType::Types::Favorite) {
|
if (categoryLeft == RoomType::Types::Favorite) {
|
||||||
return true;
|
return true;
|
||||||
@@ -51,7 +52,8 @@ bool SortFilterRoomListModel::lessThan(const QModelIndex &source_left, const QMo
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return sourceModel()->data(source_left, RoomListModel::LastActiveTimeRole).toDateTime() > sourceModel()->data(source_right, RoomListModel::LastActiveTimeRole).toDateTime();
|
return sourceModel()->data(source_left, RoomListModel::LastActiveTimeRole).toDateTime()
|
||||||
|
> sourceModel()->data(source_right, RoomListModel::LastActiveTimeRole).toDateTime();
|
||||||
}
|
}
|
||||||
if (m_sortOrder != SortFilterRoomListModel::Categories) {
|
if (m_sortOrder != SortFilterRoomListModel::Categories) {
|
||||||
return QSortFilterProxyModel::lessThan(source_left, source_right);
|
return QSortFilterProxyModel::lessThan(source_left, source_right);
|
||||||
@@ -59,7 +61,8 @@ bool SortFilterRoomListModel::lessThan(const QModelIndex &source_left, const QMo
|
|||||||
if (sourceModel()->data(source_left, RoomListModel::CategoryRole) != sourceModel()->data(source_right, RoomListModel::CategoryRole)) {
|
if (sourceModel()->data(source_left, RoomListModel::CategoryRole) != sourceModel()->data(source_right, RoomListModel::CategoryRole)) {
|
||||||
return sourceModel()->data(source_left, RoomListModel::CategoryRole).toInt() < sourceModel()->data(source_right, RoomListModel::CategoryRole).toInt();
|
return sourceModel()->data(source_left, RoomListModel::CategoryRole).toInt() < sourceModel()->data(source_right, RoomListModel::CategoryRole).toInt();
|
||||||
}
|
}
|
||||||
return sourceModel()->data(source_left, RoomListModel::LastActiveTimeRole).toDateTime() > sourceModel()->data(source_right, RoomListModel::LastActiveTimeRole).toDateTime();
|
return sourceModel()->data(source_left, RoomListModel::LastActiveTimeRole).toDateTime()
|
||||||
|
> sourceModel()->data(source_right, RoomListModel::LastActiveTimeRole).toDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SortFilterRoomListModel::setFilterText(const QString &text)
|
void SortFilterRoomListModel::setFilterText(const QString &text)
|
||||||
@@ -76,6 +79,6 @@ QString SortFilterRoomListModel::filterText() const
|
|||||||
bool SortFilterRoomListModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
|
bool SortFilterRoomListModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(source_parent);
|
Q_UNUSED(source_parent);
|
||||||
return sourceModel()->data(sourceModel()->index(source_row, 0), RoomListModel::NameRole).toString().contains(m_filterText, Qt::CaseInsensitive) &&
|
return sourceModel()->data(sourceModel()->index(source_row, 0), RoomListModel::NameRole).toString().contains(m_filterText, Qt::CaseInsensitive)
|
||||||
sourceModel()->data(sourceModel()->index(source_row, 0), RoomListModel::JoinStateRole).toString() != "upgraded";
|
&& sourceModel()->data(sourceModel()->index(source_row, 0), RoomListModel::JoinStateRole).toString() != "upgraded";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ using namespace Quotient;
|
|||||||
StickerEvent::StickerEvent(const QJsonObject &obj)
|
StickerEvent::StickerEvent(const QJsonObject &obj)
|
||||||
: RoomEvent(typeId(), obj)
|
: RoomEvent(typeId(), obj)
|
||||||
, m_imageContent(EventContent::ImageContent(obj["content"_ls].toObject()))
|
, m_imageContent(EventContent::ImageContent(obj["content"_ls].toObject()))
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
QString StickerEvent::body() const
|
QString StickerEvent::body() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "events/roomevent.h"
|
|
||||||
#include "events/eventcontent.h"
|
#include "events/eventcontent.h"
|
||||||
|
#include "events/roomevent.h"
|
||||||
|
|
||||||
namespace Quotient {
|
namespace Quotient
|
||||||
|
{
|
||||||
/// Sticker messages are specialised image messages that are displayed without
|
/// Sticker messages are specialised image messages that are displayed without
|
||||||
/// controls (e.g. no "download" link, or light-box view on click, as would be
|
/// controls (e.g. no "download" link, or light-box view on click, as would be
|
||||||
/// displayed for for m.image events).
|
/// displayed for for m.image events).
|
||||||
@@ -31,6 +31,7 @@ public:
|
|||||||
|
|
||||||
/// \brief The URL to the sticker image. This must be a valid mxc:// URI.
|
/// \brief The URL to the sticker image. This must be a valid mxc:// URI.
|
||||||
QUrl url() const;
|
QUrl url() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EventContent::ImageContent m_imageContent;
|
EventContent::ImageContent m_imageContent;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
|
|
||||||
// Modified from mujx/nheko's TrayIcon.
|
// Modified from mujx/nheko's TrayIcon.
|
||||||
|
|
||||||
#include <QSystemTrayIcon>
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QIconEngine>
|
#include <QIconEngine>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QRect>
|
#include <QRect>
|
||||||
|
#include <QSystemTrayIcon>
|
||||||
|
|
||||||
class TrayIcon : public QSystemTrayIcon
|
class TrayIcon : public QSystemTrayIcon
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user