[libcalamaresui] Convenience method to check if paste would do anything

This commit is contained in:
Adriaan de Groot 2021-03-19 13:36:40 +01:00
parent 63e61e9924
commit 668921543a
2 changed files with 13 additions and 1 deletions

View File

@ -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;
}

View File

@ -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