organize includes

This commit is contained in:
Kevin Yue 2021-09-19 09:37:21 +08:00
parent 0ca0dbe7ad
commit 71d4693f03
32 changed files with 120 additions and 97 deletions

15
.vscode/settings.json vendored
View File

@ -5,6 +5,19 @@
"qregularexpressionmatch": "cpp",
"qdatetime": "cpp",
"qprocess": "cpp",
"qobject": "cpp"
"qobject": "cpp",
"qstandardpaths": "cpp",
"qmainwindow": "cpp",
"qsystemtrayicon": "cpp",
"qpushbutton": "cpp",
"qmenu": "cpp",
"qjsondocument": "cpp",
"qnetworkaccessmanager": "cpp",
"qwebengineview": "cpp",
"qprocessenvironment": "cpp",
"qnetworkreply": "cpp",
"qicon": "cpp",
"qsslsocket": "cpp",
"qapplication": "cpp"
}
}

View File

@ -1,8 +1,8 @@
#include "cdpcommand.h"
#include <QtCore/QVariantMap>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
#include <QVariantMap>
#include <QJsonDocument>
#include <QJsonObject>
#include "cdpcommand.h"
CDPCommand::CDPCommand(QObject *parent) : QObject(parent)
{

View File

@ -1,7 +1,7 @@
#ifndef CDPCOMMAND_H
#define CDPCOMMAND_H
#include <QObject>
#include <QtCore/QObject>
class CDPCommand : public QObject
{

View File

@ -1,7 +1,8 @@
#include "cdpcommandmanager.h"
#include <QVariantMap>
#include <QtCore/QVariantMap>
#include <plog/Log.h>
#include "cdpcommandmanager.h"
CDPCommandManager::CDPCommandManager(QObject *parent)
: QObject(parent)
, networkManager(new QNetworkAccessManager)

View File

@ -1,11 +1,12 @@
#ifndef CDPCOMMANDMANAGER_H
#define CDPCOMMANDMANAGER_H
#include <QtCore/QObject>
#include <QtCore/QHash>
#include <QtWebSockets/QtWebSockets>
#include <QtNetwork/QNetworkAccessManager>
#include "cdpcommand.h"
#include <QObject>
#include <QHash>
#include <QtWebSockets>
#include <QNetworkAccessManager>
class CDPCommandManager : public QObject
{

View File

@ -1,9 +1,9 @@
#include <QtCore/QProcessEnvironment>
#include <QtWebEngineWidgets/QWebEngineView>
#include "enhancedwebview.h"
#include "cdpcommandmanager.h"
#include <QtWebEngineWidgets/QWebEngineView>
#include <QProcessEnvironment>
EnhancedWebView::EnhancedWebView(QWidget *parent)
: QWebEngineView(parent)
, cdp(new CDPCommandManager)

View File

@ -1,9 +1,10 @@
#ifndef ENHANCEDWEBVIEW_H
#define ENHANCEDWEBVIEW_H
#include "cdpcommandmanager.h"
#include <QtWebEngineWidgets/QWebEngineView>
#include "cdpcommandmanager.h"
#define ENV_CDP_PORT "QTWEBENGINE_REMOTE_DEBUGGING"
class EnhancedWebView : public QWebEngineView

View File

@ -1,11 +1,11 @@
#include <QtNetwork/QNetworkReply>
#include <plog/Log.h>
#include "gatewayauthenticator.h"
#include "gphelper.h"
#include "loginparams.h"
#include "preloginresponse.h"
#include <QNetworkReply>
#include <plog/Log.h>
using namespace gpclient::helper;
GatewayAuthenticator::GatewayAuthenticator(const QString& gateway, const GatewayAuthenticatorParams params)

View File

@ -1,10 +1,11 @@
#ifndef GATEWAYAUTHENTICATOR_H
#define GATEWAYAUTHENTICATOR_H
#include <QtCore/QObject>
#include "normalloginwindow.h"
#include "loginparams.h"
#include "gatewayauthenticatorparams.h"
#include <QObject>
class GatewayAuthenticator : public QObject
{

View File

@ -1,7 +1,8 @@
#ifndef GATEWAYAUTHENTICATORPARAMS_H
#define GATEWAYAUTHENTICATORPARAMS_H
#include <QString>
#include <QtCore/QString>
#include "portalconfigresponse.h"
class GatewayAuthenticatorParams

View File

@ -1,3 +1,6 @@
#include <QtGui/QIcon>
#include <plog/Log.h>
#include "gpclient.h"
#include "gphelper.h"
#include "ui_gpclient.h"
@ -6,9 +9,6 @@
#include "settingsdialog.h"
#include "gatewayauthenticatorparams.h"
#include <plog/Log.h>
#include <QIcon>
using namespace gpclient::helper;
GPClient::GPClient(QWidget *parent)

View File

@ -1,15 +1,15 @@
#ifndef GPCLIENT_H
#define GPCLIENT_H
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QSystemTrayIcon>
#include <QtWidgets/QMenu>
#include <QtWidgets/QPushButton>
#include "gpserviceinterface.h"
#include "portalconfigresponse.h"
#include "settingsdialog.h"
#include <QMainWindow>
#include <QSystemTrayIcon>
#include <QMenu>
#include <QPushButton>
QT_BEGIN_NAMESPACE
namespace Ui { class GPClient; }
QT_END_NAMESPACE

View File

@ -1,8 +1,8 @@
#include "gpgateway.h"
#include <QtCore/QJsonObject>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonArray>
#include <QJsonObject>
#include <QJsonDocument>
#include <QJsonArray>
#include "gpgateway.h"
GPGateway::GPGateway()
{

View File

@ -1,9 +1,9 @@
#ifndef GPGATEWAY_H
#define GPGATEWAY_H
#include <QString>
#include <QMap>
#include <QJsonObject>
#include <QtCore/QString>
#include <QtCore/QMap>
#include <QtCore/QJsonObject>
class GPGateway
{

View File

@ -1,14 +1,15 @@
#include "gphelper.h"
#include <QNetworkRequest>
#include <QXmlStreamReader>
#include <QMessageBox>
#include <QDesktopWidget>
#include <QApplication>
#include <QWidget>
#include <QSslConfiguration>
#include <QSslSocket>
#include <QtCore/QXmlStreamReader>
#include <QtWidgets/QMessageBox>
#include <QtWidgets/QDesktopWidget>
#include <QtWidgets/QApplication>
#include <QtWidgets/QWidget>
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QSslConfiguration>
#include <QtNetwork/QSslSocket>
#include <plog/Log.h>
#include "gphelper.h"
QNetworkAccessManager* gpclient::helper::networkManager = new QNetworkAccessManager;
QNetworkReply* gpclient::helper::createRequest(QString url, QByteArray params)

View File

@ -1,16 +1,16 @@
#ifndef GPHELPER_H
#define GPHELPER_H
#include <QtCore/QObject>
#include <QtCore/QUrlQuery>
#include <QtCore/QSettings>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QNetworkReply>
#include "samlloginwindow.h"
#include "gpgateway.h"
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QUrlQuery>
#include <QSettings>
const QString UA = "PAN GlobalProtect";

View File

@ -1,6 +1,6 @@
#include "loginparams.h"
#include <QtCore/QUrlQuery>
#include <QUrlQuery>
#include "loginparams.h"
LoginParams::LoginParams(const QString clientos)
{

View File

@ -1,7 +1,7 @@
#ifndef LOGINPARAMS_H
#define LOGINPARAMS_H
#include <QUrlQuery>
#include <QtCore/QUrlQuery>
class LoginParams
{

View File

@ -1,12 +1,14 @@
#include "singleapplication.h"
#include "gpclient.h"
#include "enhancedwebview.h"
#include <QStandardPaths>
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QDir>
#include <QtCore/QStandardPaths>
#include <plog/Log.h>
#include <plog/Appenders/ColorConsoleAppender.h>
static const QString version = "v1.3.3";
#include "singleapplication.h"
#include "gpclient.h"
#include "enhancedwebview.h"
#include "version.h"
int main(int argc, char *argv[])
{
@ -19,7 +21,7 @@ int main(int argc, char *argv[])
static plog::ColorConsoleAppender<plog::TxtFormatter> consoleAppender;
plog::init(plog::debug, logFile.toUtf8()).addAppender(&consoleAppender);
PLOGI << "GlobalProtect started, version: " << version;
PLOGI << "GlobalProtect started, version: " << VERSION;
QString port = QString::fromLocal8Bit(qgetenv(ENV_CDP_PORT));

View File

@ -1,8 +1,8 @@
#include <QtGui/QCloseEvent>
#include "normalloginwindow.h"
#include "ui_normalloginwindow.h"
#include <QCloseEvent>
NormalLoginWindow::NormalLoginWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::NormalLoginWindow)

View File

@ -1,7 +1,7 @@
#ifndef PORTALAUTHWINDOW_H
#define PORTALAUTHWINDOW_H
#include <QDialog>
#include <QtWidgets/QDialog>
namespace Ui {
class NormalLoginWindow;

View File

@ -1,3 +1,6 @@
#include <QtNetwork/QNetworkReply>
#include <plog/Log.h>
#include "portalauthenticator.h"
#include "gphelper.h"
#include "normalloginwindow.h"
@ -7,9 +10,6 @@
#include "portalconfigresponse.h"
#include "gpgateway.h"
#include <plog/Log.h>
#include <QNetworkReply>
using namespace gpclient::helper;
PortalAuthenticator::PortalAuthenticator(const QString& portal, const QString& clientos) : QObject()

View File

@ -1,12 +1,13 @@
#ifndef PORTALAUTHENTICATOR_H
#define PORTALAUTHENTICATOR_H
#include <QtCore/QObject>
#include "portalconfigresponse.h"
#include "normalloginwindow.h"
#include "samlloginwindow.h"
#include "preloginresponse.h"
#include <QObject>
class PortalAuthenticator : public QObject
{

View File

@ -1,8 +1,8 @@
#include "portalconfigresponse.h"
#include <QXmlStreamReader>
#include <QtCore/QXmlStreamReader>
#include <plog/Log.h>
#include "portalconfigresponse.h"
QString PortalConfigResponse::xmlUserAuthCookie = "portal-userauthcookie";
QString PortalConfigResponse::xmlPrelogonUserAuthCookie = "portal-prelogonuserauthcookie";
QString PortalConfigResponse::xmlGateways = "gateways";

View File

@ -1,11 +1,11 @@
#ifndef PORTALCONFIGRESPONSE_H
#define PORTALCONFIGRESPONSE_H
#include "gpgateway.h"
#include <QtCore/QString>
#include <QtCore/QList>
#include <QtCore/QXmlStreamReader>
#include <QString>
#include <QList>
#include <QXmlStreamReader>
#include "gpgateway.h"
class PortalConfigResponse
{

View File

@ -1,9 +1,9 @@
#include "preloginresponse.h"
#include <QXmlStreamReader>
#include <QMap>
#include <QtCore/QXmlStreamReader>
#include <QtCore/QMap>
#include <plog/Log.h>
#include "preloginresponse.h"
QString PreloginResponse::xmlAuthMessage = "authentication-message";
QString PreloginResponse::xmlLabelUsername = "username-label";
QString PreloginResponse::xmlLabelPassword = "password-label";

View File

@ -1,8 +1,8 @@
#ifndef PRELOGINRESPONSE_H
#define PRELOGINRESPONSE_H
#include <QString>
#include <QMap>
#include <QtCore/QString>
#include <QtCore/QMap>
class PreloginResponse
{

View File

@ -1,9 +1,9 @@
#include "samlloginwindow.h"
#include <QVBoxLayout>
#include <QtWidgets/QVBoxLayout>
#include <QtWebEngineWidgets/QWebEngineProfile>
#include <QtWebEngineWidgets/QWebEngineView>
#include <plog/Log.h>
#include <QWebEngineProfile>
#include <QWebEngineView>
#include "samlloginwindow.h"
SAMLLoginWindow::SAMLLoginWindow(QWidget *parent)
: QDialog(parent)

View File

@ -1,11 +1,11 @@
#ifndef SAMLLOGINWINDOW_H
#define SAMLLOGINWINDOW_H
#include "enhancedwebview.h"
#include <QtCore/QMap>
#include <QtGui/QCloseEvent>
#include <QtWidgets/QDialog>
#include <QDialog>
#include <QMap>
#include <QCloseEvent>
#include "enhancedwebview.h"
class SAMLLoginWindow : public QDialog
{

View File

@ -1,7 +1,7 @@
#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H
#include <QDialog>
#include <QtWidgets/QDialog>
namespace Ui {
class SettingsDialog;

View File

@ -1,12 +1,12 @@
#include "gpservice.h"
#include "gpserviceadaptor.h"
#include <QtCore/QFileInfo>
#include <QtDBus/QtDBus>
#include <QtCore/QDateTime>
#include <QtCore/QVariant>
#include <QtCore/QRegularExpression>
#include <QtCore/QRegularExpressionMatch>
#include <QtDBus/QtDBus>
#include "gpservice.h"
#include "gpserviceadaptor.h"
GPService::GPService(QObject *parent)
: QObject(parent)

View File

@ -1,4 +1,5 @@
#include <QtDBus>
#include <QtDBus/QtDBus>
#include "gpservice.h"
#include "singleapplication.h"
#include "sigwatch.h"