Switch to unified view

a/src/index/indexer.cpp b/src/index/indexer.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.48 2006-12-16 15:30:32 dockes Exp $ (C) 2004 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.49 2006-12-19 08:40:50 dockes Exp $ (C) 2004 J.F.Dockes";
3
#endif
3
#endif
4
/*
4
/*
5
 *   This program is free software; you can redistribute it and/or modify
5
 *   This program is free software; you can redistribute it and/or modify
6
 *   it under the terms of the GNU General Public License as published by
6
 *   it under the terms of the GNU General Public License as published by
7
 *   the Free Software Foundation; either version 2 of the License, or
7
 *   the Free Software Foundation; either version 2 of the License, or
...
...
342
    flg == FsTreeWalker::FtwDirReturn) {
342
    flg == FsTreeWalker::FtwDirReturn) {
343
    m_config->setKeyDir(fn);
343
    m_config->setKeyDir(fn);
344
    int abslen;
344
    int abslen;
345
    if (m_config->getConfParam("idxabsmlen", &abslen))
345
    if (m_config->getConfParam("idxabsmlen", &abslen))
346
        m_db.setAbstractParams(abslen, -1, -1);
346
        m_db.setAbstractParams(abslen, -1, -1);
347
  if (flg == FsTreeWalker::FtwDirReturn)
347
    return FsTreeWalker::FtwOk;
348
        return FsTreeWalker::FtwOk;
348
    }
349
    }
349
350
350
    // Check db up to date ? Doing this before file type
351
    // Check db up to date ? Doing this before file type
351
    // identification means that, if usesystemfilecommand is switched
352
    // identification means that, if usesystemfilecommand is switched
352
    // from on to off it may happen that some files which are now
353
    // from on to off it may happen that some files which are now
...
...
361
        }
362
        }
362
    }
363
    }
363
    return FsTreeWalker::FtwOk;
364
    return FsTreeWalker::FtwOk;
364
    }
365
    }
365
366
366
    FileInterner interner(fn, m_config, m_tmpdir);
367
    FileInterner interner(fn, stp, m_config, m_tmpdir);
367
368
368
    // File name transcoded to utf8 for indexation. 
369
    // File name transcoded to utf8 for indexation. 
369
    string charset = m_config->getDefCharset(true);
370
    string charset = m_config->getDefCharset(true);
370
    // If this fails, the file name won't be indexed, no big deal
371
    // If this fails, the file name won't be indexed, no big deal
371
    // Note that we used to do the full path here, but I ended up believing
372
    // Note that we used to do the full path here, but I ended up believing
...
...
425
    // document to stand for the file itself, to be used mainly for up
426
    // document to stand for the file itself, to be used mainly for up
426
    // to date checks. Typically this happens for an mbox file.
427
    // to date checks. Typically this happens for an mbox file.
427
    if (hadNullIpath == false) {
428
    if (hadNullIpath == false) {
428
    LOGDEB1(("Creating empty doc for file\n"));
429
    LOGDEB1(("Creating empty doc for file\n"));
429
    Rcl::Doc fileDoc;
430
    Rcl::Doc fileDoc;
430
    fileDoc.fmtime = doc.fmtime;
431
    fileDoc.fmtime = ascdate;
431
    fileDoc.utf8fn = doc.utf8fn;
432
    fileDoc.utf8fn = utf8fn;
432
    fileDoc.mimetype = interner.get_mimetype();
433
    fileDoc.mimetype = interner.get_mimetype();
433
    if (!m_db.add(fn, fileDoc, stp)) 
434
    if (!m_db.add(fn, fileDoc, stp)) 
434
        return FsTreeWalker::FtwError;
435
        return FsTreeWalker::FtwError;
435
    }
436
    }
436
437