separate file and document dates (mainly for email folders). Better check configuration at startup

This commit is contained in:
dockes
2005-11-05 14:40:50 +00:00
parent d26cedf7ef
commit 5ebcb0c104
14 changed files with 132 additions and 55 deletions
+3 -4
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.12 2005-10-15 12:18:04 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.13 2005-11-05 14:40:50 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
#include <stdio.h>
#include <sys/stat.h>
@@ -173,11 +173,10 @@ DbIndexer::processone(const std::string &fn, const struct stat *stp,
break;
// Set the date if this was not done in the document handler
// (ie: date from Date: mail header).
if (doc.mtime.empty()) {
if (doc.fmtime.empty()) {
char ascdate[20];
sprintf(ascdate, "%ld", long(stp->st_ctime));
doc.mtime = ascdate;
doc.fmtime = ascdate;
}
// Internal access path for multi-document files
doc.ipath = ipath;
+9 -2
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: recollindex.cpp,v 1.10 2005-04-05 09:35:35 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: recollindex.cpp,v 1.11 2005-11-05 14:40:50 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
#include <stdio.h>
@@ -26,8 +26,15 @@ static void sigcleanup(int sig)
int main(int argc, const char **argv)
{
RclConfig *config = recollinit(cleanup, sigcleanup);
string reason;
RclConfig *config = recollinit(cleanup, sigcleanup, reason);
if (config == 0 || !config->ok()) {
string str = "Configuration problem: ";
str += reason;
fprintf(stderr, "%s\n", str.c_str());
exit(1);
}
indexer = new ConfIndexer(config);
exit(!indexer->index());