| Top |
| RhythmDBImportJob * | rhythmdb_import_job_new () |
| void | rhythmdb_import_job_add_uri () |
| void | rhythmdb_import_job_start () |
| void | rhythmdb_import_job_cancel () |
| gboolean | rhythmdb_import_job_complete () |
| gboolean | rhythmdb_import_job_scan_complete () |
| int | rhythmdb_import_job_get_total () |
| int | rhythmdb_import_job_get_imported () |
| int | rhythmdb_import_job_get_processed () |
| RhythmDB * | db | Read / Write / Construct Only |
| RhythmDBEntryType * | entry-type | Read / Write / Construct Only |
| RhythmDBEntryType * | error-type | Read / Write / Construct Only |
| RhythmDBEntryType * | ignore-type | Read / Write / Construct Only |
| void | complete | Run Last |
| void | entry-added | Run Last |
| void | scan-complete | Run Last |
| void | status-changed | Run Last |
Tracks the addition to the database of files under a set of directories, providing status information.
The entry types to use for the database entries added by the import job are specified on creation.
RhythmDBImportJob * rhythmdb_import_job_new (RhythmDB *db,RhythmDBEntryType *entry_type,RhythmDBEntryType *ignore_type,RhythmDBEntryType *error_type);
Creates a new import job with the specified entry types. Before starting the job, the caller must add one or more paths to import.
db |
the RhythmDB object |
|
entry_type |
the RhythmDBEntryType to use for normal entries |
|
ignore_type |
the RhythmDBEntryType to use for ignored files (or NULL to not create ignore entries) |
|
error_type |
the RhythmDBEntryType to use for import error entries (or NULL for none) |
void rhythmdb_import_job_add_uri (RhythmDBImportJob *job,const char *uri);
Adds a URI to import. All files under the specified URI will be imported.
void
rhythmdb_import_job_start (RhythmDBImportJob *job);
Starts the import job. After this method has been called, no more URIs may be added to the import job. May only be called once for a given import job.
void
rhythmdb_import_job_cancel (RhythmDBImportJob *job);
Cancels the import job. The job will cease as soon as possible. More directories may be scanned and more files may be imported before the job actually ceases.
gboolean
rhythmdb_import_job_complete (RhythmDBImportJob *job);
Returns whether the import job is complete.
gboolean
rhythmdb_import_job_scan_complete (RhythmDBImportJob *job);
Returns whether the directory scan phase of the import job is complete.
int
rhythmdb_import_job_get_total (RhythmDBImportJob *job);
Returns the total number of files that will be processed by this import job. This increases as the import directories are scanned.
int
rhythmdb_import_job_get_imported (RhythmDBImportJob *job);
Returns the number of files successfully imported by the import job so far.
int
rhythmdb_import_job_get_processed (RhythmDBImportJob *job);
Returns the number of files processed by the import job so far.
struct RhythmDBImportJobClass {
GObjectClass parent_class;
/* signals */
void (*entry_added) (RhythmDBImportJob *job, RhythmDBEntry *entry);
void (*status_changed) (RhythmDBImportJob *job, int total, int imported);
void (*scan_complete) (RhythmDBImportJob *job, int total);
void (*complete) (RhythmDBImportJob *job, int total);
};
“entry-type” property“entry-type” RhythmDBEntryType *
Entry type to use for entries added by this job.
Flags: Read / Write / Construct Only
“error-type” property“error-type” RhythmDBEntryType *
Entry type to use for import error entries added by this job.
Flags: Read / Write / Construct Only
“ignore-type” property“ignore-type” RhythmDBEntryType *
Entry type to use for ignored entries added by this job.
Flags: Read / Write / Construct Only
“complete” signalvoid user_function (RhythmDBImportJob *job, gint arg1, gpointer user_data)
Emitted when the whole import job is complete.
Flags: Run Last
“entry-added” signalvoid user_function (RhythmDBImportJob *job, RhythmDBEntry *entry, gpointer user_data)
Emitted when an entry has been added to the database by the import job.
job |
||
entry |
the newly added RhythmDBEntry |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“scan-complete” signalvoid user_function (RhythmDBImportJob *job, gint arg1, gpointer user_data)
Emitted when the directory scan is complete. Once the scan is complete, the total number of files to be processed will not change.
Flags: Run Last
“status-changed” signalvoid user_function (RhythmDBImportJob *job, gint total, gint imported, gpointer user_data)
Emitted when the status of the import job has changed.
job |
||
total |
the current total number of files to process |
|
imported |
the current count of files imported |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last