Re-run clang-format

This commit is contained in:
Nicolas Fella
2021-08-23 19:38:34 +02:00
parent 0f106b1bbc
commit 589dfe0343
26 changed files with 201 additions and 265 deletions

View File

@@ -12,8 +12,8 @@
#include <QStringBuilder>
#include "controller.h"
#include "roommanager.h"
#include "customemojimodel.h"
#include "roommanager.h"
ActionsHandler::ActionsHandler(QObject *parent)
: QObject(parent)
@@ -62,7 +62,6 @@ void ActionsHandler::setConnection(Connection *connection)
void ActionsHandler::postEdit(const QString &text)
{
const auto localId = Controller::instance().activeConnection()->userId();
for (auto it = m_room->messageEvents().crbegin(); it != m_room->messageEvents().crend(); ++it) {
const auto &evt = **it;

View File

@@ -18,7 +18,6 @@ class ActionsHandler : public QObject
{
Q_OBJECT
/// \brief The connection that will handle sending the message.
Q_PROPERTY(Connection *connection READ connection WRITE setConnection NOTIFY connectionChanged)
@@ -35,8 +34,6 @@ public:
explicit ActionsHandler(QObject *parent = nullptr);
~ActionsHandler();
[[nodiscard]] Connection *connection() const;
void setConnection(Connection *connection);
@@ -57,8 +54,12 @@ public Q_SLOTS:
/// \brief Post a message.
///
/// This also interprets commands if any.
void
postMessage(const QString &text, const QString &attachementPath, const QString &replyEventId, const QString &editEventId, const QVariantMap &usernames, CustomEmojiModel* cem);
void postMessage(const QString &text,
const QString &attachementPath,
const QString &replyEventId,
const QString &editEventId,
const QVariantMap &usernames,
CustomEmojiModel *cem);
/// \brief Send edit instructions (.e.g s/hallo/hello/)
///

View File

@@ -3,8 +3,8 @@
#pragma once
#include <QObject>
#include <QIdentityProxyModel>
#include <QObject>
class QAbstractItemModel;
class KColorSchemeManager;
@@ -26,4 +26,3 @@ public:
private:
KColorSchemeManager *c;
};

View File

@@ -6,7 +6,6 @@
#include "actionshandler.h"
#include "commandmodel.h"
QVariantList CommandModel::filterModel(const QString &filter)
{
QVariantList result;
@@ -24,85 +23,47 @@ QVariantList CommandModel::filterModel(const QString &filter)
return result;
}
QVariantList CommandModel::commands()
{
QVariantList commands;
// Messages commands
commands.append(QVariant::fromValue(Command{
QStringLiteral("/me "),
QStringLiteral("<message>"),
i18n("Displays action")}));
commands.append(QVariant::fromValue(Command{QStringLiteral("/me "), QStringLiteral("<message>"), i18n("Displays action")}));
commands.append(QVariant::fromValue(Command{
QStringLiteral("/shrug "),
QStringLiteral("<message>"),
i18n("Prepends ¯\\_(ツ)_/¯ to a plain-text message")}));
commands.append(QVariant::fromValue(Command{QStringLiteral("/shrug "), QStringLiteral("<message>"), i18n("Prepends ¯\\_(ツ)_/¯ to a plain-text message")}));
commands.append(QVariant::fromValue(Command{
QStringLiteral("/lenny "),
QStringLiteral("<message>"),
i18n("Prepends ( ͡° ͜ʖ ͡°) to a plain-text message")}));
commands.append(QVariant::fromValue(Command{QStringLiteral("/lenny "), QStringLiteral("<message>"), i18n("Prepends ( ͡° ͜ʖ ͡°) to a plain-text message")}));
commands.append(QVariant::fromValue(Command{
QStringLiteral("/tableflip "),
QStringLiteral("<message>"),
i18n("Prepends (╯°□°)╯︵ ┻━┻ to a plain-text message")}));
commands.append(
QVariant::fromValue(Command{QStringLiteral("/tableflip "), QStringLiteral("<message>"), i18n("Prepends (╯°□°)╯︵ ┻━┻ to a plain-text message")}));
commands.append(QVariant::fromValue(Command{
QStringLiteral("/unflip "),
QStringLiteral("<message>"),
i18n("Prepends ┬──┬ ( ゜-゜ノ) to a plain-text message")}));
commands.append(
QVariant::fromValue(Command{QStringLiteral("/unflip "), QStringLiteral("<message>"), i18n("Prepends ┬──┬ ( ゜-゜ノ) to a plain-text message")}));
commands.append(QVariant::fromValue(Command{
QStringLiteral("/plain "),
QStringLiteral("<message>"),
i18n("Sends a message as plain text, without interpreting it as markdown")}));
commands.append(QVariant::fromValue(
Command{QStringLiteral("/plain "), QStringLiteral("<message>"), i18n("Sends a message as plain text, without interpreting it as markdown")}));
commands.append(QVariant::fromValue(Command{
QStringLiteral("/html "),
QStringLiteral("<message>"),
i18n("Sends a message as html, without interpreting it as markdown")}));
commands.append(QVariant::fromValue(
Command{QStringLiteral("/html "), QStringLiteral("<message>"), i18n("Sends a message as html, without interpreting it as markdown")}));
commands.append(QVariant::fromValue(Command{
QStringLiteral("/rainbow "),
QStringLiteral("<message>"),
i18n("Sends the given message coloured as a rainbow")}));
commands.append(
QVariant::fromValue(Command{QStringLiteral("/rainbow "), QStringLiteral("<message>"), i18n("Sends the given message coloured as a rainbow")}));
commands.append(QVariant::fromValue(Command{
QStringLiteral("/rainbowme "),
QStringLiteral("<message>"),
i18n("Sends the given emote coloured as a rainbow")}));
commands.append(QVariant::fromValue(Command{
QStringLiteral("/spoiler "),
QStringLiteral("<message>"),
i18n("Sends the given message as a spoiler")}));
commands.append(
QVariant::fromValue(Command{QStringLiteral("/rainbowme "), QStringLiteral("<message>"), i18n("Sends the given emote coloured as a rainbow")}));
commands.append(QVariant::fromValue(Command{QStringLiteral("/spoiler "), QStringLiteral("<message>"), i18n("Sends the given message as a spoiler")}));
// Actions commands
commands.append(QVariant::fromValue(Command{
QStringLiteral("/join "), QStringLiteral("<room-address>"),
i18n("Joins room with given address")}));
commands.append(QVariant::fromValue(Command{QStringLiteral("/join "), QStringLiteral("<room-address>"), i18n("Joins room with given address")}));
commands.append(QVariant::fromValue(Command{
QStringLiteral("/part "),
QStringLiteral("[<room-address>]"),
i18n("Leave room")}));
commands.append(QVariant::fromValue(Command{QStringLiteral("/part "), QStringLiteral("[<room-address>]"), i18n("Leave room")}));
commands.append(QVariant::fromValue(Command{
QStringLiteral("/invite "),
QStringLiteral("<user-id>"),
i18n("Invites user with given id to current room")}));
commands.append(QVariant::fromValue(Command{QStringLiteral("/invite "), QStringLiteral("<user-id>"), i18n("Invites user with given id to current room")}));
commands.append(QVariant::fromValue(Command{
QStringLiteral("/react "),
QStringLiteral("<reaction text>"),
i18n("React to this message with a text")}));
commands.append(QVariant::fromValue(Command{QStringLiteral("/react "), QStringLiteral("<reaction text>"), i18n("React to this message with a text")}));
// TODO more see elements /help action
return commands;
}

View File

@@ -25,7 +25,6 @@ Q_GADGET
Q_PROPERTY(QString command MEMBER command)
Q_PROPERTY(QString parameter MEMBER parameter)
Q_PROPERTY(QString help MEMBER help)
};
Q_DECLARE_METATYPE(Command)

View File

@@ -23,12 +23,12 @@
#include <QElapsedTimer>
#include <QFile>
#include <QFileInfo>
#include <QQuickItem>
#include <QGuiApplication>
#include <QMovie>
#include <QNetworkConfigurationManager>
#include <QNetworkReply>
#include <QPixmap>
#include <QQuickItem>
#include <QQuickWindow>
#include <QStandardPaths>
#include <QStringBuilder>
@@ -50,9 +50,9 @@
#include "neochatconfig.h"
#include "neochatroom.h"
#include "neochatuser.h"
#include "roommanager.h"
#include "settings.h"
#include "utils.h"
#include "roommanager.h"
#include <KStandardShortcut>
#ifndef Q_OS_ANDROID
@@ -119,8 +119,7 @@ Controller::Controller(QObject *parent)
}
#endif
connect(m_mgr, &QNetworkConfigurationManager::onlineStateChanged,
this, &Controller::isOnlineChanged);
connect(m_mgr, &QNetworkConfigurationManager::onlineStateChanged, this, &Controller::isOnlineChanged);
}
Controller::~Controller()
@@ -643,4 +642,3 @@ bool Controller::hasWindowSystem() const
return false;
#endif
}

View File

@@ -4,8 +4,8 @@
#pragma once
#include <QMediaPlayer>
#include <QQuickItem>
#include <QObject>
#include <QQuickItem>
#include <KAboutData>
#include <KFormat>
@@ -91,6 +91,7 @@ public:
Q_INVOKABLE void openOrCreateDirectChat(NeoChatUser *user);
Q_INVOKABLE void setBlur(QQuickItem *item, bool blur);
private:
explicit Controller(QObject *parent = nullptr);
~Controller() override;

View File

@@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include <csapi/account-data.h>
#include <csapi/profile.h>
#include <csapi/content-repo.h>
#include <csapi/profile.h>
#include "customemojimodel_p.h"
@@ -41,11 +41,7 @@ void CustomEmojiModel::fetchEmojies()
const auto e = emoji.startsWith(":") ? emoji : (QStringLiteral(":") + emoji + QStringLiteral(":"));
d->emojies << CustomEmoji {
e,
data.toObject()["url"].toString(),
QRegularExpression(QStringLiteral(R"((^|[^\\]))") + e)
};
d->emojies << CustomEmoji{e, data.toObject()["url"].toString(), QRegularExpression(QStringLiteral(R"((^|[^\\]))") + e)};
}
endResetModel();

View File

@@ -1,8 +1,8 @@
// SPDX-FileCopyrightText: 2021 Carson Black <uhhadd@gmail.com>
// SPDX-License-Identifier: GPL-2.0-or-later
#include "emojimodel.h"
#include "customemojimodel_p.h"
#include "emojimodel.h"
enum Roles {
Name,
@@ -10,11 +10,14 @@ enum Roles {
ModelData, // for emulating the regular emoji model's usage, otherwise the UI code would get too complicated
};
CustomEmojiModel::CustomEmojiModel(QObject* parent) : QAbstractListModel(parent), d(new Private)
CustomEmojiModel::CustomEmojiModel(QObject *parent)
: QAbstractListModel(parent)
, d(new Private)
{
connect(this, &CustomEmojiModel::connectionChanged, this, &CustomEmojiModel::fetchEmojies);
connect(this, &CustomEmojiModel::connectionChanged, this, [this]() {
if (!d->conn) return;
if (!d->conn)
return;
connect(d->conn, &Connection::accountDataChanged, this, [this](const QString &id) {
if (id != QStringLiteral("im.ponies.user_emotes")) {
@@ -27,7 +30,6 @@ CustomEmojiModel::CustomEmojiModel(QObject* parent) : QAbstractListModel(parent)
CustomEmojiModel::~CustomEmojiModel()
{
}
QVariant CustomEmojiModel::data(const QModelIndex &idx, int role) const
@@ -40,11 +42,7 @@ QVariant CustomEmojiModel::data(const QModelIndex& idx, int role) const
switch (Roles(role)) {
case Roles::ModelData:
return QVariant::fromValue(Emoji(
QStringLiteral("image://mxc/") + data.url.mid(6),
data.name,
true
));
return QVariant::fromValue(Emoji(QStringLiteral("image://mxc/") + data.url.mid(6), data.name, true));
case Roles::Name:
return data.name;
case Roles::ImageURL:
@@ -91,7 +89,9 @@ QString CustomEmojiModel::preprocessText(const QString &it)
{
auto cp = it;
for (const auto &emoji : qAsConst(d->emojies)) {
cp.replace(emoji.regexp, QStringLiteral(R"(<img data-mx-emoticon="" src="%1" alt="%2" title="%2" height="32" vertical-align="middle" />)").arg(emoji.url, emoji.name));
cp.replace(
emoji.regexp,
QStringLiteral(R"(<img data-mx-emoticon="" src="%1" alt="%2" title="%2" height="32" vertical-align="middle" />)").arg(emoji.url, emoji.name));
}
return cp;
}
@@ -100,14 +100,12 @@ QVariantList CustomEmojiModel::filterModel(const QString &filter)
{
QVariantList results;
for (const auto &emoji : qAsConst(d->emojies)) {
if (results.length() >= 10) break;
if (!emoji.name.contains(filter, Qt::CaseInsensitive)) continue;
if (results.length() >= 10)
break;
if (!emoji.name.contains(filter, Qt::CaseInsensitive))
continue;
results << QVariant::fromValue(Emoji(
QStringLiteral("image://mxc/") + emoji.url.mid(6),
emoji.name,
true
));
results << QVariant::fromValue(Emoji(QStringLiteral("image://mxc/") + emoji.url.mid(6), emoji.name, true));
}
return results;
}

View File

@@ -13,13 +13,11 @@ using namespace Quotient;
class CustomEmojiModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(Connection *connection READ connection WRITE setConnection NOTIFY connectionChanged)
public:
// constructors
explicit CustomEmojiModel(QObject *parent = nullptr);
@@ -46,10 +44,8 @@ public:
Q_INVOKABLE void removeEmoji(const QString &name);
private:
struct Private;
std::unique_ptr<Private> d;
void fetchEmojies();
};

View File

@@ -5,15 +5,13 @@
#include "customemojimodel.h"
struct CustomEmoji
{
struct CustomEmoji {
QString name; // with :semicolons:
QString url; // mxc://
QRegularExpression regexp;
};
struct CustomEmojiModel::Private
{
struct CustomEmojiModel::Private {
Connection *conn = nullptr;
QList<CustomEmoji> emojies;
};

View File

@@ -10,8 +10,7 @@
DevicesModel::DevicesModel(QObject *parent)
: QAbstractListModel(parent)
{
connect(&Controller::instance(), &Controller::activeConnectionChanged,
this, &DevicesModel::fetchDevices);
connect(&Controller::instance(), &Controller::activeConnectionChanged, this, &DevicesModel::fetchDevices);
fetchDevices();
}

View File

@@ -2,16 +2,16 @@
// SPDX-License-Identifier: GPL-3.0-only
#include <QCommandLineParser>
#include <QDebug>
#include <QFontDatabase>
#include <QGuiApplication>
#include <QIcon>
#include <QNetworkProxy>
#include <QNetworkProxyFactory>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QQuickStyle>
#include <QQuickWindow>
#include <QDebug>
#include <QIcon>
#ifdef Q_OS_ANDROID
#include <QGuiApplication>
@@ -31,6 +31,7 @@
#include "accountlistmodel.h"
#include "actionshandler.h"
#include "blurhashimageprovider.h"
#include "chatboxhelper.h"
#include "chatdocumenthandler.h"
#include "clipboard.h"
@@ -38,6 +39,7 @@
#include "controller.h"
#include "csapi/joining.h"
#include "csapi/leaving.h"
#include "customemojimodel.h"
#include "devicesmodel.h"
#include "emojimodel.h"
#include "filetypesingleton.h"
@@ -50,16 +52,14 @@
#include "neochatuser.h"
#include "notificationsmanager.h"
#include "publicroomlistmodel.h"
#include <room.h>
#include "roomlistmodel.h"
#include "roommanager.h"
#include "sortfilterroomlistmodel.h"
#include "spellcheckhighlighter.h"
#include "userdirectorylistmodel.h"
#include "userlistmodel.h"
#include "webshortcutmodel.h"
#include "spellcheckhighlighter.h"
#include "customemojimodel.h"
#include "blurhashimageprovider.h"
#include <room.h>
#ifdef HAVE_COLORSCHEME
#include "colorschemer.h"
#endif
@@ -112,17 +112,18 @@ int main(int argc, char *argv[])
about.addAuthor(i18n("Tobias Fella"), QString(), QStringLiteral("fella@posteo.de"));
about.setOrganizationDomain("kde.org");
about.addComponent(QStringLiteral("libQuotient"), i18n("A Qt5 library to write cross-platform clients for Matrix"), QString(), QStringLiteral("https://github.com/quotient-im/libquotient"), KAboutLicense::LGPL_V2_1);
about.addComponent(QStringLiteral("libQuotient"),
i18n("A Qt5 library to write cross-platform clients for Matrix"),
QString(),
QStringLiteral("https://github.com/quotient-im/libquotient"),
KAboutLicense::LGPL_V2_1);
KAboutData::setApplicationData(about);
QGuiApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("org.kde.neochat")));
#ifdef HAVE_KDBUSADDONS
KDBusService service(KDBusService::Unique);
service.connect(&service,
&KDBusService::activateRequested,
&RoomManager::instance(),
[](const QStringList &arguments, const QString &workingDirectory) {
service.connect(&service, &KDBusService::activateRequested, &RoomManager::instance(), [](const QStringList &arguments, const QString &workingDirectory) {
Q_UNUSED(workingDirectory);
if (arguments.isEmpty()) {
return;

View File

@@ -18,8 +18,8 @@
#include <QQmlEngine> // for qmlRegisterType()
#include <QTimeZone>
#include <KLocalizedString>
#include <KFormat>
#include <KLocalizedString>
#include "utils.h"
@@ -370,7 +370,6 @@ int MessageEventModel::rowCount(const QModelIndex &parent) const
} else {
return m_currentRoom->timelineSize();
}
}
bool MessageEventModel::canFetchMore(const QModelIndex &parent) const
@@ -388,7 +387,6 @@ void MessageEventModel::fetchMore(const QModelIndex &parent)
}
}
inline QVariantMap userAtEvent(NeoChatUser *user, NeoChatRoom *room, const RoomEvent &evt)
{
Q_UNUSED(evt)
@@ -418,8 +416,7 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
switch (role) {
case EventTypeRole:
return QStringLiteral("readMarker");
case TimeRole:
{
case TimeRole: {
const QDateTime eventDate = data(index(m_lastReadEventIndex.row() + 1, 0), TimeRole).toDateTime();
const KFormat format;
return format.formatRelativeDateTime(eventDate, QLocale::ShortFormat);
@@ -430,7 +427,8 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
return {};
}
const auto timelineIt = m_currentRoom->messageEvents().crbegin() + std::max(0, row - timelineBaseIndex() - (m_lastReadEventIndex.isValid() && m_lastReadEventIndex.row() < row ? 1 : 0));
const auto timelineIt = m_currentRoom->messageEvents().crbegin()
+ std::max(0, row - timelineBaseIndex() - (m_lastReadEventIndex.isValid() && m_lastReadEventIndex.row() < row ? 1 : 0));
const auto pendingIt = m_currentRoom->pendingEvents().crbegin() + std::min(row, timelineBaseIndex());
const auto &evt = isPending ? **pendingIt : **timelineIt;
@@ -684,8 +682,7 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
content = QVariant::fromValue(e->image().originalJson);
}
return QVariantMap{
{"eventId", replyEventId},
return QVariantMap{{"eventId", replyEventId},
{"display", m_currentRoom->eventToString(replyEvt, Qt::RichText)},
{"content", content},
{"type", type},

View File

@@ -278,12 +278,10 @@ QVariantList NeoChatRoom::getUsers(const QString &keyword) const
QVariantMap NeoChatRoom::getUser(const QString &userID) const
{
NeoChatUser user(userID, connection());
return QVariantMap {
{ QStringLiteral("id"), user.id() },
return QVariantMap{{QStringLiteral("id"), user.id()},
{QStringLiteral("displayName"), user.displayname(this)},
{QStringLiteral("avatarMediaId"), user.avatarMediaId(this)},
{ QStringLiteral("color"), user.color() }
};
{QStringLiteral("color"), user.color()}};
}
QUrl NeoChatRoom::urlToMxcUrl(const QUrl &mxcUrl)

View File

@@ -16,8 +16,8 @@
#endif
#include "controller.h"
#include "roommanager.h"
#include "neochatconfig.h"
#include "roommanager.h"
NotificationsManager &NotificationsManager::instance()
{

View File

@@ -3,13 +3,13 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#include "roommanager.h"
#include "neochatroom.h"
#include "neochatconfig.h"
#include "controller.h"
#include <QDesktopServices>
#include <QStandardPaths>
#include "neochatconfig.h"
#include "neochatroom.h"
#include <KConfigGroup>
#include <KLocalizedString>
#include <QDesktopServices>
#include <QStandardPaths>
#include <csapi/joining.h>
#include <utility>
@@ -22,7 +22,8 @@ RoomManager::RoomManager(QObject *parent)
}
RoomManager::~RoomManager()
{}
{
}
RoomManager &RoomManager::instance()
{
@@ -39,8 +40,7 @@ void RoomManager::openResource(const QString &idOrUri, const QString &action)
{
Uri uri{idOrUri};
if (!uri.isValid()) {
Q_EMIT warning(i18n("Malformed or empty Matrix id"),
i18n("%1 is not a correct Matrix identifier", idOrUri));
Q_EMIT warning(i18n("Malformed or empty Matrix id"), i18n("%1 is not a correct Matrix identifier", idOrUri));
return;
}
auto account = Controller::instance().activeConnection();
@@ -57,8 +57,7 @@ void RoomManager::openResource(const QString &idOrUri, const QString &action)
const auto result = visitResource(account, uri);
if (result == Quotient::CouldNotResolve) {
Q_EMIT warning(i18n("Room not found"),
i18n("There's no room %1 in the room list. Check the spelling and the account.", idOrUri));
Q_EMIT warning(i18n("Room not found"), i18n("There's no room %1 in the room list. Check the spelling and the account.", idOrUri));
} else { // Invalid cases should have been eliminated earlier
Q_ASSERT(result == Quotient::UriResolved);
}
@@ -89,8 +88,7 @@ void RoomManager::loadInitialRoom()
openRoomForActiveConnection();
connect(&Controller::instance(), &Controller::activeConnectionChanged,
this, &RoomManager::openRoomForActiveConnection);
connect(&Controller::instance(), &Controller::activeConnectionChanged, this, &RoomManager::openRoomForActiveConnection);
}
void RoomManager::openRoomForActiveConnection()
@@ -110,8 +108,7 @@ void RoomManager::openRoomForActiveConnection()
if (!roomId.isEmpty()) {
// Here we can cast because the controller has been configured to
// return NeoChatRoom instead of simple Quotient::Room
const auto room = qobject_cast<NeoChatRoom *>(
Controller::instance().activeConnection()->room(roomId));
const auto room = qobject_cast<NeoChatRoom *>(Controller::instance().activeConnection()->room(roomId));
if (room) {
enterRoom(room);
@@ -186,9 +183,7 @@ void RoomManager::visitRoom(Room *room, const QString &eventId)
}
}
void RoomManager::joinRoom(Quotient::Connection *account,
const QString &roomAliasOrId,
const QStringList &viaServers)
void RoomManager::joinRoom(Quotient::Connection *account, const QString &roomAliasOrId, const QStringList &viaServers)
{
account->joinRoom(QUrl::toPercentEncoding(roomAliasOrId), viaServers);
connectSingleShot(account, &Quotient::Connection::newRoom, this, [=](Quotient::Room *room) {
@@ -199,8 +194,7 @@ void RoomManager::joinRoom(Quotient::Connection *account,
bool RoomManager::visitNonMatrix(const QUrl &url)
{
if (!QDesktopServices::openUrl(url)) {
Q_EMIT warning(i18n("No application for the link"),
i18n("Your operating system could not find an application for the link."));
Q_EMIT warning(i18n("No application for the link"), i18n("Your operating system could not find an application for the link."));
}
return true;
}

View File

@@ -3,13 +3,14 @@
#pragma once
#include <KConfig>
#include <QObject>
#include <uriresolver.h>
#include <KConfig>
class NeoChatRoom;
namespace Quotient {
namespace Quotient
{
class Room;
class User;
}
@@ -53,8 +54,7 @@ public:
// Overrided methods from UriResolverBase
UriResolveResult visitUser(User *user, const QString &action) override;
void joinRoom(Quotient::Connection *account, const QString &roomAliasOrId,
const QStringList &viaServers) override;
void joinRoom(Quotient::Connection *account, const QString &roomAliasOrId, const QStringList &viaServers) override;
Q_INVOKABLE void visitRoom(Quotient::Room *room, const QString &eventId) override;
Q_INVOKABLE bool visitNonMatrix(const QUrl &url) override;

View File

@@ -79,10 +79,12 @@ SpellcheckHighlighter::SpellcheckHighlighter(QObject *parent)
: QSyntaxHighlighter(parent)
#ifndef Q_OS_ANDROID
, mSpellchecker{new Sonnet::Speller()}
, mLanguageGuesser{new Sonnet::GuessLanguage()}
, mLanguageGuesser
{
new Sonnet::GuessLanguage()
}
#endif
, m_document(nullptr)
, m_cursorPosition(-1)
, m_document(nullptr), m_cursorPosition(-1)
{
// Danger red from our color scheme
mErrorFormat.setForeground(QColor(0xED, 0x15, 0x15));

View File

@@ -5,13 +5,12 @@
#include "webshortcutmodel.h"
#ifdef HAVE_KIO
#include <KUriFilter>
#include <KIO/CommandLauncherJob>
#include <KUriFilter>
#endif
#include <KStringHandler>
struct KWebShortcutModelPrivate
{
struct KWebShortcutModelPrivate {
QString selectedText;
#ifdef HAVE_KIO
KUriFilterData filterData;
@@ -29,7 +28,6 @@ KWebShortcutModel::~KWebShortcutModel()
{
}
QString KWebShortcutModel::selectedText() const
{
return d->selectedText;

View File

@@ -62,6 +62,7 @@ public:
Q_SIGNALS:
void selectedTextChanged();
void openUrl(const QUrl &url);
private:
std::unique_ptr<KWebShortcutModelPrivate> d;
};