ThunarRenamerModel: Thunar Internal Functions Reference Manual

## ThunarRenamerModel ThunarRenamerModel |

## Functions

ThunarRenamerModel * | thunar_renamer_model_new ()
ThunarRenamerMode | thunar_renamer_model_get_mode ()
ThunarxRenamer * | thunar_renamer_model_get_renamer ()
void | thunar_renamer_model_set_renamer ()
void | thunar_renamer_model_insert ()
void | thunar_renamer_model_reorder ()
void | thunar_renamer_model_sort ()
void | thunar_renamer_model_clear ()
void | thunar_renamer_model_remove ()
#define | thunar_renamer_model_append()

## Properties

gboolean | can-rename | Read
gboolean | frozen | Read / Write
ThunarRenamerMode | mode | Read / Write
ThunarxRenamer * | renamer | Read / Write

## Types and Values

enum | ThunarRenamerModelColumn

## Object Hierarchy

        GObject
        ╰── ThunarRenamerModel

## Description

## Functions

### thunar_renamer_model_new ()

    ThunarRenamerModel *
    thunar_renamer_model_new (void);

Allocates a new ThunarRenamerModel instance.

#### Returns

the newly allocated ThunarRenamerModel.

### thunar_renamer_model_get_mode ()

    ThunarRenamerMode
    thunar_renamer_model_get_mode (ThunarRenamerModel *renamer_model);

Returns the ThunarRenamerMode currently set for `renamer_model` .

#### Parameters

renamer_model | a ThunarRenamerModel. |

#### Returns

the mode for `renamer_model` .

### thunar_renamer_model_get_renamer ()

    ThunarxRenamer *
    thunar_renamer_model_get_renamer (ThunarRenamerModel *renamer_model);

Returns the ThunarxRenamer currently used by the specified `renamer_model` .

#### Parameters

renamer_model | a ThunarRenamerModel. |

#### Returns

the current renamer for `renamer_model` .

### thunar_renamer_model_set_renamer ()

    void
    thunar_renamer_model_set_renamer (ThunarRenamerModel *renamer_model,
                                      ThunarxRenamer *renamer);

Sets the renamer for `renamer_model` to the specified `renamer` .

#### Parameters

renamer_model | a ThunarRenamerModel. |
renamer | a ThunarxRenamer or `NULL`. |

### thunar_renamer_model_insert ()

    void
    thunar_renamer_model_insert (ThunarRenamerModel *renamer_model,
                                 ThunarFile *file,
                                 gint position);

Inserts the `file` to the `renamer_model` at `position` .

#### Parameters

renamer_model | a ThunarRenamerModel. |
file | the ThunarFile to add to `renamer_model` . |
position | the position in the model. 0 is prepend, -1 is append. |

### thunar_renamer_model_reorder ()

    void
    thunar_renamer_model_reorder (ThunarRenamerModel *renamer_model,
                                  GList *tree_paths,
                                  gint position);

Reorder the treepaths in the model to their new postion in the list and sends an update to the treeview to reorder the list.

#### Parameters

renamer_model | a ThunarRenamerModel. |
tree_paths | the list of GtkTreePath that need to be moved to `position` . |
position | the new position for the list of paths. |

### thunar_renamer_model_sort ()

    void
    thunar_renamer_model_sort (ThunarRenamerModel *renamer_model,
                               GtkSortType sort_order);

Sort the entire model by the old filename.

#### Parameters

renamer_model | a ThunarRenamerModel. |
sort_order | sort direction of the model. |

### thunar_renamer_model_clear ()

    void
    thunar_renamer_model_clear (ThunarRenamerModel *renamer_model);

Clears the `renamer_model` by removing all files from it.

#### Parameters

renamer_model | a ThunarRenamerModel. |

### thunar_renamer_model_remove ()

    void
    thunar_renamer_model_remove (ThunarRenamerModel *renamer_model,
                                 GtkTreePath *path);

Removes the item identified by the given `path` from the `renamer_model` .

#### Parameters

renamer_model | a ThunarRenamerModel. |
path | a GtkTreePath in the `renamer_model` . |

### thunar_renamer_model_append()

    #define thunar_renamer_model_append(model, file) thunar_renamer_model_insert (model, file, -1)

Appends the `file` to the `renamer_model` .

#### Parameters

model | a ThunarRenamerModel. |
file | a ThunarFile instance. |

## Types and Values

### enum ThunarRenamerModelColumn

The column ids provided by ThunarRenamerModel instances.

#### Members

THUNAR_RENAMER_MODEL_COLUMN_CONFLICT | the column which tells whether there's a name conflict. |
THUNAR_RENAMER_MODEL_COLUMN_CONFLICT_WEIGHT | Use to set the text to bold in case of a conflict |
THUNAR_RENAMER_MODEL_COLUMN_FILE | the column with the ThunarFile. |
THUNAR_RENAMER_MODEL_COLUMN_NEWNAME | the column with the new name. |
THUNAR_RENAMER_MODEL_COLUMN_OLDNAME | the column with the old name. |
THUNAR_RENAMER_MODEL_N_COLUMNS |  |

## Property Details

### The `“can-rename”` property

      “can-rename”               gboolean

Whether the contents of the ThunarRenamerModel can be renamed. This is `TRUE` if atleast one file is in the model and no conflict is present.

Owner: ThunarRenamerModel

Flags: Read

Default value: FALSE

### The `“frozen”` property

      “frozen”                   gboolean

If a ThunarRenamerModel is frozen, no updates will be processed for the model and the "can-rename" property will always be `FALSE`.

Owner: ThunarRenamerModel

Flags: Read / Write

Default value: FALSE

### The `“mode”` property

      “mode”                     ThunarRenamerMode

The ThunarRenamerMode used by this ThunarRenamerModel.

Owner: ThunarRenamerModel

Flags: Read / Write

Default value: THUNAR_RENAMER_MODE_NAME

### The `“renamer”` property

      “renamer”                  ThunarxRenamer *

The ThunarxRenamer that should be used by this ThunarRenamerModel.

Owner: ThunarRenamerModel

Flags: Read / Write