## thunar-gobject-extensions

thunar-gobject-extensions

## Functions

#define | G_OBJECT_WARN_INVALID_PROPERTY_ID()
void | thunar_g_initialize_transformations ()
gchar * | thunar_g_strescape ()
gchar * | thunar_g_utf8_normalize_for_search ()
gboolean | thunar_g_app_info_equal ()
void | thunar_g_object_set_guint_data ()

## Description

## Functions

### G_OBJECT_WARN_INVALID_PROPERTY_ID()

    #define G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec) G_STMT_START{ (void)0; }G_STMT_END

### thunar_g_initialize_transformations ()

    void
    thunar_g_initialize_transformations (void);

Registers various transformation functions to the GLib Type System, which are used by `g_value_transform()` to transform between different kinds of values.

### thunar_g_strescape ()

    gchar *
    thunar_g_strescape (const gchar *source);

Similar to g_strescape, but as well escapes SPACE

Escapes the special characters '\b', '\f', '\n', '\r', '\t', '\v', '\' ' ' and '"' in the string source by inserting a '\' before them. Additionally all characters in the range 0x01-0x1F (SPACE and everything below) and in the range 0x7F-0xFF (all non-ASCII chars) are replaced with a '\' followed by their octal representation.

#### Parameters

source | The string to escape |

#### Returns

The new string. Has to be freed with g_free after usage.

[transfer full]

### thunar_g_utf8_normalize_for_search ()

    gchar *
    thunar_g_utf8_normalize_for_search (const gchar *str,
                                        gboolean strip_diacritics,
                                        gboolean casefold);

Canonicalize a UTF-8 string into a form suitable for substring matching against other strings passed through this function with the same options. The strings produced by this function cannot be transformed back into the original string. They can however be matched against each other with functions like `g_strrstr()` that aren't Unicode-aware.

The implementation is currently not locale-aware, and relies only on what GLib can do. It may change, so these strings should not be persisted to disk and reused later.

Do not use these strings for sorting. Use `g_utf8_collate_key()` instead.

Like `g_utf8_normalize()`, this returns NULL if the string is not valid UTF-8.

#### Parameters

str | The string to normalize, zero-terminated. |
strip_diacritics | Remove diacritics, leaving only base characters. |
casefold | Fold case, to ignore letter case distinctions. |

#### Returns

The normalized string, or NULL. Free non-NULL values with `g_free()` after use.

[transfer full]

### thunar_g_app_info_equal ()

    gboolean
    thunar_g_app_info_equal (gpointer appinfo1,
                             gpointer appinfo2);

For unknown reason "g_app_info_equal" does weird stuff / crashes thunar in some cases. (select two files of the same type + Sent to --> mail recipient ) So we use this trivial method to compare applications for now.

#### Parameters

appinfo1 | The first g_app_info object |
appinfo2 | The second g_app_info object |

#### Returns

: TRUE if appinfo1 is equal to appinfo2. FALSE otherwise.

### thunar_g_object_set_guint_data ()

    void
    thunar_g_object_set_guint_data (GObject *object,
                                    const gchar *key,
                                    guint data);

Since it is not possible to set a plain uint to a G_OBJECT, we need to use a pointer This helper method encapsulates the process of doing so

#### Parameters

object | The GObject to set |
key | key for which the data should be set |
data | guint value to set as data |