[libcalamaresui] Unrelated typedef for JobList

This commit is contained in:
Adriaan de Groot 2017-11-03 10:10:37 -04:00
parent eed207ae2e
commit 2d31e987c0
20 changed files with 31 additions and 29 deletions

View file

@ -46,7 +46,7 @@ public:
#endif #endif
} }
void setJobs( const QList< job_ptr >& jobs ) void setJobs( const JobList& jobs )
{ {
m_jobs = jobs; m_jobs = jobs;
} }
@ -73,7 +73,7 @@ public:
} }
private: private:
QList< job_ptr > m_jobs; JobList m_jobs;
JobQueue* m_queue; JobQueue* m_queue;
int m_jobIndex; int m_jobIndex;
@ -164,7 +164,7 @@ JobQueue::enqueue( const job_ptr& job )
void void
JobQueue::enqueue( const QList< job_ptr >& jobs ) JobQueue::enqueue( const JobList& jobs )
{ {
Q_ASSERT( !m_thread->isRunning() ); Q_ASSERT( !m_thread->isRunning() );
m_jobs.append( jobs ); m_jobs.append( jobs );

View file

@ -42,11 +42,11 @@ public:
GlobalStorage* globalStorage() const; GlobalStorage* globalStorage() const;
void enqueue( const job_ptr& job ); void enqueue( const job_ptr& job );
void enqueue( const QList< job_ptr >& jobs ); void enqueue( const JobList& jobs );
void start(); void start();
signals: signals:
void queueChanged( const QList< job_ptr >& jobs ); void queueChanged( const JobList& jobs );
void progress( qreal percent, const QString& prettyName ); void progress( qreal percent, const QString& prettyName );
void finished(); void finished();
void failed( const QString& message, const QString& details ); void failed( const QString& message, const QString& details );
@ -54,7 +54,7 @@ signals:
private: private:
static JobQueue* s_instance; static JobQueue* s_instance;
QList< job_ptr > m_jobs; JobList m_jobs;
JobThread* m_thread; JobThread* m_thread;
GlobalStorage* m_storage; GlobalStorage* m_storage;
}; };

View file

@ -19,6 +19,7 @@
#ifndef TYPEDEFS_H #ifndef TYPEDEFS_H
#define TYPEDEFS_H #define TYPEDEFS_H
#include <QList>
#include <QSharedPointer> #include <QSharedPointer>
namespace Calamares namespace Calamares
@ -26,6 +27,7 @@ namespace Calamares
class Job; class Job;
typedef QSharedPointer< Job > job_ptr; typedef QSharedPointer< Job > job_ptr;
using JobList = QList< job_ptr >;
enum ModuleAction : char enum ModuleAction : char
{ {

View file

@ -148,10 +148,10 @@ ExecutionViewStep::onActivate()
} }
QList< Calamares::job_ptr > JobList
ExecutionViewStep::jobs() const ExecutionViewStep::jobs() const
{ {
return QList< Calamares::job_ptr >(); return JobList();
} }

View file

@ -52,7 +52,7 @@ public:
void onActivate() override; void onActivate() override;
QList< job_ptr > jobs() const override; JobList jobs() const override;
void appendJobModuleInstanceKey( const QString& instanceKey ); void appendJobModuleInstanceKey( const QString& instanceKey );

View file

@ -75,10 +75,10 @@ CppJobModule::loadSelf()
} }
QList< job_ptr > JobList
CppJobModule::jobs() const CppJobModule::jobs() const
{ {
return QList< job_ptr >() << m_job; return JobList() << m_job;
} }

View file

@ -36,7 +36,7 @@ public:
Interface interface() const override; Interface interface() const override;
void loadSelf() override; void loadSelf() override;
QList< job_ptr > jobs() const override; JobList jobs() const override;
protected: protected:
void initFrom( const QVariantMap& moduleDescriptor ) override; void initFrom( const QVariantMap& moduleDescriptor ) override;

View file

@ -70,7 +70,6 @@ public:
ProcessInterface, ProcessInterface,
PythonQtInterface PythonQtInterface
}; };
virtual ~Module();
/** /**
* @brief fromDescriptor creates a new Module object of the correct type. * @brief fromDescriptor creates a new Module object of the correct type.
@ -84,6 +83,7 @@ public:
const QString& instanceId, const QString& instanceId,
const QString& configFileName, const QString& configFileName,
const QString& moduleDirectory ); const QString& moduleDirectory );
virtual ~Module();
/** /**
* @brief name returns the name of this module. * @brief name returns the name of this module.
@ -159,7 +159,7 @@ public:
* @brief jobs returns any jobs exposed by this module. * @brief jobs returns any jobs exposed by this module.
* @return a list of jobs (can be empty). * @return a list of jobs (can be empty).
*/ */
virtual QList< job_ptr > jobs() const = 0; virtual JobList jobs() const = 0;
/** /**
* @brief configurationMap returns the contents of the configuration file for * @brief configurationMap returns the contents of the configuration file for

View file

@ -53,10 +53,10 @@ ProcessJobModule::loadSelf()
} }
QList< job_ptr > JobList
ProcessJobModule::jobs() const ProcessJobModule::jobs() const
{ {
return QList< job_ptr >() << m_job; return JobList() << m_job;
} }

View file

@ -34,7 +34,7 @@ public:
Interface interface() const override; Interface interface() const override;
void loadSelf() override; void loadSelf() override;
QList< job_ptr > jobs() const override; JobList jobs() const override;
protected: protected:
void initFrom( const QVariantMap& moduleDescriptor ) override; void initFrom( const QVariantMap& moduleDescriptor ) override;

View file

@ -53,10 +53,10 @@ PythonJobModule::loadSelf()
} }
QList< job_ptr > JobList
PythonJobModule::jobs() const PythonJobModule::jobs() const
{ {
return QList< job_ptr >() << m_job; return JobList() << m_job;
} }

View file

@ -32,7 +32,7 @@ public:
Interface interface() const override; Interface interface() const override;
void loadSelf() override; void loadSelf() override;
QList< job_ptr > jobs() const override; JobList jobs() const override;
protected: protected:
void initFrom( const QVariantMap& moduleDescriptor ) override; void initFrom( const QVariantMap& moduleDescriptor ) override;

View file

@ -171,7 +171,7 @@ PythonQtViewModule::loadSelf()
} }
QList< job_ptr > JobList
PythonQtViewModule::jobs() const PythonQtViewModule::jobs() const
{ {
return m_viewStep->jobs(); return m_viewStep->jobs();

View file

@ -33,7 +33,7 @@ public:
Interface interface() const override; Interface interface() const override;
void loadSelf() override; void loadSelf() override;
QList< job_ptr > jobs() const override; JobList jobs() const override;
protected: protected:
void initFrom( const QVariantMap& moduleDescriptor ) override; void initFrom( const QVariantMap& moduleDescriptor ) override;

View file

@ -76,7 +76,7 @@ ViewModule::loadSelf()
} }
QList< job_ptr > JobList
ViewModule::jobs() const ViewModule::jobs() const
{ {
return m_viewStep->jobs(); return m_viewStep->jobs();

View file

@ -37,7 +37,7 @@ public:
Interface interface() const override; Interface interface() const override;
void loadSelf() override; void loadSelf() override;
QList< job_ptr > jobs() const override; JobList jobs() const override;
protected: protected:
void initFrom( const QVariantMap& moduleDescriptor ) override; void initFrom( const QVariantMap& moduleDescriptor ) override;

View file

@ -62,7 +62,7 @@ DebugWindow::DebugWindow()
// JobQueue page // JobQueue page
jobQueueText->setReadOnly( true ); jobQueueText->setReadOnly( true );
connect( JobQueue::instance(), &JobQueue::queueChanged, connect( JobQueue::instance(), &JobQueue::queueChanged,
this, [ this ]( const QList< Calamares::job_ptr >& jobs ) this, [ this ]( const JobList& jobs )
{ {
QStringList text; QStringList text;
for ( const auto &job : jobs ) for ( const auto &job : jobs )

View file

@ -159,10 +159,10 @@ PythonQtViewStep::isAtEnd() const
} }
QList< Calamares::job_ptr > JobList
PythonQtViewStep::jobs() const PythonQtViewStep::jobs() const
{ {
QList< Calamares::job_ptr > jobs; JobList jobs;
PythonQtObjectPtr jobsCallable = PythonQt::self()->lookupCallable( m_obj, "jobs" ); PythonQtObjectPtr jobsCallable = PythonQt::self()->lookupCallable( m_obj, "jobs" );
if ( jobsCallable.isNull() ) if ( jobsCallable.isNull() )

View file

@ -46,7 +46,7 @@ public:
bool isAtBeginning() const override; bool isAtBeginning() const override;
bool isAtEnd() const override; bool isAtEnd() const override;
QList< Calamares::job_ptr > jobs() const override; JobList jobs() const override;
void setConfigurationMap( const QVariantMap& configurationMap ) override; void setConfigurationMap( const QVariantMap& configurationMap ) override;

View file

@ -91,7 +91,7 @@ public:
*/ */
virtual void onLeave(); virtual void onLeave();
virtual QList< job_ptr > jobs() const = 0; virtual JobList jobs() const = 0;
void setModuleInstanceKey( const QString& instanceKey ); void setModuleInstanceKey( const QString& instanceKey );
QString moduleInstanceKey() const QString moduleInstanceKey() const