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

main
Adriaan de Groot 5 years ago
parent 63e61e9924
commit 668921543a

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

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

Loading…
Cancel
Save