From 2155ada589c9a42bba6fd9997773f30b033a2d33 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 4 Sep 2005 12:11:40 +0000 Subject: [PATCH] r4160: Bugfix: If you editing the target of a symlink in the properties box, and then unfocussed the entry when the symlink no longer existed, the filer would crash trying to display the error message. Added work-around (Thomas Leonard; reported as GTK bug #315229). --- ROX-Filer/Help/Changes | 7 +++++++ ROX-Filer/src/Makefile.in | 1 - ROX-Filer/src/infobox.c | 9 ++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ROX-Filer/Help/Changes b/ROX-Filer/Help/Changes index 762fa995..88269c70 100644 --- a/ROX-Filer/Help/Changes +++ b/ROX-Filer/Help/Changes @@ -2,6 +2,13 @@ A RISC OS-like filer for X by Thomas Leonard +04-Sep-2005 +~~~~~~~~~~~ +Bugfix: If you editing the target of a symlink in the properties box, and then + unfocussed the entry when the symlink no longer existed, the filer + would crash trying to display the error message. Added work-around + (Thomas Leonard; reported as GTK bug #315229). + 27-Aug-2005 ~~~~~~~~~~~ When using 'From LANG', check for translations with and with the territory diff --git a/ROX-Filer/src/Makefile.in b/ROX-Filer/src/Makefile.in index 00349aa7..712bebe3 100644 --- a/ROX-Filer/src/Makefile.in +++ b/ROX-Filer/src/Makefile.in @@ -13,7 +13,6 @@ LIBS = @LIBS@ @LFS_LDFLAGS@ -lICE -lSM CFLAGS = -I. -I${srcdir} ${PROF} @CFLAGS@ @LFS_CFLAGS@ \ `${PKG_CONFIG} --cflags gtk+-2.0 libxml-2.0` LDFLAGS = ${PROF} @LDFLAGS@ `${PKG_CONFIG} --libs gtk+-2.0 libxml-2.0 | sed 's/-lpangoxft-[^ ]*//'` ${LIBS} -EXEC = ${PLATFORM_DIR}/${PROG} ############ Things to change for different programs diff --git a/ROX-Filer/src/infobox.c b/ROX-Filer/src/infobox.c index 432037e9..d5fed6a8 100644 --- a/ROX-Filer/src/infobox.c +++ b/ROX-Filer/src/infobox.c @@ -501,19 +501,22 @@ static void cell_edited(GtkCellRendererText *cell, oldlink = readlink_dup(fullpath); if (!oldlink) { - report_error(_("'%s' is no longer a symlink"), fullpath); + /* Must use delayed_error(), as this can be called + * from a focus-out event (causes a crash). + */ + delayed_error(_("'%s' is no longer a symlink"), fullpath); return; } if (strcmp(oldlink, new_text) == 0) return; /* No change */ g_free(oldlink); if (unlink(fullpath)) { - report_error(_("Failed to unlink '%s':\n%s"), + delayed_error(_("Failed to unlink '%s':\n%s"), fullpath, g_strerror(errno)); return; } if (symlink(new_text, fullpath)) { - report_error(_("Failed to create symlink from '%s':\n%s\n" + delayed_error(_("Failed to create symlink from '%s':\n%s\n" "(note: old link has been deleted)")); return; } -- 2.11.4.GIT