Patch from Kjartan Maraas to fix a bunch of leaks.
Thu Feb 13 18:51:37 2003 Jonathan Blandford <jrb@redhat.com> * capplets/common/gconf-property-editor.c: (gconf_peditor_new): * capplets/common/gnome-theme-info.c: (read_meta_theme), (update_theme_index), (update_common_theme_dir_index), (top_theme_dir_changed), (top_icon_theme_dir_changed), (add_common_theme_dir_monitor), (real_add_top_theme_dir_monitor): * capplets/default-applications/gnome-default-applications-properti es.c: (initialize_default_applications), (read_editor), (read_terminal): * capplets/file-types/mime-edit-dialog.c: (fill_dialog): * capplets/file-types/mime-type-info.c: (load_all_mime_types): * capplets/file-types/mime-types-model.c: (mime_types_model_get_value): * capplets/font/main.c: (font_render_get_gconf), (enum_group_load): * capplets/mouse/gnome-mouse-properties.c: (read_cursor_font), (cursor_changed): * capplets/theme-switcher/gnome-theme-details.c: (window_theme_selection_changed): * capplets/theme-switcher/gnome-theme-manager.c: (meta_theme_selection_changed): * capplets/theme-switcher/theme-thumbnail.c: (generate_theme_thumbnail): * libsounds/sound-properties.c: (sound_properties_add_directory), (sound_properties_add_file): * libsounds/sound-view.c: (compare_func): * libwindow-settings/gnome-window-manager.c: (gnome_window_manager_new): Patch from Kjartan Maraas to fix a bunch of leaks.
This commit is contained in:
parent
81e38ad5b2
commit
bd160edddf
13 changed files with 138 additions and 46 deletions
30
ChangeLog
30
ChangeLog
|
@ -1,3 +1,33 @@
|
||||||
|
Thu Feb 13 18:51:37 2003 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
|
* capplets/common/gconf-property-editor.c: (gconf_peditor_new):
|
||||||
|
* capplets/common/gnome-theme-info.c: (read_meta_theme),
|
||||||
|
(update_theme_index), (update_common_theme_dir_index),
|
||||||
|
(top_theme_dir_changed), (top_icon_theme_dir_changed),
|
||||||
|
(add_common_theme_dir_monitor), (real_add_top_theme_dir_monitor):
|
||||||
|
* capplets/default-applications/gnome-default-applications-properti
|
||||||
|
es.c: (initialize_default_applications), (read_editor),
|
||||||
|
(read_terminal):
|
||||||
|
* capplets/file-types/mime-edit-dialog.c: (fill_dialog):
|
||||||
|
* capplets/file-types/mime-type-info.c: (load_all_mime_types):
|
||||||
|
* capplets/file-types/mime-types-model.c:
|
||||||
|
(mime_types_model_get_value):
|
||||||
|
* capplets/font/main.c: (font_render_get_gconf), (enum_group_load):
|
||||||
|
* capplets/mouse/gnome-mouse-properties.c: (read_cursor_font),
|
||||||
|
(cursor_changed):
|
||||||
|
* capplets/theme-switcher/gnome-theme-details.c:
|
||||||
|
(window_theme_selection_changed):
|
||||||
|
* capplets/theme-switcher/gnome-theme-manager.c:
|
||||||
|
(meta_theme_selection_changed):
|
||||||
|
* capplets/theme-switcher/theme-thumbnail.c:
|
||||||
|
(generate_theme_thumbnail):
|
||||||
|
* libsounds/sound-properties.c: (sound_properties_add_directory),
|
||||||
|
(sound_properties_add_file):
|
||||||
|
* libsounds/sound-view.c: (compare_func):
|
||||||
|
* libwindow-settings/gnome-window-manager.c:
|
||||||
|
(gnome_window_manager_new): Patch from Kjartan Maraas to fix a
|
||||||
|
bunch of leaks.
|
||||||
|
|
||||||
Tue Feb 4 17:09:18 2003 Jonathan Blandford <jrb@redhat.com>
|
Tue Feb 4 17:09:18 2003 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
* Release 2.2.0.1
|
* Release 2.2.0.1
|
||||||
|
|
|
@ -373,7 +373,8 @@ gconf_peditor_new (gchar *key,
|
||||||
gconf_entry = gconf_client_get_entry (client, GCONF_PROPERTY_EDITOR (obj)->p->key, NULL, TRUE, NULL);
|
gconf_entry = gconf_client_get_entry (client, GCONF_PROPERTY_EDITOR (obj)->p->key, NULL, TRUE, NULL);
|
||||||
GCONF_PROPERTY_EDITOR (obj)->p->callback (client, 0, gconf_entry, obj);
|
GCONF_PROPERTY_EDITOR (obj)->p->callback (client, 0, gconf_entry, obj);
|
||||||
GCONF_PROPERTY_EDITOR (obj)->p->inited = TRUE;
|
GCONF_PROPERTY_EDITOR (obj)->p->inited = TRUE;
|
||||||
|
gconf_entry_free (gconf_entry);
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -364,7 +364,9 @@ read_meta_theme (GnomeVFSURI *meta_theme_uri)
|
||||||
str = gnome_desktop_item_get_string (meta_theme_ditem, BACKGROUND_IMAGE_KEY);
|
str = gnome_desktop_item_get_string (meta_theme_ditem, BACKGROUND_IMAGE_KEY);
|
||||||
if (str != NULL)
|
if (str != NULL)
|
||||||
meta_theme_info->background_image = g_strdup (str);
|
meta_theme_info->background_image = g_strdup (str);
|
||||||
|
|
||||||
|
gnome_desktop_item_unref (meta_theme_ditem);
|
||||||
|
|
||||||
return meta_theme_info;
|
return meta_theme_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -476,7 +478,7 @@ update_theme_index (GnomeVFSURI *index_uri,
|
||||||
GnomeThemeElement key_element,
|
GnomeThemeElement key_element,
|
||||||
gint priority)
|
gint priority)
|
||||||
{
|
{
|
||||||
GnomeVFSFileInfo file_info = {0,};
|
GnomeVFSFileInfo *file_info;
|
||||||
GnomeVFSResult result;
|
GnomeVFSResult result;
|
||||||
gboolean theme_exists;
|
gboolean theme_exists;
|
||||||
GnomeThemeInfo *theme_info;
|
GnomeThemeInfo *theme_info;
|
||||||
|
@ -486,11 +488,13 @@ update_theme_index (GnomeVFSURI *index_uri,
|
||||||
|
|
||||||
/* First, we determine the new state of the file. We do no more
|
/* First, we determine the new state of the file. We do no more
|
||||||
* sophisticated a test than "files exists and is a file" */
|
* sophisticated a test than "files exists and is a file" */
|
||||||
result = gnome_vfs_get_file_info_uri (index_uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
file_info = gnome_vfs_file_info_new ();
|
||||||
if (result == GNOME_VFS_OK && file_info.type == GNOME_VFS_FILE_TYPE_REGULAR)
|
result = gnome_vfs_get_file_info_uri (index_uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
||||||
|
if (result == GNOME_VFS_OK && file_info->type == GNOME_VFS_FILE_TYPE_REGULAR)
|
||||||
theme_exists = TRUE;
|
theme_exists = TRUE;
|
||||||
else
|
else
|
||||||
theme_exists = FALSE;
|
theme_exists = FALSE;
|
||||||
|
gnome_vfs_file_info_unref (file_info);
|
||||||
|
|
||||||
/* Next, we see what currently exists */
|
/* Next, we see what currently exists */
|
||||||
parent = gnome_vfs_uri_get_parent (index_uri);
|
parent = gnome_vfs_uri_get_parent (index_uri);
|
||||||
|
@ -595,7 +599,7 @@ update_common_theme_dir_index (GnomeVFSURI *theme_index_uri,
|
||||||
gboolean icon_theme,
|
gboolean icon_theme,
|
||||||
gint priority)
|
gint priority)
|
||||||
{
|
{
|
||||||
GnomeVFSFileInfo file_info = {0,};
|
GnomeVFSFileInfo *file_info;
|
||||||
GnomeVFSResult result;
|
GnomeVFSResult result;
|
||||||
gboolean theme_exists;
|
gboolean theme_exists;
|
||||||
gpointer theme_info;
|
gpointer theme_info;
|
||||||
|
@ -617,8 +621,9 @@ update_common_theme_dir_index (GnomeVFSURI *theme_index_uri,
|
||||||
hash_by_name = meta_theme_hash_by_name;
|
hash_by_name = meta_theme_hash_by_name;
|
||||||
}
|
}
|
||||||
/* First, we determine the new state of the file. */
|
/* First, we determine the new state of the file. */
|
||||||
result = gnome_vfs_get_file_info_uri (theme_index_uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
file_info = gnome_vfs_file_info_new ();
|
||||||
if (result == GNOME_VFS_OK && file_info.type == GNOME_VFS_FILE_TYPE_REGULAR)
|
result = gnome_vfs_get_file_info_uri (theme_index_uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
||||||
|
if (result == GNOME_VFS_OK && file_info->type == GNOME_VFS_FILE_TYPE_REGULAR)
|
||||||
{
|
{
|
||||||
/* It's an interesting file. Lets try to load it. */
|
/* It's an interesting file. Lets try to load it. */
|
||||||
if (icon_theme)
|
if (icon_theme)
|
||||||
|
@ -653,6 +658,7 @@ update_common_theme_dir_index (GnomeVFSURI *theme_index_uri,
|
||||||
theme_info = NULL;
|
theme_info = NULL;
|
||||||
theme_exists = FALSE;
|
theme_exists = FALSE;
|
||||||
}
|
}
|
||||||
|
gnome_vfs_file_info_unref (file_info);
|
||||||
|
|
||||||
/* Next, we see what currently exists */
|
/* Next, we see what currently exists */
|
||||||
common_theme_dir_uri = gnome_vfs_uri_get_parent (theme_index_uri);
|
common_theme_dir_uri = gnome_vfs_uri_get_parent (theme_index_uri);
|
||||||
|
@ -912,16 +918,18 @@ top_theme_dir_changed (GnomeVFSMonitorHandle *handle,
|
||||||
|
|
||||||
if (event_type == GNOME_VFS_MONITOR_EVENT_CREATED)
|
if (event_type == GNOME_VFS_MONITOR_EVENT_CREATED)
|
||||||
{
|
{
|
||||||
GnomeVFSFileInfo file_info = {0,};
|
GnomeVFSFileInfo *file_info;
|
||||||
|
|
||||||
monitor_data = g_new0 (CommonThemeDirMonitorData, 1);
|
monitor_data = g_new0 (CommonThemeDirMonitorData, 1);
|
||||||
monitor_data->priority = priority;
|
monitor_data->priority = priority;
|
||||||
result = gnome_vfs_get_file_info_uri (common_theme_dir_uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
file_info = gnome_vfs_file_info_new ();
|
||||||
if (result == GNOME_VFS_OK && file_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY)
|
result = gnome_vfs_get_file_info_uri (common_theme_dir_uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
||||||
|
if (result == GNOME_VFS_OK && file_info->type == GNOME_VFS_FILE_TYPE_DIRECTORY)
|
||||||
{
|
{
|
||||||
add_common_theme_dir_monitor (common_theme_dir_uri, NULL, monitor_data, NULL);
|
add_common_theme_dir_monitor (common_theme_dir_uri, NULL, monitor_data, NULL);
|
||||||
g_hash_table_insert (handle_hash, file_info.name, monitor_data);
|
g_hash_table_insert (handle_hash, file_info->name, monitor_data);
|
||||||
}
|
}
|
||||||
|
gnome_vfs_file_info_unref (file_info);
|
||||||
}
|
}
|
||||||
else if (event_type == GNOME_VFS_MONITOR_EVENT_DELETED)
|
else if (event_type == GNOME_VFS_MONITOR_EVENT_DELETED)
|
||||||
{
|
{
|
||||||
|
@ -962,16 +970,18 @@ top_icon_theme_dir_changed (GnomeVFSMonitorHandle *handle,
|
||||||
|
|
||||||
if (event_type == GNOME_VFS_MONITOR_EVENT_CREATED)
|
if (event_type == GNOME_VFS_MONITOR_EVENT_CREATED)
|
||||||
{
|
{
|
||||||
GnomeVFSFileInfo file_info = {0,};
|
GnomeVFSFileInfo *file_info;
|
||||||
|
|
||||||
monitor_data = g_new0 (CommonIconThemeDirMonitorData, 1);
|
monitor_data = g_new0 (CommonIconThemeDirMonitorData, 1);
|
||||||
monitor_data->priority = priority;
|
monitor_data->priority = priority;
|
||||||
result = gnome_vfs_get_file_info_uri (common_icon_theme_dir_uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
file_info = gnome_vfs_file_info_new ();
|
||||||
if (result == GNOME_VFS_OK && file_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY)
|
result = gnome_vfs_get_file_info_uri (common_icon_theme_dir_uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
||||||
|
if (result == GNOME_VFS_OK && file_info->type == GNOME_VFS_FILE_TYPE_DIRECTORY)
|
||||||
{
|
{
|
||||||
add_common_icon_theme_dir_monitor (common_icon_theme_dir_uri, NULL, monitor_data, NULL);
|
add_common_icon_theme_dir_monitor (common_icon_theme_dir_uri, NULL, monitor_data, NULL);
|
||||||
g_hash_table_insert (handle_hash, file_info.name, monitor_data);
|
g_hash_table_insert (handle_hash, file_info->name, monitor_data);
|
||||||
}
|
}
|
||||||
|
gnome_vfs_file_info_unref (file_info);
|
||||||
}
|
}
|
||||||
else if (event_type == GNOME_VFS_MONITOR_EVENT_DELETED)
|
else if (event_type == GNOME_VFS_MONITOR_EVENT_DELETED)
|
||||||
{
|
{
|
||||||
|
@ -1004,7 +1014,7 @@ add_common_theme_dir_monitor (GnomeVFSURI *theme_dir_uri,
|
||||||
gboolean real_monitor_not_added = FALSE;
|
gboolean real_monitor_not_added = FALSE;
|
||||||
GnomeVFSURI *subdir;
|
GnomeVFSURI *subdir;
|
||||||
GnomeVFSURI *index_uri;
|
GnomeVFSURI *index_uri;
|
||||||
GnomeVFSFileInfo file_info = {0,};
|
GnomeVFSFileInfo *file_info;
|
||||||
|
|
||||||
index_uri = gnome_vfs_uri_append_file_name (theme_dir_uri, "index.theme");
|
index_uri = gnome_vfs_uri_append_file_name (theme_dir_uri, "index.theme");
|
||||||
update_meta_theme_index (index_uri, monitor_data->priority);
|
update_meta_theme_index (index_uri, monitor_data->priority);
|
||||||
|
@ -1026,8 +1036,9 @@ add_common_theme_dir_monitor (GnomeVFSURI *theme_dir_uri,
|
||||||
|
|
||||||
/* gtk-2 theme subdir */
|
/* gtk-2 theme subdir */
|
||||||
subdir = gnome_vfs_uri_append_path (theme_dir_uri, "gtk-2.0");
|
subdir = gnome_vfs_uri_append_path (theme_dir_uri, "gtk-2.0");
|
||||||
result = gnome_vfs_get_file_info_uri (theme_dir_uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
file_info = gnome_vfs_file_info_new ();
|
||||||
if (result == GNOME_VFS_OK && file_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY)
|
result = gnome_vfs_get_file_info_uri (theme_dir_uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
||||||
|
if (result == GNOME_VFS_OK && file_info->type == GNOME_VFS_FILE_TYPE_DIRECTORY)
|
||||||
{
|
{
|
||||||
index_uri = gnome_vfs_uri_append_file_name (subdir, "gtkrc");
|
index_uri = gnome_vfs_uri_append_file_name (subdir, "gtkrc");
|
||||||
update_gtk2_index (index_uri, monitor_data->priority);
|
update_gtk2_index (index_uri, monitor_data->priority);
|
||||||
|
@ -1046,8 +1057,9 @@ add_common_theme_dir_monitor (GnomeVFSURI *theme_dir_uri,
|
||||||
|
|
||||||
/* keybinding theme subdir */
|
/* keybinding theme subdir */
|
||||||
subdir = gnome_vfs_uri_append_path (theme_dir_uri, "gtk-2.0-key");
|
subdir = gnome_vfs_uri_append_path (theme_dir_uri, "gtk-2.0-key");
|
||||||
result = gnome_vfs_get_file_info_uri (theme_dir_uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
gnome_vfs_file_info_clear (file_info);
|
||||||
if (result == GNOME_VFS_OK && file_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY)
|
result = gnome_vfs_get_file_info_uri (theme_dir_uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
||||||
|
if (result == GNOME_VFS_OK && file_info->type == GNOME_VFS_FILE_TYPE_DIRECTORY)
|
||||||
{
|
{
|
||||||
index_uri = gnome_vfs_uri_append_file_name (subdir, "gtkrc");
|
index_uri = gnome_vfs_uri_append_file_name (subdir, "gtkrc");
|
||||||
update_keybinding_index (index_uri, monitor_data->priority);
|
update_keybinding_index (index_uri, monitor_data->priority);
|
||||||
|
@ -1066,8 +1078,9 @@ add_common_theme_dir_monitor (GnomeVFSURI *theme_dir_uri,
|
||||||
|
|
||||||
/* metacity theme subdir */
|
/* metacity theme subdir */
|
||||||
subdir = gnome_vfs_uri_append_path (theme_dir_uri, "metacity-1");
|
subdir = gnome_vfs_uri_append_path (theme_dir_uri, "metacity-1");
|
||||||
result = gnome_vfs_get_file_info_uri (theme_dir_uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
gnome_vfs_file_info_clear (file_info);
|
||||||
if (file_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY)
|
result = gnome_vfs_get_file_info_uri (theme_dir_uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
||||||
|
if (file_info->type == GNOME_VFS_FILE_TYPE_DIRECTORY)
|
||||||
{
|
{
|
||||||
index_uri = gnome_vfs_uri_append_file_name (subdir, "metacity-theme-1.xml");
|
index_uri = gnome_vfs_uri_append_file_name (subdir, "metacity-theme-1.xml");
|
||||||
update_metacity_index (index_uri, monitor_data->priority);
|
update_metacity_index (index_uri, monitor_data->priority);
|
||||||
|
@ -1082,6 +1095,7 @@ add_common_theme_dir_monitor (GnomeVFSURI *theme_dir_uri,
|
||||||
g_free (uri_string);
|
g_free (uri_string);
|
||||||
if (result == GNOME_VFS_ERROR_NOT_SUPPORTED)
|
if (result == GNOME_VFS_ERROR_NOT_SUPPORTED)
|
||||||
real_monitor_not_added = TRUE;
|
real_monitor_not_added = TRUE;
|
||||||
|
gnome_vfs_file_info_unref (file_info);
|
||||||
gnome_vfs_uri_unref (subdir);
|
gnome_vfs_uri_unref (subdir);
|
||||||
|
|
||||||
if (monitor_not_added)
|
if (monitor_not_added)
|
||||||
|
@ -1156,7 +1170,7 @@ real_add_top_theme_dir_monitor (GnomeVFSURI *uri,
|
||||||
GnomeVFSMonitorHandle *monitor_handle = NULL;
|
GnomeVFSMonitorHandle *monitor_handle = NULL;
|
||||||
GnomeVFSDirectoryHandle *directory_handle = NULL;
|
GnomeVFSDirectoryHandle *directory_handle = NULL;
|
||||||
GnomeVFSResult result;
|
GnomeVFSResult result;
|
||||||
GnomeVFSFileInfo file_info = {0,};
|
GnomeVFSFileInfo *file_info;
|
||||||
gchar *uri_string;
|
gchar *uri_string;
|
||||||
CallbackTuple *tuple;
|
CallbackTuple *tuple;
|
||||||
|
|
||||||
|
@ -1168,9 +1182,13 @@ real_add_top_theme_dir_monitor (GnomeVFSURI *uri,
|
||||||
tuple->priority = priority;
|
tuple->priority = priority;
|
||||||
|
|
||||||
/* Check the URI */
|
/* Check the URI */
|
||||||
gnome_vfs_get_file_info_uri (uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
file_info = gnome_vfs_file_info_new ();
|
||||||
if (file_info.type != GNOME_VFS_FILE_TYPE_DIRECTORY)
|
gnome_vfs_get_file_info_uri (uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
|
||||||
|
if (file_info->type != GNOME_VFS_FILE_TYPE_DIRECTORY) {
|
||||||
|
gnome_vfs_file_info_unref (file_info);
|
||||||
return GNOME_VFS_ERROR_NOT_A_DIRECTORY;
|
return GNOME_VFS_ERROR_NOT_A_DIRECTORY;
|
||||||
|
}
|
||||||
|
gnome_vfs_file_info_unref (file_info);
|
||||||
/* Monitor the top directory */
|
/* Monitor the top directory */
|
||||||
uri_string = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
|
uri_string = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
|
||||||
|
|
||||||
|
@ -1193,18 +1211,23 @@ real_add_top_theme_dir_monitor (GnomeVFSURI *uri,
|
||||||
if (result != GNOME_VFS_OK)
|
if (result != GNOME_VFS_OK)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
while (gnome_vfs_directory_read_next (directory_handle, &file_info) == GNOME_VFS_OK)
|
file_info = gnome_vfs_file_info_new ();
|
||||||
|
while (gnome_vfs_directory_read_next (directory_handle, file_info) == GNOME_VFS_OK)
|
||||||
{
|
{
|
||||||
GnomeVFSURI *theme_dir_uri;
|
GnomeVFSURI *theme_dir_uri;
|
||||||
gpointer monitor_data;
|
gpointer monitor_data;
|
||||||
|
|
||||||
if (file_info.type != GNOME_VFS_FILE_TYPE_DIRECTORY)
|
if (file_info->type != GNOME_VFS_FILE_TYPE_DIRECTORY) {
|
||||||
|
gnome_vfs_file_info_clear (file_info);
|
||||||
continue;
|
continue;
|
||||||
if (file_info.name[0] == '.')
|
}
|
||||||
|
if (file_info->name[0] == '.') {
|
||||||
|
gnome_vfs_file_info_clear (file_info);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* Add the directory */
|
/* Add the directory */
|
||||||
theme_dir_uri = gnome_vfs_uri_append_path (uri, file_info.name);
|
theme_dir_uri = gnome_vfs_uri_append_path (uri, file_info->name);
|
||||||
if (icon_theme)
|
if (icon_theme)
|
||||||
{
|
{
|
||||||
monitor_data = g_new0 (CommonIconThemeDirMonitorData, 1);
|
monitor_data = g_new0 (CommonIconThemeDirMonitorData, 1);
|
||||||
|
@ -1219,10 +1242,13 @@ real_add_top_theme_dir_monitor (GnomeVFSURI *uri,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
g_hash_table_insert (tuple->handle_hash, file_info.name, monitor_data);
|
g_hash_table_insert (tuple->handle_hash, file_info->name, monitor_data);
|
||||||
|
gnome_vfs_file_info_clear (file_info);
|
||||||
gnome_vfs_uri_unref (theme_dir_uri);
|
gnome_vfs_uri_unref (theme_dir_uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gnome_vfs_file_info_unref (file_info);
|
||||||
|
gnome_vfs_directory_close (directory_handle);
|
||||||
if (result != GNOME_VFS_ERROR_EOF)
|
if (result != GNOME_VFS_ERROR_EOF)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
|
|
@ -185,16 +185,25 @@ initialize_default_applications (void)
|
||||||
text_editors = gnome_vfs_mime_get_all_applications ("text/plain");
|
text_editors = gnome_vfs_mime_get_all_applications ("text/plain");
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (possible_browsers); i++ ) {
|
for (i = 0; i < G_N_ELEMENTS (possible_browsers); i++ ) {
|
||||||
if (g_find_program_in_path (possible_browsers[i].executable_name))
|
gchar *browsers = g_find_program_in_path (possible_browsers[i].executable_name);
|
||||||
|
if (browsers) {
|
||||||
possible_browsers[i].in_path = TRUE;
|
possible_browsers[i].in_path = TRUE;
|
||||||
|
g_free(browsers);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; i < G_N_ELEMENTS (possible_help_viewers); i++ ) {
|
for (i = 0; i < G_N_ELEMENTS (possible_help_viewers); i++ ) {
|
||||||
if (g_find_program_in_path (possible_help_viewers[i].executable_name))
|
gchar *help_viewers = g_find_program_in_path (possible_help_viewers[i].executable_name);
|
||||||
|
if (help_viewers) {
|
||||||
possible_help_viewers[i].in_path = TRUE;
|
possible_help_viewers[i].in_path = TRUE;
|
||||||
|
g_free (help_viewers);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; i < G_N_ELEMENTS (possible_terminals); i++ ) {
|
for (i = 0; i < G_N_ELEMENTS (possible_terminals); i++ ) {
|
||||||
if (g_find_program_in_path (possible_terminals[i].exec))
|
gchar *terminals = g_find_program_in_path (possible_terminals[i].exec);
|
||||||
|
if (terminals) {
|
||||||
possible_terminals[i].in_path = TRUE;
|
possible_terminals[i].in_path = TRUE;
|
||||||
|
g_free (terminals);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,6 +239,7 @@ read_editor (GConfClient *client,
|
||||||
gtk_entry_set_text (GTK_ENTRY (WID ("text_select_combo_entry")), mime_app->name);
|
gtk_entry_set_text (GTK_ENTRY (WID ("text_select_combo_entry")), mime_app->name);
|
||||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("text_custom_radio")), TRUE);
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("text_custom_radio")), TRUE);
|
||||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("text_select_radio")), TRUE);
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("text_select_radio")), TRUE);
|
||||||
|
gnome_vfs_mime_application_free (mime_app);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -252,6 +262,8 @@ read_editor (GConfClient *client,
|
||||||
read_editor_custom:
|
read_editor_custom:
|
||||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("text_select_radio")), TRUE);
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("text_select_radio")), TRUE);
|
||||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("text_custom_radio")), TRUE);
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("text_custom_radio")), TRUE);
|
||||||
|
if (mime_app)
|
||||||
|
gnome_vfs_mime_application_free (mime_app);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -495,6 +507,8 @@ read_terminal (GConfClient *client,
|
||||||
_(possible_terminals[i].name));
|
_(possible_terminals[i].name));
|
||||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("terminal_custom_radio")), TRUE);
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("terminal_custom_radio")), TRUE);
|
||||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("terminal_select_radio")), TRUE);
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("terminal_select_radio")), TRUE);
|
||||||
|
g_free (exec);
|
||||||
|
g_free (exec_arg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -455,6 +455,8 @@ safe_set_entry (MimeEditDialog *dialog, char const *widget, char const *txt)
|
||||||
static void
|
static void
|
||||||
fill_dialog (MimeEditDialog *dialog)
|
fill_dialog (MimeEditDialog *dialog)
|
||||||
{
|
{
|
||||||
|
gchar *category_name;
|
||||||
|
|
||||||
g_return_if_fail (dialog->p->info != NULL);
|
g_return_if_fail (dialog->p->info != NULL);
|
||||||
|
|
||||||
mime_type_info_load_all (dialog->p->info);
|
mime_type_info_load_all (dialog->p->info);
|
||||||
|
@ -463,9 +465,10 @@ fill_dialog (MimeEditDialog *dialog)
|
||||||
dialog->p->info->description);
|
dialog->p->info->description);
|
||||||
safe_set_entry (dialog, "mime_type_entry",
|
safe_set_entry (dialog, "mime_type_entry",
|
||||||
dialog->p->info->mime_type);
|
dialog->p->info->mime_type);
|
||||||
safe_set_entry (dialog, "category_entry",
|
category_name = mime_type_info_get_category_name (dialog->p->info);
|
||||||
mime_type_info_get_category_name (dialog->p->info));
|
safe_set_entry (dialog, "category_entry", category_name);
|
||||||
|
g_free (category_name);
|
||||||
|
|
||||||
update_sensitivity (dialog);
|
update_sensitivity (dialog);
|
||||||
|
|
||||||
gnome_icon_entry_set_filename (GNOME_ICON_ENTRY (WID ("icon_entry")), mime_type_info_get_icon_path (dialog->p->info));
|
gnome_icon_entry_set_filename (GNOME_ICON_ENTRY (WID ("icon_entry")), mime_type_info_get_icon_path (dialog->p->info));
|
||||||
|
|
|
@ -69,6 +69,7 @@ load_all_mime_types (GtkTreeModel *model)
|
||||||
for (tmp = list; tmp != NULL; tmp = tmp->next)
|
for (tmp = list; tmp != NULL; tmp = tmp->next)
|
||||||
mime_type_info_new (tmp->data, model);
|
mime_type_info_new (tmp->data, model);
|
||||||
|
|
||||||
|
g_list_free (tmp);
|
||||||
g_list_free (list);
|
g_list_free (list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -374,7 +374,8 @@ mime_types_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint co
|
||||||
MimeTypesModel *model;
|
MimeTypesModel *model;
|
||||||
ModelEntry *entry;
|
ModelEntry *entry;
|
||||||
GdkPixbuf *icon;
|
GdkPixbuf *icon;
|
||||||
|
gchar *pretty_string;
|
||||||
|
|
||||||
g_return_if_fail (tree_model != NULL);
|
g_return_if_fail (tree_model != NULL);
|
||||||
g_return_if_fail (IS_MIME_TYPES_MODEL (tree_model));
|
g_return_if_fail (IS_MIME_TYPES_MODEL (tree_model));
|
||||||
|
|
||||||
|
@ -454,7 +455,9 @@ mime_types_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint co
|
||||||
|
|
||||||
switch (entry->type) {
|
switch (entry->type) {
|
||||||
case MODEL_ENTRY_MIME_TYPE:
|
case MODEL_ENTRY_MIME_TYPE:
|
||||||
g_value_set_string (value, mime_type_info_get_file_extensions_pretty_string (MIME_TYPE_INFO (entry)));
|
pretty_string = mime_type_info_get_file_extensions_pretty_string (MIME_TYPE_INFO (entry));
|
||||||
|
g_value_set_string (value, pretty_string);
|
||||||
|
g_free (pretty_string);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_ENTRY_SERVICE:
|
case MODEL_ENTRY_SERVICE:
|
||||||
|
|
|
@ -306,13 +306,17 @@ font_render_get_gconf (Antialiasing *antialiasing,
|
||||||
int val;
|
int val;
|
||||||
|
|
||||||
val = ANTIALIAS_GRAYSCALE;
|
val = ANTIALIAS_GRAYSCALE;
|
||||||
if (antialias_str)
|
if (antialias_str) {
|
||||||
gconf_string_to_enum (antialias_enums, antialias_str, &val);
|
gconf_string_to_enum (antialias_enums, antialias_str, &val);
|
||||||
|
g_free (antialias_str);
|
||||||
|
}
|
||||||
*antialiasing = val;
|
*antialiasing = val;
|
||||||
|
|
||||||
val = HINT_FULL;
|
val = HINT_FULL;
|
||||||
if (hint_str)
|
if (hint_str) {
|
||||||
gconf_string_to_enum (hint_enums, hint_str, &val);
|
gconf_string_to_enum (hint_enums, hint_str, &val);
|
||||||
|
g_free (hint_str);
|
||||||
|
}
|
||||||
*hinting = val;
|
*hinting = val;
|
||||||
|
|
||||||
g_object_unref (client);
|
g_object_unref (client);
|
||||||
|
@ -531,6 +535,8 @@ enum_group_load (EnumGroup *group)
|
||||||
if (str)
|
if (str)
|
||||||
gconf_string_to_enum (group->enums, str, &val);
|
gconf_string_to_enum (group->enums, str, &val);
|
||||||
|
|
||||||
|
g_free (str);
|
||||||
|
|
||||||
in_change = TRUE;
|
in_change = TRUE;
|
||||||
|
|
||||||
for (tmp_list = group->items; tmp_list; tmp_list = tmp_list->next) {
|
for (tmp_list = group->items; tmp_list; tmp_list = tmp_list->next) {
|
||||||
|
|
|
@ -391,7 +391,8 @@ read_cursor_font (void)
|
||||||
}
|
}
|
||||||
g_free (link_name);
|
g_free (link_name);
|
||||||
}
|
}
|
||||||
|
g_free (dir_name);
|
||||||
|
closedir (dir);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -459,10 +460,11 @@ cursor_changed (GtkTreeSelection *selection,
|
||||||
gtk_tree_model_get (model, &iter,
|
gtk_tree_model_get (model, &iter,
|
||||||
COLUMN_FONT_PATH, &cursor_font,
|
COLUMN_FONT_PATH, &cursor_font,
|
||||||
-1);
|
-1);
|
||||||
if (cursor_font != NULL)
|
if (cursor_font != NULL) {
|
||||||
gconf_client_set_string (gconf_client_get_default (),
|
gconf_client_set_string (gconf_client_get_default (),
|
||||||
CURSOR_FONT_KEY, cursor_font, NULL);
|
CURSOR_FONT_KEY, cursor_font, NULL);
|
||||||
else
|
g_free (cursor_font);
|
||||||
|
} else
|
||||||
gconf_client_unset (gconf_client_get_default (),
|
gconf_client_unset (gconf_client_get_default (),
|
||||||
CURSOR_FONT_KEY, NULL);
|
CURSOR_FONT_KEY, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,7 +158,7 @@ window_theme_selection_changed (GtkTreeSelection *selection,
|
||||||
wm_settings.theme = window_theme_name;
|
wm_settings.theme = window_theme_name;
|
||||||
gnome_window_manager_change_settings (window_manager, &wm_settings);
|
gnome_window_manager_change_settings (window_manager, &wm_settings);
|
||||||
}
|
}
|
||||||
|
g_free (window_theme_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -575,6 +575,7 @@ meta_theme_selection_changed (GtkTreeSelection *selection,
|
||||||
if (meta_theme_name)
|
if (meta_theme_name)
|
||||||
{
|
{
|
||||||
meta_theme_info = gnome_theme_meta_info_find (meta_theme_name);
|
meta_theme_info = gnome_theme_meta_info_find (meta_theme_name);
|
||||||
|
g_free (meta_theme_name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -496,7 +496,8 @@ generate_theme_thumbnail (GnomeThemeMetaInfo *meta_theme_info,
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = gdk_pixbuf_scale_simple (pixbuf, ICON_SIZE_WIDTH/2, ICON_SIZE_HEIGHT/2, GDK_INTERP_BILINEAR);
|
retval = gdk_pixbuf_scale_simple (pixbuf, ICON_SIZE_WIDTH/2, ICON_SIZE_HEIGHT/2, GDK_INTERP_BILINEAR);
|
||||||
|
g_object_unref (pixbuf);
|
||||||
|
|
||||||
g_hash_table_insert (theme_hash, meta_theme_info->name, retval);
|
g_hash_table_insert (theme_hash, meta_theme_info->name, retval);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ gnome_window_manager_new (GnomeDesktopItem *it)
|
||||||
module = g_module_open (module_name, G_MODULE_BIND_LAZY);
|
module = g_module_open (module_name, G_MODULE_BIND_LAZY);
|
||||||
if (module == NULL) {
|
if (module == NULL) {
|
||||||
g_warning ("Couldn't load window manager settings module `%s' (%s)", module_name, g_module_error ());
|
g_warning ("Couldn't load window manager settings module `%s' (%s)", module_name, g_module_error ());
|
||||||
|
g_free (module_name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,9 +61,12 @@ gnome_window_manager_new (GnomeDesktopItem *it)
|
||||||
|
|
||||||
if ((!success) || wm_new_func == NULL) {
|
if ((!success) || wm_new_func == NULL) {
|
||||||
g_warning ("Couldn't load window manager settings module `%s`, couldn't find symbol \'window_manager_new\'", module_name);
|
g_warning ("Couldn't load window manager settings module `%s`, couldn't find symbol \'window_manager_new\'", module_name);
|
||||||
|
g_free (module_name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_free (module_name);
|
||||||
|
|
||||||
wm = (* wm_new_func) (GNOME_WINDOW_MANAGER_INTERFACE_VERSION);
|
wm = (* wm_new_func) (GNOME_WINDOW_MANAGER_INTERFACE_VERSION);
|
||||||
|
|
||||||
if (wm == NULL)
|
if (wm == NULL)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue