Switch to unified view

a/src/query/docseqhist.cpp b/src/query/docseqhist.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: docseqhist.cpp,v 1.1 2007-01-19 10:32:39 dockes Exp $ (C) 2005 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: docseqhist.cpp,v 1.2 2007-12-13 06:58:21 dockes Exp $ (C) 2005 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
...
...
17
 *   Free Software Foundation, Inc.,
17
 *   Free Software Foundation, Inc.,
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
 */
19
 */
20
#include <math.h>
20
#include <math.h>
21
#include <time.h>
21
#include <time.h>
22
#include <cmath>
22
23
23
#include "docseqhist.h"
24
#include "docseqhist.h"
24
#include "rcldb.h"
25
#include "rcldb.h"
25
26
26
bool DocSequenceHistory::getDoc(int num, Rcl::Doc &doc, int *percent, 
27
bool DocSequenceHistory::getDoc(int num, Rcl::Doc &doc, int *percent, 
...
...
46
    while (skip--) 
47
    while (skip--) 
47
    m_it++;
48
    m_it++;
48
    if (percent)
49
    if (percent)
49
    *percent = 100;
50
    *percent = 100;
50
    if (sh) {
51
    if (sh) {
51
    if (m_prevtime < 0 || abs(m_prevtime - m_it->unixtime) > 86400) {
52
    if (m_prevtime < 0 || abs (float(m_prevtime) - float(m_it->unixtime)) > 86400) {
52
        m_prevtime = m_it->unixtime;
53
        m_prevtime = m_it->unixtime;
53
        time_t t = (time_t)(m_it->unixtime);
54
        time_t t = (time_t)(m_it->unixtime);
54
        *sh = string(ctime(&t));
55
        *sh = string(ctime(&t));
55
        // Get rid of the final \n in ctime
56
        // Get rid of the final \n in ctime
56
        sh->erase(sh->length()-1);
57
        sh->erase(sh->length()-1);