compiles without qt3support
This commit is contained in:
parent
d70ff7ff9f
commit
419fd4b058
@ -18,30 +18,21 @@ static char rcsid[] = "@(#$Id: main.cpp,v 1.73 2008-12-17 08:01:40 dockes Exp $
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cstdlib>
|
|
||||||
|
|
||||||
#include "autoconfig.h"
|
#include "autoconfig.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
//#define WITH_KDE
|
|
||||||
#ifdef WITH_KDE
|
|
||||||
#include <kapplication.h>
|
|
||||||
#include <kmainwindow.h>
|
|
||||||
#include <kaboutdata.h>
|
|
||||||
#include <kcmdlineargs.h>
|
|
||||||
#include <klocale.h>
|
|
||||||
#else
|
|
||||||
#include <qapplication.h>
|
#include <qapplication.h>
|
||||||
#include <qtranslator.h>
|
#include <qtranslator.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <qtextcodec.h>
|
#include <qtextcodec.h>
|
||||||
#include <qtimer.h>
|
#include <qtimer.h>
|
||||||
#include <qthread.h>
|
#include <qthread.h>
|
||||||
#include <qmessagebox.h>
|
#include <qmessagebox.h>
|
||||||
#include <qcheckbox.h>
|
#include <qcheckbox.h>
|
||||||
#include <qcombobox.h>
|
#include <qcombobox.h>
|
||||||
|
#include <QLocale>
|
||||||
|
|
||||||
#include "rcldb.h"
|
#include "rcldb.h"
|
||||||
#include "rclconfig.h"
|
#include "rclconfig.h"
|
||||||
@ -50,8 +41,6 @@ static char rcsid[] = "@(#$Id: main.cpp,v 1.73 2008-12-17 08:01:40 dockes Exp $
|
|||||||
#include "smallut.h"
|
#include "smallut.h"
|
||||||
#include "rclinit.h"
|
#include "rclinit.h"
|
||||||
#include "debuglog.h"
|
#include "debuglog.h"
|
||||||
#ifdef WITH_KDE
|
|
||||||
#endif
|
|
||||||
#include "rclmain_w.h"
|
#include "rclmain_w.h"
|
||||||
#include "ssearch_w.h"
|
#include "ssearch_w.h"
|
||||||
#include "guiutils.h"
|
#include "guiutils.h"
|
||||||
@ -61,17 +50,6 @@ static char rcsid[] = "@(#$Id: main.cpp,v 1.73 2008-12-17 08:01:40 dockes Exp $
|
|||||||
#include "smallut.h"
|
#include "smallut.h"
|
||||||
#include "recollq.h"
|
#include "recollq.h"
|
||||||
|
|
||||||
#ifdef WITH_KDE
|
|
||||||
static const char description[] =
|
|
||||||
I18N_NOOP("A KDE fulltext search application");
|
|
||||||
|
|
||||||
static KCmdLineOptions options[] =
|
|
||||||
{
|
|
||||||
// { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
|
|
||||||
KCmdLineLastOption
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
RclConfig *rclconfig;
|
RclConfig *rclconfig;
|
||||||
Rcl::Db *rcldb;
|
Rcl::Db *rcldb;
|
||||||
#ifdef RCL_USE_ASPELL
|
#ifdef RCL_USE_ASPELL
|
||||||
@ -190,18 +168,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_KDE
|
|
||||||
KAboutData about("recoll", I18N_NOOP("Recoll"), Rcl::version_string(),
|
|
||||||
description,
|
|
||||||
KAboutData::License_GPL, "(C) 2006 Jean-Francois Dockes", 0, 0, "jfd@recoll.org");
|
|
||||||
about.addAuthor( "Jean-Francois Dockes", 0,
|
|
||||||
"jfd@recoll.org" );
|
|
||||||
KCmdLineArgs::init(argc, argv, &about);
|
|
||||||
KCmdLineArgs::addCmdLineOptions( options );
|
|
||||||
KApplication app;
|
|
||||||
#else
|
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
#endif
|
|
||||||
|
|
||||||
// fprintf(stderr, "Application created\n");
|
// fprintf(stderr, "Application created\n");
|
||||||
string a_config;
|
string a_config;
|
||||||
@ -241,9 +208,10 @@ int main(int argc, char **argv)
|
|||||||
question += *argv++;
|
question += *argv++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Translation file for Qt
|
// Translation file for Qt TOBEDONE ?
|
||||||
QTranslator qt( 0 );
|
QString slang = QLocale::system().name().left(2);
|
||||||
qt.load( QString( "qt_" ) + QTextCodec::locale(), "." );
|
QTranslator qt(0);
|
||||||
|
qt.load(QString("qt_") + slang, "." );
|
||||||
app.installTranslator( &qt );
|
app.installTranslator( &qt );
|
||||||
|
|
||||||
string reason;
|
string reason;
|
||||||
@ -258,10 +226,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
// Translations for Recoll
|
// Translations for Recoll
|
||||||
string translatdir = path_cat(rclconfig->getDatadir(), "translations");
|
string translatdir = path_cat(rclconfig->getDatadir(), "translations");
|
||||||
QTranslator translator( 0 );
|
QTranslator translator(0);
|
||||||
// QTextCodec::locale() returns $LANG
|
translator.load( QString("recoll_") + slang, translatdir.c_str() );
|
||||||
translator.load( QString("recoll_") + QTextCodec::locale(),
|
|
||||||
translatdir.c_str() );
|
|
||||||
app.installTranslator( &translator );
|
app.installTranslator( &translator );
|
||||||
|
|
||||||
// fprintf(stderr, "Translations installed\n");
|
// fprintf(stderr, "Translations installed\n");
|
||||||
@ -289,27 +255,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
|
|
||||||
// Create main window and set its size to previous session's
|
// Create main window and set its size to previous session's
|
||||||
#ifdef WITH_KDE
|
RclMain w;
|
||||||
#if 0
|
mainWindow = &w;
|
||||||
if (app.isRestored()) {
|
|
||||||
RESTORE(RclMain);
|
|
||||||
} else {
|
|
||||||
#endif
|
|
||||||
// no session.. just start up normally
|
|
||||||
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
|
|
||||||
/// @todo do something with the command line args here
|
|
||||||
qInitImages_recoll();
|
|
||||||
mainWindow = new RclMain;
|
|
||||||
app.setMainWidget( mainWindow );
|
|
||||||
mainWindow->show();
|
|
||||||
|
|
||||||
args->clear();
|
|
||||||
|
|
||||||
// }
|
|
||||||
#else
|
|
||||||
RclMain w;
|
|
||||||
mainWindow = &w;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (prefs.mainwidth > 100) {
|
if (prefs.mainwidth > 100) {
|
||||||
QSize s(prefs.mainwidth, prefs.mainheight);
|
QSize s(prefs.mainwidth, prefs.mainheight);
|
||||||
@ -338,7 +285,7 @@ int main(int argc, char **argv)
|
|||||||
// something to do.
|
// something to do.
|
||||||
start_idxthread(*rclconfig);
|
start_idxthread(*rclconfig);
|
||||||
|
|
||||||
mainWindow->sSearch->searchTypCMB->setCurrentItem(prefs.ssearchTyp);
|
mainWindow->sSearch->searchTypCMB->setCurrentIndex(prefs.ssearchTyp);
|
||||||
mainWindow->sSearch->searchTypeChanged(prefs.ssearchTyp);
|
mainWindow->sSearch->searchTypeChanged(prefs.ssearchTyp);
|
||||||
if (op_flags & OPT_q) {
|
if (op_flags & OPT_q) {
|
||||||
SSearch::SSearchType stype;
|
SSearch::SSearchType stype;
|
||||||
@ -351,7 +298,7 @@ int main(int argc, char **argv)
|
|||||||
} else {
|
} else {
|
||||||
stype = SSearch::SST_LANG;
|
stype = SSearch::SST_LANG;
|
||||||
}
|
}
|
||||||
mainWindow->sSearch->searchTypCMB->setCurrentItem(int(stype));
|
mainWindow->sSearch->searchTypCMB->setCurrentIndex(int(stype));
|
||||||
mainWindow->
|
mainWindow->
|
||||||
sSearch->setSearchString(QString::fromLocal8Bit(question.c_str()));
|
sSearch->setSearchString(QString::fromLocal8Bit(question.c_str()));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user