Re: Don't ask option for unmounting

Bernard Jungen <[email protected]> Sun, 31 May 2009 17:29:51 +0200
Newsgroups gmane.comp.desktop.rox.devel
Message-ID <[email protected]>
On Fri, May 29, 2009 at 07:50:35PM +0100, Tony Houghton wrote:
> On Fri, 29 May 2009 16:45:21 +0200
> Bernard Jungen <[email protected]> wrote:
> > By the way, are we sure GPOINTER_TO_INT(NULL) always yields 0? It's assumed in
> > filer_get_unmount_action().
> 
> I've changed the enum initialiser to use the former, just in case.

Mmmh, quite an unexpected fix! Alas, it doesn't work in all cases, unless the
code to parse the value from file is fixed too. :-( See attachment.

Cheers,

Bernard.

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com

_______________________________________________
rox-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rox-devel
Other-change.patch (text/x-diff, 914 B)
>From bd10f3c7909d200c440e3f3f2ccd193b75c4a779 Mon Sep 17 00:00:00 2001
From: Bernard Jungen <[email protected]>
Date: Sun, 31 May 2009 17:16:29 +0200
Subject: [PATCH 1/1] Other change

---
 ROX-Filer/src/filer.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ROX-Filer/src/filer.c b/ROX-Filer/src/filer.c
index cfaae6f..83a1520 100644
--- a/ROX-Filer/src/filer.c
+++ b/ROX-Filer/src/filer.c
@@ -3209,13 +3209,13 @@ static void load_learnt_mounts(void)
 	g_free(buffer);
 	for (n = 0; entries[n]; ++n)
 	{
+		gchar *p;
 		buffer = entries[n];
-		len = strlen(buffer);
-		if (len > 2)
-		{
-			buffer[len - 2] = 0;
+		p = strrchr(buffer, ' ');
+		if (p && p > buffer) {
+			*p = 0;
 			g_hash_table_insert(unmount_prompt_actions, g_strdup(buffer),
-				GINT_TO_POINTER(buffer[len - 1] - '0'));
+				GINT_TO_POINTER(atoi(p+1)));
 		}
 	}
 	g_strfreev(entries);
-- 
1.6.2.1