|
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.12 2005-11-05 14:40:50 dockes Exp $ (C) 2005 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: main.cpp,v 1.13 2005-11-06 15:07:09 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>
|
|
... |
|
... |
86 |
}
|
86 |
}
|
87 |
|
87 |
|
88 |
int main( int argc, char ** argv )
|
88 |
int main( int argc, char ** argv )
|
89 |
{
|
89 |
{
|
90 |
QApplication a(argc, argv);
|
90 |
QApplication a(argc, argv);
|
91 |
|
91 |
|
92 |
QTranslator translator( 0 );
|
92 |
QTranslator translator( 0 );
|
93 |
// QTextCodec::locale() return $LANG
|
93 |
// QTextCodec::locale() return $LANG
|
94 |
translator.load( QString("recoll_") + QTextCodec::locale(), "." );
|
94 |
translator.load( QString("recoll_") + QTextCodec::locale(), "." );
|
95 |
a.installTranslator( &translator );
|
95 |
a.installTranslator( &translator );
|
96 |
|
96 |
|
97 |
RecollMain w;
|
97 |
RecollMain w;
|
98 |
w.show();
|
98 |
w.show();
|
99 |
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
|
99 |
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
|
100 |
QTimer *timer = new QTimer(&a);
|
100 |
QTimer *timer = new QTimer(&a);
|
101 |
w.connect(timer, SIGNAL(timeout()), &w, SLOT(checkExit()));
|
101 |
w.connect(timer, SIGNAL(timeout()), &w, SLOT(periodic100()));
|
102 |
timer->start(100);
|
102 |
timer->start(100);
|
103 |
|
103 |
|
104 |
string reason;
|
104 |
string reason;
|
105 |
rclconfig = recollinit(recollCleanup, sigcleanup, reason);
|
105 |
rclconfig = recollinit(recollCleanup, sigcleanup, reason);
|
106 |
|
106 |
|
|
... |
|
... |
134 |
if (!rcldb || !rcldb->open(dbdir, Rcl::Db::DbRO)) {
|
134 |
if (!rcldb || !rcldb->open(dbdir, Rcl::Db::DbRO)) {
|
135 |
startindexing = 1;
|
135 |
startindexing = 1;
|
136 |
QMessageBox::information(0, "Recoll",
|
136 |
QMessageBox::information(0, "Recoll",
|
137 |
QString("Could not open database in ") +
|
137 |
QString("Could not open database in ") +
|
138 |
QString(dbdir) + ". Starting indexation");
|
138 |
QString(dbdir) + ". Starting indexation");
|
139 |
startindexing = 1;
|
|
|
140 |
}
|
139 |
}
|
141 |
|
140 |
|
142 |
start_idxthread(rclconfig);
|
141 |
start_idxthread(rclconfig);
|
143 |
|
142 |
|
144 |
return a.exec();
|
143 |
return a.exec();
|