[Kazehakase-cvs] CVS update: kazehakase/src

Zurück zum Archiv-Index

Hiroyuki Ikezoe ikezo****@users*****
Wed Dec 6 15:08:03 JST 2006


Index: kazehakase/src/kazehakase.h
diff -u kazehakase/src/kazehakase.h:1.39 kazehakase/src/kazehakase.h:1.40
--- kazehakase/src/kazehakase.h:1.39	Wed Dec  6 12:20:44 2006
+++ kazehakase/src/kazehakase.h	Wed Dec  6 15:08:03 2006
@@ -28,6 +28,7 @@
 #include <string.h>
 #include <glib.h>
 #include "kz-profile.h"
+#include "kz-search.h"
 #include "bookmarks/kz-root-bookmark.h"
 #if USE_MIGEMO
 #include "migemo.h"
@@ -63,7 +64,7 @@
 #endif
 extern gboolean	       is_restoring_session;
 
-extern gboolean        exists_search_cmd; 
+extern KzSearch	      *kz_search;
 
 #define KZ_CONF_GET(s, k, v, t)					\
 	kz_profile_get_value(kz_global_profile,			\
Index: kazehakase/src/main.c
diff -u kazehakase/src/main.c:1.123 kazehakase/src/main.c:1.124
--- kazehakase/src/main.c:1.123	Tue Dec  5 15:02:51 2006
+++ kazehakase/src/main.c	Wed Dec  6 15:08:03 2006
@@ -47,9 +47,6 @@
 #include "utils.h"
 
 #include "kz-search.h"
-#ifdef USE_RAST
-#	include "rast-search.h"
-#endif
 
 #include "mozilla.h"
 
@@ -59,6 +56,7 @@
 #if USE_MIGEMO
 Migemo         *migemo            = NULL;
 #endif
+KzSearch       *kz_search         = NULL;
 
 static gchar** action_array;
 static gchar* geometry_string;
@@ -78,8 +76,6 @@
 
 gboolean is_restoring_session = FALSE;
 
-gboolean exists_search_cmd = FALSE;
-
 static void activate_action(const gchar *text);
 
 /******************************************************************************
@@ -565,7 +561,7 @@
 	gchar *smartbookmark_file, *sys_smartbookmark_file;
 	gchar *accel_prefs_file;
 	gchar *proxy_file, *sysproxy_file;
-	gboolean use_history_search = FALSE;
+	gchar *search_engine;
 
 	/* load prefs */
 	sysconf_file = g_strdup(KZ_SYSCONFDIR "/kzrc");
@@ -575,32 +571,20 @@
 	
 	kz_global_profile = kz_profile_open(conf_file, sysconf_file);
 
-	/* check HyperEstraier Index */
-	KZ_CONF_GET("History", "store_cache", use_history_search, BOOL);
-	if (use_history_search)
-	{
-		KzSearch *search;
-#ifdef USE_RAST
-		gboolean exists_index;
-		gchar *search_command;
-		search_command = g_find_program_in_path("rast");
-		exists_index = rast_exist_index_dir();
-		if (search_command)
-		{
-			exists_search_cmd = TRUE;
-			if (!exists_index)
-				rast_make_index();
-			g_free(search_command);
-		}
-#endif
-		search = kz_search_new("hyperestraier");
-		if (search)
+	/* prepare history search engine */
+	search_engine = KZ_CONF_GET_STR("History" , "search_engine");
+	if (search_engine)
+	{
+		if (!strcmp(search_engine, "hyperestraier") ||
+		    !strcmp(search_engine, "rast"))
+			kz_search = kz_search_new(search_engine);
+
+		if (kz_search)
 		{
-			exists_search_cmd = TRUE;
-			if (!kz_search_exist_index_dir(search))
-				kz_search_make_index(search);
-			g_object_unref(search);
+			if (!kz_search_exist_index_dir(kz_search))
+				kz_search_make_index(kz_search);
 		}
+		g_free(search_engine);
 	}
 
 	/* load bookmarks */


More information about the Kazehakase-cvs mailing list
Zurück zum Archiv-Index