check if web service is available
authorchenpu@localhost
Tue, 02 Mar 2010 11:17:31 -0800
changeset 9 9960755afef0
parent 8 824cd3956314
child 10 07f080d477a3
check if web service is available
cmdassist/src/panel.c
cmdassist/src/pre-dialog.c
cmdassist/src/pre-dialog.h
--- a/cmdassist/src/panel.c	Tue Mar 02 10:16:15 2010 -0800
+++ b/cmdassist/src/panel.c	Tue Mar 02 11:17:31 2010 -0800
@@ -59,8 +59,6 @@
 
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 
-static gboolean isServiceValid = TRUE;
-
 enum
 {
   LIST_ICON = 0,
@@ -153,11 +151,11 @@
 	cmdassist_command_list.size = 0;
 
 	int status = 1;
-	if(isServiceValid) {
+	if(pre_conf.system.isServiceValid) {
 		status = getResult(str, &pre_conf, &cmdassist_command_list);
 	}
 	if(status == 1) {
-		isServiceValid = FALSE;
+		pre_conf.system.isServiceValid = FALSE;
 		if(cmdassist_command_list.list != NULL) {
 			debug_printf("clean command_list\n");
 			free(cmdassist_command_list.list);
--- a/cmdassist/src/pre-dialog.c	Tue Mar 02 10:16:15 2010 -0800
+++ b/cmdassist/src/pre-dialog.c	Tue Mar 02 11:17:31 2010 -0800
@@ -101,6 +101,8 @@
 	}
 	g_free(wsdl);
 
+	conf->system.isServiceValid = TRUE;
+
 	GSList *doc_list = NULL;
 	doc_list = gconf_client_get_list(gconf_client, CMDASSIST_GCONF_DOC_LIST, GCONF_VALUE_STRING, NULL);
 
--- a/cmdassist/src/pre-dialog.h	Tue Mar 02 10:16:15 2010 -0800
+++ b/cmdassist/src/pre-dialog.h	Tue Mar 02 11:17:31 2010 -0800
@@ -55,6 +55,7 @@
 	gint languageID;
 	gchar language[20];
 	gchar wsdl[250];
+	gboolean isServiceValid;
 };
 
 struct config_doc_t {