i18n: drop superfluous QObject* parent
These additional pointers were introduced for translations, and needed their own tricks to get lupdate to recognize the strings. Using QCoreApplication::translate() removes the need to a QObject to provide context. Drop the now-unneeded parameters.
This commit is contained in:
parent
c71385e93f
commit
d27675d660
@ -82,7 +82,7 @@ ProcessJob::exec()
|
||||
QString(),
|
||||
m_timeoutSec );
|
||||
|
||||
return CalamaresUtils::ProcessResult::explainProcess( this, ec, m_command, output, m_timeoutSec );
|
||||
return CalamaresUtils::ProcessResult::explainProcess( ec, m_command, output, m_timeoutSec );
|
||||
}
|
||||
|
||||
|
||||
|
@ -252,7 +252,7 @@ System::doChroot() const
|
||||
}
|
||||
|
||||
Calamares::JobResult
|
||||
ProcessResult::explainProcess( const QObject* parent, int ec, const QString& command, const QString& output, int timeout )
|
||||
ProcessResult::explainProcess( int ec, const QString& command, const QString& output, int timeout )
|
||||
{
|
||||
using Calamares::JobResult;
|
||||
|
||||
|
@ -41,7 +41,6 @@ public:
|
||||
|
||||
/** @brief Explain a typical external process failure.
|
||||
*
|
||||
* @param parent Used as context for translation calls.
|
||||
* @param errorCode Return code from runCommand() or similar
|
||||
* (negative values get special explanation). The member
|
||||
* function uses the exit code stored in the ProcessResult
|
||||
@ -53,18 +52,18 @@ public:
|
||||
* @param timeout Timeout passed to the process runner, for explaining
|
||||
* error code -4 (timeout).
|
||||
*/
|
||||
static Calamares::JobResult explainProcess( const QObject* parent, int errorCode, const QString& command, const QString& output, int timeout );
|
||||
static Calamares::JobResult explainProcess( int errorCode, const QString& command, const QString& output, int timeout );
|
||||
|
||||
/// @brief Convenience wrapper for explainProcess()
|
||||
inline Calamares::JobResult explainProcess( const QObject* parent, const QString& command, int timeout ) const
|
||||
inline Calamares::JobResult explainProcess( const QString& command, int timeout ) const
|
||||
{
|
||||
return explainProcess( parent, getExitCode(), command, getOutput(), timeout );
|
||||
return explainProcess( getExitCode(), command, getOutput(), timeout );
|
||||
}
|
||||
|
||||
/// @brief Convenience wrapper for explainProcess()
|
||||
inline Calamares::JobResult explainProcess( const QObject* parent, const QStringList& command, int timeout ) const
|
||||
inline Calamares::JobResult explainProcess( const QStringList& command, int timeout ) const
|
||||
{
|
||||
return explainProcess( parent, getExitCode(), command.join( ' ' ), getOutput(), timeout );
|
||||
return explainProcess( getExitCode(), command.join( ' ' ), getOutput(), timeout );
|
||||
}
|
||||
} ;
|
||||
|
||||
|
@ -98,7 +98,7 @@ CommandList::~CommandList()
|
||||
{
|
||||
}
|
||||
|
||||
Calamares::JobResult CommandList::run( const QObject* parent )
|
||||
Calamares::JobResult CommandList::run()
|
||||
{
|
||||
System::RunLocation location = m_doChroot ? System::RunLocation::RunInTarget : System::RunLocation::RunInHost;
|
||||
|
||||
@ -139,7 +139,7 @@ Calamares::JobResult CommandList::run( const QObject* parent )
|
||||
if ( suppress_result )
|
||||
cDebug() << "Error code" << r.getExitCode() << "ignored by CommandList configuration.";
|
||||
else
|
||||
return r.explainProcess( parent, processed_cmd, timeout );
|
||||
return r.explainProcess( processed_cmd, timeout );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ public:
|
||||
return m_doChroot;
|
||||
}
|
||||
|
||||
Calamares::JobResult run( const QObject* parent );
|
||||
Calamares::JobResult run();
|
||||
|
||||
using CommandList_t::isEmpty;
|
||||
using CommandList_t::count;
|
||||
|
@ -85,7 +85,7 @@ ContextualProcessJob::exec()
|
||||
{
|
||||
if ( gs->contains( binding->variable ) && ( gs->value( binding->variable ).toString() == binding->value ) )
|
||||
{
|
||||
Calamares::JobResult r = binding->commands->run( this );
|
||||
Calamares::JobResult r = binding->commands->run();
|
||||
if ( !r )
|
||||
return r;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ ShellProcessJob::exec()
|
||||
return Calamares::JobResult::ok();
|
||||
}
|
||||
|
||||
return m_commands->run( this );
|
||||
return m_commands->run();
|
||||
}
|
||||
|
||||
|
||||
|
@ -144,7 +144,7 @@ public:
|
||||
* It is used under the terms of the GNU GPL v3 or later, as
|
||||
* allowed by the libpwquality license (LICENSES/GPLv2+-libpwquality)
|
||||
*/
|
||||
QString explanation( QWidget* parent )
|
||||
QString explanation()
|
||||
{
|
||||
void* auxerror = m_auxerror;
|
||||
m_auxerror = nullptr;
|
||||
@ -312,9 +312,9 @@ DEFINE_CHECK_FUNC( libpwquality )
|
||||
{
|
||||
checks.push_back(
|
||||
PasswordCheck(
|
||||
[parent,settings]()
|
||||
[settings]()
|
||||
{
|
||||
return settings->explanation( parent );
|
||||
return settings->explanation();
|
||||
},
|
||||
[settings]( const QString& s )
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ using PasswordCheckList = QVector<PasswordCheck>;
|
||||
* an error, though).
|
||||
*/
|
||||
#define _xDEFINE_CHECK_FUNC(x) \
|
||||
add_check_##x( QWidget* parent, PasswordCheckList& checks, const QVariant& value )
|
||||
add_check_##x( PasswordCheckList& checks, const QVariant& value )
|
||||
#define DEFINE_CHECK_FUNC(x) void _xDEFINE_CHECK_FUNC(x)
|
||||
#define DECLARE_CHECK_FUNC(x) void _xDEFINE_CHECK_FUNC(x);
|
||||
|
||||
|
@ -462,16 +462,16 @@ UsersPage::addPasswordCheck( const QString& key, const QVariant& value )
|
||||
{
|
||||
if ( key == "minLength" )
|
||||
{
|
||||
add_check_minLength( this, m_passwordChecks, value );
|
||||
add_check_minLength( m_passwordChecks, value );
|
||||
}
|
||||
else if ( key == "maxLength" )
|
||||
{
|
||||
add_check_maxLength( this, m_passwordChecks, value );
|
||||
add_check_maxLength( m_passwordChecks, value );
|
||||
}
|
||||
#ifdef CHECK_PWQUALITY
|
||||
else if ( key == "libpwquality" )
|
||||
{
|
||||
add_check_libpwquality( this, m_passwordChecks, value );
|
||||
add_check_libpwquality( m_passwordChecks, value );
|
||||
}
|
||||
#endif
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user