ThunarFolder: Thunar Internal Functions Reference Manual

## ThunarFolder ThunarFolder |

## Functions

ThunarFolder * | thunar_folder_get_for_file ()
ThunarFile * | thunar_folder_get_corresponding_file ()
GList * | thunar_folder_get_files ()
gboolean | thunar_folder_get_loading ()
gboolean | thunar_folder_has_folder_monitor ()
void | thunar_folder_reload ()

## Properties

ThunarFile * | corresponding-file | Read / Write / Construct Only
gboolean | loading | Read

## Signals

void | destroy | No Hooks
void | error | Run Last
void | files-added | Run Last
void | files-removed | Run Last

## Object Hierarchy

        GObject
        ╰── ThunarFolder

## Description

## Functions

### thunar_folder_get_for_file ()

    ThunarFolder *
    thunar_folder_get_for_file (ThunarFile *file);

Opens the specified `file` as ThunarFolder and returns a reference to the folder.

The caller is responsible to free the returned object using `g_object_unref()` when no longer needed.

#### Parameters

file | a ThunarFile. |

#### Returns

the ThunarFolder which corresponds to `file` .

### thunar_folder_get_corresponding_file ()

    ThunarFile *
    thunar_folder_get_corresponding_file (const ThunarFolder *folder);

Returns the ThunarFile corresponding to this `folder` .

No reference is taken on the returned ThunarFile for the caller, so if you need a persistent reference to the file, you'll have to call `g_object_ref()` yourself.

#### Parameters

folder | a ThunarFolder instance. |

#### Returns

the ThunarFile corresponding to `folder` .

### thunar_folder_get_files ()

    GList *
    thunar_folder_get_files (const ThunarFolder *folder);

Returns the list of files currently known for `folder` . The content of the list is owned by the hash table and should not be modified or freed. Use `g_list_free()` when done using the list. The caller of the function takes ownership of the data container, but not the data inside it.

#### Parameters

folder | a ThunarFolder instance. |

#### Returns

A GList containing all the ThunarFiles inside the hash table. Use `g_list_free()` when done using the list.

[transfer container]

### thunar_folder_get_loading ()

    gboolean
    thunar_folder_get_loading (const ThunarFolder *folder);

Tells whether the contents of the `folder` are currently being loaded.

#### Parameters

folder | a ThunarFolder instance. |

#### Returns

`TRUE` if `folder` is loading, else `FALSE`.

### thunar_folder_has_folder_monitor ()

    gboolean
    thunar_folder_has_folder_monitor (const ThunarFolder *folder);

Tells whether the `folder` has a folder monitor running

#### Parameters

folder | a ThunarFolder instance. |

#### Returns

`TRUE` if `folder` has a folder monitor, else `FALSE`.

### thunar_folder_reload ()

    void
    thunar_folder_reload (ThunarFolder *folder,
                          gboolean reload_info);

Tells the `folder` object to reread the directory contents from the underlying media.

#### Parameters

folder | a ThunarFolder instance. |
reload_info | reload all information for the files too |

## Property Details

### The `“corresponding-file”` property

      “corresponding-file”       ThunarFile *

corresponding-file.

Owner: ThunarFolder

Flags: Read / Write / Construct Only

### The `“loading”` property

      “loading”                  gboolean

loading.

Owner: ThunarFolder

Flags: Read

Default value: FALSE

## Signal Details

### The `“destroy”` signal

    void
    user_function (ThunarFolder *folder,
                   gpointer      user_data)

Emitted when the ThunarFolder is destroyed.

#### Parameters

folder | a ThunarFolder. |
user_data | user data set when the signal handler was connected. |

Flags: No Hooks

### The `“error”` signal

    void
    user_function (ThunarFolder *folder,
                   gpointer      error,
                   gpointer      user_data)

Emitted when the ThunarFolder fails to completly load the directory content because of an error.

#### Parameters

folder | a ThunarFolder. |
error | the GError describing the problem. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“files-added”` signal

    void
    user_function (ThunarFolder *thunarfolder,
                   gpointer      arg1,
                   gpointer      user_data)

Emitted by the ThunarFolder whenever new files have been added to a particular folder.

#### Parameters

user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“files-removed”` signal

    void
    user_function (ThunarFolder *thunarfolder,
                   gpointer      arg1,
                   gpointer      user_data)

Emitted by the ThunarFolder whenever a bunch of files is removed from the folder, which means they are not necessarily deleted from disk. This can be used to implement the reload of folders, which take longer to load.

#### Parameters

user_data | user data set when the signal handler was connected. |

Flags: Run Last