RSSyl: Copy RFolderItem private data properly.
authorAndrej Kacian <ticho@claws-mail.org>
Sat, 18 Oct 2014 11:55:38 +0000 (13:55 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Sat, 18 Oct 2014 11:58:03 +0000 (13:58 +0200)
src/plugins/rssyl/rssyl.c

index c87fde9..928d21c 100644 (file)
@@ -39,6 +39,7 @@
 #include <xml.h>
 #include <toolbar.h>
 #include <prefs_toolbar.h>
+#include <utils.h>
 
 /* Local includes */
 #include "libfeed/feeditem.h"
@@ -807,6 +808,7 @@ static gboolean rssyl_subscribe_uri(Folder *folder, const gchar *uri)
 static void rssyl_copy_private_data(Folder *folder, FolderItem *oldi,
                FolderItem *newi)
 {
+       gchar *dpathold, *dpathnew;
        RFolderItem *olditem = (RFolderItem *)oldi,
                                                                        *newitem = (RFolderItem *)newi;
 
@@ -814,15 +816,42 @@ static void rssyl_copy_private_data(Folder *folder, FolderItem *oldi,
        g_return_if_fail(olditem != NULL);
        g_return_if_fail(newitem != NULL);
 
-       if( olditem->url != NULL ) {
+       if (olditem->url != NULL) {
                g_free(newitem->url);
                newitem->url = g_strdup(olditem->url);
        }
 
-       if( olditem->official_title != NULL ) {
+       if (olditem->official_title != NULL) {
                g_free(newitem->official_title);
                newitem->official_title = g_strdup(olditem->official_title);
        }
+
+       if (olditem->source_id != NULL) {
+               g_free(newitem->source_id);
+               newitem->source_id = g_strdup(olditem->source_id);
+       }
+
+       newitem->keep_old = olditem->keep_old;
+       newitem->default_refresh_interval = olditem->default_refresh_interval;
+       newitem->refresh_interval = olditem->refresh_interval;
+       newitem->fetch_comments = olditem->fetch_comments;
+       newitem->fetch_comments_max_age = olditem->fetch_comments_max_age;
+       newitem->silent_update = olditem->silent_update;
+       newitem->write_heading = olditem->write_heading;
+       newitem->ignore_title_rename = olditem->ignore_title_rename;
+       newitem->ssl_verify_peer = olditem->ssl_verify_peer;
+       newitem->refresh_id = olditem->refresh_id;
+       newitem->fetching_comments = olditem->fetching_comments;
+       newitem->last_update = olditem->last_update;
+
+       dpathold = g_strconcat(rssyl_item_get_path(oldi->folder, oldi),
+                       G_DIR_SEPARATOR_S, RSSYL_DELETED_FILE, NULL);
+       dpathnew = g_strconcat(rssyl_item_get_path(newi->folder, newi),
+                       G_DIR_SEPARATOR_S, RSSYL_DELETED_FILE, NULL);
+       move_file(dpathold, dpathnew, TRUE);
+       g_free(dpathold);
+       g_free(dpathnew);
+
 }
 
 /************************************************************************/