From 4d72bcd655cf61088cacbac01ca28eb4a2250cd1 Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Tue, 17 Jan 2023 13:57:03 +0200 Subject: Reshuffle some includes This fixes the clangd warnings about included headers that were not used directly. Change-Id: I502be0257f6c5265bc9c72b739aebcb7629638aa Reviewed-by: Sami Littow Reviewed-by: Iikka Eklund --- include/commonsetup.h | 1 - include/httpclient.h | 1 - include/jsonhandler.h | 1 - include/licdsetup.h | 3 --- include/licenser.h | 9 --------- include/tcpserver.h | 3 +-- include/utils.h | 1 - mocwrapper/mocwrapper.cpp | 6 ++++++ mocwrapper/mocwrapper.h | 6 ------ qtlicensetool/qtlicensetool.cpp | 5 +++++ qtlicensetool/qtlicensetool.h | 3 --- src/clienthandler.cpp | 3 +++ src/daemon_clients/clienthandler.h | 4 ++-- src/daemon_clients/clitoolhandler.h | 2 ++ src/daemon_clients/cocohandler.h | 1 + src/daemon_clients/mochandler.h | 2 ++ src/daemon_clients/pluginhandler.h | 2 ++ src/daemon_clients/squishhandler.h | 2 ++ src/daemon_clients/squishidehandler.h | 1 + src/httpclient.cpp | 2 ++ src/jsonhandler.cpp | 2 ++ src/licdsetup.cpp | 3 +++ src/licenser.cpp | 10 ++++++++++ 23 files changed, 44 insertions(+), 29 deletions(-) diff --git a/include/commonsetup.h b/include/commonsetup.h index 5bace4c..d0f403b 100644 --- a/include/commonsetup.h +++ b/include/commonsetup.h @@ -6,7 +6,6 @@ #include #include -#include "version.h" #define DAEMON_ADDR "localhost" #define DAEMON_PORT 60000 diff --git a/include/httpclient.h b/include/httpclient.h index b1a63c1..a587c67 100644 --- a/include/httpclient.h +++ b/include/httpclient.h @@ -7,7 +7,6 @@ #include #include #include -#include "version.h" #define SERVER_CONN_TIMEOUT 10 diff --git a/include/jsonhandler.h b/include/jsonhandler.h index 18baad0..3755f19 100644 --- a/include/jsonhandler.h +++ b/include/jsonhandler.h @@ -10,7 +10,6 @@ #include #include #include -#include "utils.h" // Very simple JSON reader/writer, takes a JSON string as input // Specific to Qt license daemon only, doesn't work with JSONs in general diff --git a/include/licdsetup.h b/include/licdsetup.h index 41c5564..d4c7d84 100644 --- a/include/licdsetup.h +++ b/include/licdsetup.h @@ -4,9 +4,6 @@ */ #pragma once -#include "commonsetup.h" -#include "utils.h" - #include #include #include diff --git a/include/licenser.h b/include/licenser.h index 1f7256d..a15f1fa 100644 --- a/include/licenser.h +++ b/include/licenser.h @@ -20,17 +20,8 @@ #endif #include "httpclient.h" #include "tcpserver.h" -#include "utils.h" -#include "hmac_sha256.h" -#include "jsonhandler.h" #include "licdsetup.h" #include "clienthandler.h" -#include "mochandler.h" -#include "clitoolhandler.h" -#include "pluginhandler.h" -#include "cocohandler.h" -#include "squishhandler.h" -#include "squishidehandler.h" class Licenser { diff --git a/include/tcpserver.h b/include/tcpserver.h index f7def7a..a031b88 100644 --- a/include/tcpserver.h +++ b/include/tcpserver.h @@ -25,8 +25,7 @@ #include #include #include - #include "curl/curl.h" - typedef int type_socket; +typedef int type_socket; #else #define WIN32_LEAN_AND_MEAN #include diff --git a/include/utils.h b/include/utils.h index a215ffd..f714e92 100644 --- a/include/utils.h +++ b/include/utils.h @@ -3,7 +3,6 @@ * SPDX-License-Identifier: GPL-3.0-only WITH Qt-GPL-exception-1.0 */ #pragma once -#include "commonsetup.h" #include #include diff --git a/mocwrapper/mocwrapper.cpp b/mocwrapper/mocwrapper.cpp index d22137c..a992005 100644 --- a/mocwrapper/mocwrapper.cpp +++ b/mocwrapper/mocwrapper.cpp @@ -5,6 +5,12 @@ #include "mocwrapper.h" +#include "licdsetup.h" +#include "tcpclient.h" +#include "version.h" +#include "commonsetup.h" +#include "utils.h" + int main(int argc, char *argv[]) { // First check if version is asked diff --git a/mocwrapper/mocwrapper.h b/mocwrapper/mocwrapper.h index 8b7e363..6c4deaa 100644 --- a/mocwrapper/mocwrapper.h +++ b/mocwrapper/mocwrapper.h @@ -17,12 +17,6 @@ #include #endif -#include "tcpclient.h" -#include "utils.h" -#include "commonsetup.h" -#include "licdsetup.h" - - #define BUFFER_SIZE 1024 int getUserInfo(const std::string &filepath); diff --git a/qtlicensetool/qtlicensetool.cpp b/qtlicensetool/qtlicensetool.cpp index a166876..6c0bbc9 100644 --- a/qtlicensetool/qtlicensetool.cpp +++ b/qtlicensetool/qtlicensetool.cpp @@ -5,6 +5,11 @@ #include "qtlicensetool.h" +#include "commonsetup.h" +#include "tcpclient.h" +#include "utils.h" +#include "version.h" + int main(int argc, char *argv[]) { // Fetch the settings from .ini file diff --git a/qtlicensetool/qtlicensetool.h b/qtlicensetool/qtlicensetool.h index 8a88560..25ef04b 100644 --- a/qtlicensetool/qtlicensetool.h +++ b/qtlicensetool/qtlicensetool.h @@ -36,9 +36,6 @@ enum qt_tool_action_type { e_action_license_query = 4 }; -#include "tcpclient.h" -#include "utils.h" -#include "commonsetup.h" #include "licdsetup.h" #define APP_NAME "Qt licensing CLI" diff --git a/src/clienthandler.cpp b/src/clienthandler.cpp index b5fec10..1c1c6c9 100644 --- a/src/clienthandler.cpp +++ b/src/clienthandler.cpp @@ -5,6 +5,9 @@ #include "clienthandler.h" +#include "jsonhandler.h" +#include "utils.h" + bool ClientHandler::checkLicenseExpiryTime(std::string &reply) { std::cout << "Offline - checking validity from license file " << m_request.licenseFile << std::endl; diff --git a/src/daemon_clients/clienthandler.h b/src/daemon_clients/clienthandler.h index 695847e..8d04be8 100644 --- a/src/daemon_clients/clienthandler.h +++ b/src/daemon_clients/clienthandler.h @@ -7,10 +7,10 @@ #include #include -#include "utils.h" +#include + #include "commonsetup.h" #include "licdsetup.h" -#include "jsonhandler.h" class ClientHandler { diff --git a/src/daemon_clients/clitoolhandler.h b/src/daemon_clients/clitoolhandler.h index c9446d1..ce3429e 100644 --- a/src/daemon_clients/clitoolhandler.h +++ b/src/daemon_clients/clitoolhandler.h @@ -5,6 +5,8 @@ #pragma once #include "clienthandler.h" +#include "jsonhandler.h" +#include "utils.h" class CliToolHandler : public virtual ClientHandler { diff --git a/src/daemon_clients/cocohandler.h b/src/daemon_clients/cocohandler.h index 54fa49b..48494e0 100644 --- a/src/daemon_clients/cocohandler.h +++ b/src/daemon_clients/cocohandler.h @@ -5,6 +5,7 @@ #pragma once #include "clienthandler.h" +#include "utils.h" class CocoHandler : public ClientHandler { diff --git a/src/daemon_clients/mochandler.h b/src/daemon_clients/mochandler.h index d73f8db..acf1228 100644 --- a/src/daemon_clients/mochandler.h +++ b/src/daemon_clients/mochandler.h @@ -5,6 +5,8 @@ #pragma once #include "clienthandler.h" +#include "jsonhandler.h" +#include "utils.h" class MocHandler : virtual public ClientHandler { public: diff --git a/src/daemon_clients/pluginhandler.h b/src/daemon_clients/pluginhandler.h index 6d39500..27eae11 100644 --- a/src/daemon_clients/pluginhandler.h +++ b/src/daemon_clients/pluginhandler.h @@ -5,6 +5,8 @@ #pragma once #include "clienthandler.h" +#include "jsonhandler.h" +#include "utils.h" class PluginHandler : public ClientHandler { diff --git a/src/daemon_clients/squishhandler.h b/src/daemon_clients/squishhandler.h index 2542442..04d1abb 100644 --- a/src/daemon_clients/squishhandler.h +++ b/src/daemon_clients/squishhandler.h @@ -5,6 +5,8 @@ #pragma once #include "clienthandler.h" +#include "jsonhandler.h" +#include "utils.h" class SquishHandler : public ClientHandler { diff --git a/src/daemon_clients/squishidehandler.h b/src/daemon_clients/squishidehandler.h index abef26a..30f3447 100644 --- a/src/daemon_clients/squishidehandler.h +++ b/src/daemon_clients/squishidehandler.h @@ -5,6 +5,7 @@ #pragma once #include "clienthandler.h" +#include "utils.h" class SquishIdeHandler : public ClientHandler { diff --git a/src/httpclient.cpp b/src/httpclient.cpp index 506936c..07d13ea 100644 --- a/src/httpclient.cpp +++ b/src/httpclient.cpp @@ -5,6 +5,8 @@ #include "httpclient.h" +#include "version.h" + size_t WriteCallback(char *contents, size_t size, size_t nmemb, void *userp) { //std::cout << "Reading data\n"; diff --git a/src/jsonhandler.cpp b/src/jsonhandler.cpp index b9e5d65..41a0c81 100644 --- a/src/jsonhandler.cpp +++ b/src/jsonhandler.cpp @@ -5,6 +5,8 @@ #include "jsonhandler.h" +#include "utils.h" + JsonHandler::JsonHandler(const std::string &jsonString) { if (preParse(jsonString) != 0) { diff --git a/src/licdsetup.cpp b/src/licdsetup.cpp index 2594485..45addda 100644 --- a/src/licdsetup.cpp +++ b/src/licdsetup.cpp @@ -5,6 +5,9 @@ #include "licdsetup.h" +#include "commonsetup.h" +#include "utils.h" + LicdSetup::LicdSetup(int type, const std::string &callerBinaryPath) : m_setType(type) { diff --git a/src/licenser.cpp b/src/licenser.cpp index 0b3cc48..0e4540b 100644 --- a/src/licenser.cpp +++ b/src/licenser.cpp @@ -5,6 +5,16 @@ #include "licenser.h" +#include "clitoolhandler.h" +#include "cocohandler.h" +#include "mochandler.h" +#include "pluginhandler.h" +#include "squishhandler.h" +#include "squishidehandler.h" +#include "version.h" + +#include "hmac_sha256.h" + Licenser::Licenser(uint16_t tcpPort) { // Init daemon settings -- cgit v1.2.3