Skip to content
Snippets Groups Projects
Commit a81649e4 authored by edgrif's avatar edgrif
Browse files

add new delete all connections from step list function.

parent ebdef464
No related branches found
No related tags found
No related merge requests found
......@@ -27,9 +27,9 @@
* Exported functions: See ZMap/ZMapView.h for public functions and
* zmapView_P.h for private functions.
* HISTORY:
* Last edited: Dec 5 14:15 2008 (edgrif)
* Last edited: Mar 20 11:03 2009 (edgrif)
* Created: Mon Sep 20 10:29:15 2004 (edgrif)
* CVS info: $Id: zmapViewUtils.c,v 1.11 2008-12-09 14:16:13 edgrif Exp $
* CVS info: $Id: zmapViewUtils.c,v 1.12 2009-03-20 12:41:52 edgrif Exp $
*-------------------------------------------------------------------
*/
......@@ -72,6 +72,7 @@ static ZMapViewConnectionStep stepListFindStep(ZMapViewConnectionStepList step_l
static void stepFind(gpointer data, gpointer user_data) ;
static void reqFind(gpointer data, gpointer user_data) ;
static void requestRemove(gpointer data, gpointer user_data) ;
static void connectionRemove(gpointer data, gpointer user_data) ;
static void stepDestroy(gpointer data, gpointer user_data) ;
static void requestDestroy(gpointer data, gpointer user_data) ;
static void isConnection(gpointer data, gpointer user_data) ;
......@@ -365,6 +366,24 @@ void zmapViewStepListStepRequestDeleteAll(ZMapViewConnectionStepList step_list,
}
/* A Connection failed so remove it from the step list. */
void zmapViewStepListStepConnectionDeleteAll(ZMapViewConnectionStepList step_list, ZMapViewConnection connection)
{
StepListDeleteStruct delete_data = {NULL} ;
delete_data.step_list = step_list ;
delete_data.connection = connection ;
g_list_foreach(step_list->steps, connectionRemove, &delete_data) ;
return ;
}
/* Test to see if there are any requests in the steps, use this after
* doing a 'delete all' to check that there is still something to run. */
gboolean zmapViewStepListAreConnections(ZMapViewConnectionStepList step_list)
......@@ -763,6 +782,27 @@ static void requestRemove(gpointer data, gpointer user_data)
static void connectionRemove(gpointer data, gpointer user_data)
{
ZMapViewConnectionStep step = (ZMapViewConnectionStep)data ;
StepListDelete delete_data = (StepListDelete)user_data ;
StepListFindStruct step_find = {0} ;
step_find.connection = delete_data->connection ;
stepFind(data, &step_find) ;
if (step_find.request)
{
step->connections = g_list_remove(step->connections, step_find.request) ;
requestDestroy(step_find.request, delete_data->step_list) ;
}
return ;
}
/* All requests are in STEPLIST_PENDING state and after dispatching will go into STEPLIST_DISPATCHED. */
static void stepDispatch(gpointer data, gpointer user_data)
{
......@@ -823,7 +863,7 @@ static void stepFind(gpointer data, gpointer user_data)
ZMapViewConnectionStep step = (ZMapViewConnectionStep)data ;
StepListFind step_find = (StepListFind)user_data ;
if (step->request == step_find->request_type)
if (!(step_find->request_type) || step->request == step_find->request_type)
{
/* If there is a connection then go on and find it otherwise just return the step. */
if (step_find->connection)
......
......@@ -20,13 +20,13 @@
* This file is part of the ZMap genome database package
* originated by
* Ed Griffiths (Sanger Institute, UK) edgrif@sanger.ac.uk,
* Rob Clack (Sanger Institute, UK) rnc@sanger.ac.uk
* Roy Storey (Sanger Institute, UK) rds@sanger.ac.uk
*
* Description:
* HISTORY:
* Last edited: Feb 12 19:36 2009 (rds)
* Last edited: Mar 20 10:59 2009 (edgrif)
* Created: Thu May 13 15:06:21 2004 (edgrif)
* CVS info: $Id: zmapView_P.h,v 1.45 2009-02-13 10:24:20 rds Exp $
* CVS info: $Id: zmapView_P.h,v 1.46 2009-03-20 12:41:52 edgrif Exp $
*-------------------------------------------------------------------
*/
#ifndef ZMAP_VIEW_P_H
......@@ -319,6 +319,7 @@ void zmapViewStepListStepProcessRequest(ZMapViewConnectionStepList step_list, ZM
ZMapViewConnectionRequest zmapViewStepListFindRequest(ZMapViewConnectionStepList step_list,
ZMapServerReqType request_type, ZMapViewConnection connection) ;
void zmapViewStepListStepRequestDeleteAll(ZMapViewConnectionStepList step_list, ZMapViewConnectionRequest request) ;
void zmapViewStepListStepConnectionDeleteAll(ZMapViewConnectionStepList step_list, ZMapViewConnection connection) ;
gboolean zmapViewStepListAreConnections(ZMapViewConnectionStepList step_list) ;
gboolean zmapViewStepListIsNext(ZMapViewConnectionStepList step_list) ;
void zmapViewStepDestroy(gpointer data, gpointer user_data) ;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment