diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-05-14 20:51:05 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-05-16 06:41:25 +0200 |
commit | 3fcc0c5acb160364e819688cc67a8aaf814fafef (patch) | |
tree | 0c3dae76fe36491cf30192fcd9f11e6afff2ba13 /lib | |
parent | 0599ef6e603dce219b2ba000d7322e8d937753b9 (diff) | |
download | libquotient-3fcc0c5acb160364e819688cc67a8aaf814fafef.tar.gz libquotient-3fcc0c5acb160364e819688cc67a8aaf814fafef.zip |
Optimise #includes for QOlm* classes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/connection.cpp | 15 | ||||
-rw-r--r-- | lib/e2ee/qolmaccount.cpp | 3 | ||||
-rw-r--r-- | lib/e2ee/qolmaccount.h | 6 | ||||
-rw-r--r-- | lib/e2ee/qolmsession.cpp | 7 | ||||
-rw-r--r-- | lib/e2ee/qolmsession.h | 7 |
5 files changed, 17 insertions, 21 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp index bd4d9251..511b64e2 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -35,16 +35,17 @@ #include "jobs/syncjob.h" #ifdef Quotient_E2EE_ENABLED -# include "e2ee/qolmaccount.h" -# include "e2ee/qolmutils.h" # include "database.h" +# include "e2ee/qolmaccount.h" # include "e2ee/qolminboundsession.h" +# include "e2ee/qolmsession.h" +# include "e2ee/qolmutils.h" -#if QT_VERSION_MAJOR >= 6 -# include <qt6keychain/keychain.h> -#else -# include <qt5keychain/keychain.h> -#endif +# if QT_VERSION_MAJOR >= 6 +# include <qt6keychain/keychain.h> +# else +# include <qt5keychain/keychain.h> +# endif #endif // Quotient_E2EE_ENABLED #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) diff --git a/lib/e2ee/qolmaccount.cpp b/lib/e2ee/qolmaccount.cpp index 476a60bd..af9eb1bf 100644 --- a/lib/e2ee/qolmaccount.cpp +++ b/lib/e2ee/qolmaccount.cpp @@ -5,6 +5,7 @@ #include "qolmaccount.h" #include "connection.h" +#include "e2ee/qolmsession.h" #include "e2ee/qolmutility.h" #include "e2ee/qolmutils.h" @@ -12,6 +13,8 @@ #include <QtCore/QRandomGenerator> +#include <olm/olm.h> + using namespace Quotient; QHash<QString, QString> OneTimeKeys::curve25519() const diff --git a/lib/e2ee/qolmaccount.h b/lib/e2ee/qolmaccount.h index 17f43f1a..08301998 100644 --- a/lib/e2ee/qolmaccount.h +++ b/lib/e2ee/qolmaccount.h @@ -9,18 +9,12 @@ #include "e2ee/e2ee.h" #include "e2ee/qolmerrors.h" #include "e2ee/qolmmessage.h" -#include "e2ee/qolmsession.h" #include <QObject> struct OlmAccount; namespace Quotient { -class QOlmSession; -class Connection; - -using QOlmSessionPtr = std::unique_ptr<QOlmSession>; - //! An olm account manages all cryptographic keys used on a device. //! \code{.cpp} //! const auto olmAccount = new QOlmAccount(this); diff --git a/lib/e2ee/qolmsession.cpp b/lib/e2ee/qolmsession.cpp index e575ff39..531a6696 100644 --- a/lib/e2ee/qolmsession.cpp +++ b/lib/e2ee/qolmsession.cpp @@ -3,10 +3,12 @@ // SPDX-License-Identifier: LGPL-2.1-or-later #include "qolmsession.h" + #include "e2ee/qolmutils.h" #include "logging.h" + #include <cstring> -#include <QDebug> +#include <olm/olm.h> using namespace Quotient; @@ -247,5 +249,4 @@ std::variant<bool, QOlmError> QOlmSession::matchesInboundSessionFrom(const QStri QOlmSession::QOlmSession(OlmSession *session) : m_session(session) -{ -} +{} diff --git a/lib/e2ee/qolmsession.h b/lib/e2ee/qolmsession.h index f20c9837..4eb151b6 100644 --- a/lib/e2ee/qolmsession.h +++ b/lib/e2ee/qolmsession.h @@ -4,17 +4,14 @@ #pragma once -#include <QDebug> -#include <olm/olm.h> // FIXME: OlmSession #include "e2ee/e2ee.h" #include "e2ee/qolmmessage.h" #include "e2ee/qolmerrors.h" #include "e2ee/qolmaccount.h" -namespace Quotient { +struct OlmSession; -class QOlmAccount; -class QOlmSession; +namespace Quotient { //! Either an outbound or inbound session for secure communication. class QUOTIENT_API QOlmSession |