Reduce Cache.h includes further via one forward declaration

This commit is contained in:
Nicolas Werner 2019-12-15 03:34:17 +01:00
parent 37fbcaf07b
commit 79f967da8c
9 changed files with 13 additions and 4 deletions

View file

@ -104,7 +104,6 @@ numeric_key_comparison(const MDB_val *a, const MDB_val *b)
return -1; return -1;
} }
Cache::Cache(const QString &userId, QObject *parent) Cache::Cache(const QString &userId, QObject *parent)
: QObject{parent} : QObject{parent}
, env_{nullptr} , env_{nullptr}
@ -2901,4 +2900,3 @@ restoreSessions()
return instance_->restoreSessions(); return instance_->restoreSessions();
} }
} // namespace cache } // namespace cache

View file

@ -22,6 +22,7 @@
#include <variant> #include <variant>
#include <mtx/common.hpp> #include <mtx/common.hpp>
#include <mtx/requests.hpp>
#include <mtx/responses.hpp> #include <mtx/responses.hpp>
#include <mtxclient/http/errors.hpp> #include <mtxclient/http/errors.hpp>

View file

@ -23,6 +23,7 @@
#include <mtx/requests.hpp> #include <mtx/requests.hpp>
#include "Cache.h"
#include "ChatPage.h" #include "ChatPage.h"
#include "Config.h" #include "Config.h"
#include "Logging.h" #include "Logging.h"

View file

@ -1,8 +1,8 @@
#include "MxcImageProvider.h" #include "MxcImageProvider.h"
#include "Cache.h" #include "Cache.h"
#include "MatrixClient.h"
#include "Logging.h" #include "Logging.h"
#include "MatrixClient.h"
void void
MxcImageResponse::run() MxcImageResponse::run()

View file

@ -22,6 +22,7 @@
#include <QTimer> #include <QTimer>
#include <QtConcurrent> #include <QtConcurrent>
#include "Cache.h"
#include "QuickSwitcher.h" #include "QuickSwitcher.h"
#include "popups/SuggestionsPopup.h" #include "popups/SuggestionsPopup.h"

View file

@ -29,6 +29,7 @@
#include <QString> #include <QString>
#include <QTextStream> #include <QTextStream>
#include "Cache.h"
#include "Config.h" #include "Config.h"
#include "MatrixClient.h" #include "MatrixClient.h"
#include "Olm.h" #include "Olm.h"

View file

@ -15,6 +15,7 @@
#include <cmark.h> #include <cmark.h>
#include "Cache.h"
#include "Config.h" #include "Config.h"
using TimelineEvent = mtx::events::collections::TimelineEvents; using TimelineEvent = mtx::events::collections::TimelineEvents;

View file

@ -2,7 +2,6 @@
#include <variant> #include <variant>
#include "Cache.h"
#include "RoomInfoListItem.h" #include "RoomInfoListItem.h"
#include <QCoreApplication> #include <QCoreApplication>
@ -13,6 +12,12 @@
#include <qmath.h> #include <qmath.h>
namespace cache {
// Forward declarations to prevent dependency on Cache.h, since this header is included often!
QString
displayName(const QString &room_id, const QString &user_id);
}
class QComboBox; class QComboBox;
// Contains information about related events for // Contains information about related events for

View file

@ -16,6 +16,7 @@
#include "dialogs/RoomSettings.h" #include "dialogs/RoomSettings.h"
#include "Cache.h"
#include "ChatPage.h" #include "ChatPage.h"
#include "Config.h" #include "Config.h"
#include "Logging.h" #include "Logging.h"