|
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.16 2006-04-01 08:07:43 dockes Exp $ (C) 2005 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: rclmain.cpp,v 1.17 2006-04-01 21:02:12 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
|
|
... |
|
... |
525 |
}
|
525 |
}
|
526 |
|
526 |
|
527 |
/** Show detailed expansion of a query */
|
527 |
/** Show detailed expansion of a query */
|
528 |
void RclMain::showQueryDetails()
|
528 |
void RclMain::showQueryDetails()
|
529 |
{
|
529 |
{
|
530 |
// Break query into lines of reasonable length, avoid cutting words!
|
530 |
// Break query into lines of reasonable length, avoid cutting words,
|
|
|
531 |
// Also limit the total number of lines.
|
531 |
const unsigned int ll = 80;
|
532 |
const unsigned int ll = 100;
|
|
|
533 |
const unsigned int maxlines = 50;
|
532 |
string query = currentQueryData.description;
|
534 |
string query = currentQueryData.description;
|
533 |
string oq;
|
535 |
string oq;
|
|
|
536 |
unsigned int nlines = 0;
|
534 |
while (query.length() > 0) {
|
537 |
while (query.length() > 0) {
|
535 |
string ss = query.substr(0, ll);
|
538 |
string ss = query.substr(0, ll);
|
536 |
if (ss.length() == ll) {
|
539 |
if (ss.length() == ll) {
|
537 |
string::size_type pos = ss.find_last_of(" ");
|
540 |
string::size_type pos = ss.find_last_of(" ");
|
538 |
if (pos == string::npos) {
|
541 |
if (pos == string::npos) {
|
|
... |
|
... |
550 |
LOGDEB(("showQueryDetails: Internal error!\n"));
|
553 |
LOGDEB(("showQueryDetails: Internal error!\n"));
|
551 |
oq = query;
|
554 |
oq = query;
|
552 |
break;
|
555 |
break;
|
553 |
}
|
556 |
}
|
554 |
oq += ss + "\n";
|
557 |
oq += ss + "\n";
|
|
|
558 |
if (nlines++ >= maxlines) {
|
|
|
559 |
oq += " ... \n";
|
|
|
560 |
break;
|
|
|
561 |
}
|
555 |
query= query.substr(ss.length());
|
562 |
query= query.substr(ss.length());
|
556 |
LOGDEB1(("oq [%s]\n, query [%s]\n, ss [%s]\n",
|
563 |
LOGDEB1(("oq [%s]\n, query [%s]\n, ss [%s]\n",
|
557 |
oq.c_str(), query.c_str(), ss.c_str()));
|
564 |
oq.c_str(), query.c_str(), ss.c_str()));
|
558 |
}
|
565 |
}
|
559 |
|
566 |
|