From c3de788956f25a095e9abad3162c0e216e928029 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Sun, 5 May 2024 21:49:43 +0200 Subject: [PATCH] Cleanup includes --- src/fakerunner.cpp | 2 +- src/models/messagecontentmodel.cpp | 1 - src/models/messagecontentmodel.h | 2 -- src/models/roomlistmodel.cpp | 2 +- src/neochatroom.cpp | 1 - src/runner.cpp | 12 ------------ src/runner.h | 7 ------- src/spacehierarchycache.cpp | 3 ++- src/spacehierarchycache.h | 7 +++---- src/texthandler.h | 3 --- src/windowcontroller.cpp | 6 ++++++ src/windowcontroller.h | 5 +---- 12 files changed, 14 insertions(+), 37 deletions(-) diff --git a/src/fakerunner.cpp b/src/fakerunner.cpp index 8d82822b8..f5f8fd718 100644 --- a/src/fakerunner.cpp +++ b/src/fakerunner.cpp @@ -33,4 +33,4 @@ FakeRunner::FakeRunner() qDBusRegisterMetaType(); } -#include "moc_fakerunner.cpp" \ No newline at end of file +#include "moc_fakerunner.cpp" diff --git a/src/models/messagecontentmodel.cpp b/src/models/messagecontentmodel.cpp index 6f5f0aaa6..059e18535 100644 --- a/src/models/messagecontentmodel.cpp +++ b/src/models/messagecontentmodel.cpp @@ -11,7 +11,6 @@ #include #include -#include #ifndef Q_OS_ANDROID #include diff --git a/src/models/messagecontentmodel.h b/src/models/messagecontentmodel.h index d42438498..8f942ffc5 100644 --- a/src/models/messagecontentmodel.h +++ b/src/models/messagecontentmodel.h @@ -11,8 +11,6 @@ #include "enums/messagecomponenttype.h" #include "eventhandler.h" #include "itinerarymodel.h" -#include "linkpreviewer.h" -#include "neochatroom.h" struct MessageComponent { MessageComponentType::Type type = MessageComponentType::Other; diff --git a/src/models/roomlistmodel.cpp b/src/models/roomlistmodel.cpp index 5654395fa..ef5400ae4 100644 --- a/src/models/roomlistmodel.cpp +++ b/src/models/roomlistmodel.cpp @@ -4,7 +4,7 @@ #include "roomlistmodel.h" #include "eventhandler.h" -#include "neochatconfig.h" +#include "neochatconnection.h" #include "neochatroom.h" #include "roommanager.h" #include "spacehierarchycache.h" diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index 9cd3ff8da..aa273f6c0 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -46,7 +46,6 @@ #include "spacehierarchycache.h" #include "texthandler.h" #include "urlhelper.h" -#include "utils.h" #ifndef Q_OS_ANDROID #include diff --git a/src/runner.cpp b/src/runner.cpp index 6ae5c50c5..37ab29640 100644 --- a/src/runner.cpp +++ b/src/runner.cpp @@ -6,7 +6,6 @@ #include #include "controller.h" -#include "neochatroom.h" #include "roomlistmodel.h" #include "roommanager.h" #include "sortfilterroomlistmodel.h" @@ -43,17 +42,6 @@ Runner::Runner() qDBusRegisterMetaType(); } -void Runner::setRoomListModel(RoomListModel *roomListModel) -{ - m_model->setSourceModel(roomListModel); - Q_EMIT roomListModelChanged(); -} - -RoomListModel *Runner::roomListModel() const -{ - return dynamic_cast(m_model->sourceModel()); -} - RemoteActions Runner::Actions() { return {}; diff --git a/src/runner.h b/src/runner.h index b57fc7738..480fb387e 100644 --- a/src/runner.h +++ b/src/runner.h @@ -165,10 +165,6 @@ class Runner : public QObject, protected QDBusContext { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.krunner1") - QML_ELEMENT - QML_SINGLETON - - Q_PROPERTY(RoomListModel *roomListModel READ roomListModel WRITE setRoomListModel NOTIFY roomListModelChanged) public: static Runner *create(QQmlEngine *engine, QJSEngine *) { @@ -194,9 +190,6 @@ public: */ Q_SCRIPTABLE void Run(const QString &id, const QString &actionId); - void setRoomListModel(RoomListModel *roomListModel); - RoomListModel *roomListModel() const; - Q_SIGNALS: void roomListModelChanged(); diff --git a/src/spacehierarchycache.cpp b/src/spacehierarchycache.cpp index 2c2826359..180ea5804 100644 --- a/src/spacehierarchycache.cpp +++ b/src/spacehierarchycache.cpp @@ -3,13 +3,14 @@ #include "spacehierarchycache.h" +#include #include #include #include +#include "neochatconnection.h" #include "neochatroom.h" -#include "neochatroomtype.h" #include "roomlistmodel.h" using namespace Quotient; diff --git a/src/spacehierarchycache.h b/src/spacehierarchycache.h index d493ea14b..5f3943f2b 100644 --- a/src/spacehierarchycache.h +++ b/src/spacehierarchycache.h @@ -10,15 +10,14 @@ #include #include -#include - -#include "neochatconnection.h" - namespace Quotient { class Room; +class GetSpaceHierarchyJob; } +class NeoChatConnection; + /** * @class SpaceHierarchyCache * diff --git a/src/texthandler.h b/src/texthandler.h index 56ed46c31..ae392110f 100644 --- a/src/texthandler.h +++ b/src/texthandler.h @@ -3,11 +3,8 @@ #pragma once -#include #include -#include #include -#include #include "models/messagecontentmodel.h" #include "neochatroom.h" diff --git a/src/windowcontroller.cpp b/src/windowcontroller.cpp index b83cde861..dace607c5 100644 --- a/src/windowcontroller.cpp +++ b/src/windowcontroller.cpp @@ -14,8 +14,14 @@ #endif #include + +#include #include +#ifdef HAVE_WINDOWSYSTEM +#include +#endif + WindowController &WindowController::instance() { static WindowController instance; diff --git a/src/windowcontroller.h b/src/windowcontroller.h index 237104aa2..e79162d02 100644 --- a/src/windowcontroller.h +++ b/src/windowcontroller.h @@ -6,10 +6,7 @@ #include #include #include -#include -#ifdef HAVE_WINDOWSYSTEM -#include -#endif + /** * @class WindowController *