QUrl for serverURL + renames

This commit is contained in:
Anubhav Choudhary 2021-02-10 14:38:26 +05:30
parent b4078f3634
commit 7057081bdf
4 changed files with 12 additions and 11 deletions

View File

@ -23,6 +23,7 @@
#include <QPixmap> #include <QPixmap>
#include <QSize> #include <QSize>
#include <QStringList> #include <QStringList>
#include <QUrl>
namespace YAML namespace YAML
{ {
@ -219,7 +220,7 @@ public:
//Paste functionality related //Paste functionality related
QString uploadServerType() { return m_uploadServerType; }; QString uploadServerType() { return m_uploadServerType; };
QString uploadServerURL() { return m_uploadServerURL; }; QUrl uploadServerURL() { return m_uploadServerURL; };
int uploadServerPort() { return m_uploadServerPort; }; int uploadServerPort() { return m_uploadServerPort; };
public slots: public slots:
@ -270,7 +271,7 @@ private:
bool m_welcomeExpandingLogo; bool m_welcomeExpandingLogo;
QString m_uploadServerType; QString m_uploadServerType;
QString m_uploadServerURL; QUrl m_uploadServerURL;
int m_uploadServerPort; int m_uploadServerPort;
WindowExpansion m_windowExpansion; WindowExpansion m_windowExpansion;

View File

@ -141,8 +141,8 @@ ViewManager::insertViewStep( int before, ViewStep* step )
void void
ViewManager::onInstallationFailed( const QString& message, const QString& details ) ViewManager::onInstallationFailed( const QString& message, const QString& details )
{ {
QString UploadServerType = Calamares::Branding::instance()->uploadServerType(); QString serverType = Calamares::Branding::instance()->uploadServerType();
bool shouldOfferWebPaste = CalamaresUtils::UploadServersList.contains( UploadServerType ); bool shouldOfferWebPaste = CalamaresUtils::UploadServersList.contains( serverType );
cError() << "Installation failed:"; cError() << "Installation failed:";
cDebug() << "- message:" << message; cDebug() << "- message:" << message;
@ -186,10 +186,10 @@ ViewManager::onInstallationFailed( const QString& message, const QString& detail
if ( msgBox->buttonRole( button ) == QMessageBox::ButtonRole::YesRole ) if ( msgBox->buttonRole( button ) == QMessageBox::ButtonRole::YesRole )
{ {
QString pasteUrlMsg; QString pasteUrlMsg;
QString UploadServerType = Calamares::Branding::instance()->uploadServerType(); QString serverType = Calamares::Branding::instance()->uploadServerType();
if ( UploadServerType == "fiche" ) if ( serverType == "fiche" )
{ {
pasteUrlMsg = CalamaresUtils::sendLogToPastebin( msgBox ); pasteUrlMsg = CalamaresUtils::ficheLogUpload( msgBox );
} }
else else
{ {
@ -545,7 +545,7 @@ ViewManager::updateBackAndNextVisibility( bool visible )
UPDATE_BUTTON_PROPERTY( backAndNextVisible, visible ) UPDATE_BUTTON_PROPERTY( backAndNextVisible, visible )
} }
QVariant QVariant
ViewManager::data( const QModelIndex& index, int role ) const ViewManager::data( const QModelIndex& index, int role ) const
{ {
if ( !index.isValid() ) if ( !index.isValid() )

View File

@ -30,10 +30,10 @@ QStringList UploadServersList = {
}; };
QString 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(); quint16 fichePort = Calamares::Branding::instance()->uploadServerPort();
QString pasteUrlFmt = parent->tr( "Install log posted to\n\n%1\n\nLink copied to clipboard" ); QString pasteUrlFmt = parent->tr( "Install log posted to\n\n%1\n\nLink copied to clipboard" );

View File

@ -22,7 +22,7 @@ namespace CalamaresUtils
* *
* Returns the (string) URL that the pastebin gives us. * Returns the (string) URL that the pastebin gives us.
*/ */
QString sendLogToPastebin( QObject* parent ); QString ficheLogUpload( QObject* parent );
extern QStringList UploadServersList; extern QStringList UploadServersList;