aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/fs/download.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/fs/download.c')
-rw-r--r--src/plugins/fs/download.c63
1 files changed, 33 insertions, 30 deletions
diff --git a/src/plugins/fs/download.c b/src/plugins/fs/download.c
index 9f123578..08c8efbd 100644
--- a/src/plugins/fs/download.c
+++ b/src/plugins/fs/download.c
@@ -198,6 +198,7 @@ fs_download_started(struct FSUI_DownloadList * fsui_dl,
198 char * uri_name; 198 char * uri_name;
199 gboolean valid; 199 gboolean valid;
200 struct ECRS_URI * u; 200 struct ECRS_URI * u;
201 GtkTreeModel * model;
201 202
202 /* setup visualization */ 203 /* setup visualization */
203 list = MALLOC(sizeof(DownloadList)); 204 list = MALLOC(sizeof(DownloadList));
@@ -259,55 +260,57 @@ fs_download_started(struct FSUI_DownloadList * fsui_dl,
259 list->searchList = sl_parent; 260 list->searchList = sl_parent;
260 list->searchViewRowReference = NULL; 261 list->searchViewRowReference = NULL;
261 if (sl_parent != NULL) { 262 if (sl_parent != NULL) {
263 model = GTK_TREE_MODEL(sl_parent->tree);
262 if (dl_parent != NULL) { 264 if (dl_parent != NULL) {
263
264 /* have parent, must be download from 265 /* have parent, must be download from
265 directory inside of search */ 266 directory inside of search */
267 GE_BREAK(ectx,
268 gtk_tree_row_reference_get_model(dl_parent->searchViewRowReference)
269 == model);
266 path = gtk_tree_row_reference_get_path(dl_parent->searchViewRowReference); 270 path = gtk_tree_row_reference_get_path(dl_parent->searchViewRowReference);
267 if (path != NULL) { 271 if (path != NULL) {
268 valid = gtk_tree_model_get_iter(GTK_TREE_MODEL(sl_parent->tree), 272 valid = gtk_tree_model_get_iter(model,
269 &piter, 273 &piter,
270 path); 274 path);
271 if (valid == TRUE) 275 GE_BREAK(ectx, valid == TRUE);
272 valid = gtk_tree_model_iter_children(GTK_TREE_MODEL(sl_parent->tree), 276 if (valid == TRUE) {
277 valid = gtk_tree_model_iter_children(model,
273 &iter, 278 &iter,
274 &piter); 279 &piter);
280 GE_BREAK(ectx, valid == TRUE);
281 }
275 } else { 282 } else {
276 GE_BREAK(ectx, 0); 283 GE_BREAK(ectx, 0);
277 valid = FALSE; 284 valid = FALSE;
278 } 285 }
279 } else { 286 } else {
280 /* must be top-level entry in search */ 287 /* no download-parent, must be top-level entry in search */
281 valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(sl_parent->tree), 288 valid = gtk_tree_model_get_iter_first(model,
282 &iter); 289 &iter);
290 GE_BREAK(ectx, valid == TRUE);
283 } 291 }
284 if (valid == TRUE) { 292 while (valid == TRUE) {
285 valid = FALSE;
286 /* find matching entry */ 293 /* find matching entry */
287 do { 294 gtk_tree_model_get(model,
288 gtk_tree_model_get(GTK_TREE_MODEL(sl_parent->tree), 295 &iter,
296 SEARCH_URI, &u,
297 -1);
298 if (ECRS_equalsUri(u,
299 fi->uri)) {
300 path = gtk_tree_model_get_path(model,
301 &iter);
302 list->searchViewRowReference
303 = gtk_tree_row_reference_new(model,
304 path);
305 gtk_tree_path_free(path);
306 gtk_tree_store_set(sl_parent->tree,
289 &iter, 307 &iter,
290 SEARCH_URI, &u, 308 SEARCH_CELL_BG_COLOR, "yellow",
291 -1); 309 -1);
292 if (ECRS_equalsUri(u, 310 break;
293 fi->uri)) { 311 }
294 valid = TRUE; 312 valid = gtk_tree_model_iter_next(model,
295 path = gtk_tree_model_get_path(GTK_TREE_MODEL(sl_parent->tree), 313 &iter);
296 &iter);
297 list->searchViewRowReference
298 = gtk_tree_row_reference_new(GTK_TREE_MODEL(sl_parent->tree),
299 path);
300 gtk_tree_path_free(path);
301 gtk_tree_store_set(sl_parent->tree,
302 &iter,
303 SEARCH_CELL_BG_COLOR, "yellow",
304 -1);
305 break;
306 }
307 } while (TRUE == gtk_tree_model_iter_next(GTK_TREE_MODEL(sl_parent->tree),
308 &iter));
309 } else {
310 GE_BREAK(ectx, 0);
311 } 314 }
312 if (valid == FALSE) { 315 if (valid == FALSE) {
313 /* did not find matching entry in search list -- bug! Continue 316 /* did not find matching entry in search list -- bug! Continue