From: Andrey Paskal Date: Sat, 26 Jul 2008 07:49:41 +0000 (+0400) Subject: Sync with CVS HEAD. X-Git-Url: https://gitweb.ananas.su/?a=commitdiff_plain;h=2ffa32438d0084d8f7a6ddbe1b93f2546458dbf2;p=projects%2Fananas-labs.git Sync with CVS HEAD. Minor changes in binreloc logic and aLog init. --- diff --git a/src/ananas/main.cpp b/src/ananas/main.cpp index ac07996..d8a77a9 100644 --- a/src/ananas/main.cpp +++ b/src/ananas/main.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** $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 ** @@ -51,13 +51,6 @@ int setTranslator(QString lang) #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","."); @@ -137,6 +130,16 @@ int main( int argc, char ** argv ) 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 ); @@ -147,23 +150,16 @@ int main( int argc, char ** argv ) 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") ); diff --git a/src/designer/main.cpp b/src/designer/main.cpp index 58568c0..af9b38a 100644 --- a/src/designer/main.cpp +++ b/src/designer/main.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** $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 ** @@ -56,13 +56,6 @@ int setTranslator(QString lang) #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","."); @@ -145,6 +138,14 @@ int main( int argc, char ** argv ) 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 ); @@ -155,24 +156,17 @@ int main( int argc, char ** argv ) 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 ); diff --git a/src/lib/alog.cpp b/src/lib/alog.cpp index d1667aa..d9fce08 100644 --- a/src/lib/alog.cpp +++ b/src/lib/alog.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** $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 @@ -148,7 +148,8 @@ aLog::init(const QString &log_name, int show_up) 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 ); diff --git a/src/lib/lib.pro b/src/lib/lib.pro index 50bf8db..78f5617 100644 --- a/src/lib/lib.pro +++ b/src/lib/lib.pro @@ -123,7 +123,7 @@ shared { win32:DEFINES += ANANAS_NO_DLL } -unix:DEFINES += ENABLE_BINRELOC +#unix:DEFINES += ENABLE_BINRELOC # prodject file of Ananas Library include ( ../ananas.pri ) diff --git a/src/plugins/engine.cpp b/src/plugins/engine.cpp index 8abcb1c..c8546ac 100644 --- a/src/plugins/engine.cpp +++ b/src/plugins/engine.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** $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 @@ -86,7 +86,7 @@ aObjectsFactory::aObjectsFactory( aEngine *e ) registerClass("DataField","aDataField"); // registerClass("reg","QAreg"); registerClass("Journal","aDocJournal"); - registerClass("ComboBox","AComboBox"); +// registerClass("ComboBox","AComboBox"); //registerClass("djournalview","QAjournview"); // registerClass("djournalview","QAdocjournal"); // registerClass("form","AForms");