From 41c9013fa46a194b3e4fee6ced1b9d1b65e177ac Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Thu, 6 Jun 2024 11:59:28 -0400 Subject: [PATCH] chat: don't use incomplete types with signals/slots/Q_INVOKABLE (#2408) Signed-off-by: Jared Van Bortel --- gpt4all-chat/chat.cpp | 1 - gpt4all-chat/chat.h | 2 +- gpt4all-chat/chatapi.h | 2 +- gpt4all-chat/chatllm.cpp | 2 -- gpt4all-chat/chatllm.h | 4 ++-- gpt4all-chat/database.cpp | 1 - gpt4all-chat/database.h | 3 ++- gpt4all-chat/download.cpp | 2 -- gpt4all-chat/download.h | 5 ++--- gpt4all-chat/embllm.h | 1 - gpt4all-chat/modellist.cpp | 1 - gpt4all-chat/modellist.h | 7 +++---- gpt4all-chat/mysettings.cpp | 2 -- gpt4all-chat/mysettings.h | 4 +--- gpt4all-chat/network.cpp | 4 ---- gpt4all-chat/network.h | 9 ++++----- gpt4all-chat/server.cpp | 1 - gpt4all-chat/server.h | 2 +- 18 files changed, 17 insertions(+), 36 deletions(-) diff --git a/gpt4all-chat/chat.cpp b/gpt4all-chat/chat.cpp index 926142bc..42aa15bb 100644 --- a/gpt4all-chat/chat.cpp +++ b/gpt4all-chat/chat.cpp @@ -4,7 +4,6 @@ #include "mysettings.h" #include "network.h" #include "server.h" -#include "database.h" #include #include diff --git a/gpt4all-chat/chat.h b/gpt4all-chat/chat.h index a4116e1c..4f1e8c5a 100644 --- a/gpt4all-chat/chat.h +++ b/gpt4all-chat/chat.h @@ -3,6 +3,7 @@ #include "chatllm.h" #include "chatmodel.h" +#include "database.h" // IWYU pragma: keep #include "localdocsmodel.h" // IWYU pragma: keep #include "modellist.h" @@ -13,7 +14,6 @@ #include class QDataStream; -struct ResultInfo; class Chat : public QObject { diff --git a/gpt4all-chat/chatapi.h b/gpt4all-chat/chatapi.h index 0c47dfe1..90aaf5b7 100644 --- a/gpt4all-chat/chatapi.h +++ b/gpt4all-chat/chatapi.h @@ -3,6 +3,7 @@ #include "../gpt4all-backend/llmodel.h" +#include #include #include #include @@ -16,7 +17,6 @@ #include #include -class QByteArray; class QNetworkAccessManager; class ChatAPI; diff --git a/gpt4all-chat/chatllm.cpp b/gpt4all-chat/chatllm.cpp index 87bdcb4e..11c51041 100644 --- a/gpt4all-chat/chatllm.cpp +++ b/gpt4all-chat/chatllm.cpp @@ -2,7 +2,6 @@ #include "chat.h" #include "chatapi.h" -#include "database.h" #include "localdocs.h" #include "mysettings.h" #include "network.h" @@ -14,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/gpt4all-chat/chatllm.h b/gpt4all-chat/chatllm.h index c65f8888..67791164 100644 --- a/gpt4all-chat/chatllm.h +++ b/gpt4all-chat/chatllm.h @@ -1,6 +1,7 @@ #ifndef CHATLLM_H #define CHATLLM_H +#include "database.h" // IWYU pragma: keep #include "modellist.h" #include "../gpt4all-backend/llmodel.h" @@ -8,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -21,8 +23,6 @@ #include class QDataStream; -struct ResultInfo; -template class QList; enum LLModelType { GPTJ_, diff --git a/gpt4all-chat/database.cpp b/gpt4all-chat/database.cpp index f098d811..b92f0667 100644 --- a/gpt4all-chat/database.cpp +++ b/gpt4all-chat/database.cpp @@ -1,7 +1,6 @@ #include "database.h" #include "embeddings.h" -#include "embllm.h" #include "modellist.h" #include "mysettings.h" #include "network.h" diff --git a/gpt4all-chat/database.h b/gpt4all-chat/database.h index c8160f3c..34cf7681 100644 --- a/gpt4all-chat/database.h +++ b/gpt4all-chat/database.h @@ -1,6 +1,8 @@ #ifndef DATABASE_H #define DATABASE_H +#include "embllm.h" // IWYU pragma: keep + #include #include #include @@ -22,7 +24,6 @@ class QFileSystemWatcher; class QSqlError; class QTextStream; class QTimer; -struct EmbeddingResult; struct DocumentInfo { diff --git a/gpt4all-chat/download.cpp b/gpt4all-chat/download.cpp index 41e946c4..66037736 100644 --- a/gpt4all-chat/download.cpp +++ b/gpt4all-chat/download.cpp @@ -14,12 +14,10 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include diff --git a/gpt4all-chat/download.h b/gpt4all-chat/download.h index 0dfcea29..8c1bb021 100644 --- a/gpt4all-chat/download.h +++ b/gpt4all-chat/download.h @@ -5,18 +5,17 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include class QByteArray; -class QFile; -class QSslError; -template class QList; struct ReleaseInfo { Q_GADGET diff --git a/gpt4all-chat/embllm.h b/gpt4all-chat/embllm.h index b9109f23..06ec94d6 100644 --- a/gpt4all-chat/embllm.h +++ b/gpt4all-chat/embllm.h @@ -2,7 +2,6 @@ #define EMBLLM_H #include -#include #include #include #include diff --git a/gpt4all-chat/modellist.cpp b/gpt4all-chat/modellist.cpp index 5a7d4591..2fca1331 100644 --- a/gpt4all-chat/modellist.cpp +++ b/gpt4all-chat/modellist.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/gpt4all-chat/modellist.h b/gpt4all-chat/modellist.h index 6c547650..1209a7b3 100644 --- a/gpt4all-chat/modellist.h +++ b/gpt4all-chat/modellist.h @@ -12,14 +12,13 @@ #include #include #include +#include #include +#include +#include #include #include #include -#include -#include - -class QSslError; struct ModelInfo { Q_GADGET diff --git a/gpt4all-chat/mysettings.cpp b/gpt4all-chat/mysettings.cpp index bbe833e8..c52ab638 100644 --- a/gpt4all-chat/mysettings.cpp +++ b/gpt4all-chat/mysettings.cpp @@ -1,7 +1,5 @@ #include "mysettings.h" -#include "modellist.h" - #include "../gpt4all-backend/llmodel.h" #include diff --git a/gpt4all-chat/mysettings.h b/gpt4all-chat/mysettings.h index b6393c49..86b9183b 100644 --- a/gpt4all-chat/mysettings.h +++ b/gpt4all-chat/mysettings.h @@ -1,7 +1,7 @@ #ifndef MYSETTINGS_H #define MYSETTINGS_H -#include "modellist.h" +#include "modellist.h" // IWYU pragma: keep #include #include @@ -10,8 +10,6 @@ #include -struct ModelInfo; - class MySettings : public QObject { Q_OBJECT diff --git a/gpt4all-chat/network.cpp b/gpt4all-chat/network.cpp index 13ef29b2..b9f435a6 100644 --- a/gpt4all-chat/network.cpp +++ b/gpt4all-chat/network.cpp @@ -11,7 +11,6 @@ #include "../gpt4all-backend/llmodel.h" -#include #include #include #include @@ -20,14 +19,11 @@ #include #include #include -#include -#include #include #include #include #include #include -#include #include #include #include diff --git a/gpt4all-chat/network.h b/gpt4all-chat/network.h index 92fa7290..bf35ac11 100644 --- a/gpt4all-chat/network.h +++ b/gpt4all-chat/network.h @@ -1,19 +1,18 @@ #ifndef NETWORK_H #define NETWORK_H +#include #include +#include #include #include +#include #include +#include #include #include #include -class QByteArray; -class QNetworkReply; -class QSslError; -template class QList; - struct KeyValue { QString key; QJsonValue value; diff --git a/gpt4all-chat/server.cpp b/gpt4all-chat/server.cpp index 57699860..8e70d820 100644 --- a/gpt4all-chat/server.cpp +++ b/gpt4all-chat/server.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/gpt4all-chat/server.h b/gpt4all-chat/server.h index 3f8a12eb..689f0b60 100644 --- a/gpt4all-chat/server.h +++ b/gpt4all-chat/server.h @@ -4,6 +4,7 @@ #include "chatllm.h" #include "database.h" +#include #include #include #include @@ -11,7 +12,6 @@ class Chat; class QHttpServer; -class QHttpServerRequest; class Server : public ChatLLM {