From 7057081bdff9fa1110f9abca9b28360462836972 Mon Sep 17 00:00:00 2001 From: Anubhav Choudhary Date: Wed, 10 Feb 2021 14:38:26 +0530 Subject: [PATCH] QUrl for serverURL + renames --- src/libcalamaresui/Branding.h | 5 +++-- src/libcalamaresui/ViewManager.cpp | 12 ++++++------ src/libcalamaresui/utils/Paste.cpp | 4 ++-- src/libcalamaresui/utils/Paste.h | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/libcalamaresui/Branding.h b/src/libcalamaresui/Branding.h index 493579a34..2afb8edc2 100644 --- a/src/libcalamaresui/Branding.h +++ b/src/libcalamaresui/Branding.h @@ -23,6 +23,7 @@ #include #include #include +#include namespace YAML { @@ -219,7 +220,7 @@ public: //Paste functionality related QString uploadServerType() { return m_uploadServerType; }; - QString uploadServerURL() { return m_uploadServerURL; }; + QUrl uploadServerURL() { return m_uploadServerURL; }; int uploadServerPort() { return m_uploadServerPort; }; public slots: @@ -270,7 +271,7 @@ private: bool m_welcomeExpandingLogo; QString m_uploadServerType; - QString m_uploadServerURL; + QUrl m_uploadServerURL; int m_uploadServerPort; WindowExpansion m_windowExpansion; diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index ae2460c37..3ffd3b43c 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -141,8 +141,8 @@ ViewManager::insertViewStep( int before, ViewStep* step ) void ViewManager::onInstallationFailed( const QString& message, const QString& details ) { - QString UploadServerType = Calamares::Branding::instance()->uploadServerType(); - bool shouldOfferWebPaste = CalamaresUtils::UploadServersList.contains( UploadServerType ); + QString serverType = Calamares::Branding::instance()->uploadServerType(); + bool shouldOfferWebPaste = CalamaresUtils::UploadServersList.contains( serverType ); cError() << "Installation failed:"; cDebug() << "- message:" << message; @@ -186,10 +186,10 @@ ViewManager::onInstallationFailed( const QString& message, const QString& detail if ( msgBox->buttonRole( button ) == QMessageBox::ButtonRole::YesRole ) { QString pasteUrlMsg; - QString UploadServerType = Calamares::Branding::instance()->uploadServerType(); - if ( UploadServerType == "fiche" ) + QString serverType = Calamares::Branding::instance()->uploadServerType(); + if ( serverType == "fiche" ) { - pasteUrlMsg = CalamaresUtils::sendLogToPastebin( msgBox ); + pasteUrlMsg = CalamaresUtils::ficheLogUpload( msgBox ); } else { @@ -545,7 +545,7 @@ ViewManager::updateBackAndNextVisibility( bool visible ) UPDATE_BUTTON_PROPERTY( backAndNextVisible, visible ) } -QVariant +QVariant ViewManager::data( const QModelIndex& index, int role ) const { if ( !index.isValid() ) diff --git a/src/libcalamaresui/utils/Paste.cpp b/src/libcalamaresui/utils/Paste.cpp index 269876017..2fea0806e 100644 --- a/src/libcalamaresui/utils/Paste.cpp +++ b/src/libcalamaresui/utils/Paste.cpp @@ -30,10 +30,10 @@ QStringList UploadServersList = { }; QString -sendLogToPastebin( QObject* parent ) +ficheLogUpload( QObject* parent ) { - const QString& ficheHost = Calamares::Branding::instance()->uploadServerURL(); + const QString& ficheHost = Calamares::Branding::instance()->uploadServerURL().toString(); quint16 fichePort = Calamares::Branding::instance()->uploadServerPort(); QString pasteUrlFmt = parent->tr( "Install log posted to\n\n%1\n\nLink copied to clipboard" ); diff --git a/src/libcalamaresui/utils/Paste.h b/src/libcalamaresui/utils/Paste.h index 69adfa99c..29e73fc1c 100644 --- a/src/libcalamaresui/utils/Paste.h +++ b/src/libcalamaresui/utils/Paste.h @@ -22,7 +22,7 @@ namespace CalamaresUtils * * Returns the (string) URL that the pastebin gives us. */ -QString sendLogToPastebin( QObject* parent ); +QString ficheLogUpload( QObject* parent ); extern QStringList UploadServersList;