Switch to unified view

a/src/qtgui/rclmain_w.cpp b/src/qtgui/rclmain_w.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.47 2008-01-17 11:15:43 dockes Exp $ (C) 2005 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.48 2008-02-19 08:02:01 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
...
...
351
        } else {
351
        } else {
352
            QMessageBox::warning(0, "Recoll", 
352
            QMessageBox::warning(0, "Recoll", 
353
                     QString::fromAscii(indexingReason.c_str()));
353
                     QString::fromAscii(indexingReason.c_str()));
354
        }
354
        }
355
        }
355
        }
356
        // Make sure we reopen the db to get the results.
356
        // Make sure we reopen the db to get the results. If there
357
      // is current search data, we should reset it else things
358
      // are inconsistent (ie: applying sort will fail. But we
359
      // don't like erasing results while the user may be
360
      // looking at them either). Fixing this would be
361
      // relatively complicated (keep an open/close gen number
362
      // and check this / restart query in DocSeqDb() ?)
357
        rcldb->close();
363
        rcldb->close();
358
    }
364
    }
359
    } else {
365
    } else {
360
    // Indexing is running
366
    // Indexing is running
361
    m_idxStatusAck = false;
367
    m_idxStatusAck = false;
...
...
418
}
424
}
419
425
420
// Start a db query and set the reslist docsource
426
// Start a db query and set the reslist docsource
421
void RclMain::startSearch(RefCntr<Rcl::SearchData> sdata)
427
void RclMain::startSearch(RefCntr<Rcl::SearchData> sdata)
422
{
428
{
423
    LOGDEB(("RclMain::startSearch\n"));
429
    LOGDEB(("RclMain::startSearch. Indexing %s\n", 
430
      indexingstatus == IDXTS_NULL?"on":"off"));
424
    // The db may have been closed at the end of indexing
431
    // The db may have been closed at the end of indexing
425
    string reason;
432
    string reason;
426
    // If indexing is being performed, we reopen the db at each query.
433
    // If indexing is being performed, we reopen the db at each query.
427
    if (!maybeOpenDb(reason, indexingstatus == IDXTS_NULL)) {
434
    if (!maybeOpenDb(reason, indexingstatus == IDXTS_NULL)) {
428
    QMessageBox::critical(0, "Recoll", QString(reason.c_str()));
435
    QMessageBox::critical(0, "Recoll", QString(reason.c_str()));
...
...
462
    m_searchData = RefCntr<Rcl::SearchData>();
469
    m_searchData = RefCntr<Rcl::SearchData>();
463
}
470
}
464
471
465
void RclMain::setDocSequence()
472
void RclMain::setDocSequence()
466
{
473
{
467
    if (m_searchData.getcnt() == 0)
474
    if (m_searchData.getcnt() == 0) {
475
  // Null refcntr ?? No current search data 
468
    return;
476
    return;
477
    }
469
    RefCntr<DocSequence> docsource;
478
    RefCntr<DocSequence> docsource;
470
    if (m_sortspecs.sortwidth > 0) {
479
    if (m_sortspecs.sortwidth > 0) {
471
    docsource = RefCntr<DocSequence>(new DocSeqSorted(m_docSource, 
480
    docsource = RefCntr<DocSequence>(new DocSeqSorted(m_docSource, 
472
                              m_sortspecs,
481
                              m_sortspecs,
473
              string(tr("Query results (sorted)").utf8())));
482
              string(tr("Query results (sorted)").utf8())));