X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSession%2FSALOME_Session_Server.cxx;h=27e56ff20335723bbc49642a32e6da3352afc602;hb=b2df0ed4f0edde04e03b929672d0787fd2a5769b;hp=7e1fbe5f44136516d910becbff68af9472bdeaf8;hpb=ad6276bbf89c70b93ccef9a82800f18ff5578a00;p=modules%2Fgui.git diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index 7e1fbe5f4..27e56ff20 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -52,7 +52,9 @@ #include #include +#ifdef USE_SALOME_STYLE #include +#endif // USE_SALOME_STYLE #include "GUI_version.h" #include @@ -97,19 +99,24 @@ * - stop Session ( must be idle ) * - get session state */ - +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) void MessageOutput( QtMsgType type, const char* msg ) +#else +void MessageOutput( QtMsgType type, const QMessageLogContext &context, const QString &msg ) +#endif { switch ( type ) { case QtDebugMsg: - //MESSAGE( "Debug: " << msg ); +#ifdef QT_DEBUG_MESSAGE + MESSAGE( "Debug: " << qPrintable( QString(msg) ) ); +#endif break; case QtWarningMsg: - MESSAGE( "Warning: " << msg ); + MESSAGE( "Warning: " << qPrintable( QString(msg) ) ); break; case QtFatalMsg: - MESSAGE( "Fatal: " << msg ); + MESSAGE( "Fatal: " << qPrintable( QString(msg) ) ); break; } } @@ -251,7 +258,8 @@ public: SALOME_QApplication( int& argc, char** argv ) : TestApplication( argc, argv ), myHandler ( 0 ) {} #else SALOME_QApplication( int& argc, char** argv ) -#ifndef WIN32 +// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5 +#if !defined WIN32 && QT_VERSION < QT_VERSION_CHECK(5, 0, 0) // san: Opening an X display and choosing a visual most suitable for 3D visualization // in order to make SALOME viewers work with non-native X servers : QApplication( (Display*)Qtx::getDisplay(), argc, argv, Qtx::getVisual() ), @@ -341,20 +349,27 @@ void shutdownServers( SALOME_NamingService* theNS ) int main( int argc, char **argv ) { // Install Qt debug messages handler +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) qInstallMsgHandler( MessageOutput ); +#else + qInstallMessageHandler( MessageOutput ); +#endif +// TODO (QT5 PORTING) Below is a temporary solution, to allow compiling with Qt 5 +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) //Set a "native" graphic system in case if application runs on the remote host QString remote(getenv("REMOTEHOST")); QString client(getenv("SSH_CLIENT")); if(remote.length() > 0 || client.length() > 0 ) { QApplication::setGraphicsSystem(QLatin1String("native")); } - +#endif + // add /plugins dir to the pluins search path for image plugins QString qtdir = Qtx::qtDir( "plugins" ); if ( !qtdir.isEmpty() ) QApplication::addLibraryPath( qtdir ); - + // set "C" locale if requested via preferences { SALOME_Session stmp( argc, argv ); @@ -377,7 +392,7 @@ int main( int argc, char **argv ) _qappl.setApplicationVersion( salomeVersion() ); // Add application library path (to search style plugin etc...) - QString path = QDir::convertSeparators( SUIT_Tools::addSlash( QString( ::getenv( "GUI_ROOT_DIR" ) ) ) + QString( "bin/salome" ) ); + QString path = QDir::toNativeSeparators( SUIT_Tools::addSlash( QString( ::getenv( "GUI_ROOT_DIR" ) ) ) + QString( "bin/salome" ) ); _qappl.addLibraryPath( path ); bool isGUI = isFound( "GUI", argc, argv ); @@ -564,9 +579,11 @@ int main( int argc, char **argv ) SUIT_Application* aGUIApp = aGUISession->startApplication( "SalomeApp", 0, 0 ); if ( aGUIApp ) { +#ifdef USE_SALOME_STYLE Style_Salome::initialize( aGUIApp->resourceMgr() ); if ( aGUIApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) ) Style_Salome::apply(); +#endif // USE_SALOME_STYLE if ( !isFound( "noexcepthandler", argc, argv ) ) _qappl.setHandler( aGUISession->handler() ); // after loading SalomeApp application