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.70 2008-09-30 12:38:29 dockes Exp $ (C) 2005 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: main.cpp,v 1.71 2008-11-24 15:23:12 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
...
...
70
{
70
{
71
//    { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
71
//    { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
72
    KCmdLineLastOption
72
    KCmdLineLastOption
73
};
73
};
74
#endif
74
#endif
75
76
const string recoll_datadir = RECOLL_DATADIR;
77
75
78
RclConfig *rclconfig;
76
RclConfig *rclconfig;
79
Rcl::Db *rcldb;
77
Rcl::Db *rcldb;
80
#ifdef RCL_USE_ASPELL
78
#ifdef RCL_USE_ASPELL
81
Aspell *aspell;
79
Aspell *aspell;
...
...
235
    // Translation file for Qt
233
    // Translation file for Qt
236
    QTranslator qt( 0 );
234
    QTranslator qt( 0 );
237
    qt.load( QString( "qt_" ) + QTextCodec::locale(), "." );
235
    qt.load( QString( "qt_" ) + QTextCodec::locale(), "." );
238
    app.installTranslator( &qt );
236
    app.installTranslator( &qt );
239
237
238
    string reason;
239
    rclconfig = recollinit(recollCleanup, sigcleanup, reason, &a_config);
240
    if (!rclconfig || !rclconfig->ok()) {
241
  QString msg = "Configuration problem: ";
242
  msg += QString::fromUtf8(reason.c_str());
243
  QMessageBox::critical(0, "Recoll",  msg);
244
  exit(1);
245
    }
246
    //    fprintf(stderr, "recollinit done\n");
247
240
    // Translations for Recoll
248
    // Translations for Recoll
241
    string translatdir = path_cat(recoll_datadir, "translations");
249
    string translatdir = path_cat(rclconfig->getDatadir(), "translations");
242
    QTranslator translator( 0 );
250
    QTranslator translator( 0 );
243
    // QTextCodec::locale() returns $LANG
251
    // QTextCodec::locale() returns $LANG
244
    translator.load( QString("recoll_") + QTextCodec::locale(), 
252
    translator.load( QString("recoll_") + QTextCodec::locale(), 
245
             translatdir.c_str() );
253
             translatdir.c_str() );
246
    app.installTranslator( &translator );
254
    app.installTranslator( &translator );
247
255
248
    //    fprintf(stderr, "Translations installed\n");
256
    //    fprintf(stderr, "Translations installed\n");
249
250
    string reason;
251
    rclconfig = recollinit(recollCleanup, sigcleanup, reason, &a_config);
252
    if (!rclconfig || !rclconfig->ok()) {
253
  QString msg = app.translate("Main", "Configuration problem: ");
254
  msg += QString::fromUtf8(reason.c_str());
255
  QMessageBox::critical(0, "Recoll",  msg);
256
  exit(1);
257
    }
258
    //    fprintf(stderr, "recollinit done\n");
259
257
260
#ifdef RCL_USE_ASPELL
258
#ifdef RCL_USE_ASPELL
261
    aspell = new Aspell(rclconfig);
259
    aspell = new Aspell(rclconfig);
262
    aspell->init(reason);
260
    aspell->init(reason);
263
    if (!aspell || !aspell->ok()) {
261
    if (!aspell || !aspell->ok()) {