From 3c6683bd982f33bc9795bcb76859812a050d3303 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 9 Mar 2021 14:51:59 +0100 Subject: [PATCH] [libcalamaresui] Rip out untyped data about upload server This doesn't compile, but indicates the **type** information desired about the (a) upload server. --- src/libcalamaresui/Branding.h | 23 ++++++++++++++++------- src/libcalamaresui/utils/Paste.h | 5 +---- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/libcalamaresui/Branding.h b/src/libcalamaresui/Branding.h index 87f71e862..52c27bfea 100644 --- a/src/libcalamaresui/Branding.h +++ b/src/libcalamaresui/Branding.h @@ -83,13 +83,16 @@ public: }; Q_ENUM( StyleEntry ) - enum UploadServerEntry : short + /** @brief Supported log-upload servers. + * + * 'None' is here as a fallback. + */ + enum UploadServerType : short { - Type, - URL, - Port + None, + Fiche }; - Q_ENUM( UploadServerEntry ) + Q_ENUM( UploadServerType ) /** @brief Setting for how much the main window may expand. */ enum class WindowExpansion @@ -218,6 +221,13 @@ public: ///@brief Which navigation flavor is configured PanelFlavor navigationFlavor() const { return m_navigationFlavor; } + /** @brief Upload server configuration + * + * This is both the type (which may be none, in which case the URL + * is irrelevant and usually empty) and the URL for the upload. + */ + QPair< UploadServerType, QUrl > uploadServer() const { return m_uploadServer; } + /** * Creates a map called "branding" in the global storage, and inserts an * entry for each of the branding strings. This makes the branding @@ -234,7 +244,6 @@ public slots: QString styleString( StyleEntry styleEntry ) const; QString imagePath( ImageEntry imageEntry ) const; - QString uploadServer( UploadServerEntry uploadServerEntry ) const; PanelSide sidebarSide() const { return m_sidebarSide; } PanelSide navigationSide() const { return m_navigationSide; } @@ -252,7 +261,7 @@ private: QMap< QString, QString > m_strings; QMap< QString, QString > m_images; QMap< QString, QString > m_style; - QMap< QString, QString > m_uploadServer; + QPair< UploadServerType, QUrl > m_uploadServer; /* The slideshow can be done in one of two ways: * - as a sequence of images diff --git a/src/libcalamaresui/utils/Paste.h b/src/libcalamaresui/utils/Paste.h index cde1f1841..784f2f28a 100644 --- a/src/libcalamaresui/utils/Paste.h +++ b/src/libcalamaresui/utils/Paste.h @@ -10,10 +10,9 @@ #ifndef UTILS_PASTE_H #define UTILS_PASTE_H -#include +#include class QObject; -class QString; namespace CalamaresUtils { @@ -24,8 +23,6 @@ namespace CalamaresUtils */ QString ficheLogUpload( QObject* parent ); -extern QStringList UploadServersList; - } // namespace CalamaresUtils #endif