From 1ff854f05d66f03955406098be3549e1a6f69961 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 9 Mar 2021 15:32:46 +0100 Subject: [PATCH] [libcalamaresui] Push upload to a more abstract API - have a namespace Paste with just one entry point, which will handle untangling type &c. This doesn't compile, but indicates the direction to take the API --- src/libcalamaresui/ViewManager.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index 184dceb32..30614fdfa 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -142,8 +142,7 @@ ViewManager::insertViewStep( int before, ViewStep* step ) void ViewManager::onInstallationFailed( const QString& message, const QString& details ) { - QString serverType = Calamares::Branding::instance()->uploadServer( Calamares::Branding::Type ); - bool shouldOfferWebPaste = CalamaresUtils::UploadServersList.contains( serverType ); + bool shouldOfferWebPaste = Calamares::Branding::instance()->uploadServer().first != Calamares::Branding::UploadServerType::None; cError() << "Installation failed:" << message; cDebug() << Logger::SubEntry << "- message:" << message; @@ -186,18 +185,10 @@ ViewManager::onInstallationFailed( const QString& message, const QString& detail msgBox->show(); cDebug() << "Calamares will quit when the dialog closes."; - connect( msgBox, &QMessageBox::buttonClicked, [msgBox, serverType]( QAbstractButton* button ) { + connect( msgBox, &QMessageBox::buttonClicked, [msgBox]( QAbstractButton* button ) { if ( msgBox->buttonRole( button ) == QMessageBox::ButtonRole::YesRole ) { - QString pasteUrlMsg; - if ( serverType == "fiche" ) - { - pasteUrlMsg = CalamaresUtils::ficheLogUpload( msgBox ); - } - else - { - pasteUrlMsg = QString(); - } + QString pasteUrlMsg = CalamaresUtils::Paste::doLogUpload(); QString pasteUrlTitle = tr( "Install Log Paste URL" ); if ( pasteUrlMsg.isEmpty() )