Other: C++ code cleanup

This commit is contained in:
Xavier Michelon
2022-07-25 15:50:20 +02:00
committed by Jakub
parent 055829dcf8
commit 62a589b6ad
14 changed files with 64 additions and 39 deletions

View File

@ -16,8 +16,8 @@
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#ifndef BRIDGE_QT6_APP_CONTROLLER_H
#define BRIDGE_QT6_APP_CONTROLLER_H
#ifndef BRIDGE_GUI_APP_CONTROLLER_H
#define BRIDGE_GUI_APP_CONTROLLER_H
class QMLBackend;
@ -60,4 +60,4 @@ private: // data members
AppController& app(); ///< Return a reference to the app controller.
#endif // BRIDGE_QT6_APP_CONTROLLER_H
#endif // BRIDGE_GUI_APP_CONTROLLER_H

View File

@ -16,12 +16,12 @@
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#ifndef BRIDGE_QT6_DOCK_ICON_H
#define BRIDGE_QT6_DOCK_ICON_H
#ifndef BRIDGE_GUI_DOCK_ICON_H
#define BRIDGE_GUI_DOCK_ICON_H
void setDockIconVisibleState(bool visible); ///< Set the DOCK icon visibility state
bool getDockIconVisibleState(); ///< Get the Dock icon visibility state
#endif // #ifndef BRIDGE_QT6_DOCK_ICON_H
#endif // #ifndef BRIDGE_GUI_DOCK_ICON_H

View File

@ -16,8 +16,8 @@
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#ifndef BRIDGE_QT6_EVENT_STREAM_WORKER_H
#define BRIDGE_QT6_EVENT_STREAM_WORKER_H
#ifndef BRIDGE_GUI_EVENT_STREAM_WORKER_H
#define BRIDGE_GUI_EVENT_STREAM_WORKER_H
#include "GRPC/bridge.grpc.pb.h"
@ -49,4 +49,4 @@ signals:
};
#endif //BRIDGE_QT6_EVENT_STREAM_WORKER_H
#endif //BRIDGE_GUI_EVENT_STREAM_WORKER_H

View File

@ -16,8 +16,8 @@
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#ifndef BRIDGE_QT6_EXCEPTION_H
#define BRIDGE_QT6_EXCEPTION_H
#ifndef BRIDGE_GUI_EXCEPTION_H
#define BRIDGE_GUI_EXCEPTION_H
#include <stdexcept>
@ -43,4 +43,4 @@ private: // data members
};
#endif //BRIDGE_QT6_EXCEPTION_H
#endif //BRIDGE_GUI_EXCEPTION_H

View File

@ -16,8 +16,8 @@
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#ifndef BRIDGE_QT6_RPC_CLIENT_H
#define BRIDGE_QT6_RPC_CLIENT_H
#ifndef BRIDGE_GUI_RPC_CLIENT_H
#define BRIDGE_GUI_RPC_CLIENT_H
#include "GRPC/bridge.grpc.pb.h"
@ -218,4 +218,4 @@ private: // data members.
};
#endif // BRIDGE_QT6_RPC_CLIENT_H
#endif // BRIDGE_GUI_RPC_CLIENT_H

View File

@ -16,8 +16,8 @@
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#ifndef BRIDGE_QT6_GRPCUTILS_H
#define BRIDGE_QT6_GRPCUTILS_H
#ifndef BRIDGE_GUI_GRPCUTILS_H
#define BRIDGE_GUI_GRPCUTILS_H
#include "Log.h"
@ -31,4 +31,4 @@ SPUser parsegrpcUser(grpc::User const& grpcUser); ///< Parse a gRPC user struct
grpc::LogLevel logLevelToGRPC(Log::Level level); ///< Convert a Log::Level to gRPC enum value.
#endif // BRIDGE_QT6_GRPCUTILS_H
#endif // BRIDGE_GUI_GRPCUTILS_H

View File

@ -16,8 +16,8 @@
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#ifndef BRIDGE_QT6_LOG_H
#define BRIDGE_QT6_LOG_H
#ifndef BRIDGE_GUI_LOG_H
#define BRIDGE_GUI_LOG_H
//****************************************************************************************************************************************************
@ -79,4 +79,4 @@ private: // data members
};
#endif //BRIDGE_QT6_LOG_H
#endif //BRIDGE_GUI_LOG_H

View File

@ -16,8 +16,15 @@
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#ifndef BRIDGE_GUI_PCH_H
#define BRIDGE_GUI_PCH_H
#include <QtCore>
#include <QtQuick>
#include <QtQml>
#include <QtQuickControls2>
#include <AppController.h>
#endif // BRIDGE_GUI_PCH_H

View File

@ -16,8 +16,8 @@
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#ifndef BRIDGE_QT6_QMLBACKEND_H
#define BRIDGE_QT6_QMLBACKEND_H
#ifndef BRIDGE_GUI_QMLBACKEND_H
#define BRIDGE_GUI_QMLBACKEND_H
#include <grpcpp/support/status.h>
@ -221,4 +221,4 @@ private: // data members
};
#endif // BRIDGE_QT6_QMLBACKEND_H
#endif // BRIDGE_GUI_QMLBACKEND_H

View File

@ -16,8 +16,8 @@
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#ifndef BRIDGE_QT6_USER_H
#define BRIDGE_QT6_USER_H
#ifndef BRIDGE_GUI_USER_H
#define BRIDGE_GUI_USER_H
#include "Log.h"
@ -90,4 +90,4 @@ private:
typedef std::shared_ptr<User> SPUser;
#endif // BRIDGE_QT6_USER_H
#endif // BRIDGE_GUI_USER_H

View File

@ -16,8 +16,8 @@
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#ifndef BRIDGE_QT6_USER_LIST_H
#define BRIDGE_QT6_USER_LIST_H
#ifndef BRIDGE_GUI_USER_LIST_H
#define BRIDGE_GUI_USER_LIST_H
#include "User.h"
@ -61,4 +61,4 @@ private: // data members
};
#endif // BRIDGE_QT6_USER_LIST_H
#endif // BRIDGE_GUI_USER_LIST_H

View File

@ -1,6 +1,24 @@
#ifndef VERSION_H
#define VERSION_H
// Copyright (c) 2022 Proton AG
//
// This file is part of Proton Mail Bridge.
//
// Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#ifndef BRIDGE_GUI_VERSION_H
#define BRIDGE_GUI_VERSION_H
#define PROJECT_VER "@BRIDGE_APP_VERSION@"
#endif // VERSION_H
#endif // BRIDGE_GUI_VERSION_H

View File

@ -16,8 +16,8 @@
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#ifndef BRIDGE_QT6_OVERSEER_H
#define BRIDGE_QT6_OVERSEER_H
#ifndef BRIDGE_GUI_OVERSEER_H
#define BRIDGE_GUI_OVERSEER_H
#include "Worker.h"
@ -53,4 +53,4 @@ typedef std::unique_ptr<Overseer> UPOverseer; ///< Type definition for unique po
typedef std::shared_ptr<Overseer> SPOverseer; ///< Type definition for shared pointer to Overseer.
#endif //BRIDGE_QT6_OVERSEER_H
#endif //BRIDGE_GUI_OVERSEER_H

View File

@ -16,8 +16,8 @@
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#ifndef BRIDGE_QT6_WORKER_H
#define BRIDGE_QT6_WORKER_H
#ifndef BRIDGE_GUI_WORKER_H
#define BRIDGE_GUI_WORKER_H
//****************************************************************************************************************************************************
/// \brief Pure virtual class for worker intended to perform a threaded operation.
@ -43,4 +43,4 @@ signals:
};
#endif //BRIDGE_QT6_WORKER_H
#endif //BRIDGE_GUI_WORKER_H