|
a/src/qtgui/guiutils.cpp |
|
b/src/qtgui/guiutils.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.5 2006-04-04 10:38:52 dockes Exp $ (C) 2005 Jean-Francois Dockes";
|
2 |
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.6 2006-04-05 12:50:42 dockes Exp $ (C) 2005 Jean-Francois 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
|
|
... |
|
... |
22 |
#include "debuglog.h"
|
22 |
#include "debuglog.h"
|
23 |
#include "smallut.h"
|
23 |
#include "smallut.h"
|
24 |
#include "recoll.h"
|
24 |
#include "recoll.h"
|
25 |
#include "guiutils.h"
|
25 |
#include "guiutils.h"
|
26 |
#include "pathut.h"
|
26 |
#include "pathut.h"
|
|
|
27 |
#include "base64.h"
|
27 |
|
28 |
|
28 |
#include <qsettings.h>
|
29 |
#include <qsettings.h>
|
|
|
30 |
#include <qstringlist.h>
|
29 |
|
31 |
|
30 |
const static char *htmlbrowserlist =
|
32 |
const static char *htmlbrowserlist =
|
31 |
"opera konqueror firefox mozilla netscape";
|
33 |
"opera konqueror firefox mozilla netscape";
|
32 |
|
34 |
|
33 |
// Search for and launch an html browser for the documentation. If the
|
35 |
// Search for and launch an html browser for the documentation. If the
|
|
... |
|
... |
127 |
|
129 |
|
128 |
SETTING_RW(prefs.queryBuildAbstract,
|
130 |
SETTING_RW(prefs.queryBuildAbstract,
|
129 |
"/Recoll/prefs/query/buildAbstract", Bool, true);
|
131 |
"/Recoll/prefs/query/buildAbstract", Bool, true);
|
130 |
SETTING_RW(prefs.queryReplaceAbstract,
|
132 |
SETTING_RW(prefs.queryReplaceAbstract,
|
131 |
"/Recoll/prefs/query/replaceAbstract", Bool, false);
|
133 |
"/Recoll/prefs/query/replaceAbstract", Bool, false);
|
|
|
134 |
|
|
|
135 |
QStringList qsl;
|
|
|
136 |
if (writing) {
|
|
|
137 |
for (list<string>::const_iterator it = prefs.allExtraDbs.begin();
|
|
|
138 |
it != prefs.allExtraDbs.end(); it++) {
|
|
|
139 |
string b64;
|
|
|
140 |
base64_encode(*it, b64);
|
|
|
141 |
qsl.push_back(QString::fromAscii(b64.c_str()));
|
|
|
142 |
}
|
|
|
143 |
settings.writeEntry("/Recoll/prefs/query/allExtraDbs", qsl);
|
|
|
144 |
|
|
|
145 |
qsl.clear();
|
|
|
146 |
for (list<string>::const_iterator it = prefs.activeExtraDbs.begin();
|
|
|
147 |
it != prefs.activeExtraDbs.end(); it++) {
|
|
|
148 |
string b64;
|
|
|
149 |
base64_encode(*it, b64);
|
|
|
150 |
qsl.push_back(QString::fromAscii(b64.c_str()));
|
|
|
151 |
}
|
|
|
152 |
settings.writeEntry("/Recoll/prefs/query/activeExtraDbs", qsl);
|
|
|
153 |
} else {
|
|
|
154 |
qsl = settings.readListEntry("/Recoll/prefs/query/allExtraDbs");
|
|
|
155 |
prefs.allExtraDbs.clear();
|
|
|
156 |
for (QStringList::iterator it = qsl.begin(); it != qsl.end(); it++) {
|
|
|
157 |
string dec;
|
|
|
158 |
base64_decode((*it).ascii(), dec);
|
|
|
159 |
prefs.allExtraDbs.push_back(dec);
|
|
|
160 |
}
|
|
|
161 |
|
|
|
162 |
qsl = settings.readListEntry("/Recoll/prefs/query/activeExtraDbs");
|
|
|
163 |
prefs.activeExtraDbs.clear();
|
|
|
164 |
for (QStringList::iterator it = qsl.begin(); it != qsl.end(); it++) {
|
|
|
165 |
string dec;
|
|
|
166 |
base64_decode((*it).ascii(), dec);
|
|
|
167 |
prefs.activeExtraDbs.push_back(dec);
|
|
|
168 |
}
|
|
|
169 |
}
|
|
|
170 |
|
|
|
171 |
#if 1
|
|
|
172 |
{
|
|
|
173 |
list<string>::const_iterator it;
|
|
|
174 |
fprintf(stderr, "All extra Dbs:\n");
|
|
|
175 |
for (it = prefs.allExtraDbs.begin();
|
|
|
176 |
it != prefs.allExtraDbs.end(); it++) {
|
|
|
177 |
fprintf(stderr, " [%s]\n", it->c_str());
|
|
|
178 |
}
|
|
|
179 |
fprintf(stderr, "Active extra Dbs:\n");
|
|
|
180 |
for (it = prefs.activeExtraDbs.begin();
|
|
|
181 |
it != prefs.activeExtraDbs.end(); it++) {
|
|
|
182 |
fprintf(stderr, " [%s]\n", it->c_str());
|
|
|
183 |
}
|
|
|
184 |
}
|
|
|
185 |
#endif
|
132 |
}
|
186 |
}
|
133 |
|
187 |
|
134 |
|
188 |
|