From a1f1775d159c9ce3c7c0e569fe4f20f80a2bcf00 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 1 Sep 2017 18:11:43 +0200 Subject: [PATCH] Move SyncJournalDB to src/common --- src/cmd/cmd.cpp | 2 +- src/{libsync => common}/asserts.h | 0 src/{csync/std => common}/c_jhash.h | 2 +- src/{libsync => common}/checksums.cpp | 27 ++++++----- src/{libsync => common}/checksums.h | 47 ++++++++++++------- src/common/common.cmake | 4 ++ src/{libsync => common}/ownsql.cpp | 23 +++++---- src/{libsync => common}/ownsql.h | 26 +++++----- src/{libsync => common}/syncjournaldb.cpp | 34 +++++++------- src/{libsync => common}/syncjournaldb.h | 30 +++++++----- .../syncjournalfilerecord.cpp | 22 +++++---- .../syncjournalfilerecord.h | 28 ++++++----- src/csync/CMakeLists.txt | 3 +- src/csync/csync.cpp | 2 +- src/csync/csync_reconcile.cpp | 2 +- src/csync/csync_statedb.cpp | 2 +- src/csync/csync_util.cpp | 2 +- src/csync/vio/csync_vio.cpp | 2 +- src/gui/creds/httpcredentialsgui.cpp | 2 +- src/gui/folder.cpp | 2 +- src/gui/folder.h | 2 +- src/gui/folderman.cpp | 2 +- src/gui/folderstatusmodel.cpp | 2 +- src/gui/folderwizard.cpp | 2 +- src/gui/issueswidget.cpp | 2 +- src/gui/notificationwidget.cpp | 2 +- src/gui/owncloudgui.cpp | 2 +- src/gui/socketapi.cpp | 4 +- src/gui/socketapi.h | 2 +- src/libsync/CMakeLists.txt | 8 +--- src/libsync/account.cpp | 2 +- src/libsync/configfile.cpp | 2 +- src/libsync/creds/abstractcredentials.cpp | 2 +- src/libsync/discoveryphase.cpp | 2 +- src/libsync/owncloudpropagator.cpp | 6 +-- src/libsync/owncloudpropagator.h | 2 +- src/libsync/propagatedownload.cpp | 8 ++-- src/libsync/propagateremotedelete.cpp | 2 +- src/libsync/propagateremotemkdir.cpp | 4 +- src/libsync/propagateremotemove.cpp | 4 +- src/libsync/propagateupload.cpp | 8 ++-- src/libsync/propagateuploadng.cpp | 6 +-- src/libsync/propagateuploadv1.cpp | 8 ++-- src/libsync/propagatorjobs.cpp | 4 +- src/libsync/propagatorjobs.h | 10 +--- src/libsync/syncengine.cpp | 6 +-- src/libsync/syncengine.h | 2 +- src/libsync/syncfileitem.cpp | 2 +- src/libsync/syncfilestatustracker.cpp | 6 +-- src/libsync/syncfilestatustracker.h | 2 +- test/csync/std_tests/check_std_c_jhash.c | 2 +- test/syncenginetestutils.h | 2 +- test/testchecksumvalidator.cpp | 2 +- test/testownsql.cpp | 2 +- test/testsyncjournaldb.cpp | 4 +- test/testuploadreset.cpp | 2 +- 56 files changed, 209 insertions(+), 183 deletions(-) rename src/{libsync => common}/asserts.h (100%) rename src/{csync/std => common}/c_jhash.h (99%) rename src/{libsync => common}/checksums.cpp (89%) rename src/{libsync => common}/checksums.h (63%) rename src/{libsync => common}/ownsql.cpp (93%) rename src/{libsync => common}/ownsql.h (67%) rename src/{libsync => common}/syncjournaldb.cpp (98%) rename src/{libsync => common}/syncjournaldb.h (91%) rename src/{libsync => common}/syncjournalfilerecord.cpp (61%) rename src/{libsync => common}/syncjournalfilerecord.h (69%) diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp index 60d54a1c4..d8d836ecf 100644 --- a/src/cmd/cmd.cpp +++ b/src/cmd/cmd.cpp @@ -31,7 +31,7 @@ #include "creds/httpcredentials.h" #include "simplesslerrorhandler.h" #include "syncengine.h" -#include "syncjournaldb.h" +#include "common/syncjournaldb.h" #include "config.h" #include "connectionvalidator.h" diff --git a/src/libsync/asserts.h b/src/common/asserts.h similarity index 100% rename from src/libsync/asserts.h rename to src/common/asserts.h diff --git a/src/csync/std/c_jhash.h b/src/common/c_jhash.h similarity index 99% rename from src/csync/std/c_jhash.h rename to src/common/c_jhash.h index 261a0a4a4..699244a0d 100644 --- a/src/csync/std/c_jhash.h +++ b/src/common/c_jhash.h @@ -12,7 +12,7 @@ */ /** - * @file c_jhash.h + * @file common/c_jhash.h * * @brief Interface of the cynapses jhash implementation * diff --git a/src/libsync/checksums.cpp b/src/common/checksums.cpp similarity index 89% rename from src/libsync/checksums.cpp rename to src/common/checksums.cpp index 448b5d477..6ffb57385 100644 --- a/src/libsync/checksums.cpp +++ b/src/common/checksums.cpp @@ -1,22 +1,23 @@ /* * Copyright (C) by Klaas Freitag * - * 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) any later version. + * 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 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. + * 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 "config.h" -#include "filesystem.h" -#include "checksums.h" -#include "syncfileitem.h" -#include "propagatorjobs.h" -#include "account.h" +#include "filesystembase.h" +#include "common/checksums.h" #include #include diff --git a/src/libsync/checksums.h b/src/common/checksums.h similarity index 63% rename from src/libsync/checksums.h rename to src/common/checksums.h index 3c31c8c03..fa8bf3313 100644 --- a/src/libsync/checksums.h +++ b/src/common/checksums.h @@ -1,21 +1,24 @@ /* * Copyright (C) by Klaas Freitag * - * 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) any later version. + * 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 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. + * 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 "owncloudlib.h" -#include "accountfwd.h" +#include "ocsynclib.h" #include #include @@ -23,29 +26,37 @@ namespace OCC { +/** + * Tags for checksum headers values. + * They are here for being shared between Upload- and Download Job + */ +static const char checkSumMD5C[] = "MD5"; +static const char checkSumSHA1C[] = "SHA1"; +static const char checkSumAdlerC[] = "Adler32"; + class SyncJournalDb; /// Creates a checksum header from type and value. -QByteArray makeChecksumHeader(const QByteArray &checksumType, const QByteArray &checksum); +OCSYNC_EXPORT QByteArray makeChecksumHeader(const QByteArray &checksumType, const QByteArray &checksum); /// Parses a checksum header -bool parseChecksumHeader(const QByteArray &header, QByteArray *type, QByteArray *checksum); +OCSYNC_EXPORT bool parseChecksumHeader(const QByteArray &header, QByteArray *type, QByteArray *checksum); /// Convenience for getting the type from a checksum header, null if none -QByteArray parseChecksumHeaderType(const QByteArray &header); +OCSYNC_EXPORT QByteArray parseChecksumHeaderType(const QByteArray &header); /// Checks OWNCLOUD_DISABLE_CHECKSUM_UPLOAD -bool uploadChecksumEnabled(); +OCSYNC_EXPORT bool uploadChecksumEnabled(); /// Checks OWNCLOUD_CONTENT_CHECKSUM_TYPE (default: SHA1) -QByteArray contentChecksumType(); +OCSYNC_EXPORT QByteArray contentChecksumType(); /** * Computes the checksum of a file. * \ingroup libsync */ -class OWNCLOUDSYNC_EXPORT ComputeChecksum : public QObject +class OCSYNC_EXPORT ComputeChecksum : public QObject { Q_OBJECT public: @@ -87,7 +98,7 @@ private: * Checks whether a file's checksum matches the expected value. * @ingroup libsync */ -class OWNCLOUDSYNC_EXPORT ValidateChecksumHeader : public QObject +class OCSYNC_EXPORT ValidateChecksumHeader : public QObject { Q_OBJECT public: @@ -118,7 +129,7 @@ private: * Hooks checksum computations into csync. * @ingroup libsync */ -class OWNCLOUDSYNC_EXPORT CSyncChecksumHook : public QObject +class OCSYNC_EXPORT CSyncChecksumHook : public QObject { Q_OBJECT public: diff --git a/src/common/common.cmake b/src/common/common.cmake index ab1ca1e83..e448868c6 100644 --- a/src/common/common.cmake +++ b/src/common/common.cmake @@ -2,6 +2,10 @@ # Essentially they could be in the same directory but are separate to # help keep track of the different code licenses. set(common_SOURCES + ${CMAKE_CURRENT_LIST_DIR}/checksums.cpp ${CMAKE_CURRENT_LIST_DIR}/filesystembase.cpp + ${CMAKE_CURRENT_LIST_DIR}/ownsql.cpp + ${CMAKE_CURRENT_LIST_DIR}/syncjournaldb.cpp + ${CMAKE_CURRENT_LIST_DIR}/syncjournalfilerecord.cpp ${CMAKE_CURRENT_LIST_DIR}/utility.cpp ) diff --git a/src/libsync/ownsql.cpp b/src/common/ownsql.cpp similarity index 93% rename from src/libsync/ownsql.cpp rename to src/common/ownsql.cpp index e66fdfb3e..2bda1ab09 100644 --- a/src/libsync/ownsql.cpp +++ b/src/common/ownsql.cpp @@ -1,18 +1,21 @@ /* * Copyright (C) by Klaas Freitag * - * 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) any later version. + * 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 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. + * 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 #include #include @@ -22,7 +25,7 @@ #include "ownsql.h" #include "common/utility.h" -#include "asserts.h" +#include "common/asserts.h" #define SQLITE_SLEEP_TIME_USEC 100000 #define SQLITE_REPEAT_COUNT 20 diff --git a/src/libsync/ownsql.h b/src/common/ownsql.h similarity index 67% rename from src/libsync/ownsql.h rename to src/common/ownsql.h index 72c749091..a7f3c2bf0 100644 --- a/src/libsync/ownsql.h +++ b/src/common/ownsql.h @@ -1,15 +1,19 @@ /* * Copyright (C) by Klaas Freitag * - * 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) any later version. + * 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 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. + * 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 */ #ifndef OWNSQL_H @@ -20,7 +24,7 @@ #include #include -#include "owncloudlib.h" +#include "ocsynclib.h" namespace OCC { @@ -28,7 +32,7 @@ namespace OCC { * @brief The SqlDatabase class * @ingroup libsync */ -class OWNCLOUDSYNC_EXPORT SqlDatabase +class OCSYNC_EXPORT SqlDatabase { Q_DISABLE_COPY(SqlDatabase) public: @@ -56,7 +60,7 @@ private: * @brief The SqlQuery class * @ingroup libsync */ -class OWNCLOUDSYNC_EXPORT SqlQuery +class OCSYNC_EXPORT SqlQuery { Q_DISABLE_COPY(SqlQuery) public: diff --git a/src/libsync/syncjournaldb.cpp b/src/common/syncjournaldb.cpp similarity index 98% rename from src/libsync/syncjournaldb.cpp rename to src/common/syncjournaldb.cpp index 5f344fa08..d1dae8f66 100644 --- a/src/libsync/syncjournaldb.cpp +++ b/src/common/syncjournaldb.cpp @@ -1,15 +1,19 @@ /* * Copyright (C) by Klaas Freitag * - * 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) any later version. + * 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 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. + * 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 @@ -20,17 +24,13 @@ #include #include -#include "ownsql.h" - -#include "syncjournaldb.h" -#include "syncjournalfilerecord.h" -#include "common/utility.h" +#include "common/syncjournaldb.h" #include "version.h" -#include "filesystem.h" -#include "asserts.h" -#include "checksums.h" +#include "filesystembase.h" +#include "common/asserts.h" +#include "common/checksums.h" -#include "std/c_jhash.h" +#include "common/c_jhash.h" namespace OCC { diff --git a/src/libsync/syncjournaldb.h b/src/common/syncjournaldb.h similarity index 91% rename from src/libsync/syncjournaldb.h rename to src/common/syncjournaldb.h index da8054109..0afefebcf 100644 --- a/src/libsync/syncjournaldb.h +++ b/src/common/syncjournaldb.h @@ -1,15 +1,19 @@ /* * Copyright (C) by Klaas Freitag * - * 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) any later version. + * 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 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. + * 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 */ #ifndef SYNCJOURNALDB_H @@ -21,8 +25,8 @@ #include #include "common/utility.h" -#include "ownsql.h" -#include "syncjournalfilerecord.h" +#include "common/ownsql.h" +#include "common/syncjournalfilerecord.h" namespace OCC { class SyncJournalFileRecord; @@ -33,7 +37,7 @@ class SyncJournalFileRecord; * This class is thread safe. All public functions lock the mutex. * @ingroup libsync */ -class OWNCLOUDSYNC_EXPORT SyncJournalDb : public QObject +class OCSYNC_EXPORT SyncJournalDb : public QObject { Q_OBJECT public: @@ -265,10 +269,10 @@ private: QString _journalMode; }; -bool OWNCLOUDSYNC_EXPORT +bool OCSYNC_EXPORT operator==(const SyncJournalDb::DownloadInfo &lhs, const SyncJournalDb::DownloadInfo &rhs); -bool OWNCLOUDSYNC_EXPORT +bool OCSYNC_EXPORT operator==(const SyncJournalDb::UploadInfo &lhs, const SyncJournalDb::UploadInfo &rhs); diff --git a/src/libsync/syncjournalfilerecord.cpp b/src/common/syncjournalfilerecord.cpp similarity index 61% rename from src/libsync/syncjournalfilerecord.cpp rename to src/common/syncjournalfilerecord.cpp index 5936f0f50..c6a77b997 100644 --- a/src/libsync/syncjournalfilerecord.cpp +++ b/src/common/syncjournalfilerecord.cpp @@ -1,18 +1,22 @@ /* * Copyright (C) by Klaas Freitag * - * 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) any later version. + * 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 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. + * 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 "syncjournalfilerecord.h" +#include "common/syncjournalfilerecord.h" #include "common/utility.h" namespace OCC { diff --git a/src/libsync/syncjournalfilerecord.h b/src/common/syncjournalfilerecord.h similarity index 69% rename from src/libsync/syncjournalfilerecord.h rename to src/common/syncjournalfilerecord.h index 86d214908..ca8430469 100644 --- a/src/libsync/syncjournalfilerecord.h +++ b/src/common/syncjournalfilerecord.h @@ -1,15 +1,19 @@ /* * Copyright (C) by Klaas Freitag * - * 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) any later version. + * 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 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. + * 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 */ #ifndef SYNCJOURNALFILERECORD_H @@ -18,7 +22,7 @@ #include #include -#include "owncloudlib.h" +#include "ocsynclib.h" namespace OCC { @@ -28,7 +32,7 @@ class SyncFileItem; * @brief The SyncJournalFileRecord class * @ingroup libsync */ -class OWNCLOUDSYNC_EXPORT SyncJournalFileRecord +class OCSYNC_EXPORT SyncJournalFileRecord { public: SyncJournalFileRecord(); @@ -58,11 +62,11 @@ public: QByteArray _checksumHeader; }; -bool OWNCLOUDSYNC_EXPORT +bool OCSYNC_EXPORT operator==(const SyncJournalFileRecord &lhs, const SyncJournalFileRecord &rhs); -class SyncJournalErrorBlacklistRecord +class OCSYNC_EXPORT SyncJournalErrorBlacklistRecord { public: enum Category { diff --git a/src/csync/CMakeLists.txt b/src/csync/CMakeLists.txt index e265b95d9..acb1cc7c2 100644 --- a/src/csync/CMakeLists.txt +++ b/src/csync/CMakeLists.txt @@ -1,4 +1,5 @@ project(libcsync) +set(CMAKE_AUTOMOC TRUE) # global needed variables set(APPLICATION_NAME "ocsync") @@ -134,7 +135,7 @@ if(ZLIB_FOUND) endif(ZLIB_FOUND) find_package(Qt5Core REQUIRED) -qt5_use_modules(${CSYNC_LIBRARY} Core) +qt5_use_modules(${CSYNC_LIBRARY} Core Concurrent) # For src/common/utility_mac.cpp if (APPLE) diff --git a/src/csync/csync.cpp b/src/csync/csync.cpp index ac096ae2b..6c36637b8 100644 --- a/src/csync/csync.cpp +++ b/src/csync/csync.cpp @@ -49,7 +49,7 @@ #include "csync_log.h" #include "csync_rename.h" -#include "c_jhash.h" +#include "common/c_jhash.h" csync_s::csync_s(const char *localUri, const char *db_file) { diff --git a/src/csync/csync_reconcile.cpp b/src/csync/csync_reconcile.cpp index ee7eee7a1..dd1cad68e 100644 --- a/src/csync/csync_reconcile.cpp +++ b/src/csync/csync_reconcile.cpp @@ -26,7 +26,7 @@ #include "csync_util.h" #include "csync_statedb.h" #include "csync_rename.h" -#include "c_jhash.h" +#include "common/c_jhash.h" #define CSYNC_LOG_CATEGORY_NAME "csync.reconciler" #include "csync_log.h" diff --git a/src/csync/csync_statedb.cpp b/src/csync/csync_statedb.cpp index 7f7ed0c29..89ac83fd7 100644 --- a/src/csync/csync_statedb.cpp +++ b/src/csync/csync_statedb.cpp @@ -41,7 +41,7 @@ #include "csync_exclude.h" #include "c_string.h" -#include "c_jhash.h" +#include "common/c_jhash.h" #include "c_utf8.h" #include "csync_time.h" diff --git a/src/csync/csync_util.cpp b/src/csync/csync_util.cpp index 4fc13a471..d90a2eacc 100644 --- a/src/csync/csync_util.cpp +++ b/src/csync/csync_util.cpp @@ -30,7 +30,7 @@ #include #include -#include "c_jhash.h" +#include "common/c_jhash.h" #include "csync_util.h" #include "vio/csync_vio.h" diff --git a/src/csync/vio/csync_vio.cpp b/src/csync/vio/csync_vio.cpp index 57eb46c39..dab04d3df 100644 --- a/src/csync/vio/csync_vio.cpp +++ b/src/csync/vio/csync_vio.cpp @@ -31,7 +31,7 @@ #include "vio/csync_vio.h" #include "vio/csync_vio_local.h" #include "csync_statedb.h" -#include "std/c_jhash.h" +#include "common/c_jhash.h" #define CSYNC_LOG_CATEGORY_NAME "csync.vio.main" diff --git a/src/gui/creds/httpcredentialsgui.cpp b/src/gui/creds/httpcredentialsgui.cpp index 98e4df907..bc533db86 100644 --- a/src/gui/creds/httpcredentialsgui.cpp +++ b/src/gui/creds/httpcredentialsgui.cpp @@ -24,7 +24,7 @@ #include "account.h" #include "networkjobs.h" #include -#include "asserts.h" +#include "common/asserts.h" using namespace QKeychain; diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 961e8754c..864c496bf 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -22,7 +22,7 @@ #include "logger.h" #include "configfile.h" #include "networkjobs.h" -#include "syncjournalfilerecord.h" +#include "common/syncjournalfilerecord.h" #include "syncresult.h" #include "clientproxy.h" #include "syncengine.h" diff --git a/src/gui/folder.h b/src/gui/folder.h index 1c67c0722..7b503a6d6 100644 --- a/src/gui/folder.h +++ b/src/gui/folder.h @@ -19,7 +19,7 @@ #include "syncresult.h" #include "progressdispatcher.h" -#include "syncjournaldb.h" +#include "common/syncjournaldb.h" #include "clientproxy.h" #include "networkjobs.h" diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp index bb56db2ef..475eb4f1a 100644 --- a/src/gui/folderman.cpp +++ b/src/gui/folderman.cpp @@ -23,7 +23,7 @@ #include "accountmanager.h" #include "filesystem.h" #include "lockwatcher.h" -#include "asserts.h" +#include "common/asserts.h" #include #ifdef Q_OS_MAC diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index 16e2ab0e0..a7b38dc43 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -15,7 +15,7 @@ #include "folderstatusmodel.h" #include "folderman.h" #include "accountstate.h" -#include "asserts.h" +#include "common/asserts.h" #include #include #include "folderstatusdelegate.h" diff --git a/src/gui/folderwizard.cpp b/src/gui/folderwizard.cpp index 26ce66dfd..283f34856 100644 --- a/src/gui/folderwizard.cpp +++ b/src/gui/folderwizard.cpp @@ -22,7 +22,7 @@ #include "accountstate.h" #include "creds/abstractcredentials.h" #include "wizard/owncloudwizard.h" -#include "asserts.h" +#include "common/asserts.h" #include #include diff --git a/src/gui/issueswidget.cpp b/src/gui/issueswidget.cpp index 19e69c014..40f2822b7 100644 --- a/src/gui/issueswidget.cpp +++ b/src/gui/issueswidget.cpp @@ -29,7 +29,7 @@ #include "accountstate.h" #include "account.h" #include "accountmanager.h" -#include "syncjournalfilerecord.h" +#include "common/syncjournalfilerecord.h" #include "elidedlabel.h" #include "ui_issueswidget.h" diff --git a/src/gui/notificationwidget.cpp b/src/gui/notificationwidget.cpp index 0457857b8..bcada1075 100644 --- a/src/gui/notificationwidget.cpp +++ b/src/gui/notificationwidget.cpp @@ -15,7 +15,7 @@ #include "notificationwidget.h" #include "QProgressIndicator.h" #include "common/utility.h" -#include "asserts.h" +#include "common/asserts.h" #include diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp index cb0cafbd8..e5a398c8e 100644 --- a/src/gui/owncloudgui.cpp +++ b/src/gui/owncloudgui.cpp @@ -32,7 +32,7 @@ #include "accountstate.h" #include "openfilemanager.h" #include "accountmanager.h" -#include "syncjournalfilerecord.h" +#include "common/syncjournalfilerecord.h" #include "creds/abstractcredentials.h" #include diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp index fe7ca5f4d..9261cef83 100644 --- a/src/gui/socketapi.cpp +++ b/src/gui/socketapi.cpp @@ -21,7 +21,7 @@ #include "folderman.h" #include "folder.h" #include "theme.h" -#include "syncjournalfilerecord.h" +#include "common/syncjournalfilerecord.h" #include "syncengine.h" #include "syncfileitem.h" #include "filesystem.h" @@ -30,7 +30,7 @@ #include "accountstate.h" #include "account.h" #include "capabilities.h" -#include "asserts.h" +#include "common/asserts.h" #include "guiutility.h" #include diff --git a/src/gui/socketapi.h b/src/gui/socketapi.h index d4f6e7bf8..2b7b4fe9f 100644 --- a/src/gui/socketapi.h +++ b/src/gui/socketapi.h @@ -18,7 +18,7 @@ #include "syncfileitem.h" #include "syncfilestatus.h" -#include "ownsql.h" +// #include "ownsql.h" #if defined(Q_OS_MAC) #include "socketapisocket_mac.h" diff --git a/src/libsync/CMakeLists.txt b/src/libsync/CMakeLists.txt index c7ac8ef08..be5cb885e 100644 --- a/src/libsync/CMakeLists.txt +++ b/src/libsync/CMakeLists.txt @@ -54,12 +54,8 @@ set(libsync_SRCS syncfileitem.cpp syncfilestatus.cpp syncfilestatustracker.cpp - syncjournaldb.cpp - syncjournalfilerecord.cpp syncresult.cpp theme.cpp - ownsql.cpp - checksums.cpp excludedfiles.cpp creds/dummycredentials.cpp creds/abstractcredentials.cpp @@ -125,9 +121,9 @@ GENERATE_EXPORT_HEADER( ${synclib_NAME} ) if(TOKEN_AUTH_ONLY) - qt5_use_modules(${synclib_NAME} Network Concurrent) + qt5_use_modules(${synclib_NAME} Network) else() - qt5_use_modules(${synclib_NAME} Widgets Network Concurrent) + qt5_use_modules(${synclib_NAME} Widgets Network) endif() set_target_properties( ${synclib_NAME} PROPERTIES diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp index d70e7ac9e..7f2fadb29 100644 --- a/src/libsync/account.cpp +++ b/src/libsync/account.cpp @@ -20,7 +20,7 @@ #include "creds/abstractcredentials.h" #include "capabilities.h" #include "theme.h" -#include "asserts.h" +#include "common/asserts.h" #include #include diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp index 0fa6b77ff..6fd3df6f0 100644 --- a/src/libsync/configfile.cpp +++ b/src/libsync/configfile.cpp @@ -17,7 +17,7 @@ #include "configfile.h" #include "theme.h" #include "common/utility.h" -#include "asserts.h" +#include "common/asserts.h" #include "creds/abstractcredentials.h" diff --git a/src/libsync/creds/abstractcredentials.cpp b/src/libsync/creds/abstractcredentials.cpp index 2dadc0793..f64b51fd2 100644 --- a/src/libsync/creds/abstractcredentials.cpp +++ b/src/libsync/creds/abstractcredentials.cpp @@ -15,7 +15,7 @@ #include #include -#include "asserts.h" +#include "common/asserts.h" #include "creds/abstractcredentials.h" namespace OCC { diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index 9ebcd7fa8..a4345c58a 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -16,7 +16,7 @@ #include "account.h" #include "theme.h" -#include "asserts.h" +#include "common/asserts.h" #include #include diff --git a/src/libsync/owncloudpropagator.cpp b/src/libsync/owncloudpropagator.cpp index c8bd46cd4..346d61e86 100644 --- a/src/libsync/owncloudpropagator.cpp +++ b/src/libsync/owncloudpropagator.cpp @@ -14,8 +14,8 @@ */ #include "owncloudpropagator.h" -#include "syncjournaldb.h" -#include "syncjournalfilerecord.h" +#include "common/syncjournaldb.h" +#include "common/syncjournalfilerecord.h" #include "propagatedownload.h" #include "propagateupload.h" #include "propagateremotedelete.h" @@ -25,7 +25,7 @@ #include "configfile.h" #include "common/utility.h" #include "account.h" -#include "asserts.h" +#include "common/asserts.h" #ifdef Q_OS_WIN #include diff --git a/src/libsync/owncloudpropagator.h b/src/libsync/owncloudpropagator.h index 093fd8aac..f62fd58a9 100644 --- a/src/libsync/owncloudpropagator.h +++ b/src/libsync/owncloudpropagator.h @@ -27,7 +27,7 @@ #include "csync_util.h" #include "syncfileitem.h" -#include "syncjournaldb.h" +#include "common/syncjournaldb.h" #include "bandwidthmanager.h" #include "accountfwd.h" #include "discoveryphase.h" diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp index 21af4d45c..3e6b8898a 100644 --- a/src/libsync/propagatedownload.cpp +++ b/src/libsync/propagatedownload.cpp @@ -17,13 +17,13 @@ #include "propagatedownload.h" #include "networkjobs.h" #include "account.h" -#include "syncjournaldb.h" -#include "syncjournalfilerecord.h" +#include "common/syncjournaldb.h" +#include "common/syncjournalfilerecord.h" #include "common/utility.h" #include "filesystem.h" #include "propagatorjobs.h" -#include "checksums.h" -#include "asserts.h" +#include "common/checksums.h" +#include "common/asserts.h" #include #include diff --git a/src/libsync/propagateremotedelete.cpp b/src/libsync/propagateremotedelete.cpp index 73f5c8240..0ace61790 100644 --- a/src/libsync/propagateremotedelete.cpp +++ b/src/libsync/propagateremotedelete.cpp @@ -15,7 +15,7 @@ #include "propagateremotedelete.h" #include "owncloudpropagator_p.h" #include "account.h" -#include "asserts.h" +#include "common/asserts.h" #include diff --git a/src/libsync/propagateremotemkdir.cpp b/src/libsync/propagateremotemkdir.cpp index 92ba2b9a5..4772f42eb 100644 --- a/src/libsync/propagateremotemkdir.cpp +++ b/src/libsync/propagateremotemkdir.cpp @@ -15,9 +15,9 @@ #include "propagateremotemkdir.h" #include "owncloudpropagator_p.h" #include "account.h" -#include "syncjournalfilerecord.h" +#include "common/syncjournalfilerecord.h" #include "propagateremotedelete.h" -#include "asserts.h" +#include "common/asserts.h" #include #include diff --git a/src/libsync/propagateremotemove.cpp b/src/libsync/propagateremotemove.cpp index 7f0d8785b..b347b0ab0 100644 --- a/src/libsync/propagateremotemove.cpp +++ b/src/libsync/propagateremotemove.cpp @@ -16,9 +16,9 @@ #include "propagatorjobs.h" #include "owncloudpropagator_p.h" #include "account.h" -#include "syncjournalfilerecord.h" +#include "common/syncjournalfilerecord.h" #include "filesystem.h" -#include "asserts.h" +#include "common/asserts.h" #include #include #include diff --git a/src/libsync/propagateupload.cpp b/src/libsync/propagateupload.cpp index c49be0785..05ec97a00 100644 --- a/src/libsync/propagateupload.cpp +++ b/src/libsync/propagateupload.cpp @@ -17,15 +17,15 @@ #include "owncloudpropagator_p.h" #include "networkjobs.h" #include "account.h" -#include "syncjournaldb.h" -#include "syncjournalfilerecord.h" +#include "common/syncjournaldb.h" +#include "common/syncjournalfilerecord.h" #include "common/utility.h" #include "filesystem.h" #include "propagatorjobs.h" -#include "checksums.h" +#include "common/checksums.h" #include "syncengine.h" #include "propagateremotedelete.h" -#include "asserts.h" +#include "common/asserts.h" #include #include diff --git a/src/libsync/propagateuploadng.cpp b/src/libsync/propagateuploadng.cpp index edeb43516..4afdad38b 100644 --- a/src/libsync/propagateuploadng.cpp +++ b/src/libsync/propagateuploadng.cpp @@ -17,15 +17,15 @@ #include "owncloudpropagator_p.h" #include "networkjobs.h" #include "account.h" -#include "syncjournaldb.h" -#include "syncjournalfilerecord.h" +#include "common/syncjournaldb.h" +#include "common/syncjournalfilerecord.h" #include "common/utility.h" #include "filesystem.h" #include "propagatorjobs.h" #include "syncengine.h" #include "propagateremotemove.h" #include "propagateremotedelete.h" -#include "asserts.h" +#include "common/asserts.h" #include #include diff --git a/src/libsync/propagateuploadv1.cpp b/src/libsync/propagateuploadv1.cpp index a5396c700..790023a64 100644 --- a/src/libsync/propagateuploadv1.cpp +++ b/src/libsync/propagateuploadv1.cpp @@ -17,15 +17,15 @@ #include "owncloudpropagator_p.h" #include "networkjobs.h" #include "account.h" -#include "syncjournaldb.h" -#include "syncjournalfilerecord.h" +#include "common/syncjournaldb.h" +#include "common/syncjournalfilerecord.h" #include "common/utility.h" #include "filesystem.h" #include "propagatorjobs.h" -#include "checksums.h" +#include "common/checksums.h" #include "syncengine.h" #include "propagateremotedelete.h" -#include "asserts.h" +#include "common/asserts.h" #include #include diff --git a/src/libsync/propagatorjobs.cpp b/src/libsync/propagatorjobs.cpp index 1d841abb4..ecf46f285 100644 --- a/src/libsync/propagatorjobs.cpp +++ b/src/libsync/propagatorjobs.cpp @@ -17,8 +17,8 @@ #include "owncloudpropagator_p.h" #include "propagateremotemove.h" #include "common/utility.h" -#include "syncjournaldb.h" -#include "syncjournalfilerecord.h" +#include "common/syncjournaldb.h" +#include "common/syncjournalfilerecord.h" #include "filesystem.h" #include #include diff --git a/src/libsync/propagatorjobs.h b/src/libsync/propagatorjobs.h index 04c09cd48..424685ab4 100644 --- a/src/libsync/propagatorjobs.h +++ b/src/libsync/propagatorjobs.h @@ -21,16 +21,10 @@ namespace OCC { /** - * Tags for checksum headers. - * They are here for being shared between Upload- and Download Job + * Tags for checksum header. + * It's here for being shared between Upload- and Download Job */ - -// the header itself static const char checkSumHeaderC[] = "OC-Checksum"; -// ...and it's values -static const char checkSumMD5C[] = "MD5"; -static const char checkSumSHA1C[] = "SHA1"; -static const char checkSumAdlerC[] = "Adler32"; /** * @brief Declaration of the other propagation jobs diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 5a0a56cf9..4b4836ad3 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -16,8 +16,8 @@ #include "syncengine.h" #include "account.h" #include "owncloudpropagator.h" -#include "syncjournaldb.h" -#include "syncjournalfilerecord.h" +#include "common/syncjournaldb.h" +#include "common/syncjournalfilerecord.h" #include "discoveryphase.h" #include "creds/abstractcredentials.h" #include "syncfilestatus.h" @@ -25,7 +25,7 @@ #include "filesystem.h" #include "propagateremotedelete.h" #include "propagatedownload.h" -#include "asserts.h" +#include "common/asserts.h" #ifdef Q_OS_WIN #include diff --git a/src/libsync/syncengine.h b/src/libsync/syncengine.h index 3bc6da984..7f96afef9 100644 --- a/src/libsync/syncengine.h +++ b/src/libsync/syncengine.h @@ -38,7 +38,7 @@ #include "syncfilestatustracker.h" #include "accountfwd.h" #include "discoveryphase.h" -#include "checksums.h" +#include "common/checksums.h" class QProcess; diff --git a/src/libsync/syncfileitem.cpp b/src/libsync/syncfileitem.cpp index 681d703c9..0e6d8cb2a 100644 --- a/src/libsync/syncfileitem.cpp +++ b/src/libsync/syncfileitem.cpp @@ -13,7 +13,7 @@ */ #include "syncfileitem.h" -#include "syncjournalfilerecord.h" +#include "common/syncjournalfilerecord.h" #include "common/utility.h" #include diff --git a/src/libsync/syncfilestatustracker.cpp b/src/libsync/syncfilestatustracker.cpp index c0b315372..7b40b6071 100644 --- a/src/libsync/syncfilestatustracker.cpp +++ b/src/libsync/syncfilestatustracker.cpp @@ -15,9 +15,9 @@ #include "syncfilestatustracker.h" #include "syncengine.h" -#include "syncjournaldb.h" -#include "syncjournalfilerecord.h" -#include "asserts.h" +#include "common/syncjournaldb.h" +#include "common/syncjournalfilerecord.h" +#include "common/asserts.h" #include diff --git a/src/libsync/syncfilestatustracker.h b/src/libsync/syncfilestatustracker.h index 48ecfd5c2..f4b31a130 100644 --- a/src/libsync/syncfilestatustracker.h +++ b/src/libsync/syncfilestatustracker.h @@ -16,7 +16,7 @@ #ifndef SYNCFILESTATUSTRACKER_H #define SYNCFILESTATUSTRACKER_H -#include "ownsql.h" +// #include "ownsql.h" #include "syncfileitem.h" #include "syncfilestatus.h" #include diff --git a/test/csync/std_tests/check_std_c_jhash.c b/test/csync/std_tests/check_std_c_jhash.c index 29dc32207..de7d8e7d5 100644 --- a/test/csync/std_tests/check_std_c_jhash.c +++ b/test/csync/std_tests/check_std_c_jhash.c @@ -6,7 +6,7 @@ */ #include "torture.h" -#include "std/c_jhash.h" +#include "common/c_jhash.h" #define HASHSTATE 1 #define HASHLEN 1 diff --git a/test/syncenginetestutils.h b/test/syncenginetestutils.h index 3fb03324f..cabac73bf 100644 --- a/test/syncenginetestutils.h +++ b/test/syncenginetestutils.h @@ -11,7 +11,7 @@ #include "logger.h" #include "filesystem.h" #include "syncengine.h" -#include "syncjournaldb.h" +#include "common/syncjournaldb.h" #include #include diff --git a/test/testchecksumvalidator.cpp b/test/testchecksumvalidator.cpp index d2d10096d..041dc193c 100644 --- a/test/testchecksumvalidator.cpp +++ b/test/testchecksumvalidator.cpp @@ -9,7 +9,7 @@ #include #include -#include "checksums.h" +#include "common/checksums.h" #include "networkjobs.h" #include "common/utility.h" #include "filesystem.h" diff --git a/test/testownsql.cpp b/test/testownsql.cpp index 0172468e8..77541794a 100644 --- a/test/testownsql.cpp +++ b/test/testownsql.cpp @@ -8,7 +8,7 @@ #include -#include "ownsql.h" +#include "common/ownsql.h" using namespace OCC; diff --git a/test/testsyncjournaldb.cpp b/test/testsyncjournaldb.cpp index e01a32f13..e3ea07cd9 100644 --- a/test/testsyncjournaldb.cpp +++ b/test/testsyncjournaldb.cpp @@ -8,8 +8,8 @@ #include -#include "syncjournaldb.h" -#include "syncjournalfilerecord.h" +#include "common/syncjournaldb.h" +#include "common/syncjournalfilerecord.h" using namespace OCC; diff --git a/test/testuploadreset.cpp b/test/testuploadreset.cpp index bf077ddee..9c92d9a1d 100644 --- a/test/testuploadreset.cpp +++ b/test/testuploadreset.cpp @@ -8,7 +8,7 @@ #include #include "syncenginetestutils.h" #include -#include +#include using namespace OCC;