Minor changes in binreloc logic and aLog init.
/****************************************************************************
-** $Id: main.cpp,v 1.40 2008/07/05 12:19:39 app Exp $
+** $Id: main.cpp,v 1.42 2008/07/19 07:01:36 leader Exp $
**
** Main file of Ananas Engine application
**
#ifdef _Windows
langdir = qApp->applicationDirPath()+"/translations/";
#else
- BrInitError error;
- if (br_init_lib(&error) == 0 && error != BR_INIT_ERROR_DISABLED) {
- aLog::print(aLog::MT_INFO, QObject::tr("Warning: BinReloc failed to initialize (error code %1)\n").arg(error));
- aLog::print(aLog::MT_INFO, QObject::tr("Will fallback to hardcoded default path.\n"));
- }
- aLog::print(aLog::MT_DEBUG, QObject::tr("setTranslator - BinReloc path to data dir is %1.\n").arg( br_find_data_dir("/usr/share") ));
-
langdir = QString(br_find_data_dir("/usr/share")) + QString("/ananas/translations/");
#endif
tr_app.load( langdir+"ananas-engine-"+lang.lower()+".qm",".");
BrInitError error;
QTextCodec::setCodecForCStrings( QTextCodec::codecForName("UTF8") );
+ aLog::init("",aLog::MT_DEBUG);
+
+#ifndef _Windows
+ if (br_init_lib(&error) == 0 && error != BR_INIT_ERROR_DISABLED) {
+ aLog::print(aLog::MT_INFO, QObject::tr("Warning: BinReloc failed to initialize (error code %1)\n").arg(error));
+ aLog::print(aLog::MT_INFO, QObject::tr("Will fallback to hardcoded default path.\n"));
+ }
+ aLog::print(aLog::MT_DEBUG, QObject::tr("main - BinReloc path to data dir is %1.\n").arg( br_find_data_dir("/usr/share") ));
+ aLog::print(aLog::MT_DEBUG, QObject::tr("main - BinReloc path to lib dir is %1.\n").arg( br_find_data_dir("/usr/lib") ));
+#endif
if ( parseCommandLine( qApp->argc(), qApp->argv() ) ) return 1;
qApp->installTranslator( &tr_app );
qApp->installTranslator( &tr_lib );
pixmap = QPixmap::fromMimeSource( qApp->applicationDirPath()+"/engine-splash-"+lang+".png" );
qApp->addLibraryPath( qApp->applicationDirPath() );
#else
- if (br_init_lib(&error) == 0 && error != BR_INIT_ERROR_DISABLED) {
- aLog::print(aLog::MT_INFO, QObject::tr("Warning: BinReloc failed to initialize (error code %1)\n").arg(error));
- aLog::print(aLog::MT_INFO, QObject::tr("Will fallback to hardcoded default path.\n"));
- }
- aLog::print(aLog::MT_DEBUG, QObject::tr("main - BinReloc path to data dir is %1.\n").arg( br_find_data_dir("/usr/share") ));
- aLog::print(aLog::MT_DEBUG, QObject::tr("main - BinReloc path to lib dir is %1.\n").arg( br_find_data_dir("/usr/lib") ));
-
pixmap = QPixmap::fromMimeSource( QString(br_find_data_dir("/usr/share") ) + "/ananas/designer/locale/engine-splash-"+lang+".png");
qApp->addLibraryPath( QString( br_find_lib_dir("/usr/lib")) + "/ananas/qt3plugins" );
- QStringList list = a.libraryPaths();
- QString libPath = "";
- QStringList::Iterator it = list.begin();
- while( it != list.end() ) {
- libPath += *it+":";
- ++it;
- }
+ QStringList list = a.libraryPaths();
+ QString libPath = "";
+ QStringList::Iterator it = list.begin();
+ while( it != list.end() ) {
+ libPath += *it+":";
+ ++it;
+ }
aLog::print(aLog::MT_DEBUG, QString("main - qt library path is '%1'\n").arg( libPath));
#endif
printf("extensions: \n%s\n",( const char *) AExtensionFactory::keys().join("\n") );
/****************************************************************************
-** $Id: main.cpp,v 1.34 2007/09/18 11:56:37 app Exp $
+** $Id: main.cpp,v 1.36 2008/07/19 07:01:36 leader Exp $
**
** Main file of Ananas Designer application
**
#ifdef Q_OS_WIN32
langdir = qApp->applicationDirPath()+"/translations/";
#else
- BrInitError error;
- if (br_init_lib(&error) == 0 && error != BR_INIT_ERROR_DISABLED) {
- aLog::print(aLog::MT_INFO, QObject::tr("Warning: BinReloc failed to initialize (error code %1)\n").arg(error));
- aLog::print(aLog::MT_INFO, QObject::tr("Will fallback to hardcoded default path.\n"));
- }
- aLog::print(aLog::MT_DEBUG, QObject::tr("setTranslator - BinReloc path to data dir is %1.\n").arg( br_find_data_dir("/usr/share") ));
-
langdir = QString( br_find_data_dir( "/usr/share") ) + "/ananas/translations/";
#endif
tr_app.load( langdir+"ananas-designer-"+lang+".qm",".");
QPixmap pixmap;
BrInitError error;
+ aLog::init("",aLog::MT_DEBUG);
+#ifndef Q_OS_WIN32
+ if (br_init_lib(&error) == 0 && error != BR_INIT_ERROR_DISABLED) {
+ aLog::print(aLog::MT_INFO, QObject::tr("Warning: BinReloc failed to initialize (error code %1)\n").arg(error));
+ aLog::print(aLog::MT_INFO, QObject::tr("Will fallback to hardcoded default path.\n"));
+ }
+ aLog::print(aLog::MT_DEBUG, QObject::tr("main - BinReloc path to data dir is %1.\n").arg( br_find_data_dir("/usr/share") ));
+#endif
if ( parseCommandLine( argc, argv ) ) return 1;
qApp->installTranslator( &tr_lib );
qApp->installTranslator( &tr_plugins );
pixmap = QPixmap::fromMimeSource( qApp->applicationDirPath()+"/designer-splash-"+lang+".png" );
qApp->addLibraryPath( qApp->applicationDirPath() );
#else
- if (br_init_lib(&error) == 0 && error != BR_INIT_ERROR_DISABLED) {
- aLog::print(aLog::MT_INFO, QObject::tr("Warning: BinReloc failed to initialize (error code %1)\n").arg(error));
- aLog::print(aLog::MT_INFO, QObject::tr("Will fallback to hardcoded default path.\n"));
- }
- aLog::print(aLog::MT_DEBUG, QObject::tr("main - BinReloc path to data dir is %1.\n").arg( br_find_data_dir("/usr/share") ));
-
pixmap = QPixmap::fromMimeSource( QString(br_find_data_dir("/usr/share")) + "/ananas/designer/locale/designer-splash-"+lang+".png" );
qApp->addLibraryPath( QString( br_find_lib_dir("/usr/lib")) + "/ananas/qt3plugins" );
-
- QStringList list = app.libraryPaths();
- QString libPath = "";
- QStringList::Iterator it = list.begin();
- while( it != list.end() ) {
- libPath += *it+":";
- ++it;
- }
- aLog::print(aLog::MT_DEBUG, QString("main - qt library path is '%1'\n").arg( libPath));
#endif
+ QStringList list = app.libraryPaths();
+ QString libPath = "";
+ QStringList::Iterator it = list.begin();
+ while( it != list.end() ) {
+ libPath += *it+":";
+ ++it;
+ }
+ aLog::print(aLog::MT_DEBUG, QString("main - qt library path is '%1'\n").arg( libPath));
if ( pixmap.isNull() )
pixmap = QPixmap::fromMimeSource( "designer-splash-en.png" );
QSplashScreen *splash = new QSplashScreen( pixmap );
/****************************************************************************
-** $Id: alog.cpp,v 1.10 2007/05/26 19:01:06 leader Exp $
+** $Id: alog.cpp,v 1.11 2008/07/19 07:01:36 leader Exp $
**
** Log functions source file of
** Ananas application library
if(logLev=="DEBUG") aLog::logLevel = aLog::MT_DEBUG;
aLog::logName = log;
-
+
+ if (aLog::f.isOpen()) f.close();
aLog::f.setName(getLogName());
aLog::f.open( IO_WriteOnly | IO_Append );
win32:DEFINES += ANANAS_NO_DLL
}
-unix:DEFINES += ENABLE_BINRELOC
+#unix:DEFINES += ENABLE_BINRELOC
# prodject file of Ananas Library
include ( ../ananas.pri )
/****************************************************************************
-** $Id: engine.cpp,v 1.42 2008/07/05 12:19:40 app Exp $
+** $Id: engine.cpp,v 1.43 2008/07/19 07:12:38 leader Exp $
**
** Code file of the Ananas Engine of Ananas
** Engine applications
registerClass("DataField","aDataField");
// registerClass("reg","QAreg");
registerClass("Journal","aDocJournal");
- registerClass("ComboBox","AComboBox");
+// registerClass("ComboBox","AComboBox");
//registerClass("djournalview","QAjournview");
// registerClass("djournalview","QAdocjournal");
// registerClass("form","AForms");