Hiroyuki Ikezoe
ikezo****@users*****
Wed Dec 6 11:04:51 JST 2006
Index: kazehakase/src/mozilla/kz-mozembed.cpp diff -u kazehakase/src/mozilla/kz-mozembed.cpp:1.218 kazehakase/src/mozilla/kz-mozembed.cpp:1.219 --- kazehakase/src/mozilla/kz-mozembed.cpp:1.218 Wed Dec 6 09:25:47 2006 +++ kazehakase/src/mozilla/kz-mozembed.cpp Wed Dec 6 11:04:51 2006 @@ -1017,13 +1017,24 @@ kz_moz_embed_create_thumbnail(KZ_EMBED(kzembed)); } - if (store_cache && exists_search_cmd && - (!last_modified || (history_get_last_modified(uri) < last_modified)) && + if ((!last_modified || (history_get_last_modified(uri) < last_modified)) && !g_str_has_prefix(location, "history-search:")) { - gchar *filename; - filename = mozilla_store_history_file(kzembed); - if (filename) + if (store_cache) + { + gchar *filename; + filename = mozilla_store_history_file(kzembed); + if (filename) + { +#ifdef USE_RAST + if (exists_search_cmd) + g_idle_add(rast_update_index, filename); +#endif + g_free(filename); + } + } + + if (exists_search_cmd) { const gchar *title = kz_moz_embed_get_title(KZ_EMBED(kzembed)); @@ -1033,7 +1044,6 @@ if (serializer) { serializer->SerializeToString(node, value); - NS_UTF16ToCString (value, NS_CSTRING_ENCODING_UTF8, cValue); } gchar *contents = g_strdup(cValue.get()); @@ -1041,7 +1051,7 @@ KzSearch *search = kz_search_new("hyperestraier"); if (search) { - kz_search_register_document(search, filename, "UTF-8", title, contents, last_modified); + kz_search_register_document(search, uri, "UTF-8", title, contents, last_modified); g_object_unref(search); } #ifdef WITH_ANTHY @@ -1052,9 +1062,6 @@ g_object_unref(search); } #endif -#ifdef USE_RAST - g_idle_add(rast_update_index, filename); -#endif g_free(contents); } } @@ -2893,13 +2900,13 @@ nsnull, nsnull, localFile); // update timestamp file - gchar *timestamp_file = g_strconcat(g_get_home_dir(), + gchar *timestamp_file = g_build_filename(g_get_home_dir(), HISTORY_DIR, "timestamp", NULL); struct stat st; - g_stat(filename, &st); + g_stat(dir, &st); // Hmm, rounding st_mtime causes some problem I think. Is it OK? gchar *time = g_strdup_printf("%d", (int)st.st_mtime); @@ -2908,7 +2915,7 @@ g_io_channel_write_chars(io, time, strlen(time), NULL, NULL); g_io_channel_write_chars(io, ",", 1, NULL, NULL); - g_io_channel_write_chars(io, filename, strlen(filename), + g_io_channel_write_chars(io, dir, strlen(dir), NULL, NULL); g_io_channel_write_chars(io, "\n", 1, NULL, NULL); g_io_channel_shutdown(io, TRUE, NULL);