RSSyl: fix OPML import creating incorrect folder hierarchy
authorAndrej Kacian <ticho@claws-mail.org>
Wed, 13 Aug 2014 20:32:01 +0000 (22:32 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Wed, 13 Aug 2014 20:32:20 +0000 (22:32 +0200)
src/plugins/rssyl/rssyl_cb_menu.c

index d0c2ef99f5f9e2f95e4bbbc8cffc946dc5fb078e..bb1104468ca8883d7ec5b4dc45680d3dbba39cbe 100644 (file)
@@ -352,7 +352,10 @@ void rssyl_import_feed_list_cb(GtkAction *action, gpointer data)
 
        ctx = malloc( sizeof(OPMLImportCtx) );
        ctx->failures = 0;
 
        ctx = malloc( sizeof(OPMLImportCtx) );
        ctx->failures = 0;
-       ctx->depth = rssyl_folder_depth(item);
+       /* This needs to be +2, since we will be comparing it to depth of
+        * <outline> tag in OPML's XML structure. Topmost outlines are under
+        * <opml> and <body>, hence 2. */
+       ctx->depth = rssyl_folder_depth(item) + 2;
        ctx->current = NULL;
        ctx->current = g_slist_append(ctx->current, item);
 
        ctx->current = NULL;
        ctx->current = g_slist_append(ctx->current, item);