aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt47
-rw-r--r--connection.cpp2
-rw-r--r--connection.h1
-rw-r--r--events/event.h2
-rw-r--r--events/receiptevent.cpp4
-rw-r--r--events/receiptevent.h1
-rw-r--r--events/roomaliasesevent.cpp1
-rw-r--r--events/roommemberevent.cpp1
-rw-r--r--events/roommessageevent.cpp1
-rw-r--r--jobs/joinroomjob.cpp1
-rw-r--r--jobs/passwordlogin.cpp2
-rw-r--r--jobs/postreceiptjob.cpp17
-rw-r--r--jobs/postreceiptjob.h5
-rw-r--r--jobs/roommessagesjob.cpp1
-rw-r--r--jobs/syncjob.cpp4
15 files changed, 25 insertions, 65 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5449446b..24cdd58d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,18 +19,28 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
"MinSizeRel" "RelWithDebInfo")
endif()
-find_package(Qt5Core 5.2.0 REQUIRED) # For JSON (de)serialization
-find_package(Qt5Network 5.2.0 REQUIRED) # For networking
-find_package(Qt5Gui 5.2.0 REQUIRED) # For userpics
+if ( CMAKE_VERSION VERSION_LESS "3.1" )
+ CHECK_CXX_COMPILER_FLAG("-std=c++11" STD_FLAG_SUPPORTED)
+ if ( STD_FLAG_SUPPORTED )
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ endif ( STD_FLAG_SUPPORTED )
+else ( CMAKE_VERSION VERSION_LESS "3.1" )
+ set(CMAKE_CXX_STANDARD 11)
+endif ( CMAKE_VERSION VERSION_LESS "3.1" )
+
+find_package(Qt5 5.2.1 REQUIRED Network Gui)
+get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE)
message( STATUS )
-message( STATUS "================================================================================" )
-message( STATUS " libqmatrixclient Build Information " )
-message( STATUS "================================================================================" )
-message( STATUS "Building with: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" )
-message( STATUS "Install Prefix: ${CMAKE_INSTALL_PREFIX}" )
-message( STATUS "Path to Qt Core: ${Qt5Core_DIR}" )
-message( STATUS "================================================================================" )
+message( STATUS "=============================================================================" )
+message( STATUS " libqmatrixclient Build Information" )
+message( STATUS "=============================================================================" )
+if (CMAKE_BUILD_TYPE)
+ message( STATUS "Build type: ${CMAKE_BUILD_TYPE}")
+endif(CMAKE_BUILD_TYPE)
+message( STATUS "Using compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" )
+message( STATUS "Using Qt ${Qt5_VERSION} at ${Qt5_Prefix}" )
+message( STATUS "=============================================================================" )
message( STATUS )
# Set up source files
@@ -39,7 +49,6 @@ set(libqmatrixclient_SRCS
connection.cpp
room.cpp
user.cpp
- logmessage.cpp
state.cpp
settings.cpp
events/event.cpp
@@ -69,20 +78,4 @@ add_library(qmatrixclient ${libqmatrixclient_SRCS})
set_property(TARGET qmatrixclient PROPERTY VERSION "0.0.0")
set_property(TARGET qmatrixclient PROPERTY SOVERSION 0 )
-if ( CMAKE_VERSION VERSION_LESS "3.1" )
- CHECK_CXX_COMPILER_FLAG("-std=c++11" STD_FLAG_SUPPORTED)
- if ( STD_FLAG_SUPPORTED )
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
- endif ( STD_FLAG_SUPPORTED )
-else ( CMAKE_VERSION VERSION_LESS "3.1" )
- target_compile_features(qmatrixclient PRIVATE cxx_range_for)
- target_compile_features(qmatrixclient PRIVATE cxx_override)
- target_compile_features(qmatrixclient PRIVATE cxx_strong_enums)
- target_compile_features(qmatrixclient PRIVATE cxx_lambdas)
- target_compile_features(qmatrixclient PRIVATE cxx_auto_type)
- target_compile_features(qmatrixclient PRIVATE cxx_generalized_initializers)
- target_compile_features(qmatrixclient PRIVATE cxx_nullptr)
- target_compile_features(qmatrixclient PRIVATE cxx_variadic_templates)
-endif ( CMAKE_VERSION VERSION_LESS "3.1" )
-
target_link_libraries(qmatrixclient Qt5::Core Qt5::Network Qt5::Gui)
diff --git a/connection.cpp b/connection.cpp
index e0274fd7..0f115e3a 100644
--- a/connection.cpp
+++ b/connection.cpp
@@ -211,7 +211,7 @@ PostReceiptJob* Connection::postReceipt(Room* room, Event* event)
void Connection::joinRoom(QString roomAlias)
{
JoinRoomJob* job = new JoinRoomJob(d->data, roomAlias);
- connect( job, &SyncJob::success, [=] () {
+ connect( job, &BaseJob::success, [=] () {
if ( Room* r = provideRoom(job->roomId()) )
emit joinedRoom(r);
});
diff --git a/connection.h b/connection.h
index a1b0d97b..0e25d695 100644
--- a/connection.h
+++ b/connection.h
@@ -20,6 +20,7 @@
#include <QtCore/QObject>
#include <QtCore/QUrl>
+#include <QtCore/QSize>
namespace QMatrixClient
{
diff --git a/events/event.h b/events/event.h
index a47407da..12b0ebd5 100644
--- a/events/event.h
+++ b/events/event.h
@@ -18,8 +18,6 @@
#pragma once
-#include <algorithm>
-
#include <QtCore/QString>
#include <QtCore/QDateTime>
#include <QtCore/QJsonObject>
diff --git a/events/receiptevent.cpp b/events/receiptevent.cpp
index 29d78a20..74e89ba2 100644
--- a/events/receiptevent.cpp
+++ b/events/receiptevent.cpp
@@ -35,13 +35,11 @@ Example of a Receipt Event:
#include "receiptevent.h"
-#include <QtCore/QJsonObject>
#include <QtCore/QJsonArray>
#include <QtCore/QDebug>
using namespace QMatrixClient;
-
class ReceiptEvent::Private
{
public:
@@ -83,7 +81,7 @@ ReceiptEvent* ReceiptEvent::fromJson(const QJsonObject& obj)
{
const QJsonObject user = reads[userId].toObject();
const QDateTime time = QDateTime::fromMSecsSinceEpoch( (quint64) user["ts"].toDouble(), Qt::UTC );
- receipts.push_back({ eventId, userId, time });
+ receipts.push_back({ userId, time });
}
e->d->eventToReceipts.insert(eventId, receipts);
}
diff --git a/events/receiptevent.h b/events/receiptevent.h
index 14472fb7..5ca33f75 100644
--- a/events/receiptevent.h
+++ b/events/receiptevent.h
@@ -27,7 +27,6 @@ namespace QMatrixClient
class Receipt
{
public:
- QString eventId;
QString userId;
QDateTime timestamp;
};
diff --git a/events/roomaliasesevent.cpp b/events/roomaliasesevent.cpp
index 15b4c54e..9c64e40c 100644
--- a/events/roomaliasesevent.cpp
+++ b/events/roomaliasesevent.cpp
@@ -34,7 +34,6 @@
#include "roomaliasesevent.h"
-#include <QtCore/QJsonObject>
#include <QtCore/QJsonArray>
#include <QtCore/QDebug>
diff --git a/events/roommemberevent.cpp b/events/roommemberevent.cpp
index e58bda8f..93b4bb32 100644
--- a/events/roommemberevent.cpp
+++ b/events/roommemberevent.cpp
@@ -19,7 +19,6 @@
#include "roommemberevent.h"
#include <QtCore/QDebug>
-#include <QtCore/QUrl>
using namespace QMatrixClient;
diff --git a/events/roommessageevent.cpp b/events/roommessageevent.cpp
index 76152102..bb28d682 100644
--- a/events/roommessageevent.cpp
+++ b/events/roommessageevent.cpp
@@ -18,7 +18,6 @@
#include "roommessageevent.h"
-#include <QtCore/QJsonObject>
#include <QtCore/QMimeDatabase>
#include <QtCore/QDebug>
diff --git a/jobs/joinroomjob.cpp b/jobs/joinroomjob.cpp
index d443acd7..073084c4 100644
--- a/jobs/joinroomjob.cpp
+++ b/jobs/joinroomjob.cpp
@@ -18,7 +18,6 @@
#include "joinroomjob.h"
-#include <QtCore/QJsonObject>
#include <QtNetwork/QNetworkReply>
#include "../connectiondata.h"
diff --git a/jobs/passwordlogin.cpp b/jobs/passwordlogin.cpp
index a7a405aa..c78c15b5 100644
--- a/jobs/passwordlogin.cpp
+++ b/jobs/passwordlogin.cpp
@@ -18,8 +18,6 @@
#include "passwordlogin.h"
-#include <QtCore/QJsonDocument>
-#include <QtCore/QJsonObject>
#include <QtNetwork/QNetworkReply>
#include "../connectiondata.h"
diff --git a/jobs/postreceiptjob.cpp b/jobs/postreceiptjob.cpp
index d0c82b4f..1eaefc2a 100644
--- a/jobs/postreceiptjob.cpp
+++ b/jobs/postreceiptjob.cpp
@@ -24,23 +24,10 @@
using namespace QMatrixClient;
-class PostReceiptJob::Private
-{
- public:
- Private() {}
-
- QString roomId;
- QString eventId;
-};
-
PostReceiptJob::PostReceiptJob(ConnectionData* connection, QString roomId, QString eventId)
: BaseJob(connection, JobHttpType::PostJob, "PostReceiptJob",
QString("/_matrix/client/r0/rooms/%1/receipt/m.read/%2").arg(roomId, eventId))
- , d(new Private)
-{
-}
+{ }
PostReceiptJob::~PostReceiptJob()
-{
- delete d;
-}
+{ }
diff --git a/jobs/postreceiptjob.h b/jobs/postreceiptjob.h
index 5236ebc6..c0002dc0 100644
--- a/jobs/postreceiptjob.h
+++ b/jobs/postreceiptjob.h
@@ -22,15 +22,10 @@
namespace QMatrixClient
{
- class Room;
class PostReceiptJob: public BaseJob
{
public:
PostReceiptJob(ConnectionData* connection, QString roomId, QString eventId);
virtual ~PostReceiptJob();
-
- private:
- class Private;
- Private* d;
};
}
diff --git a/jobs/roommessagesjob.cpp b/jobs/roommessagesjob.cpp
index d67ffc2a..1e53f601 100644
--- a/jobs/roommessagesjob.cpp
+++ b/jobs/roommessagesjob.cpp
@@ -19,7 +19,6 @@
#include "roommessagesjob.h"
#include "../room.h"
-#include <QtCore/QJsonObject>
#include <QtCore/QJsonArray>
using namespace QMatrixClient;
diff --git a/jobs/syncjob.cpp b/jobs/syncjob.cpp
index 521f829e..554ac0f7 100644
--- a/jobs/syncjob.cpp
+++ b/jobs/syncjob.cpp
@@ -18,13 +18,9 @@
#include "syncjob.h"
-#include <QtCore/QJsonDocument>
-#include <QtCore/QJsonObject>
-#include <QtCore/QJsonValue>
#include <QtCore/QJsonArray>
#include <QtCore/QDebug>
-#include "../room.h"
#include "../connectiondata.h"
using namespace QMatrixClient;