evolution-rss r288 - in trunk: . src



Author: lucilanga
Date: Mon Jun  9 14:31:33 2008
New Revision: 288
URL: http://svn.gnome.org/viewvc/evolution-rss?rev=288&view=rev

Log:
2008-06-09  Lucian Langa  <lucilanga gnome org>

* fix move folder to imply rename
* support multiple levels of rename

Modified:
   trunk/ChangeLog
   trunk/TODO
   trunk/src/misc.c
   trunk/src/rss.c

Modified: trunk/TODO
==============================================================================
--- trunk/TODO	(original)
+++ trunk/TODO	Mon Jun  9 14:31:33 2008
@@ -27,6 +27,5 @@
 	* obey ttl entity
 	* check rename feed when evo 2.24 x86_64 
 	* when adding a feed as opml file offer to import (file detection)
-	* fix move->rename
 	* run-time migration function from text/evolution-rss-feed -> x-evolution/evolution-rss-feed
 	* test new proxy autehntification

Modified: trunk/src/misc.c
==============================================================================
--- trunk/src/misc.c	(original)
+++ trunk/src/misc.c	Mon Jun  9 14:31:33 2008
@@ -297,6 +297,23 @@
         }
 }
 
+gchar *extract_main_folder(gchar *folder)
+{
+	gchar *main_folder = lookup_main_folder();
+        gchar *base = g_strdup_printf("%s/", main_folder);
+        gchar **nnew;
+	gchar *tmp;
+	if (nnew = g_strsplit(folder, base, 0))
+	{
+		g_free(base);
+		tmp = g_strdup(nnew[1]);
+		g_strfreev(nnew);
+		return tmp;
+	}
+	else
+		return NULL;
+}
+
 /* hrm, is there a library for this shit? */
 static struct {
         char *name;

Modified: trunk/src/rss.c
==============================================================================
--- trunk/src/rss.c	(original)
+++ trunk/src/rss.c	Mon Jun  9 14:31:33 2008
@@ -2667,8 +2667,10 @@
 void
 update_feed_folder(gchar *old_name, gchar *new_name)
 {
-	gchar *oname = g_path_get_basename(old_name);
-	gchar *nname = g_path_get_basename(new_name);
+	gchar *oname = extract_main_folder(old_name);
+	gchar *nname = extract_main_folder(new_name);
+	g_print("oname:%s\n", oname);
+	g_print("nname:%s\n", nname);
 	FILE *f;
 	gchar *feed_dir = rss_component_peek_base_directory(mail_component_peek());
         if (!g_file_test(feed_dir, G_FILE_TEST_EXISTS))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]