/* For use by UI code that sets preferences.  */
void prefs_set_string_like_value(pref_t *pref, const gchar *value, gboolean *changed)
/* For use by UI code that sets preferences.  */
void prefs_set_string_like_value(pref_t *pref, const gchar *value, gboolean *changed)
{
    if (*pref->varp.string) {
        if (strcmp(*pref->varp.string, value) != 0) {
            *changed = TRUE;
            g_free(*pref->varp.string);
            *pref->varp.string = g_strdup(value);
        }
    } else if (value) {
        *pref->varp.string = g_strdup(value);
    }
}