* <many>: fix source code checks; move mu_msg_str_normalize to separate file

This commit is contained in:
Dirk-Jan C. Binnema
2010-11-20 17:27:17 +02:00
parent 2c8bd1015d
commit 5818c40d7f
6 changed files with 685 additions and 646 deletions

View File

@ -243,6 +243,23 @@ get_query (MuConfigOptions *opts)
return query;
}
static gboolean
db_is_ready (const char *xpath)
{
if (mu_util_db_is_empty (xpath)) {
g_warning ("Database is empty; use 'mu index' to "
"add messages");
return FALSE;
}
if (!mu_util_db_version_up_to_date (xpath)) {
update_warning ();
return FALSE;
}
return TRUE;
}
gboolean
mu_cmd_find (MuConfigOptions *opts)
@ -259,16 +276,8 @@ mu_cmd_find (MuConfigOptions *opts)
return FALSE;
xpath = mu_runtime_xapian_dir ();
if (mu_util_db_is_empty (xpath)) {
g_warning ("Database is empty; use 'mu index' to add messages");
if (!db_is_ready(xpath))
return FALSE;
}
if (!mu_util_db_version_up_to_date (xpath)) {
update_warning ();
return FALSE;
}
/* first param is 'query', search params are after that */
query = get_query (opts);