From 3249179dda1a6e624c1ccbe98ed4503eebed60a0 Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Sun, 6 Nov 2016 12:38:04 +0100 Subject: Use #pragma once everywhere --- connection.h | 11 ++++------- connectiondata.h | 11 ++++------- events/event.h | 5 +---- events/receiptevent.h | 5 +---- events/roomaliasesevent.h | 5 +---- events/roomcanonicalaliasevent.h | 5 +---- events/roommemberevent.h | 5 +---- events/roommessageevent.h | 11 ++++------- events/roomnameevent.h | 5 +---- events/roomtopicevent.h | 5 +---- events/typingevent.h | 5 +---- events/unknownevent.h | 5 +---- jobs/basejob.h | 5 +---- jobs/checkauthmethods.h | 13 +++++-------- jobs/geteventsjob.h | 5 +---- jobs/joinroomjob.h | 5 +---- jobs/leaveroomjob.h | 5 +---- jobs/mediathumbnailjob.h | 5 +---- jobs/passwordlogin.h | 5 +---- jobs/postmessagejob.h | 5 +---- jobs/postreceiptjob.h | 5 +---- jobs/roommembersjob.h | 5 +---- jobs/roommessagesjob.h | 5 +---- jobs/syncjob.h | 7 ++----- joinstate.h | 5 +---- kcoreaddons_export.h | 5 +---- logmessage.h | 5 +---- room.h | 5 +---- state.h | 5 +---- user.h | 5 +---- 30 files changed, 44 insertions(+), 134 deletions(-) diff --git a/connection.h b/connection.h index c5dad246..a1b0d97b 100644 --- a/connection.h +++ b/connection.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_CONNECTION_H -#define QMATRIXCLIENT_CONNECTION_H +#pragma once #include #include @@ -83,13 +82,13 @@ namespace QMatrixClient void connectionError(QString error); void resolveError(QString error); //void jobError(BaseJob* job); - + protected: /** * @brief Access the underlying ConnectionData class */ ConnectionData* connectionData(); - + /** * @brief Find a (possibly new) Room object for the specified id * Use this method whenever you need to find a Room object in @@ -105,7 +104,7 @@ namespace QMatrixClient * makes it possible for derived classes to have its own User class */ virtual User* createUser(QString userId); - + /** * makes it possible for derived classes to have its own Room class */ @@ -116,5 +115,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_CONNECTION_H diff --git a/connectiondata.h b/connectiondata.h index 5c8342d7..89e30e4d 100644 --- a/connectiondata.h +++ b/connectiondata.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_CONNECTIONDATA_H -#define QMATRIXCLIENT_CONNECTIONDATA_H +#pragma once #include @@ -30,7 +29,7 @@ namespace QMatrixClient public: ConnectionData(QUrl baseUrl); virtual ~ConnectionData(); - + //bool isConnected() const; QString accessToken() const; QUrl baseUrl() const; @@ -42,11 +41,9 @@ namespace QMatrixClient QString lastEvent() const; void setLastEvent( QString identifier ); - + private: class Private; Private* d; }; -} - -#endif // QMATRIXCLIENT_CONNECTIONDATA_H +} diff --git a/events/event.h b/events/event.h index 2e5e5da1..a47407da 100644 --- a/events/event.h +++ b/events/event.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_EVENT_H -#define QMATRIXCLIENT_EVENT_H +#pragma once #include @@ -112,5 +111,3 @@ namespace QMatrixClient return fallback; } } - -#endif // QMATRIXCLIENT_EVENT_H diff --git a/events/receiptevent.h b/events/receiptevent.h index cf08fed9..14472fb7 100644 --- a/events/receiptevent.h +++ b/events/receiptevent.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_RECEIPTEVENT_H -#define QMATRIXCLIENT_RECEIPTEVENT_H +#pragma once #include "event.h" @@ -56,5 +55,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_RECEIPTEVENT_H diff --git a/events/roomaliasesevent.h b/events/roomaliasesevent.h index 89ea63b8..8f638be2 100644 --- a/events/roomaliasesevent.h +++ b/events/roomaliasesevent.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_ROOMALIASESEVENT_H -#define QMATRIXCLIENT_ROOMALIASESEVENT_H +#pragma once #include "event.h" @@ -40,5 +39,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_ROOMALIASESEVENT_H \ No newline at end of file diff --git a/events/roomcanonicalaliasevent.h b/events/roomcanonicalaliasevent.h index f3ab8e5a..87219be6 100644 --- a/events/roomcanonicalaliasevent.h +++ b/events/roomcanonicalaliasevent.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_ROOMCANONICALALIASEVENT_H -#define QMATRIXCLIENT_ROOMCANONICALALIASEVENT_H +#pragma once #include "event.h" @@ -38,5 +37,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_ROOMCANONICALALIASEVENT_H \ No newline at end of file diff --git a/events/roommemberevent.h b/events/roommemberevent.h index e47013cb..f37cdc04 100644 --- a/events/roommemberevent.h +++ b/events/roommemberevent.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_ROOMMEMBEREVENT_H -#define QMATRIXCLIENT_ROOMMEMBEREVENT_H +#pragma once #include #include @@ -46,5 +45,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_ROOMMEMBEREVENT_H diff --git a/events/roommessageevent.h b/events/roommessageevent.h index 591b2df9..67789ef7 100644 --- a/events/roommessageevent.h +++ b/events/roommessageevent.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_ROOMMESSAGEEVENT_H -#define QMATRIXCLIENT_ROOMMESSAGEEVENT_H +#pragma once #include #include @@ -42,7 +41,7 @@ namespace QMatrixClient public: RoomMessageEvent(); virtual ~RoomMessageEvent(); - + QString userId() const; MessageEventType msgtype() const; @@ -57,9 +56,9 @@ namespace QMatrixClient QString body() const; MessageEventContent::Base* content() const; - + static RoomMessageEvent* fromJson( const QJsonObject& obj ); - + private: class Private; Private* d; @@ -145,5 +144,3 @@ namespace QMatrixClient using AudioContent = ThumbnailedContent; } } - -#endif // QMATRIXCLIENT_ROOMMESSAGEEVENT_H diff --git a/events/roomnameevent.h b/events/roomnameevent.h index 436a1dd4..0997ad9c 100644 --- a/events/roomnameevent.h +++ b/events/roomnameevent.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_ROOMNAMEEVENT_H -#define QMATRIXCLIENT_ROOMNAMEEVENT_H +#pragma once #include "event.h" @@ -40,5 +39,3 @@ private: }; } - -#endif // QMATRIXCLIENT_ROOMNAMEEVENT_H diff --git a/events/roomtopicevent.h b/events/roomtopicevent.h index f4d87eef..d4347953 100644 --- a/events/roomtopicevent.h +++ b/events/roomtopicevent.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_ROOMTOPICEVENT_H -#define QMATRIXCLIENT_ROOMTOPICEVENT_H +#pragma once #include @@ -40,5 +39,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_ROOMTOPICEVENT_H diff --git a/events/typingevent.h b/events/typingevent.h index 2625dc66..5a8b045c 100644 --- a/events/typingevent.h +++ b/events/typingevent.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_TYPINGEVENT_H -#define QMATRIXCLIENT_TYPINGEVENT_H +#pragma once #include @@ -40,5 +39,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_TYPINGEVENT_H diff --git a/events/unknownevent.h b/events/unknownevent.h index 58493095..51f2c4be 100644 --- a/events/unknownevent.h +++ b/events/unknownevent.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_UNKNOWNEVENT_H -#define QMATRIXCLIENT_UNKNOWNEVENT_H +#pragma once #include "event.h" @@ -39,5 +38,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_UNKNOWNEVENT_H \ No newline at end of file diff --git a/jobs/basejob.h b/jobs/basejob.h index b356eb7e..55267def 100644 --- a/jobs/basejob.h +++ b/jobs/basejob.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_BASEJOB_H -#define QMATRIXCLIENT_BASEJOB_H +#pragma once #include #include @@ -229,5 +228,3 @@ namespace QMatrixClient QScopedPointer d; }; } - -#endif // QMATRIXCLIENT_BASEJOB_H diff --git a/jobs/checkauthmethods.h b/jobs/checkauthmethods.h index e6aeba69..f6eb978a 100644 --- a/jobs/checkauthmethods.h +++ b/jobs/checkauthmethods.h @@ -16,30 +16,27 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_CHECKAUTHMETHODS_H -#define QMATRIXCLIENT_CHECKAUTHMETHODS_H +#pragma once #include "basejob.h" namespace QMatrixClient { class ConnectionData; - + class CheckAuthMethods : public BaseJob { public: CheckAuthMethods(ConnectionData* connection); virtual ~CheckAuthMethods(); - + QString session(); - + protected: Status parseJson(const QJsonDocument& data) override; - + private: class Private; Private* d; }; } - -#endif // QMATRIXCLIENT_CHECKAUTHMETHODS_H diff --git a/jobs/geteventsjob.h b/jobs/geteventsjob.h index d2eb75eb..fdd7f2f8 100644 --- a/jobs/geteventsjob.h +++ b/jobs/geteventsjob.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_GETEVENTSJOB_H -#define QMATRIXCLIENT_GETEVENTSJOB_H +#pragma once #include "basejob.h" @@ -45,5 +44,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_GETEVENTSJOB_H \ No newline at end of file diff --git a/jobs/joinroomjob.h b/jobs/joinroomjob.h index c1eebbef..a69843ed 100644 --- a/jobs/joinroomjob.h +++ b/jobs/joinroomjob.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_JOINROOMJOB_H -#define QMATRIXCLIENT_JOINROOMJOB_H +#pragma once #include "basejob.h" @@ -41,5 +40,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_JOINROOMJOB_H diff --git a/jobs/leaveroomjob.h b/jobs/leaveroomjob.h index 492233f6..4a62810f 100644 --- a/jobs/leaveroomjob.h +++ b/jobs/leaveroomjob.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_LEAVEROOMJOB_H -#define QMATRIXCLIENT_LEAVEROOMJOB_H +#pragma once #include "basejob.h" @@ -33,5 +32,3 @@ namespace QMatrixClient virtual ~LeaveRoomJob(); }; } - -#endif // QMATRIXCLIENT_LEAVEROOMJOB_H diff --git a/jobs/mediathumbnailjob.h b/jobs/mediathumbnailjob.h index 15bec9a1..cf1e9afb 100644 --- a/jobs/mediathumbnailjob.h +++ b/jobs/mediathumbnailjob.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_MEDIATHUMBNAILJOB_H -#define QMATRIXCLIENT_MEDIATHUMBNAILJOB_H +#pragma once #include "basejob.h" @@ -44,5 +43,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_MEDIATHUMBNAILJOB_H diff --git a/jobs/passwordlogin.h b/jobs/passwordlogin.h index 156865a3..c1291389 100644 --- a/jobs/passwordlogin.h +++ b/jobs/passwordlogin.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_PASSWORDLOGIN_H -#define QMATRIXCLIENT_PASSWORDLOGIN_H +#pragma once #include "basejob.h" @@ -43,5 +42,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_PASSWORDLOGIN_H diff --git a/jobs/postmessagejob.h b/jobs/postmessagejob.h index 9d52ae8d..2e1989fd 100644 --- a/jobs/postmessagejob.h +++ b/jobs/postmessagejob.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_POSTMESSAGEJOB_H -#define QMATRIXCLIENT_POSTMESSAGEJOB_H +#pragma once #include "basejob.h" @@ -40,5 +39,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_POSTMESSAGEJOB_H diff --git a/jobs/postreceiptjob.h b/jobs/postreceiptjob.h index 4e047b3a..5236ebc6 100644 --- a/jobs/postreceiptjob.h +++ b/jobs/postreceiptjob.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_POSTRECEIPTJOB_H -#define QMATRIXCLIENT_POSTRECEIPTJOB_H +#pragma once #include "basejob.h" @@ -35,5 +34,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_POSTRECEIPTJOB_H diff --git a/jobs/roommembersjob.h b/jobs/roommembersjob.h index 04803d67..ef22d2ef 100644 --- a/jobs/roommembersjob.h +++ b/jobs/roommembersjob.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_ROOMMEMBERSJOB_H -#define QMATRIXCLIENT_ROOMMEMBERSJOB_H +#pragma once #include "basejob.h" @@ -43,5 +42,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_ROOMMEMBERSJOB_H diff --git a/jobs/roommessagesjob.h b/jobs/roommessagesjob.h index 227ffac2..348217cc 100644 --- a/jobs/roommessagesjob.h +++ b/jobs/roommessagesjob.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_ROOMMESSAGESJOB_H -#define QMATRIXCLIENT_ROOMMESSAGESJOB_H +#pragma once #include "basejob.h" @@ -47,5 +46,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_ROOMMESSAGESJOB_H diff --git a/jobs/syncjob.h b/jobs/syncjob.h index e7b23d16..be1d4776 100644 --- a/jobs/syncjob.h +++ b/jobs/syncjob.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_SYNCJOB_H -#define QMATRIXCLIENT_SYNCJOB_H +#pragma once #include "basejob.h" @@ -102,7 +101,7 @@ namespace QMatrixClient SyncJob(ConnectionData* connection, QString since = {}, QString filter = {}, int timeout = -1, QString presence = {}); virtual ~SyncJob(); - + SyncData& roomData(); QString nextBatch() const; @@ -114,5 +113,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_SYNCJOB_H diff --git a/joinstate.h b/joinstate.h index e7175b2b..348ca8a6 100644 --- a/joinstate.h +++ b/joinstate.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_JOINSTATE_H -#define QMATRIXCLIENT_JOINSTATE_H +#pragma once namespace QMatrixClient { @@ -28,5 +27,3 @@ namespace QMatrixClient Leave }; } - -#endif // QMATRIXCLIENT_JOINSTATE_H \ No newline at end of file diff --git a/kcoreaddons_export.h b/kcoreaddons_export.h index 00c13059..16e7360b 100644 --- a/kcoreaddons_export.h +++ b/kcoreaddons_export.h @@ -1,6 +1,5 @@ -#ifndef KCOREADDONS_EXPORT_H -#define KCOREADDONS_EXPORT_H +#pragma once #ifdef KCOREADDONS_STATIC_DEFINE # define KCOREADDONS_EXPORT @@ -37,5 +36,3 @@ #if DEFINE_NO_DEPRECATED # define KCOREADDONS_NO_DEPRECATED #endif - -#endif diff --git a/logmessage.h b/logmessage.h index bb58af65..aa753adc 100644 --- a/logmessage.h +++ b/logmessage.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_LOGMESSAGE_H -#define QMATRIXCLIENT_LOGMESSAGE_H +#pragma once #include @@ -40,5 +39,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_LOGMESSAGE_H \ No newline at end of file diff --git a/room.h b/room.h index fb3212e9..637c93f2 100644 --- a/room.h +++ b/room.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_ROOM_H -#define QMATRIXCLIENT_ROOM_H +#pragma once #include #include @@ -136,5 +135,3 @@ namespace QMatrixClient void setLastReadEvent(User* user, QString eventId); }; } - -#endif // QMATRIXCLIENT_ROOM_H diff --git a/state.h b/state.h index 79566eba..b059ea92 100644 --- a/state.h +++ b/state.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_STATE_H -#define QMATRIXCLIENT_STATE_H +#pragma once #include #include @@ -46,5 +45,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_STATE_H \ No newline at end of file diff --git a/user.h b/user.h index 33a89e0b..2cb20b57 100644 --- a/user.h +++ b/user.h @@ -16,8 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef QMATRIXCLIENT_USER_H -#define QMATRIXCLIENT_USER_H +#pragma once #include #include @@ -64,5 +63,3 @@ namespace QMatrixClient Private* d; }; } - -#endif // QMATRIXCLIENT_USER_H -- cgit v1.2.3 From bc3ab9fdd3efc1fc40d6cef919e68246afb1ac83 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 14 Nov 2016 08:07:35 +0900 Subject: Removed no more used files --- jobs/geteventsjob.cpp | 96 ------------------------------------------------- jobs/geteventsjob.h | 46 ------------------------ jobs/roommembersjob.cpp | 70 ------------------------------------ jobs/roommembersjob.h | 44 ----------------------- kcoreaddons_export.h | 38 -------------------- logmessage.cpp | 60 ------------------------------- logmessage.h | 41 --------------------- 7 files changed, 395 deletions(-) delete mode 100644 jobs/geteventsjob.cpp delete mode 100644 jobs/geteventsjob.h delete mode 100644 jobs/roommembersjob.cpp delete mode 100644 jobs/roommembersjob.h delete mode 100644 kcoreaddons_export.h delete mode 100644 logmessage.cpp delete mode 100644 logmessage.h diff --git a/jobs/geteventsjob.cpp b/jobs/geteventsjob.cpp deleted file mode 100644 index 748a0189..00000000 --- a/jobs/geteventsjob.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2015 Felix Rohrbach - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "geteventsjob.h" - -#include -#include -#include -#include -#include - -#include - -#include "../room.h" -#include "../connectiondata.h" -#include "../events/event.h" - -using namespace QMatrixClient; - -class GetEventsJob::Private -{ - public: - Private() {} - - QList events; - QString from; -}; - -GetEventsJob::GetEventsJob(ConnectionData* connection, QString from) - : BaseJob(connection, JobHttpType::GetJob) - , d(new Private) -{ - if( from.isEmpty() ) - from = connection->lastEvent(); - d->from = from; -} - -GetEventsJob::~GetEventsJob() -{ - delete d; -} - -QList< Event* > GetEventsJob::events() -{ - return d->events; -} - -QString GetEventsJob::apiPath() -{ - return "_matrix/client/r0/events"; -} - -QUrlQuery GetEventsJob::query() -{ - QUrlQuery query; - query.addQueryItem("from", d->from); - return query; -} - -void GetEventsJob::parseJson(const QJsonDocument& data) -{ - QJsonObject json = data.object(); - if( !json.contains("chunk") || !json.value("chunk").isArray() ) - { - fail( BaseJob::UserDefinedError, "Couldn't find chunk" ); - return; - } - QJsonArray chunk = json.value("chunk").toArray(); -// qDebug() << chunk; - for( const QJsonValue& val: chunk ) - { - QJsonObject eventObj = val.toObject(); - Event* event = Event::fromJson(eventObj); - if( event ) - { - d->events.append(event); - } - } - connection()->setLastEvent( json.value("end").toString() ); - emitResult(); -} \ No newline at end of file diff --git a/jobs/geteventsjob.h b/jobs/geteventsjob.h deleted file mode 100644 index fdd7f2f8..00000000 --- a/jobs/geteventsjob.h +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2015 Felix Rohrbach - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#pragma once - -#include "basejob.h" - -namespace QMatrixClient -{ - class ConnectionData; - class Room; - class Event; - class GetEventsJob: public BaseJob - { - Q_OBJECT - public: - GetEventsJob(ConnectionData* connection, QString from=QString()); - virtual ~GetEventsJob(); - - QList events(); - - protected: - QString apiPath(); - QUrlQuery query(); - void parseJson(const QJsonDocument& data); - - private: - class Private; - Private* d; - }; -} diff --git a/jobs/roommembersjob.cpp b/jobs/roommembersjob.cpp deleted file mode 100644 index 7fc44c63..00000000 --- a/jobs/roommembersjob.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2015 Felix Rohrbach - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "roommembersjob.h" - -#include -#include -#include - -#include "../room.h" -#include "../state.h" - -using namespace QMatrixClient; - -class RoomMembersJob::Private -{ - public: - Room* room; - QList states; -}; - -RoomMembersJob::RoomMembersJob(ConnectionData* data, Room* room) - : BaseJob(data, JobHttpType::GetJob, "RoomMembersJob") - , d(new Private) -{ - d->room = room; -} - -RoomMembersJob::~RoomMembersJob() -{ - delete d; -} - -QList< State* > RoomMembersJob::states() -{ - return d->states; -} - -QString RoomMembersJob::apiPath() const -{ - return QString("_matrix/client/r0/rooms/%1/members").arg(d->room->id()); -} - -BaseJob::Status RoomMembersJob::parseJson(const QJsonDocument& data) -{ - QJsonArray chunk = data.object().value("chunk").toArray(); - for( const QJsonValue& val : chunk ) - { - State* state = State::fromJson(val.toObject()); - if( state ) - d->states.append(state); - } - qDebug() << "States: " << d->states.count(); - return Success; -} diff --git a/jobs/roommembersjob.h b/jobs/roommembersjob.h deleted file mode 100644 index ef22d2ef..00000000 --- a/jobs/roommembersjob.h +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2015 Felix Rohrbach - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#pragma once - -#include "basejob.h" - -namespace QMatrixClient -{ - class ConnectionData; - class Room; - class State; - class RoomMembersJob: public BaseJob - { - public: - RoomMembersJob(ConnectionData* data, Room* room); - virtual ~RoomMembersJob(); - - QList states(); - - protected: - QString apiPath() const override; - Status parseJson(const QJsonDocument& data) override; - - private: - class Private; - Private* d; - }; -} diff --git a/kcoreaddons_export.h b/kcoreaddons_export.h deleted file mode 100644 index 16e7360b..00000000 --- a/kcoreaddons_export.h +++ /dev/null @@ -1,38 +0,0 @@ - -#pragma once - -#ifdef KCOREADDONS_STATIC_DEFINE -# define KCOREADDONS_EXPORT -# define KCOREADDONS_NO_EXPORT -#else -# ifndef KCOREADDONS_EXPORT -# ifdef KF5CoreAddons_EXPORTS - /* We are building this library */ -# define KCOREADDONS_EXPORT __attribute__((visibility("default"))) -# else - /* We are using this library */ -# define KCOREADDONS_EXPORT __attribute__((visibility("default"))) -# endif -# endif - -# ifndef KCOREADDONS_NO_EXPORT -# define KCOREADDONS_NO_EXPORT __attribute__((visibility("hidden"))) -# endif -#endif - -#ifndef KCOREADDONS_DEPRECATED -# define KCOREADDONS_DEPRECATED __attribute__ ((__deprecated__)) -#endif - -#ifndef KCOREADDONS_DEPRECATED_EXPORT -# define KCOREADDONS_DEPRECATED_EXPORT KCOREADDONS_EXPORT KCOREADDONS_DEPRECATED -#endif - -#ifndef KCOREADDONS_DEPRECATED_NO_EXPORT -# define KCOREADDONS_DEPRECATED_NO_EXPORT KCOREADDONS_NO_EXPORT KCOREADDONS_DEPRECATED -#endif - -#define DEFINE_NO_DEPRECATED 0 -#if DEFINE_NO_DEPRECATED -# define KCOREADDONS_NO_DEPRECATED -#endif diff --git a/logmessage.cpp b/logmessage.cpp deleted file mode 100644 index 8b385c25..00000000 --- a/logmessage.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2015 Felix Rohrbach - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "logmessage.h" - -using namespace QMatrixClient; - -class LogMessage::Private -{ - public: - Private() {} - - MessageType type; - QString message; - QString author; -}; - -LogMessage::LogMessage(LogMessage::MessageType type, QString message, QString author) - : d(new Private) -{ - d->type = type; - d->message = message; - d->author = author; -} - -LogMessage::~LogMessage() -{ - delete d; -} - -LogMessage::MessageType LogMessage::type() const -{ - return d->type; -} - -QString LogMessage::message() const -{ - return d->message; -} - -QString LogMessage::author() const -{ - return d->author; -} - diff --git a/logmessage.h b/logmessage.h deleted file mode 100644 index aa753adc..00000000 --- a/logmessage.h +++ /dev/null @@ -1,41 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2015 Felix Rohrbach - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#pragma once - -#include - -namespace QMatrixClient -{ - class LogMessage - { - public: - enum MessageType{ UserMessage, StatusMessage }; - - LogMessage( MessageType type, QString message, QString author=QString() ); - virtual ~LogMessage(); - - MessageType type() const; - QString message() const; - QString author() const; - - private: - class Private; - Private* d; - }; -} -- cgit v1.2.3