Apply clang-format

This commit is contained in:
Tobias Fella
2020-12-25 22:23:35 +01:00
parent 6351454759
commit c449a8fafe
13 changed files with 1347 additions and 1352 deletions

View File

@@ -42,9 +42,9 @@
#include "csapi/wellknown.h" #include "csapi/wellknown.h"
#include "events/eventcontent.h" #include "events/eventcontent.h"
#include "events/roommessageevent.h" #include "events/roommessageevent.h"
#include "neochatconfig.h"
#include "neochatroom.h" #include "neochatroom.h"
#include "neochatuser.h" #include "neochatuser.h"
#include "neochatconfig.h"
#include "settings.h" #include "settings.h"
#include "utils.h" #include "utils.h"
#include <KStandardShortcut> #include <KStandardShortcut>
@@ -100,7 +100,6 @@ void Controller::loginWithCredentials(const QString &serverAddr, const QString &
return; return;
} }
if (deviceName.isEmpty()) { if (deviceName.isEmpty()) {
deviceName = "NeoChat " + QSysInfo::machineHostName() + " " + QSysInfo::productType() + " " + QSysInfo::productVersion() + " " + QSysInfo::currentCpuArchitecture(); deviceName = "NeoChat " + QSysInfo::machineHostName() + " " + QSysInfo::productType() + " " + QSysInfo::productVersion() + " " + QSysInfo::currentCpuArchitecture();
} }
@@ -565,8 +564,7 @@ QList<QKeySequence> Controller::preferencesShortcuts() const
} }
NeochatDeleteDeviceJob::NeochatDeleteDeviceJob(const QString &deviceId, const Omittable<QJsonObject> &auth) NeochatDeleteDeviceJob::NeochatDeleteDeviceJob(const QString &deviceId, const Omittable<QJsonObject> &auth)
: Quotient::BaseJob(HttpVerb::Delete, QStringLiteral("DeleteDeviceJob"), : Quotient::BaseJob(HttpVerb::Delete, QStringLiteral("DeleteDeviceJob"), QStringLiteral("/_matrix/client/r0/devices/%1").arg(deviceId))
QStringLiteral("/_matrix/client/r0/devices/%1").arg(deviceId))
{ {
QJsonObject _data; QJsonObject _data;
addParam<IfNotEmpty>(_data, QStringLiteral("auth"), auth); addParam<IfNotEmpty>(_data, QStringLiteral("auth"), auth);

View File

@@ -130,7 +130,8 @@ public:
explicit NeochatChangePasswordJob(const QString &newPassword, bool logoutDevices, const Omittable<QJsonObject> &auth = none); explicit NeochatChangePasswordJob(const QString &newPassword, bool logoutDevices, const Omittable<QJsonObject> &auth = none);
}; };
class NeochatDeleteDeviceJob : public BaseJob { class NeochatDeleteDeviceJob : public BaseJob
{
public: public:
explicit NeochatDeleteDeviceJob(const QString &deviceId, const Omittable<QJsonObject> &auth = none); explicit NeochatDeleteDeviceJob(const QString &deviceId, const Omittable<QJsonObject> &auth = none);
}; };

View File

@@ -28,6 +28,7 @@
#include "controller.h" #include "controller.h"
#include "csapi/joining.h" #include "csapi/joining.h"
#include "csapi/leaving.h" #include "csapi/leaving.h"
#include "devicesmodel.h"
#include "emojimodel.h" #include "emojimodel.h"
#include "matriximageprovider.h" #include "matriximageprovider.h"
#include "messageeventmodel.h" #include "messageeventmodel.h"
@@ -41,7 +42,6 @@
#include "sortfilterroomlistmodel.h" #include "sortfilterroomlistmodel.h"
#include "userdirectorylistmodel.h" #include "userdirectorylistmodel.h"
#include "userlistmodel.h" #include "userlistmodel.h"
#include "devicesmodel.h"
using namespace Quotient; using namespace Quotient;
@@ -83,8 +83,7 @@ int main(int argc, char *argv[])
#ifdef NEOCHAT_FLATPAK #ifdef NEOCHAT_FLATPAK
// Copy over the included FontConfig configuration to the // Copy over the included FontConfig configuration to the
// app's config dir: // app's config dir:
QFile::copy("/app/etc/fonts/conf.d/99-noto-mono-color-emoji.conf", QFile::copy("/app/etc/fonts/conf.d/99-noto-mono-color-emoji.conf", "/var/config/fontconfig/conf.d/99-noto-mono-color-emoji.conf");
"/var/config/fontconfig/conf.d/99-noto-mono-color-emoji.conf");
#endif #endif
Clipboard clipboard; Clipboard clipboard;

View File

@@ -29,10 +29,10 @@
#include "events/roompowerlevelsevent.h" #include "events/roompowerlevelsevent.h"
#include "events/typingevent.h" #include "events/typingevent.h"
#include "jobs/downloadfilejob.h" #include "jobs/downloadfilejob.h"
#include "neochatconfig.h"
#include "notificationsmanager.h" #include "notificationsmanager.h"
#include "user.h" #include "user.h"
#include "utils.h" #include "utils.h"
#include "neochatconfig.h"
#include <KLocalizedString> #include <KLocalizedString>
@@ -71,11 +71,9 @@ NeoChatRoom::NeoChatRoom(Connection *connection, QString roomId, JoinState joinS
NotificationsManager::instance().postNotification(this, displayName(), sender->displayname(this), eventToString(*lastEvent), avatar_image); NotificationsManager::instance().postNotification(this, displayName(), sender->displayname(this), eventToString(*lastEvent), avatar_image);
}); });
connect(this, &Room::aboutToAddHistoricalMessages, connect(this, &Room::aboutToAddHistoricalMessages, this, &NeoChatRoom::readMarkerLoadedChanged);
this, &NeoChatRoom::readMarkerLoadedChanged);
connect(this, &Quotient::Room::eventsHistoryJobChanged, connect(this, &Quotient::Room::eventsHistoryJobChanged, this, &NeoChatRoom::lastActiveTimeChanged);
this, &NeoChatRoom::lastActiveTimeChanged);
} }
void NeoChatRoom::uploadFile(const QUrl &url, const QString &body) void NeoChatRoom::uploadFile(const QUrl &url, const QString &body)
@@ -173,7 +171,6 @@ QString NeoChatRoom::lastEventToString() const
return QLatin1String(""); return QLatin1String("");
} }
bool NeoChatRoom::isEventHighlighted(const RoomEvent *e) const bool NeoChatRoom::isEventHighlighted(const RoomEvent *e) const
{ {
return highlights.contains(e); return highlights.contains(e);

View File

@@ -11,8 +11,8 @@
#include <KLocalizedString> #include <KLocalizedString>
#include <KNotification> #include <KNotification>
#include "neochatconfig.h"
#include "controller.h" #include "controller.h"
#include "neochatconfig.h"
NotificationsManager &NotificationsManager::instance() NotificationsManager &NotificationsManager::instance()
{ {