16949
|
1 |
--- tracker-0.6.95-orig/data/modules/Makefile.am 2009-07-02 13:37:17.847605000 +0800
|
|
2 |
+++ tracker-0.6.95/data/modules/Makefile.am 2009-06-11 16:16:47.941854000 +0800
|
|
3 |
@@ -6,6 +6,7 @@
|
|
4 |
applications.module \
|
|
5 |
evolution.module \
|
|
6 |
files.module \
|
|
7 |
- gaim-conversations.module
|
|
8 |
+ gaim-conversations.module \
|
|
9 |
+ web-history.module
|
|
10 |
|
|
11 |
EXTRA_DIST = $(config_DATA)
|
|
12 |
--- /dev/null 2009-07-02 13:16:20.000000000 +0800
|
|
13 |
+++ tracker-0.6.95/data/modules/web-history.module 2009-06-11 16:16:47.942036000 +0800
|
|
14 |
@@ -0,0 +1,22 @@
|
|
15 |
+[General]
|
|
16 |
+Description=Web History
|
|
17 |
+Enabled=true
|
|
18 |
+
|
|
19 |
+[Monitors]
|
|
20 |
+Directories=
|
|
21 |
+RecurseDirectories=$HOME/.xesam/Firefox/ToIndex/;
|
|
22 |
+
|
|
23 |
+[Ignored]
|
|
24 |
+Directories=
|
|
25 |
+Files=
|
|
26 |
+DirectoriesWithContent=
|
|
27 |
+
|
|
28 |
+[Index]
|
|
29 |
+Service=WebHistory
|
|
30 |
+MimeTypes=
|
|
31 |
+Files=
|
|
32 |
+ScanTimeout=6000
|
|
33 |
+CacheTimeout=120
|
|
34 |
+
|
|
35 |
+[Specific]
|
|
36 |
+# Options specific to this module
|
|
37 |
--- tracker-0.6.95-orig/src/tracker-indexer/modules/Makefile.am 2009-07-02 13:37:17.558151000 +0800
|
|
38 |
+++ tracker-0.6.95/src/tracker-indexer/modules/Makefile.am 2009-06-11 16:16:42.324761000 +0800
|
|
39 |
@@ -24,7 +24,8 @@
|
|
40 |
indexer_modules_LTLIBRARIES = \
|
|
41 |
libtracker-module-applications.la \
|
|
42 |
libtracker-module-files.la \
|
|
43 |
- libtracker-module-gaim-conversations.la
|
|
44 |
+ libtracker-module-gaim-conversations.la \
|
|
45 |
+ libtracker-module-web-history.la
|
|
46 |
|
|
47 |
# Applications module
|
|
48 |
libtracker_module_applications_la_SOURCES = applications.c
|
|
49 |
@@ -53,6 +54,15 @@
|
|
50 |
$(GCOV_LIBS) \
|
|
51 |
$(GLIB2_LIBS)
|
|
52 |
|
|
53 |
+# WebHistory module
|
|
54 |
+libtracker_module_web_history_la_SOURCES = web-history.c
|
|
55 |
+libtracker_module_web_history_la_LDFLAGS = $(module_flags)
|
|
56 |
+libtracker_module_web_history_la_LIBADD = \
|
|
57 |
+ $(GMODULE_LIBS) \
|
|
58 |
+ $(GIO_LIBS) \
|
|
59 |
+ $(GCOV_LIBS) \
|
|
60 |
+ $(GLIB2_LIBS)
|
|
61 |
+
|
|
62 |
if HAVE_GCONF
|
|
63 |
|
|
64 |
indexer_modules_LTLIBRARIES += \
|
|
65 |
--- /dev/null 2009-07-02 13:16:20.000000000 +0800
|
|
66 |
+++ tracker-0.6.95/src/tracker-indexer/modules/web-history.c 2009-06-11 16:16:42.440289000 +0800
|
|
67 |
@@ -0,0 +1,400 @@
|
|
68 |
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
|
69 |
+/*
|
|
70 |
+ * Copyright (C) 2006, Mr Jamie McCracken ([email protected])
|
|
71 |
+ * Copyright (C) 2008, Nokia
|
|
72 |
+
|
|
73 |
+ * This library is free software; you can redistribute it and/or
|
|
74 |
+ * modify it under the terms of the GNU General Public
|
|
75 |
+ * License as published by the Free Software Foundation; either
|
|
76 |
+ * version 2 of the License, or (at your option) any later version.
|
|
77 |
+ *
|
|
78 |
+ * This library is distributed in the hope that it will be useful,
|
|
79 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
80 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
81 |
+ * General Public License for more details.
|
|
82 |
+ *
|
|
83 |
+ * You should have received a copy of the GNU General Public
|
|
84 |
+ * License along with this library; if not, write to the
|
|
85 |
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
86 |
+ * Boston, MA 02110-1301, USA.
|
|
87 |
+ */
|
|
88 |
+
|
|
89 |
+#include <sys/stat.h>
|
|
90 |
+#include "config.h"
|
|
91 |
+
|
|
92 |
+#include <tracker-indexer/tracker-module.h>
|
|
93 |
+#define TEXT_MAX_SIZE 1048576 /* bytes */
|
|
94 |
+#define TEXT_CHECK_SIZE 65535
|
|
95 |
+#define METADATA_WEBHISTORY_URL "Doc:URL"
|
|
96 |
+#define METADATA_WEBHISTORY_PAGE_CONTENTTYPE "Web:PageContentType"
|
|
97 |
+#define METADATA_WEBHISTORY_CHARACTERSET "Web:CharacterSet"
|
|
98 |
+#define METADATA_WEBHISTORY_REFERRER "Web:Referrer"
|
|
99 |
+#define METADATA_WEBHISTORY_KEYWORD "User:Keywords"
|
|
100 |
+#define METADATA_WEBHISTORY_ACCESSED "File:Accessed"
|
|
101 |
+#define METADATA_WEBHISTORY_TITLE "Doc:Title"
|
|
102 |
+
|
|
103 |
+#define TRACKER_TYPE_WEB_FILE (tracker_web_file_get_type ())
|
|
104 |
+#define TRACKER_WEB_FILE(module) (G_TYPE_CHECK_INSTANCE_CAST ((module), TRACKER_TYPE_WEB_FILE, TrackerWebFile))
|
|
105 |
+
|
|
106 |
+typedef struct TrackerWebFile TrackerWebFile;
|
|
107 |
+typedef struct TrackerWebFileClass TrackerWebFileClass;
|
|
108 |
+
|
|
109 |
+struct TrackerWebFile {
|
|
110 |
+ TrackerModuleFile parent_instance;
|
|
111 |
+};
|
|
112 |
+
|
|
113 |
+struct TrackerWebFileClass {
|
|
114 |
+ TrackerModuleFileClass parent_class;
|
|
115 |
+};
|
|
116 |
+
|
|
117 |
+static GType tracker_web_file_get_type (void) G_GNUC_CONST;
|
|
118 |
+static gchar * tracker_web_file_get_text (TrackerModuleFile *file);
|
|
119 |
+static TrackerModuleMetadata * tracker_web_file_get_metadata (TrackerModuleFile *file);
|
|
120 |
+
|
|
121 |
+
|
|
122 |
+G_DEFINE_DYNAMIC_TYPE (TrackerWebFile, tracker_web_file, TRACKER_TYPE_MODULE_FILE);
|
|
123 |
+
|
|
124 |
+
|
|
125 |
+static void
|
|
126 |
+tracker_web_file_class_init (TrackerWebFileClass *klass)
|
|
127 |
+{
|
|
128 |
+ TrackerModuleFileClass *file_class = TRACKER_MODULE_FILE_CLASS (klass);
|
|
129 |
+
|
|
130 |
+ file_class->get_metadata = tracker_web_file_get_metadata;
|
|
131 |
+ file_class->get_text = tracker_web_file_get_text;
|
|
132 |
+}
|
|
133 |
+
|
|
134 |
+static void
|
|
135 |
+tracker_web_file_class_finalize (TrackerWebFileClass *klass)
|
|
136 |
+{
|
|
137 |
+}
|
|
138 |
+
|
|
139 |
+static void
|
|
140 |
+tracker_web_file_init (TrackerWebFile *file)
|
|
141 |
+{
|
|
142 |
+}
|
|
143 |
+
|
|
144 |
+static gchar *
|
|
145 |
+tracker_web_file_get_text (TrackerModuleFile *file)
|
|
146 |
+{
|
|
147 |
+ return tracker_module_metadata_utils_get_text (tracker_module_file_get_file (file));
|
|
148 |
+}
|
|
149 |
+static gboolean
|
|
150 |
+get_file_is_utf8 (GString *s,
|
|
151 |
+ gssize *bytes_valid)
|
|
152 |
+{
|
|
153 |
+ const gchar *end;
|
|
154 |
+
|
|
155 |
+ /* Check for UTF-8 validity, since we may
|
|
156 |
+ * have cut off the end.
|
|
157 |
+ */
|
|
158 |
+ if (g_utf8_validate (s->str, s->len, &end)) {
|
|
159 |
+ *bytes_valid = (gssize) s->len;
|
|
160 |
+ return TRUE;
|
|
161 |
+ }
|
|
162 |
+
|
|
163 |
+ *bytes_valid = end - s->str;
|
|
164 |
+
|
|
165 |
+ /* 4 is the maximum bytes for a UTF-8 character. */
|
|
166 |
+ if (*bytes_valid > 4) {
|
|
167 |
+ return FALSE;
|
|
168 |
+ }
|
|
169 |
+
|
|
170 |
+ if (g_utf8_get_char_validated (end, *bytes_valid) == (gunichar) -1) {
|
|
171 |
+ return FALSE;
|
|
172 |
+ }
|
|
173 |
+
|
|
174 |
+ return TRUE;
|
|
175 |
+}
|
|
176 |
+
|
|
177 |
+#ifdef TRY_LOCALE_TO_UTF8_CONVERSION
|
|
178 |
+
|
|
179 |
+static GString *
|
|
180 |
+get_file_in_locale (GString *s)
|
|
181 |
+{
|
|
182 |
+ GError *error = NULL;
|
|
183 |
+ gchar *str;
|
|
184 |
+ gsize bytes_read;
|
|
185 |
+ gsize bytes_written;
|
|
186 |
+
|
|
187 |
+ str = g_locale_to_utf8 (s->str,
|
|
188 |
+ s->len,
|
|
189 |
+ &bytes_read,
|
|
190 |
+ &bytes_written,
|
|
191 |
+ &error);
|
|
192 |
+ if (error) {
|
|
193 |
+ g_debug (" Conversion to UTF-8 read %d bytes, wrote %d bytes",
|
|
194 |
+ bytes_read,
|
|
195 |
+ bytes_written);
|
|
196 |
+ g_message ("Could not convert file from locale to UTF-8, %s",
|
|
197 |
+ error->message);
|
|
198 |
+ g_error_free (error);
|
|
199 |
+ g_free (str);
|
|
200 |
+ } else {
|
|
201 |
+ g_string_assign (s, str);
|
|
202 |
+ g_free (str);
|
|
203 |
+ }
|
|
204 |
+
|
|
205 |
+ return s;
|
|
206 |
+}
|
|
207 |
+
|
|
208 |
+#endif /* TRY_LOCALE_TO_UTF8_CONVERSION */
|
|
209 |
+static gchar *
|
|
210 |
+get_file_content (const gchar *path)
|
|
211 |
+{
|
|
212 |
+ GFile *file;
|
|
213 |
+ GFileInputStream *stream;
|
|
214 |
+ GError *error = NULL;
|
|
215 |
+ GString *s;
|
|
216 |
+ gssize bytes;
|
|
217 |
+ gssize bytes_valid;
|
|
218 |
+ gssize bytes_read_total;
|
|
219 |
+ gssize buf_size;
|
|
220 |
+ gchar buf[TEXT_CHECK_SIZE];
|
|
221 |
+ gboolean has_more_data;
|
|
222 |
+ gboolean has_reached_max;
|
|
223 |
+ gboolean is_utf8;
|
|
224 |
+
|
|
225 |
+ file = g_file_new_for_path (path);
|
|
226 |
+ stream = g_file_read (file, NULL, &error);
|
|
227 |
+
|
|
228 |
+ if (error) {
|
|
229 |
+ g_message ("Could not get read file:'%s', %s",
|
|
230 |
+ path,
|
|
231 |
+ error->message);
|
|
232 |
+ g_error_free (error);
|
|
233 |
+ g_object_unref (file);
|
|
234 |
+
|
|
235 |
+ return NULL;
|
|
236 |
+ }
|
|
237 |
+
|
|
238 |
+ s = g_string_new ("");
|
|
239 |
+ has_reached_max = FALSE;
|
|
240 |
+ has_more_data = TRUE;
|
|
241 |
+ bytes_read_total = 0;
|
|
242 |
+ buf_size = TEXT_CHECK_SIZE - 1;
|
|
243 |
+
|
|
244 |
+ g_debug (" Starting read...");
|
|
245 |
+
|
|
246 |
+ while (has_more_data && !has_reached_max && !error) {
|
|
247 |
+ gssize bytes_read;
|
|
248 |
+ gssize bytes_remaining;
|
|
249 |
+
|
|
250 |
+ /* Leave space for NULL termination and make sure we
|
|
251 |
+ * add it at the end now.
|
|
252 |
+ */
|
|
253 |
+ bytes_remaining = buf_size;
|
|
254 |
+ bytes_read = 0;
|
|
255 |
+
|
|
256 |
+ /* Loop until we hit the maximum */
|
|
257 |
+ for (bytes = -1; bytes != 0 && !error; ) {
|
|
258 |
+ bytes = g_input_stream_read (G_INPUT_STREAM (stream),
|
|
259 |
+ buf,
|
|
260 |
+ bytes_remaining,
|
|
261 |
+ NULL,
|
|
262 |
+ &error);
|
|
263 |
+
|
|
264 |
+ bytes_read += bytes;
|
|
265 |
+ bytes_remaining -= bytes;
|
|
266 |
+
|
|
267 |
+ g_debug (" Read %" G_GSSIZE_FORMAT " bytes", bytes);
|
|
268 |
+ }
|
|
269 |
+
|
|
270 |
+ /* Set the NULL termination after the last byte read */
|
|
271 |
+ buf[buf_size - bytes_remaining] = '\0';
|
|
272 |
+
|
|
273 |
+ /* First of all, check if this is the first time we
|
|
274 |
+ * have tried to read the file up to the TEXT_CHECK_SIZE
|
|
275 |
+ * limit. Then make sure that we read the maximum size
|
|
276 |
+ * of the buffer. If we don't do this, there is the
|
|
277 |
+ * case where we read 10 bytes in and it is just one
|
|
278 |
+ * line with no '\n'. Once we have confirmed this we
|
|
279 |
+ * check that the buffer has a '\n' to make sure the
|
|
280 |
+ * file is worth indexing. Similarly if the file has
|
|
281 |
+ * <= 3 bytes then we drop it.
|
|
282 |
+ */
|
|
283 |
+ if (bytes_read_total == 0) {
|
|
284 |
+ if (bytes_read == buf_size &&
|
|
285 |
+ strchr (buf, '\n') == NULL) {
|
|
286 |
+ g_debug (" No '\\n' in the first %" G_GSSIZE_FORMAT " bytes, not indexing file",
|
|
287 |
+ buf_size);
|
|
288 |
+ break;
|
|
289 |
+ } else if (bytes_read <= 2) {
|
|
290 |
+ g_debug (" File has less than 3 characters in it, not indexing file");
|
|
291 |
+ break;
|
|
292 |
+ }
|
|
293 |
+ }
|
|
294 |
+
|
|
295 |
+ /* Here we increment the bytes read total to evaluate
|
|
296 |
+ * the next states. We don't do this before the
|
|
297 |
+ * previous condition so we can know when we have
|
|
298 |
+ * iterated > 1.
|
|
299 |
+ */
|
|
300 |
+ bytes_read_total += bytes_read;
|
|
301 |
+
|
|
302 |
+ if (bytes_read != buf_size || bytes_read == 0) {
|
|
303 |
+ has_more_data = FALSE;
|
|
304 |
+ }
|
|
305 |
+
|
|
306 |
+ if (bytes_read_total >= TEXT_MAX_SIZE) {
|
|
307 |
+ has_reached_max = TRUE;
|
|
308 |
+ }
|
|
309 |
+
|
|
310 |
+ g_debug (" Read "
|
|
311 |
+ "%" G_GSSIZE_FORMAT " bytes total, "
|
|
312 |
+ "%" G_GSSIZE_FORMAT " bytes this time, "
|
|
313 |
+ "more data:%s, reached max:%s",
|
|
314 |
+ bytes_read_total,
|
|
315 |
+ bytes_read,
|
|
316 |
+ has_more_data ? "yes" : "no",
|
|
317 |
+ has_reached_max ? "yes" : "no");
|
|
318 |
+
|
|
319 |
+ /* The + 1 is for the NULL terminating byte */
|
|
320 |
+ s = g_string_append_len (s, buf, bytes_read + 1);
|
|
321 |
+ }
|
|
322 |
+
|
|
323 |
+ if (has_reached_max) {
|
|
324 |
+ g_debug (" Maximum indexable limit reached");
|
|
325 |
+ }
|
|
326 |
+
|
|
327 |
+ if (error) {
|
|
328 |
+ g_message ("Could not read input stream for:'%s', %s",
|
|
329 |
+ path,
|
|
330 |
+ error->message);
|
|
331 |
+ g_error_free (error);
|
|
332 |
+ g_string_free (s, TRUE);
|
|
333 |
+ g_object_unref (stream);
|
|
334 |
+ g_object_unref (file);
|
|
335 |
+
|
|
336 |
+ return NULL;
|
|
337 |
+ }
|
|
338 |
+
|
|
339 |
+ /* Check for UTF-8 Validity, if not try to convert it to the
|
|
340 |
+ * locale we are in.
|
|
341 |
+ */
|
|
342 |
+ is_utf8 = get_file_is_utf8 (s, &bytes_valid);
|
|
343 |
+
|
|
344 |
+ /* Make sure the string is NULL terminated and in the case
|
|
345 |
+ * where the string is valid UTF-8 up to the last character
|
|
346 |
+ * which was cut off, NULL terminate to the last most valid
|
|
347 |
+ * character.
|
|
348 |
+ */
|
|
349 |
+#ifdef TRY_LOCALE_TO_UTF8_CONVERSION
|
|
350 |
+ if (!is_utf8) {
|
|
351 |
+ s = get_file_in_locale (s);
|
|
352 |
+ } else {
|
|
353 |
+ g_debug (" Truncating to last valid UTF-8 character (%d/%d bytes)",
|
|
354 |
+ bytes_valid,
|
|
355 |
+ s->len);
|
|
356 |
+ s = g_string_truncate (s, bytes_valid);
|
|
357 |
+ }
|
|
358 |
+#else /* TRY_LOCALE_TO_UTF8_CONVERSION */
|
|
359 |
+ g_debug (" Truncating to last valid UTF-8 character (%" G_GSSIZE_FORMAT "/%" G_GSSIZE_FORMAT " bytes)",
|
|
360 |
+ bytes_valid,
|
|
361 |
+ s->len);
|
|
362 |
+ s = g_string_truncate (s, bytes_valid);
|
|
363 |
+#endif /* TRY_LOCALE_TO_UTF8_CONVERSION */
|
|
364 |
+
|
|
365 |
+ g_object_unref (stream);
|
|
366 |
+ g_object_unref (file);
|
|
367 |
+
|
|
368 |
+ if (s->len < 1) {
|
|
369 |
+ g_string_free (s, TRUE);
|
|
370 |
+ s = NULL;
|
|
371 |
+ }
|
|
372 |
+
|
|
373 |
+ return s ? g_string_free (s, FALSE) : NULL;
|
|
374 |
+}
|
|
375 |
+
|
|
376 |
+static TrackerModuleMetadata *
|
|
377 |
+tracker_web_file_get_metadata (TrackerModuleFile *file)
|
|
378 |
+{
|
|
379 |
+ TrackerModuleMetadata *metadata = NULL;
|
|
380 |
+ gchar *content_path, *metadata_path, *metadata_content;
|
|
381 |
+ gchar *base_name, *dir_name;
|
|
382 |
+ gchar **metadata_array;
|
|
383 |
+ gchar **temp_array;
|
|
384 |
+ guint len;
|
|
385 |
+ struct stat st;
|
|
386 |
+
|
|
387 |
+ content_path = g_file_get_path (tracker_module_file_get_file (file));
|
|
388 |
+ base_name = g_path_get_basename (content_path);
|
|
389 |
+ if (g_strrstr (base_name, "firefox-xesam-web") == NULL){
|
|
390 |
+ g_free (content_path);
|
|
391 |
+ g_free (base_name);
|
|
392 |
+ return NULL;
|
|
393 |
+ }
|
|
394 |
+ dir_name = g_path_get_dirname (content_path);
|
|
395 |
+ metadata_path = g_strconcat (dir_name, "/.", base_name, NULL);
|
|
396 |
+
|
|
397 |
+ if (!g_file_test (metadata_path, G_FILE_TEST_EXISTS)){
|
|
398 |
+ g_free (content_path);
|
|
399 |
+ g_free (metadata_path);
|
|
400 |
+ return NULL;
|
|
401 |
+ }
|
|
402 |
+ metadata_content = get_file_content (metadata_path);
|
|
403 |
+ metadata_array = g_strsplit (metadata_content, "\n", -1);
|
|
404 |
+ len = g_strv_length (metadata_array);
|
|
405 |
+ if (len < 4){
|
|
406 |
+ g_debug (" Is Metadata file right? The file is %s\n", metadata_path);
|
|
407 |
+ g_strfreev (metadata_array);
|
|
408 |
+ g_free (metadata_path);
|
|
409 |
+ g_free (content_path);
|
|
410 |
+ return NULL;
|
|
411 |
+ }
|
|
412 |
+ metadata = tracker_module_metadata_new ();
|
|
413 |
+
|
|
414 |
+ tracker_module_metadata_add_string (metadata, METADATA_WEBHISTORY_URL, metadata_array[0]);
|
|
415 |
+ tracker_module_metadata_add_string (metadata, METADATA_WEBHISTORY_TITLE, metadata_array[1]);
|
|
416 |
+ tracker_module_metadata_add_string (metadata,METADATA_WEBHISTORY_PAGE_CONTENTTYPE, metadata_array[3]);
|
|
417 |
+
|
|
418 |
+ temp_array = g_strsplit (metadata_array[4], "=", 2);
|
|
419 |
+ if (g_strrstr (temp_array[0], "encoding") != NULL){
|
|
420 |
+ tracker_module_metadata_add_string (metadata,METADATA_WEBHISTORY_CHARACTERSET, temp_array[1]);
|
|
421 |
+ }
|
|
422 |
+ g_strfreev (temp_array);
|
|
423 |
+ if (len > 6){
|
|
424 |
+ temp_array = g_strsplit (metadata_array[5], "=", 2);
|
|
425 |
+ if (g_strrstr (temp_array[0], "referrer") != NULL){
|
|
426 |
+ tracker_module_metadata_add_string (metadata, METADATA_WEBHISTORY_REFERRER, temp_array[1]);
|
|
427 |
+ }
|
|
428 |
+ if (g_strrstr (temp_array[0], "keyword") != NULL){
|
|
429 |
+ tracker_module_metadata_add_string (metadata, METADATA_WEBHISTORY_KEYWORD, temp_array[1]);
|
|
430 |
+ }
|
|
431 |
+ g_strfreev (temp_array);
|
|
432 |
+ temp_array = g_strsplit (metadata_array[6], "=", 2);
|
|
433 |
+ if (g_strrstr (temp_array[0], "keyword") != NULL){
|
|
434 |
+ tracker_module_metadata_add_string (metadata, METADATA_WEBHISTORY_KEYWORD, temp_array[1]);
|
|
435 |
+ }
|
|
436 |
+ g_strfreev (temp_array);
|
|
437 |
+ }
|
|
438 |
+
|
|
439 |
+ if(g_lstat (content_path, &st) >=0){
|
|
440 |
+ tracker_module_metadata_add_date (metadata, METADATA_WEBHISTORY_ACCESSED, st.st_mtim.tv_nsec);
|
|
441 |
+ }
|
|
442 |
+ g_free (content_path);
|
|
443 |
+ g_free (metadata_path);
|
|
444 |
+ g_strfreev (metadata_array);
|
|
445 |
+
|
|
446 |
+ return metadata;
|
|
447 |
+}
|
|
448 |
+
|
|
449 |
+
|
|
450 |
+void
|
|
451 |
+indexer_module_initialize (GTypeModule *module)
|
|
452 |
+{
|
|
453 |
+ tracker_web_file_register_type (module);
|
|
454 |
+}
|
|
455 |
+
|
|
456 |
+void
|
|
457 |
+indexer_module_shutdown (void)
|
|
458 |
+{
|
|
459 |
+}
|
|
460 |
+
|
|
461 |
+TrackerModuleFile *
|
|
462 |
+indexer_module_create_file (GFile *file)
|
|
463 |
+{
|
|
464 |
+ return g_object_new (TRACKER_TYPE_WEB_FILE,
|
|
465 |
+ "file", file,
|
|
466 |
+ NULL);
|
|
467 |
+}
|
|
468 |
--- tracker-0.6.95-orig/data/services/Makefile.am 2009-07-02 13:37:17.846918000 +0800
|
|
469 |
+++ tracker-0.6.95/data/services/Makefile.am 2009-06-11 16:16:47.880119000 +0800
|
|
470 |
@@ -13,6 +13,7 @@
|
|
471 |
file.metadata \
|
|
472 |
image.metadata \
|
|
473 |
video.metadata \
|
|
474 |
- playlist.metadata
|
|
475 |
+ playlist.metadata \
|
|
476 |
+ webhistory.metadata
|
|
477 |
|
|
478 |
EXTRA_DIST = $(config_DATA)
|
|
479 |
--- tracker-0.6.95-orig/data/services/default.service 2009-07-02 13:37:17.847003000 +0800
|
|
480 |
+++ tracker-0.6.95/data/services/default.service 2009-06-11 16:16:47.880203000 +0800
|
|
481 |
@@ -52,6 +52,7 @@
|
|
482 |
KeyMetadata2=Doc:URL
|
|
483 |
KeyMetadata3=Doc:Keywords
|
|
484 |
KeyMetadata4=User:Keywords
|
|
485 |
+KeyMetadata5=File:Accessed
|
|
486 |
TabularMetadata=File:Name;File:Mime;Doc:Title;Doc:URL;Doc:Author;File:Size;File:Modified;Doc:Created;
|
|
487 |
TileMetadata=Doc:Title;Doc:URL;Doc:Subject;Doc:Author;Doc:Created;Doc:PageCount;File:Size;
|
|
488 |
ShowServiceFiles=false
|
|
489 |
--- /dev/null 2009-07-02 13:16:20.000000000 +0800
|
|
490 |
+++ tracker-0.6.95/data/services/webhistory.metadata 2009-06-11 16:16:47.880464000 +0800
|
|
491 |
@@ -0,0 +1,56 @@
|
|
492 |
+[Doc:Title]
|
|
493 |
+DisplayName=Title
|
|
494 |
+Description=The title of the web page
|
|
495 |
+DataType=index
|
|
496 |
+Parent=DC:Title
|
|
497 |
+Weight=25
|
|
498 |
+Filtered=false
|
|
499 |
+
|
|
500 |
+[Doc:Keywords]
|
|
501 |
+DisplayName=Doc Keywords
|
|
502 |
+Description=keywords embedded in the web page
|
|
503 |
+DataType=keyword
|
|
504 |
+Parent=DC:Keywords
|
|
505 |
+Weight=15
|
|
506 |
+Filtered=false
|
|
507 |
+Delimited=true
|
|
508 |
+
|
|
509 |
+[User:Keywords]
|
|
510 |
+DisplayName=Keywords
|
|
511 |
+Description=keywords user sets
|
|
512 |
+DataType=keyword
|
|
513 |
+Weight=30
|
|
514 |
+Filtered=false
|
|
515 |
+
|
|
516 |
+[Web:PageContentType]
|
|
517 |
+DisplayName=Page Type
|
|
518 |
+Description=the type of the web page
|
|
519 |
+DataType=index
|
|
520 |
+Weight=1
|
|
521 |
+
|
|
522 |
+[Web:CharacterSet]
|
|
523 |
+DisplayName=Character Set
|
|
524 |
+Description=Number of words in the document
|
|
525 |
+DataType=index
|
|
526 |
+Weight=1
|
|
527 |
+
|
|
528 |
+[Web:Referrer]
|
|
529 |
+DisplayName=Referrer
|
|
530 |
+Description=The link referrer of this web page
|
|
531 |
+DataType=string
|
|
532 |
+Weight=1
|
|
533 |
+
|
|
534 |
+[Doc:URL]
|
|
535 |
+DisplayName=URL
|
|
536 |
+Description=URL to this web page
|
|
537 |
+DataType=index
|
|
538 |
+Weight=25
|
|
539 |
+Filtered=false
|
|
540 |
+
|
|
541 |
+[File:Accessed]
|
|
542 |
+DisplayName=Accessed
|
|
543 |
+Description=Last acessed date
|
|
544 |
+DataType=date
|
|
545 |
+Parent=DC:Date
|
|
546 |
+FieldName=Accessed
|
|
547 |
+
|
|
548 |
--- tracker-0.6.95-orig/src/libtracker-gtk/tracker-metadata-tile.c 2009-07-02 13:37:17.596886000 +0800
|
|
549 |
+++ tracker-0.6.95/src/libtracker-gtk/tracker-metadata-tile.c 2009-06-11 16:16:45.052830000 +0800
|
|
550 |
@@ -166,6 +166,7 @@
|
|
551 |
"File:Size",
|
|
552 |
"File:Mime",
|
|
553 |
"Doc:Keywords",
|
|
554 |
+ "File:Accessed",
|
|
555 |
NULL
|
|
556 |
};
|
|
557 |
|
|
558 |
@@ -175,6 +176,7 @@
|
|
559 |
WEBHISTORY_SIZE,
|
|
560 |
WEBHISTORY_MIME,
|
|
561 |
WEBHISTORY_KEYWORDS,
|
|
562 |
+ WEBHISTORY_ACCESSED,
|
|
563 |
WEBHISTORY_N_KEYS
|
|
564 |
};
|
|
565 |
|
|
566 |
@@ -678,11 +680,11 @@
|
|
567 |
priv = TRACKER_METADATA_TILE_GET_PRIVATE (tile);
|
|
568 |
|
|
569 |
/* create title */
|
|
570 |
- _property_to_label ( priv->title, array[WEBHISTORY_URL] , "<span size='large'><b>%s</b></span>");
|
|
571 |
+ _property_to_label ( priv->title, array[WEBHISTORY_TITLE] , "<span size='large'><b>%s</b></span>");
|
|
572 |
|
|
573 |
/* then set the remaining properties */
|
|
574 |
- _property_to_label ( priv->info1, array[WEBHISTORY_TITLE] , _("Subject : <b>%s</b>"));
|
|
575 |
- _property_to_label ( priv->info2, array[WEBHISTORY_KEYWORDS] , "Keywords: <b>%s</b>");
|
|
576 |
+ _property_to_label ( priv->info1, array[WEBHISTORY_URL] , _("URL: <b>%s</b>"));
|
|
577 |
+ _date_to_label ( priv->info2, array[WEBHISTORY_ACCESSED] , _("Accessed :<b>%s</b>"));
|
|
578 |
|
|
579 |
tracker_metadata_tile_show (tile);
|
|
580 |
g_strfreev (array);
|