Switch to unified view

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.51 2006-09-28 11:55:30 dockes Exp $ (C) 2005 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: main.cpp,v 1.52 2006-10-11 14:16:26 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
...
...
16
 *   along with this program; if not, write to the
16
 *   along with this program; if not, write to the
17
 *   Free Software Foundation, Inc.,
17
 *   Free Software Foundation, Inc.,
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
 */
19
 */
20
20
21
#include "autoconfig.h"
22
21
#include <unistd.h>
23
#include <unistd.h>
22
24
23
//#define WITH_KDE
25
//#define WITH_KDE
24
#ifdef WITH_KDE
26
#ifdef WITH_KDE
25
#include <kapplication.h>
27
#include <kapplication.h>
...
...
49
#ifdef WITH_KDE
51
#ifdef WITH_KDE
50
#include "rclversion.h"
52
#include "rclversion.h"
51
#endif
53
#endif
52
#include "rclmain_w.h"
54
#include "rclmain_w.h"
53
#include "guiutils.h"
55
#include "guiutils.h"
56
#ifdef RCL_USE_ASPELL
57
#include "rclaspell.h"
58
#endif
54
59
55
#ifdef WITH_KDE
60
#ifdef WITH_KDE
56
static const char description[] =
61
static const char description[] =
57
    I18N_NOOP("A KDE fulltext search application");
62
    I18N_NOOP("A KDE fulltext search application");
58
63
...
...
66
71
67
const string recoll_datadir = RECOLL_DATADIR;
72
const string recoll_datadir = RECOLL_DATADIR;
68
73
69
RclConfig *rclconfig;
74
RclConfig *rclconfig;
70
Rcl::Db *rcldb;
75
Rcl::Db *rcldb;
76
#ifdef RCL_USE_ASPELL
77
Aspell *aspell;
78
#endif
71
79
72
RclHistory *g_dynconf;
80
RclHistory *g_dynconf;
73
int recollNeedsExit;
81
int recollNeedsExit;
74
static string dbdir;
82
static string dbdir;
75
static RclMain *mainWindow;
83
static RclMain *mainWindow;
...
...
121
    LOGDEB2(("recollCleanup: closing database\n"));
129
    LOGDEB2(("recollCleanup: closing database\n"));
122
    delete rcldb;
130
    delete rcldb;
123
    rcldb = 0;
131
    rcldb = 0;
124
    delete rclconfig;
132
    delete rclconfig;
125
    rclconfig = 0;
133
    rclconfig = 0;
134
#ifdef RCL_USE_ASPELL
135
    delete aspell;
136
    aspell = 0;
137
#endif
126
    LOGDEB2(("recollCleanup: done\n"));
138
    LOGDEB2(("recollCleanup: done\n"));
127
}
139
}
128
140
129
static void sigcleanup(int)
141
static void sigcleanup(int)
130
{
142
{
...
...
212
    QMessageBox::critical(0, "Recoll",  msg);
224
    QMessageBox::critical(0, "Recoll",  msg);
213
    exit(1);
225
    exit(1);
214
    }
226
    }
215
    //    fprintf(stderr, "recollinit done\n");
227
    //    fprintf(stderr, "recollinit done\n");
216
228
229
#ifdef RCL_USE_ASPELL
230
    aspell = new Aspell(rclconfig);
231
    aspell->init(reason);
232
    if (!aspell || !aspell->ok()) {
233
  LOGDEB(("Aspell speller creation failed %s\n", reason.c_str()));
234
  aspell = 0;
235
    }
236
#endif
237
217
    string historyfile = path_cat(rclconfig->getConfDir(), "history");
238
    string historyfile = path_cat(rclconfig->getConfDir(), "history");
218
    g_dynconf = new RclHistory(historyfile);
239
    g_dynconf = new RclHistory(historyfile);
219
    if (!g_dynconf || !g_dynconf->ok()) {
240
    if (!g_dynconf || !g_dynconf->ok()) {
220
    QString msg = app.translate("Main", "Configuration problem (dynconf");
241
    QString msg = app.translate("Main", "Configuration problem (dynconf");
221
    QMessageBox::critical(0, "Recoll",  msg);
242
    QMessageBox::critical(0, "Recoll",  msg);