diff --git a/src/libcalamaresui/utils/Paste.cpp b/src/libcalamaresui/utils/Paste.cpp index 2f0cfa143..a61b80b4e 100644 --- a/src/libcalamaresui/utils/Paste.cpp +++ b/src/libcalamaresui/utils/Paste.cpp @@ -126,3 +126,10 @@ CalamaresUtils::Paste::doLogUpload( QObject* parent ) } return QString(); } + +bool +CalamaresUtils::Paste::isEnabled() +{ + auto [ type, serverUrl ] = Calamares::Branding::instance()->uploadServer(); + return type != Calamares::Branding::UploadServerType::None; +} diff --git a/src/libcalamaresui/utils/Paste.h b/src/libcalamaresui/utils/Paste.h index 6258e57a0..c6b0adba8 100644 --- a/src/libcalamaresui/utils/Paste.h +++ b/src/libcalamaresui/utils/Paste.h @@ -18,12 +18,17 @@ namespace CalamaresUtils { namespace Paste { - /** @brief Send the current log file to a pastebin * * Returns the (string) URL that the pastebin gives us. */ QString doLogUpload( QObject* parent ); + +/** @brief Is paste enabled? + * + * Checks the branding instance if paste can be done. + */ +bool isEnabled(); } // namespace Paste } // namespace CalamaresUtils