|
a/src/qtgui/main.cpp |
|
b/src/qtgui/main.cpp |
|
... |
|
... |
49 |
#include "readfile.h"
|
49 |
#include "readfile.h"
|
50 |
|
50 |
|
51 |
#include "recollq.h"
|
51 |
#include "recollq.h"
|
52 |
|
52 |
|
53 |
extern RclConfig *theconfig;
|
53 |
extern RclConfig *theconfig;
|
54 |
RclConfig *thestableconfig;
|
|
|
55 |
PTMutexInit thestableconfiglock;
|
|
|
56 |
|
54 |
|
57 |
// To avoid writing settings if we stopped before reading them (else
|
55 |
// To avoid writing settings if we stopped before reading them (else
|
58 |
// some kinds of errors would reset the qt/recoll settings to
|
56 |
// some kinds of errors would reset the qt/recoll settings to
|
59 |
// defaults)
|
57 |
// defaults)
|
60 |
static bool havereadsettings;
|
58 |
static bool havereadsettings;
|
61 |
|
|
|
62 |
void snapshotConfig()
|
|
|
63 |
{
|
|
|
64 |
PTMutexLocker locker(thestableconfiglock);
|
|
|
65 |
thestableconfig = new RclConfig(*theconfig);
|
|
|
66 |
}
|
|
|
67 |
|
59 |
|
68 |
PTMutexInit thetempfileslock;
|
60 |
PTMutexInit thetempfileslock;
|
69 |
static vector<TempFile> o_tempfiles;
|
61 |
static vector<TempFile> o_tempfiles;
|
70 |
/* Keep an array of temporary files for deletion at exit. It happens that we
|
62 |
/* Keep an array of temporary files for deletion at exit. It happens that we
|
71 |
erase some of them before exiting (ie: when closing a preview tab), we don't
|
63 |
erase some of them before exiting (ie: when closing a preview tab), we don't
|
|
... |
|
... |
154 |
rwSettings(true);
|
146 |
rwSettings(true);
|
155 |
}
|
147 |
}
|
156 |
LOGDEB2(("recollCleanup: closing database\n"));
|
148 |
LOGDEB2(("recollCleanup: closing database\n"));
|
157 |
deleteZ(rcldb);
|
149 |
deleteZ(rcldb);
|
158 |
deleteZ(theconfig);
|
150 |
deleteZ(theconfig);
|
159 |
// deleteZ(thestableconfig);
|
|
|
160 |
|
151 |
|
161 |
PTMutexLocker locker(thetempfileslock);
|
152 |
PTMutexLocker locker(thetempfileslock);
|
162 |
o_tempfiles.clear();
|
153 |
o_tempfiles.clear();
|
163 |
|
154 |
|
164 |
#ifdef RCL_USE_ASPELL
|
155 |
#ifdef RCL_USE_ASPELL
|
|
... |
|
... |
306 |
msg += QString::fromUtf8(reason.c_str());
|
297 |
msg += QString::fromUtf8(reason.c_str());
|
307 |
QMessageBox::critical(0, "Recoll", msg);
|
298 |
QMessageBox::critical(0, "Recoll", msg);
|
308 |
exit(1);
|
299 |
exit(1);
|
309 |
}
|
300 |
}
|
310 |
// fprintf(stderr, "recollinit done\n");
|
301 |
// fprintf(stderr, "recollinit done\n");
|
311 |
snapshotConfig();
|
|
|
312 |
|
302 |
|
313 |
// Translations for Qt standard widgets
|
303 |
// Translations for Qt standard widgets
|
314 |
QString slang = QLocale::system().name().left(2);
|
304 |
QString slang = QLocale::system().name().left(2);
|
315 |
QTranslator qt_trans(0);
|
305 |
QTranslator qt_trans(0);
|
316 |
qt_trans.load(QString("qt_%1").arg(slang),
|
306 |
qt_trans.load(QString("qt_%1").arg(slang),
|