zeitgeist team mailing list archive
-
zeitgeist team
-
Mailing list archive
-
Message #05047
[Branch ~zeitgeist/zeitgeist/bluebird] Rev 416: And do all my changes once again
------------------------------------------------------------
revno: 416
committer: Michal Hruby <michal.mhr@xxxxxxxxx>
branch nick: bluebird
timestamp: Wed 2012-03-07 17:08:26 +0100
message:
And do all my changes once again
modified:
extensions/fts++/indexer.cpp
extensions/fts++/indexer.h
--
lp:zeitgeist
https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.
To unsubscribe from this branch go to https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird/+edit-subscription
=== modified file 'extensions/fts++/indexer.cpp'
--- extensions/fts++/indexer.cpp 2012-03-05 20:40:24 +0000
+++ extensions/fts++/indexer.cpp 2012-03-07 16:08:26 +0000
@@ -23,7 +23,6 @@
#include <xapian.h>
#include <queue>
#include <vector>
-#include <cassert>
#include <gio/gio.h>
#include <gio/gdesktopappinfo.h>
@@ -52,6 +51,7 @@
const std::string FTS_MAIN_DIR = "fts.index";
const int RELEVANCY_RESULT_TYPE = 100;
+const int HASH_LENGTH = 16;
void Indexer::Initialize (GError **error)
{
@@ -104,7 +104,7 @@
this->enquire = new Xapian::Enquire (*this->db);
- assert (g_checksum_type_get_length (G_CHECKSUM_MD5) == 16);
+ g_assert (g_checksum_type_get_length (G_CHECKSUM_MD5) == HASH_LENGTH);
this->checksum = g_checksum_new (G_CHECKSUM_MD5);
if (!this->checksum)
g_critical ("GChecksum initialization failed.");
@@ -1014,12 +1014,12 @@
// query that'd be subject to races.
// FIXME(?): This doesn't work for events with multiple subjects.
g_checksum_update (checksum, (guchar *) uri.c_str (), -1);
- guint8 uri_hash[17];
- gsize hash_size = 16;
+ guint8 uri_hash[HASH_LENGTH + 1];
+ gsize hash_size = HASH_LENGTH;
g_checksum_get_digest (checksum, uri_hash, &hash_size);
- assert (hash_size == 16);
- doc.add_value (VALUE_URI_HASH, std::string((char *) uri_hash, 16));
g_checksum_reset (checksum);
+ g_assert (hash_size == HASH_LENGTH);
+ doc.add_value (VALUE_URI_HASH, std::string((char *) uri_hash, hash_size));
val = zeitgeist_subject_get_text (subject);
if (val && val[0] != '\0')
=== modified file 'extensions/fts++/indexer.h'
--- extensions/fts++/indexer.h 2012-03-05 20:40:24 +0000
+++ extensions/fts++/indexer.h 2012-03-07 16:08:26 +0000
@@ -20,8 +20,8 @@
#ifndef _ZGFTS_INDEXER_H_
#define _ZGFTS_INDEXER_H_
+#include <glib.h>
#include <glib-object.h>
-#include <glib/gchecksum.h>
#include <gio/gio.h>
#include <xapian.h>
@@ -56,7 +56,7 @@
if (enquire) delete enquire;
if (query_parser) delete query_parser;
if (db) delete db;
- if (checksum) { g_checksum_free (checksum); checksum = NULL; }
+ if (checksum) g_checksum_free (checksum);
for (AppInfoMap::iterator it = app_info_cache.begin ();
it != app_info_cache.end (); ++it)