Salome HOME
projects
/
modules
/
gui.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
GUI launcher: systematize run procedure
[modules/gui.git]
/
src
/
SUIT
/
SUIT_ResourceMgr.cxx
diff --git
a/src/SUIT/SUIT_ResourceMgr.cxx
b/src/SUIT/SUIT_ResourceMgr.cxx
index 2e127d376ede6cd500e50cf73837be1bcd50f26e..6da123a541d1d483d90376f4397e1dd596e9b4ed 100644
(file)
--- a/
src/SUIT/SUIT_ResourceMgr.cxx
+++ b/
src/SUIT/SUIT_ResourceMgr.cxx
@@
-82,12
+82,11
@@
QString SUIT_ResourceMgr::userFileName( const QString& appName, const bool for_l
{
QString pathName;
{
QString pathName;
- QStringList arguments;
- if ( SUIT_Session::session() ) arguments = SUIT_Session::session()->arguments();
// Try config file, given in arguments
// Try config file, given in arguments
- for (int i = 1; i < arguments.count(); i++) {
+ QStringList args = QApplication::arguments();
+ for (int i = 1; i < args.count(); i++) {
QRegExp rx ("--resources=(.+)");
QRegExp rx ("--resources=(.+)");
- if ( rx.indexIn( arg
ument
s[i] ) >= 0 && rx.captureCount() > 0 ) {
+ if ( rx.indexIn( args[i] ) >= 0 && rx.captureCount() > 0 ) {
QString file = rx.cap(1);
QFileInfo fi (file);
pathName = fi.absoluteFilePath();
QString file = rx.cap(1);
QFileInfo fi (file);
pathName = fi.absoluteFilePath();
@@
-185,15
+184,16
@@
long SUIT_ResourceMgr::userFileId( const QString& ) const
*/
QString SUIT_ResourceMgr::defaultLanguage() const
{
*/
QString SUIT_ResourceMgr::defaultLanguage() const
{
- QStringList arguments;
QString language;
QString language;
- if ( SUIT_Session::session() ) arguments = SUIT_Session::session()->arguments();
+
// Try language, given in arguments
// Try language, given in arguments
- for (int i = 1; i < arguments.count(); i++) {
+ QStringList args = QApplication::arguments();
+ for (int i = 1; i < args.count(); i++) {
QRegExp rx ("--language=(.+)");
QRegExp rx ("--language=(.+)");
- if ( rx.indexIn( arg
ument
s[i] ) >= 0 && rx.captureCount() > 0 ) {
+ if ( rx.indexIn( args[i] ) >= 0 && rx.captureCount() > 0 ) {
language = rx.cap(1);
}
}
language = rx.cap(1);
}
}
+
return language;
}
return language;
}