|
a/src/qtgui/main.cpp |
|
b/src/qtgui/main.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: main.cpp,v 1.28 2006-01-04 11:33:44 dockes Exp $ (C) 2005 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: main.cpp,v 1.29 2006-01-19 17:11:46 dockes Exp $ (C) 2005 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
|
4 |
|
5 |
#include <unistd.h>
|
5 |
#include <unistd.h>
|
6 |
|
6 |
|
7 |
#include <qapplication.h>
|
7 |
#include <qapplication.h>
|
|
... |
|
... |
28 |
#include "history.h"
|
28 |
#include "history.h"
|
29 |
#include "debuglog.h"
|
29 |
#include "debuglog.h"
|
30 |
|
30 |
|
31 |
#include "recollmain.h"
|
31 |
#include "recollmain.h"
|
32 |
|
32 |
|
33 |
static const char *recollprefix = RECOLL_PREFIX;
|
33 |
static const char *recoll_datadir = RECOLL_DATADIR;
|
34 |
|
34 |
|
35 |
RclConfig *rclconfig;
|
35 |
RclConfig *rclconfig;
|
36 |
Rcl::Db *rcldb;
|
36 |
Rcl::Db *rcldb;
|
37 |
int recollNeedsExit;
|
37 |
int recollNeedsExit;
|
38 |
string tmpdir;
|
38 |
string tmpdir;
|
|
... |
|
... |
135 |
QTranslator qt( 0 );
|
135 |
QTranslator qt( 0 );
|
136 |
qt.load( QString( "qt_" ) + QTextCodec::locale(), "." );
|
136 |
qt.load( QString( "qt_" ) + QTextCodec::locale(), "." );
|
137 |
a.installTranslator( &qt );
|
137 |
a.installTranslator( &qt );
|
138 |
|
138 |
|
139 |
// Translations for Recoll
|
139 |
// Translations for Recoll
|
140 |
recollsharedir = path_cat(recollprefix, "share/recoll");
|
|
|
141 |
string translatdir = path_cat(recollsharedir, "translations");
|
140 |
string translatdir = path_cat(recoll_datadir, "translations");
|
142 |
QTranslator translator( 0 );
|
141 |
QTranslator translator( 0 );
|
143 |
// QTextCodec::locale() returns $LANG
|
142 |
// QTextCodec::locale() returns $LANG
|
144 |
translator.load( QString("recoll_") + QTextCodec::locale(),
|
143 |
translator.load( QString("recoll_") + QTextCodec::locale(),
|
145 |
translatdir.c_str() );
|
144 |
translatdir.c_str() );
|
146 |
a.installTranslator( &translator );
|
145 |
a.installTranslator( &translator );
|
|
... |
|
... |
173 |
}
|
172 |
}
|
174 |
dbdir = path_tildexpand(dbdir);
|
173 |
dbdir = path_tildexpand(dbdir);
|
175 |
|
174 |
|
176 |
rclconfig->getConfParam("iconsdir", iconsdir);
|
175 |
rclconfig->getConfParam("iconsdir", iconsdir);
|
177 |
if (iconsdir.empty()) {
|
176 |
if (iconsdir.empty()) {
|
178 |
iconsdir = path_cat(recollsharedir, "images");
|
177 |
iconsdir = path_cat(recoll_datadir, "images");
|
179 |
} else {
|
178 |
} else {
|
180 |
iconsdir = path_tildexpand(iconsdir);
|
179 |
iconsdir = path_tildexpand(iconsdir);
|
181 |
}
|
180 |
}
|
182 |
|
181 |
|
183 |
if (!maketmpdir(tmpdir)) {
|
182 |
if (!maketmpdir(tmpdir)) {
|
|
... |
|
... |
230 |
// user has set a preference, we use it directly instead of guessing.
|
229 |
// user has set a preference, we use it directly instead of guessing.
|
231 |
bool startHelpBrowser(const string &iurl)
|
230 |
bool startHelpBrowser(const string &iurl)
|
232 |
{
|
231 |
{
|
233 |
string url;
|
232 |
string url;
|
234 |
if (iurl.empty()) {
|
233 |
if (iurl.empty()) {
|
235 |
url = path_cat(recollsharedir, "doc");
|
234 |
url = path_cat(recoll_datadir, "doc");
|
236 |
url = path_cat(url, "usermanual.html");
|
235 |
url = path_cat(url, "usermanual.html");
|
237 |
url = string("file://") + url;
|
236 |
url = string("file://") + url;
|
238 |
} else
|
237 |
} else
|
239 |
url = iurl;
|
238 |
url = iurl;
|
240 |
|
239 |
|