From 6feb984156f7e504a00ad8edfef84993ad1b3e74 Mon Sep 17 00:00:00 2001 From: Alan Fitton Date: Wed, 20 Feb 2013 19:17:08 +0000 Subject: update year in copyright headers, fix the jumbled file lists (caused by unsorted files) --- src/trg-files-model.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/trg-files-model.c') diff --git a/src/trg-files-model.c b/src/trg-files-model.c index f082bd8..a0a2a37 100644 --- a/src/trg-files-model.c +++ b/src/trg-files-model.c @@ -1,6 +1,6 @@ /* * transmission-remote-gtk - A GTK RPC client to Transmission - * Copyright (C) 2011 Alan Fitton + * Copyright (C) 2011-2013 Alan Fitton * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -192,6 +192,9 @@ static trg_files_tree_node *trg_file_parser_node_insert(trg_files_tree_node } } + if (!target_node && lastIter && lastIter->childrenHash) + target_node = g_hash_table_lookup(lastIter->childrenHash, path_el); + /* Node needs creating */ if (!target_node) { @@ -201,11 +204,10 @@ static trg_files_tree_node *trg_file_parser_node_insert(trg_files_tree_node /* Under the parent of the last iteration. */ if (lastIter) - lastIter->children = - g_list_append(lastIter->children, target_node); + trg_files_tree_node_add_child(lastIter, target_node); /* None set, so under the top node. */ else - top->children = g_list_append(top->children, target_node); + trg_files_tree_node_add_child(top, target_node); } lastIter = target_node; -- cgit v1.2.3