ThunarVfsJob

ThunarVfsJob

Functions

Signals

ThunarVfsJobResponse ask No Hooks
ThunarVfsJobResponse ask-replace No Hooks
void error No Hooks
void finished No Hooks
void info-message No Hooks
gboolean infos-ready No Hooks
void new-files No Hooks
void percent No Hooks

Types and Values

Object Hierarchy

    GObject
    ╰── ThunarVfsJob

Includes

#include <thunar-vfs/thunar-vfs.h>

Description

Functions

thunar_vfs_job_launch ()

ThunarVfsJob *
thunar_vfs_job_launch (ThunarVfsJob *job);

This functions schedules job to be run as soon as possible, in a separate thread.

Parameters

job

a ThunarVfsJob.

 

Returns

a pointer to job .


thunar_vfs_job_cancel ()

void
thunar_vfs_job_cancel (ThunarVfsJob *job);

Attempts to cancel the operation currently performed by job . Even after the cancellation of job , it may still emit signals, so you must take care of disconnecting all handlers appropriately if you cannot handle signals after cancellation.

Parameters

job

a ThunarVfsJob.

 

thunar_vfs_job_cancelled ()

gboolean
thunar_vfs_job_cancelled (const ThunarVfsJob *job);

Checks whether job was previously cancelled by a call to thunar_vfs_job_cancel().

Parameters

job

a ThunarVfsJob.

 

Returns

TRUE if job is cancelled.

Types and Values

enum ThunarVfsJobResponse

Possible responses for the ThunarVfsJob::ask signal.

Members

THUNAR_VFS_JOB_RESPONSE_YES

   

THUNAR_VFS_JOB_RESPONSE_YES_ALL

   

THUNAR_VFS_JOB_RESPONSE_NO

   

THUNAR_VFS_JOB_RESPONSE_CANCEL

   

THUNAR_VFS_JOB_RESPONSE_NO_ALL

   

THUNAR_VFS_JOB_RESPONSE_RETRY

   

struct ThunarVfsJob

struct ThunarVfsJob;

Signal Details

The “ask” signal

ThunarVfsJobResponse
user_function (ThunarVfsJob        *job,
               gchar               *message,
               ThunarVfsJobResponse choices,
               gpointer             user_data)

The message is garantied to contain valid UTF-8.

Parameters

job

a ThunarVfsJob.

 

message

question to display to the user.

 

choices

a combination of ThunarVfsInteractiveJobResponses.

 

user_data

user data set when the signal handler was connected.

 

Returns

the selected choice.

Flags: No Hooks


The “ask-replace” signal

ThunarVfsJobResponse
user_function (ThunarVfsJob  *job,
               ThunarVfsInfo *src_info,
               ThunarVfsInfo *dst_info,
               gpointer       user_data)

Emitted to ask the user whether the destination file should be replaced by the source file.

Parameters

job

a ThunarVfsJob.

 

src_info

the ThunarVfsInfo of the source file.

 

dst_info

the ThunarVfsInfo of the destination file, that may be replaced with the source file.

 

user_data

user data set when the signal handler was connected.

 

Returns

the selected choice.

Flags: No Hooks

Since: 0.8.1


The “error” signal

void
user_function (ThunarVfsJob *job,
               gpointer      error,
               gpointer      user_data)

Emitted whenever an error occurs while executing the job .

Parameters

job

a ThunarVfsJob.

 

error

a GError describing the cause.

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks


The “finished” signal

void
user_function (ThunarVfsJob *job,
               gpointer      user_data)

This signal will be automatically emitted once the job finishes its execution, no matter whether job completed successfully or was cancelled by the user.

Parameters

job

a ThunarVfsJob.

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks


The “info-message” signal

void
user_function (ThunarVfsJob *job,
               gchar        *message,
               gpointer      user_data)

This signal is emitted to display information about the job . Examples of messages are "Preparing..." or "Cleaning up...".

The message is garantied to contain valid UTF-8, so it can be displayed by GtkWidgets out of the box.

Parameters

job

a ThunarVfsJob.

 

message

information to be displayed about job .

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks


The “infos-ready” signal

gboolean
user_function (ThunarVfsJob *job,
               gpointer      info_list,
               gpointer      user_data)

This signal is used by ThunarVfsJobs returned by the thunar_vfs_listdir() function whenever there's a bunch of ThunarVfsInfos ready. This signal is garantied to be never emitted with an info_list parameter of NULL.

To allow some further optimizations on the handler-side, the handler is allowed to take over ownership of the info_list , i.e. it can reuse the infos list and just replace the data elements with it's own objects based on the ThunarVfsInfos contained within the info_list (and of course properly unreffing the previously contained infos). If a handler takes over ownership of info_list it must return TRUE here, and no further handlers will be run. Else, if the handler doesn't want to take over ownership of infos , it must return FALSE, and other handlers will be run. Use this feature with care, and only if you can be sure that you are the only handler connected to this signal for a given job!

Parameters

job

a ThunarVfsJob.

 

info_list

a list of ThunarVfsInfos.

 

user_data

user data set when the signal handler was connected.

 

Returns

TRUE if the handler took over ownership of info_list , else FALSE.

Flags: No Hooks


The “new-files” signal

void
user_function (ThunarVfsJob *job,
               gpointer      path_list,
               gpointer      user_data)

This signal is emitted by the job right before the job is terminated and informs the application about the list of created files in path_list . path_list contains only the toplevel path items, that were specified by the application on creation of the job .

Parameters

job

a ThunarVfsJob.

 

path_list

a list of ThunarVfsPaths that were created by job .

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks


The “percent” signal

void
user_function (ThunarVfsJob *job,
               gdouble       percent,
               gpointer      user_data)

This signal is emitted to present the state of the overall progress.

The percent value is garantied to be in the range 0.0 to 100.0.

Parameters

job

a ThunarVfsJob.

 

percent

the percentage of completeness.

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks