Switch to unified view

a/src/qtgui/rclmain.cpp b/src/qtgui/rclmain.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: rclmain.cpp,v 1.25 2006-04-26 11:29:10 dockes Exp $ (C) 2005 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: rclmain.cpp,v 1.26 2006-04-27 06:12:10 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
...
...
440
// It would probably be better to cleanup in preview.ui.h and
440
// It would probably be better to cleanup in preview.ui.h and
441
// rclreslist.cpp and do the proper html stuff in the latter case
441
// rclreslist.cpp and do the proper html stuff in the latter case
442
// (which is different because it's format is explicit richtext
442
// (which is different because it's format is explicit richtext
443
// instead of auto as for preview, needed because it's built by
443
// instead of auto as for preview, needed because it's built by
444
// fragments?).
444
// fragments?).
445
static const char* punct = " \t()<>\"'[]{}!^*,";
445
static const char* punct = " \t()<>\"'[]{}!^*,\n\r";
446
void RclMain::ssearchAddTerm(QString term)
446
void RclMain::ssearchAddTerm(QString term)
447
{
447
{
448
    string t = (const char *)term.utf8();
448
    string t = (const char *)term.utf8();
449
    string::size_type pos = t.find_last_not_of(punct);
449
    string::size_type pos = t.find_last_not_of(punct);
450
    if (pos == string::npos)
450
    if (pos == string::npos)
...
...
540
    Rcl::Doc doc;
540
    Rcl::Doc doc;
541
    if (!resList->getDoc(docnum, doc))
541
    if (!resList->getDoc(docnum, doc))
542
    return;
542
    return;
543
    list<string> terms;
543
    list<string> terms;
544
    terms = rcldb->expand(doc);
544
    terms = rcldb->expand(doc);
545
    // Do we keep the original query. I think we'd better not.
545
    QString text = sSearch->queryText->text();
546
    QString text;// = sSearch->queryText->text();
546
    for (list<string>::iterator it = terms.begin(); it != terms.end(); it++) {
547
    for (list<string>::iterator it = terms.begin(); it != terms.end(); it++) {
547
    text += QString::fromLatin1(" \"") +
548
    text += QString::fromLatin1(" \"") +
548
        QString::fromUtf8((*it).c_str()) + QString::fromLatin1("\"");
549
        QString::fromUtf8((*it).c_str()) + QString::fromLatin1("\"");
549
    }
550
    }
550
    sSearch->queryText->setText(text);
551
    sSearch->queryText->setText(text);