RhythmGame 1.4.3
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | Properties | List of all members
qml_components::ReplayImportOperation Class Referencefinal

Tracks the progress of an asynchronous replay import. More...

#include <ReplayImportOperation.h>

Inheritance diagram for qml_components::ReplayImportOperation:
Inheritance graph
[legend]
Collaboration diagram for qml_components::ReplayImportOperation:
Collaboration graph
[legend]

Public Types

enum  Roles { MessageRole = Qt::UserRole }
 

Signals

void progressChanged ()
 
void finishedChanged ()
 
void countChanged ()
 
void error (const QString &message)
 

Public Member Functions

 ReplayImportOperation (int total, QObject *parent=nullptr)
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
QHash< int, QByteArray > roleNames () const override
 
auto getDone () const -> int
 
auto getTotal () const -> int
 
auto getImported () const -> int
 
auto getSkipped () const -> int
 
auto getErrored () const -> int
 
auto isFinished () const -> bool
 
void setTotal (int total)
 
void finish ()
 
void fail (const QString &message)
 
void incrementImported ()
 
void incrementSkipped ()
 
void incrementErrored ()
 
void reportError (const QString &message)
 

Properties

QML_ELEMENTint done
 
int total
 
int imported
 
int skipped
 
int errored
 
bool finished
 
int count
 

Detailed Description

Tracks the progress of an asynchronous replay import.

Each processed file (whether imported, skipped, or failed) increments done toward total. The error() signal fires for each failure without halting the operation.

Member Enumeration Documentation

◆ Roles

Enumerator
MessageRole 

Constructor & Destructor Documentation

◆ ReplayImportOperation()

qml_components::ReplayImportOperation::ReplayImportOperation ( int  total,
QObject *  parent = nullptr 
)
explicit

Member Function Documentation

◆ countChanged

void qml_components::ReplayImportOperation::countChanged ( )
signal

◆ data()

QVariant qml_components::ReplayImportOperation::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

◆ error

void qml_components::ReplayImportOperation::error ( const QString &  message)
signal

◆ fail()

void qml_components::ReplayImportOperation::fail ( const QString &  message)

Reports a fatal worker failure and finishes the operation (main thread).

◆ finish()

void qml_components::ReplayImportOperation::finish ( )

Called on the main thread after the worker has committed all its saves.

◆ finishedChanged

void qml_components::ReplayImportOperation::finishedChanged ( )
signal

◆ getDone()

auto qml_components::ReplayImportOperation::getDone ( ) const -> int
inline

◆ getErrored()

auto qml_components::ReplayImportOperation::getErrored ( ) const -> int
inline

◆ getImported()

auto qml_components::ReplayImportOperation::getImported ( ) const -> int
inline

◆ getSkipped()

auto qml_components::ReplayImportOperation::getSkipped ( ) const -> int
inline

◆ getTotal()

auto qml_components::ReplayImportOperation::getTotal ( ) const -> int
inline

◆ incrementErrored()

void qml_components::ReplayImportOperation::incrementErrored ( )

Called on the main thread when a replay failed to import.

◆ incrementImported()

void qml_components::ReplayImportOperation::incrementImported ( )

Called on the main thread when a replay was successfully saved.

◆ incrementSkipped()

void qml_components::ReplayImportOperation::incrementSkipped ( )

Called on the main thread when a replay was already present and skipped.

◆ isFinished()

auto qml_components::ReplayImportOperation::isFinished ( ) const -> bool
inline

◆ progressChanged

void qml_components::ReplayImportOperation::progressChanged ( )
signal

◆ reportError()

void qml_components::ReplayImportOperation::reportError ( const QString &  message)

Emits the error() signal with the given message (main thread).

◆ roleNames()

QHash< int, QByteArray > qml_components::ReplayImportOperation::roleNames ( ) const
override

◆ rowCount()

int qml_components::ReplayImportOperation::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

◆ setTotal()

void qml_components::ReplayImportOperation::setTotal ( int  total)

Called on the main thread after discovering the work to import.

Property Documentation

◆ count

int qml_components::ReplayImportOperation::count
read

◆ done

QML_ELEMENTint qml_components::ReplayImportOperation::done
read

◆ errored

int qml_components::ReplayImportOperation::errored
read

◆ finished

bool qml_components::ReplayImportOperation::finished
read

◆ imported

int qml_components::ReplayImportOperation::imported
read

◆ skipped

int qml_components::ReplayImportOperation::skipped
read

◆ total

int qml_components::ReplayImportOperation::total
read

The documentation for this class was generated from the following files: