1999-02-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gnome-file-property-dialog.c (apply_metadata_change): Fix memory leak. 1999-02-22 Miguel de Icaza <miguel@nuclecu.unam.mx> * gdesktop.c (desktop_reload_icons): Fix memory leak. * glayout.c (create_new_menu_from): Fix memory leak.
Этот коммит содержится в:
родитель
197cf5dcab
Коммит
f1120801b6
@ -1,3 +1,7 @@
|
|||||||
|
1999-02-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* gnome-file-property-dialog.c (apply_metadata_change): Fix memory leak.
|
||||||
|
|
||||||
1999-02-22 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
1999-02-22 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||||
|
|
||||||
* gdesktop.c (desktop_reload_icons): Fix memory leak.
|
* gdesktop.c (desktop_reload_icons): Fix memory leak.
|
||||||
|
@ -423,6 +423,10 @@ desktop_reload_icons (int user_pos, int xpos, int ypos)
|
|||||||
|
|
||||||
full_name = g_concat_dir_and_file (desktop_directory, dirent->d_name);
|
full_name = g_concat_dir_and_file (desktop_directory, dirent->d_name);
|
||||||
fe = file_entry_from_file (full_name);
|
fe = file_entry_from_file (full_name);
|
||||||
|
if (!fe){
|
||||||
|
g_free (full_name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
im = gicon_get_icon_for_file (desktop_directory, fe, FALSE);
|
im = gicon_get_icon_for_file (desktop_directory, fe, FALSE);
|
||||||
file_entry_free (fe);
|
file_entry_free (fe);
|
||||||
g_free (full_name);
|
g_free (full_name);
|
||||||
@ -1056,7 +1060,11 @@ desktop_icon_info_open (DesktopIconInfo *dii)
|
|||||||
filename = g_concat_dir_and_file (desktop_directory, dii->filename);
|
filename = g_concat_dir_and_file (desktop_directory, dii->filename);
|
||||||
|
|
||||||
fe = file_entry_from_file (filename);
|
fe = file_entry_from_file (filename);
|
||||||
|
if (!fe){
|
||||||
|
message (1, _("Error"), "I could not fetch the information from the file");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (S_ISDIR (fe->buf.st_mode) || link_isdir (fe))
|
if (S_ISDIR (fe->buf.st_mode) || link_isdir (fe))
|
||||||
new_panel_at (filename);
|
new_panel_at (filename);
|
||||||
else {
|
else {
|
||||||
@ -1650,7 +1658,9 @@ desktop_icon_info_new (char *filename, char *url, char *caption, int xpos, int y
|
|||||||
|
|
||||||
full_name = g_concat_dir_and_file (desktop_directory, filename);
|
full_name = g_concat_dir_and_file (desktop_directory, filename);
|
||||||
fe = file_entry_from_file (full_name);
|
fe = file_entry_from_file (full_name);
|
||||||
|
if (!fe)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
dii = g_new (DesktopIconInfo, 1);
|
dii = g_new (DesktopIconInfo, 1);
|
||||||
dii->x = 0;
|
dii->x = 0;
|
||||||
dii->y = 0;
|
dii->y = 0;
|
||||||
|
@ -94,6 +94,19 @@ void free (void *ptr);
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
option_has_user (char *str)
|
||||||
|
{
|
||||||
|
if ((p = strstr (mnt->mnt_opts, "user")) != NULL){
|
||||||
|
if ((p - 2) >= str){
|
||||||
|
if (strncmp (p - 2, "nouser", 6) == 0)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef MOUNTED_GETMNTENT1
|
#ifdef MOUNTED_GETMNTENT1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -116,7 +129,7 @@ is_block_device_mountable (char *devname)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
while ((mnt = getmntent (f))){
|
while ((mnt = getmntent (f))){
|
||||||
if (strstr (mnt->mnt_opts, "user")){
|
if (option_has_user (mnt->mt_opts)){
|
||||||
retval = g_strdup (mnt->mnt_dir);
|
retval = g_strdup (mnt->mnt_dir);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -156,7 +169,7 @@ get_mountable_devices (void)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
while ((mnt = getmntent (f))){
|
while ((mnt = getmntent (f))){
|
||||||
if (strstr (mnt->mnt_opts, "user")){
|
if (option_has_user (mnt->mnt_opts)){
|
||||||
list = g_list_prepend (list, g_strdup (mnt->mnt_fsname));
|
list = g_list_prepend (list, g_strdup (mnt->mnt_fsname));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1268,7 +1268,9 @@ apply_metadata_change (GnomeFilePropertyDialog *fpd)
|
|||||||
if (!fpd->can_set_icon)
|
if (!fpd->can_set_icon)
|
||||||
return 1;
|
return 1;
|
||||||
/* And finally, we set the metadata on the icon filename */
|
/* And finally, we set the metadata on the icon filename */
|
||||||
text = gnome_icon_entry_get_filename (GNOME_ICON_ENTRY (fpd->button)); /*gtk_entry_get_text (GTK_ENTRY (gnome_icon_entry_gtk_entry (GNOME_ICON_ENTRY (fpd->button))));*/
|
text = gnome_icon_entry_get_filename (GNOME_ICON_ENTRY (fpd->button));
|
||||||
|
/*gtk_entry_get_text (GTK_ENTRY (gnome_icon_entry_gtk_entry (GNOME_ICON_ENTRY (fpd->button))));*/
|
||||||
|
|
||||||
icon_name = gicon_get_filename_for_icon (fpd->im);
|
icon_name = gicon_get_filename_for_icon (fpd->im);
|
||||||
if (text) {
|
if (text) {
|
||||||
if (strcmp (text, icon_name))
|
if (strcmp (text, icon_name))
|
||||||
@ -1284,6 +1286,7 @@ apply_metadata_change (GnomeFilePropertyDialog *fpd)
|
|||||||
gnome_metadata_remove (fpd->file_name, "icon-filename");
|
gnome_metadata_remove (fpd->file_name, "icon-filename");
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
g_free (text);
|
||||||
}
|
}
|
||||||
/* I suppose we should only do this if we know there's been a change -- I'll try to figure it
|
/* I suppose we should only do this if we know there's been a change -- I'll try to figure it
|
||||||
* out later if it turns out to be important. */
|
* out later if it turns out to be important. */
|
||||||
|
@ -530,7 +530,7 @@ create_regexp_actions (GtkWidget *menu, WPanel *panel,
|
|||||||
|
|
||||||
/* Fill in the common part of the menus */
|
/* Fill in the common part of the menus */
|
||||||
|
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; a_uiinfo [i].type != GNOME_APP_UI_ENDOFINFO; i++)
|
||||||
a_uiinfo[i].user_data = closure;
|
a_uiinfo[i].user_data = closure;
|
||||||
|
|
||||||
fill_menu (GTK_MENU_SHELL (menu), a_uiinfo, insert_pos);
|
fill_menu (GTK_MENU_SHELL (menu), a_uiinfo, insert_pos);
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user