...
 
Commits (2)
add_subdirectory(interfaces)
add_subdirectory(daemon)
add_subdirectory(client)
\ No newline at end of file
qt5_add_resources(KDECONNECT_FILESYNC_CLIENT_SRCS resources.qrc)
include_directories(../../)
add_executable(kdeconnect-filesync-client
main.cpp
common.cpp
client.cpp
sync_table_model.cpp
../../filesyncapp/interfaces/json_types.cpp
${KDECONNECT_FILESYNC_CLIENT_SRCS})
sync_table_model.cpp)
target_link_libraries(kdeconnect-filesync-client
kdeconnectinterfaces
kdeconnect_filesyncapp_interfaces
KF5::CoreAddons
KF5::DBusAddons
Qt5::Quick
......
......@@ -22,7 +22,6 @@
#include <QThread>
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <interfaces/dbusinterfaces.h>
#include "client.h"
#include "common.h"
......
......@@ -22,8 +22,8 @@
#define FILESYNC_COMMON_H
#include <exception>
#include <QtCore/QString>
#include <QtCore/QProcess>
#include <QString>
#include <QProcess>
namespace FileSync
{
......
......@@ -24,6 +24,7 @@
#include <KLocalizedContext>
#include <KLocalizedString>
#include <QQmlContext>
#include "filesyncapp/interfaces/json_types.h"
#include "client.h"
#include "sync_table_model.h"
......
......@@ -21,9 +21,9 @@
#import <QLoggingCategory>
#include <QDBusPendingReply>
#include "interfaces/dbusinterfaces.h"
#include "sync_table_model.h"
#include "../../filesyncapp/interfaces/json_types.h"
#include "filesyncapp/interfaces/json_types.h"
#include "interfaces/dbusinterfaces.h"
Q_LOGGING_CATEGORY(LOG_SYNC_TABLE_MODEL,
"kdeconnect.filesyncapp.client.syncTableModel");
......
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
include_directories(
../../
${CMAKE_CURRENT_BINARY_DIR}/../../../interfaces
)
set(kdeconnect_libraries
kdeconnectinterfaces
kdeconnect_filesyncapp_interfaces
KF5::KIOWidgets
KF5::I18n
Qt5::DBus
Qt5::Test
)
ecm_add_test(
../../client.cpp
client_test.cpp LINK_LIBRARIES ${kdeconnect_libraries} TEST_NAME client_test)
add_to_coverage("client")
/**
* Copyright 2019 Viktor Porvaznik <viktor.porvaznik@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QObject>
#include <QTest>
// Class under the test
#include "client.h"
namespace FileSync
{
class ClientTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void test0()
{
}
};
}
QTEST_MAIN(FileSync::ClientTest)
#include "client_test.moc"
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
include_directories(
../../
${CMAKE_CURRENT_BINARY_DIR}/../../../interfaces
)
set(kdeconnect_libraries
kdeconnectinterfaces
kdeconnect_filesyncapp_interfaces
KF5::I18n
Qt5::DBus
Qt5::Test
)
ecm_add_test(
../../sync_table_model.cpp
sync_table_model_test.cpp LINK_LIBRARIES ${kdeconnect_libraries} TEST_NAME sync_table_model_test)
add_to_coverage("sync_table_model")
/**
* Copyright 2019 Viktor Porvaznik <viktor.porvaznik@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QObject>
#include <QTest>
// Class under the test
#include "sync_table_model.h"
namespace FileSync
{
class SyncTableModelTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void test0()
{
}
};
}
QTEST_MAIN(FileSync::SyncTableModelTest)
#include "sync_table_model_test.moc"
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
include_directories(../)
add_executable(kdeconnect-filesync-daemon
main.cpp
log.cpp
......@@ -11,13 +13,11 @@ add_executable(kdeconnect-filesync-daemon
sync_operation.cpp
config.cpp
singleton_pool.hpp
../interfaces/filesyncapp_interface.cpp
../interfaces/sync_result.cpp
../interfaces/json_types.cpp
${KDECONNECT_FILESYNC_DAEMON_SRCS})
filesyncapp_interface.cpp)
target_link_libraries(kdeconnect-filesync-daemon
kdeconnectinterfaces
kdeconnect_filesyncapp_interfaces
KF5::CoreAddons
KF5::DBusAddons
)
......
......@@ -23,8 +23,8 @@
#include <exception>
#include <QLoggingCategory>
#include <QtCore/QString>
#include <QtCore/QProcess>
#include <QString>
#include <QProcess>
namespace FileSync
{
......
......@@ -25,12 +25,12 @@
#include <QJsonArray>
#include <QString>
#include <QLoggingCategory>
#include <QtCore/QDateTime>
#include <QtCore/QObject>
#include <QtCore/QFile>
#include <QtCore/QStandardPaths>
#include <QtCore/QFileInfo>
#include <QtCore/QJsonDocument>
#include <QDateTime>
#include <QObject>
#include <QFile>
#include <QStandardPaths>
#include <QFileInfo>
#include <QJsonDocument>
#include "common.h"
#include "singleton_pool.hpp"
......
......@@ -18,9 +18,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QJsonArray>
#include <config.h>
#include <daemon.h>
#include <QJsonArray>
Q_LOGGING_CATEGORY(LOG_DAEMON, "kdeconnect.filesyncapp.daemon");
......
......@@ -25,6 +25,7 @@
#include <QObject>
#include <QDBusAbstractAdaptor>
#include <QCoreApplication>
#include "interfaces/dbusinterfaces.h"
#include "filesyncapp/interfaces/sync_result.h"
#include "executor.h"
......
......@@ -28,6 +28,7 @@
#include <QStandardPaths>
#include <QCoreApplication>
#include <QLoggingCategory>
#include "interfaces/dbusinterfaces.h"
#include "filesyncapp/interfaces/sync_result.h"
#include "log.h"
......
......@@ -21,9 +21,9 @@
#include <QJsonArray>
#include <QJsonDocument>
#include <filesyncapp/interfaces/filesyncapp_interface.h>
#include <log.h>
#include <common.h>
#include "filesyncapp_interface.h"
#include "common.h"
#include "log.h"
Q_LOGGING_CATEGORY(LOG_INTERFACES_DBUS,
"kdeconnect.filesyncapp.interfaces.dbus");
......
......@@ -18,19 +18,20 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "index.h"
#include "log.h"
#include "common.h"
#include <QString>
#include <QMap>
#include <QPair>
#include <QtCore/QDir>
#include <QDir>
#include <QLoggingCategory>
#include <QtCore/QDateTime>
#include <QtCore/QJsonDocument>
#include <QDateTime>
#include <QJsonDocument>
#include <QStandardPaths>
#include <QtCore/QJsonArray>
#include <QtCore/QCryptographicHash>
#include <QJsonArray>
#include <QCryptographicHash>
#include "index.h"
#include "log.h"
#include "common.h"
Q_LOGGING_CATEGORY(LOG_INDEX, "kdeconnect.filesyncapp.daemon.index");
......
......@@ -21,9 +21,9 @@
#ifndef FILESYNC_INDEX_H
#define FILESYNC_INDEX_H
#include <QtCore/QArgument>
#include <QArgument>
#include <QString>
#include <QtCore/QPair>
#include <QPair>
#include <QJsonObject>
#include <QObject>
......
......@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtCore/QFile>
#include <QFile>
#include "log.h"
#include "common.h"
......
......@@ -24,9 +24,9 @@
#include <string>
#include <QString>
#include <QLoggingCategory>
#include <QtCore/QDateTime>
#include <QtCore/QObject>
#include <QtCore/QFile>
#include <QDateTime>
#include <QObject>
#include <QFile>
#include "singleton_pool.hpp"
......
......@@ -20,18 +20,16 @@
#include <QCommandLineParser>
#include <QDBusConnection>
#include <qdbuserror.h>
#include <QDBusError>
#include "daemon.h"
#include "common.h"
#include <filesyncapp/interfaces/filesyncapp_interface.h>
#include <filesyncapp/interfaces/sync_result.h>
#include <filesyncapp/interfaces/json_types.h>
#include "filesyncapp_interface.h"
#include "interfaces/sync_result.h"
#include "interfaces/json_types.h"
Q_LOGGING_CATEGORY(LOG_MAIN, "kdeconnect.filesyncapp.main");
// TODO optimize imports and remove unused ones
//TODO all strings to consts
int main(int argc, char *argv[])
......
......@@ -18,8 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <log.h>
#include <sftp_mounter.h>
#include "log.h"
#include "sftp_mounter.h"
#include "util.h"
Q_LOGGING_CATEGORY(LOG_SFTP_MOUNTER, "kdeconnect.filesyncapp.daemon.sftpMounter");
......
......@@ -26,9 +26,10 @@
#include <QStandardPaths>
#include <QCoreApplication>
#include <QLoggingCategory>
#include "common.h"
#include "interfaces/dbusinterfaces.h"
#include "filesyncapp/interfaces/sync_result.h"
#include "common.h"
namespace FileSync
{
......
......@@ -23,7 +23,7 @@
#include <QString>
#include <QMap>
#include <qdebug.h>
#include <QDebug>
namespace FileSync
{
......
......@@ -18,7 +18,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtCore/QFileInfo>
#include <QFileInfo>
#include <QDateTime>
#include <QLoggingCategory>
#include "sync_operation.h"
#include "log.h"
#include "common.h"
......
......@@ -21,8 +21,8 @@
#ifndef FILESYNC_SYNC_OPERATION_H
#define FILESYNC_SYNC_OPERATION_H
#include <QtCore/QString>
#include <QtCore/QPair>
#include <QString>
#include <QPair>
#include <QObject>
namespace FileSync
......
......@@ -3,8 +3,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
include_directories(
${KDEConnectCore_BINARY_DIR}
${CMAKE_SOURCE_DIR}
../../
)
......
......@@ -3,14 +3,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
include_directories(
${KDEConnectCore_BINARY_DIR}
${CMAKE_SOURCE_DIR}
../../
)
set(kdeconnect_libraries
kdeconnectcore
kdeconnectinterfaces
kdeconnect_filesyncapp_interfaces
KF5::I18n
KF5::KIOWidgets
Qt5::DBus
......@@ -29,9 +28,7 @@ ecm_add_test(
../../sync_operation.cpp
../../config.cpp
../../sftp_mounter.cpp
../../../interfaces/filesyncapp_interface.cpp
../../../interfaces/sync_result.cpp
../../../interfaces/json_types.cpp
../../filesyncapp_interface.cpp
daemon_test.cpp LINK_LIBRARIES ${kdeconnect_libraries} TEST_NAME daemon_test)
add_to_coverage("daemon")
......@@ -3,14 +3,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
include_directories(
${KDEConnectCore_BINARY_DIR}
${CMAKE_SOURCE_DIR}
../../
)
set(kdeconnect_libraries
kdeconnectcore
kdeconnectinterfaces
kdeconnect_filesyncapp_interfaces
KF5::I18n
KF5::KIOWidgets
Qt5::DBus
......@@ -29,9 +28,7 @@ ecm_add_test(
../../sync_operation.cpp
../../config.cpp
../../sftp_mounter.cpp
../../../interfaces/filesyncapp_interface.cpp
../../../interfaces/sync_result.cpp
../../../interfaces/json_types.cpp
../../filesyncapp_interface.cpp
executor_test.cpp LINK_LIBRARIES ${kdeconnect_libraries} TEST_NAME executor_test)
add_to_coverage("executor")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
include_directories(
../../
${CMAKE_CURRENT_BINARY_DIR}/../../../interfaces
)
set(kdeconnect_libraries
kdeconnectcore
kdeconnectinterfaces
kdeconnect_filesyncapp_interfaces
KF5::I18n
KF5::KIOWidgets
Qt5::DBus
Qt5::Network
Qt5::Test
qca-qt5
pthread
)
ecm_add_test(
../../util.cpp
../../log.cpp
../../index.cpp
../../executor.cpp
../../daemon.cpp
../../sync_operation.cpp
../../config.cpp
../../sftp_mounter.cpp
../../filesyncapp_interface.cpp
filesyncapp_interface_test.cpp LINK_LIBRARIES ${kdeconnect_libraries} TEST_NAME filesyncapp_interface_test)
add_to_coverage("filesyncapp_interface")
/**
* Copyright 2019 Viktor Porvaznik <viktor.porvaznik@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QObject>
#include <QTest>
// Class under the test
#include "filesyncapp_interface.h"
namespace FileSync
{
class FilesyncappInterfaceTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void test0()
{
}
};
}
QTEST_MAIN(FileSync::FilesyncappInterfaceTest)
#include "filesyncapp_interface_test.moc"
......@@ -3,8 +3,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
include_directories(
${KDEConnectCore_BINARY_DIR}
${CMAKE_SOURCE_DIR}
../../
)
......
......@@ -3,8 +3,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
include_directories(
${KDEConnectCore_BINARY_DIR}
${CMAKE_SOURCE_DIR}
../../
)
......
......@@ -3,14 +3,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
include_directories(
${KDEConnectCore_BINARY_DIR}
${CMAKE_SOURCE_DIR}
../../
)
set(kdeconnect_libraries
kdeconnectcore
kdeconnectinterfaces
kdeconnect_filesyncapp_interfaces
KF5::I18n
KF5::KIOWidgets
Qt5::DBus
......@@ -29,9 +28,7 @@ ecm_add_test(
../../executor.cpp
../../sftp_mounter.cpp
../../sync_operation.cpp
../../../interfaces/filesyncapp_interface.cpp
../../../interfaces/json_types.cpp
../../../interfaces/sync_result.cpp
../../filesyncapp_interface.cpp
sftp_mounter_test.cpp LINK_LIBRARIES ${kdeconnect_libraries} TEST_NAME sftp_mounter_test)
add_to_coverage("sftp_mounter")
......@@ -3,8 +3,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
include_directories(
${KDEConnectCore_BINARY_DIR}
${CMAKE_SOURCE_DIR}
../../
)
......
......@@ -2,26 +2,20 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
set(tested_class "sync_operation")
set(test_name ${tested_class}_test)
include_directories(
${KDEConnectCore_BINARY_DIR}
${CMAKE_SOURCE_DIR}
../../
mocks/
real/
)
set(kdeconnect_libraries
kdeconnectcore
KF5::I18n
KF5::KIOWidgets
Qt5::DBus
Qt5::Network
Qt5::Test
qca-qt5
pthread
)
ecm_add_test(
../../util.cpp
../../sync_operation.cpp
sync_operation_test.cpp LINK_LIBRARIES ${kdeconnect_libraries} TEST_NAME sync_operation_test)
real/${tested_class}.cpp
${test_name}.cpp LINK_LIBRARIES ${kdeconnect_libraries} TEST_NAME ${test_name})
add_to_coverage("sync_operation")
add_to_coverage(${tested_class})
../../common.h
\ No newline at end of file
#define M(message) { \
}
#define D(logCategory, message) { \
}
#define I(logCategory, message) { \
}
#define W(logCategory, message) { \
}
#define E(logCategory, message) { \
}
#define LOG_D(logCategory, message) { \
}
#define LOG_I(logCategory, message) { \
}
#define LOG_W(logCategory, message) { \
}
#define LOG_E(logCategory, message) { \
}
/**
* Copyright 2019 Viktor Porvaznik <viktor.porvaznik@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QString>
#include <QList>
namespace FileSync
{
class Util
{
public:
static int
runCommand(const QString &commandToRun, QString &stdout, QString &stderr);
static QString convertToHash(const QString &toConvert)
{
return QString();
}
static QString getFileContent(const QString &filePath)
{
return QString();
}
static QList<QString> scanDir(const QString &rootElement)
{
return QList<QString>();
}
};
}
../../sync_operation.cpp
\ No newline at end of file
../../sync_operation.h
\ No newline at end of file
......@@ -2,25 +2,20 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
set(tested_class "util")
set(test_name ${tested_class}_test)
include_directories(
${KDEConnectCore_BINARY_DIR}
${CMAKE_SOURCE_DIR}
../../
mocks/
real/
)
set(kdeconnect_libraries
kdeconnectcore
KF5::I18n
KF5::KIOWidgets
Qt5::DBus
Qt5::Network
Qt5::Test
qca-qt5
pthread
)
ecm_add_test(
../../util.cpp
util_test.cpp LINK_LIBRARIES ${kdeconnect_libraries} TEST_NAME util_test)
real/${tested_class}.cpp
${test_name}.cpp LINK_LIBRARIES ${kdeconnect_libraries} TEST_NAME ${test_name})
add_to_coverage("util")
add_to_coverage(${tested_class})
../../common.h
\ No newline at end of file
#define M(message) { \
}
#define D(logCategory, message) { \
}
#define I(logCategory, message) { \
}
#define W(logCategory, message) { \
}
#define E(logCategory, message) { \
}
#define LOG_D(logCategory, message) { \
}
#define LOG_I(logCategory, message) { \
}
#define LOG_W(logCategory, message) { \
}
#define LOG_E(logCategory, message) { \
}
../../util.cpp
\ No newline at end of file
../../util.h
\ No newline at end of file
......@@ -18,12 +18,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QLoggingCategory>
#include <QCryptographicHash>
#include <QFileInfo>
#include <QProcess>
#include <QDir>
#include "log.h"
#include "common.h"
#include "util.h"
#include <QLoggingCategory>
#include <QtCore/QCryptographicHash>
#include <QtGui/QtGui>
Q_LOGGING_CATEGORY(LOG_UTIL, "kdeconnect.filesyncapp.util");
......
......@@ -21,10 +21,7 @@
#ifndef FILESYNC_UTIL_H
#define FILESYNC_UTIL_H
#include <exception>
#include <QLoggingCategory>
#include <QtCore/QString>
#include <QtCore/QProcess>
#include <QString>
namespace FileSync
{
......
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
set(kdeconnect_filesyncapp_interfaces_SRCS
sync_result.cpp
json_types.cpp
)
add_library(kdeconnect_filesyncapp_interfaces SHARED ${kdeconnect_filesyncapp_interfaces_SRCS})
target_link_libraries(kdeconnect_filesyncapp_interfaces Qt5::DBus)
generate_export_header(kdeconnectcore EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/kdeconnect_filesyncapp_interfaces_export.h BASE_NAME KDEConnectFilesyncappInterface)
install(TARGETS kdeconnect_filesyncapp_interfaces ${INSTALL_TARGETS_DEFAULT_ARGS})
......@@ -18,11 +18,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "json_types.h"
#include <QDBusArgument>
#include <QJsonObject>
#include <QJsonArray>
#include "json_types.h"
QDBusArgument &
operator<<(QDBusArgument &argument, const QJsonObject &obj)
{
......
......@@ -24,11 +24,13 @@
#include <QJsonObject>
#include <QVariantMap>
#include <QDBusArgument>
#include <QtDBus/QtDBus>
#include <QtDBus>
#include "kdeconnect_filesyncapp_interfaces_export.h"
namespace FileSync
{
class JsonTypes
class KDECONNECTFILESYNCAPPINTERFACE_EXPORT JsonTypes
{
public:
static void registerQJsonObjectTypeAsDbusType();
......
......@@ -27,9 +27,11 @@
#include <QDBusArgument>
#include <QVariantMap>
#include "kdeconnect_filesyncapp_interfaces_export.h"
namespace FileSync
{
class SyncResult : public QObject
class KDECONNECTFILESYNCAPPINTERFACE_EXPORT SyncResult : public QObject
{
Q_OBJECT
......
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
include_directories(
../../
${CMAKE_CURRENT_BINARY_DIR}/../../../interfaces
)
set(kdeconnect_libraries
Qt5::DBus
Qt5::Test
)
ecm_add_test(
../../json_types.cpp
json_types_test.cpp LINK_LIBRARIES ${kdeconnect_libraries} TEST_NAME json_types_test)
add_to_coverage("json_types")
/**
* Copyright 2019 Viktor Porvaznik <viktor.porvaznik@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QObject>
#include <QTest>
// Class under the test
#include "json_types.h"
namespace FileSync
{
class JsonTypesTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void test0()
{
}
};
}
QTEST_MAIN(FileSync::JsonTypesTest)
#include "json_types_test.moc"
......@@ -3,20 +3,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
include_directories(
${KDEConnectCore_BINARY_DIR}
${CMAKE_SOURCE_DIR}
../../
${CMAKE_CURRENT_BINARY_DIR}/../../../interfaces
)
set(kdeconnect_libraries
kdeconnectcore
KF5::I18n
KF5::KIOWidgets
Qt5::DBus
Qt5::Network
Qt5::Test
qca-qt5
pthread
)
ecm_add_test(
......
......@@ -53,7 +53,7 @@ geninterface(${CMAKE_SOURCE_DIR}/plugins/sms/smsplugin.h smsinterface)
geninterface(${CMAKE_SOURCE_DIR}/plugins/sms/conversationsdbusinterface.h conversationsinterface)
geninterface(${CMAKE_SOURCE_DIR}/plugins/share/shareplugin.h shareinterface)
geninterface(${CMAKE_SOURCE_DIR}/plugins/filesync/filesync_plugin.h filesyncplugin_interface)
geninterface(${CMAKE_SOURCE_DIR}/filesyncapp/interfaces/filesyncapp_interface.h filesyncapp_interface)
geninterface(${CMAKE_SOURCE_DIR}/filesyncapp/daemon/filesyncapp_interface.h filesyncapp_interface)
geninterface(${CMAKE_SOURCE_DIR}/plugins/remotesystemvolume/remotesystemvolumeplugin.h remotesystemvolumeinterface)
......
......@@ -2,7 +2,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
set(kdeconnect_filesync_SRCS
filesync_plugin.cpp
../../filesyncapp/interfaces/sync_result.cpp
)
kdeconnect_add_plugin(kdeconnect_filesync JSON kdeconnect_filesync.json SOURCES ${kdeconnect_filesync_SRCS})
......@@ -10,6 +9,7 @@ kdeconnect_add_plugin(kdeconnect_filesync JSON kdeconnect_filesync.json SOURCES
target_link_libraries(kdeconnect_filesync
kdeconnectcore
kdeconnectinterfaces
kdeconnect_filesyncapp_interfaces
Qt5::DBus
KF5::I18n
)
\ No newline at end of file
......@@ -27,9 +27,9 @@
#include <QDBusConnection>
#include <QProcess>
#include "interfaces/dbusinterfaces.h"
#include "filesync_constants.h"
#include "filesync_plugin.h"
#include "interfaces/dbusinterfaces.h"
#include "filesyncapp/interfaces/sync_result.h"
K_PLUGIN_FACTORY_WITH_JSON(KdeConnectPluginFactory, "kdeconnect_filesync.json",
......
......@@ -26,8 +26,8 @@
#include <QObject>
#include <QString>
#include <filesync_constants.h>
#include <filesyncapp/interfaces/sync_result.h>
#include "filesync_constants.h"
#include "filesyncapp/interfaces/sync_result.h"
namespace FileSyncPlugin
{
......
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
include_directories(
../../
${CMAKE_CURRENT_BINARY_DIR}/../../../interfaces
)
set(kdeconnect_libraries
kdeconnectcore
kdeconnectinterfaces
kdeconnect_filesyncapp_interfaces
KF5::I18n
Qt5::DBus
Qt5::Test
)
ecm_add_test(
../../filesync_plugin.cpp
filesync_plugin_test.cpp LINK_LIBRARIES ${kdeconnect_libraries} TEST_NAME filesync_plugin_test)
add_to_coverage("filesync_plugin")
/**
* Copyright 2019 Viktor Porvaznik <viktor.porvaznik@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QObject>
#include <QTest>
// Class under the test
#include "filesync_plugin.h"
namespace FileSync
{
class FilesyncPluginTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void test0()
{
}
};
}
QTEST_MAIN(FileSync::FilesyncPluginTest)
#include "filesync_plugin_test.moc"