From 6b222db01aca374e5d2f8d76d48b26e9f16a3390 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 30 Mar 2016 15:49:20 +0300 Subject: [PATCH] Remove deprecated ResourceExporter tool --- src/CMakeLists.txt | 1 - src/ResExporter/CMakeLists.txt | 40 ------- src/ResExporter/ResourceExporter.cxx | 152 --------------------------- 3 files changed, 193 deletions(-) delete mode 100755 src/ResExporter/CMakeLists.txt delete mode 100644 src/ResExporter/ResourceExporter.cxx diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 052ae86c5..17fd52a98 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -132,7 +132,6 @@ ENDIF(SALOME_USE_PYCONSOLE) # Light SALOME packages ## ADD_SUBDIRECTORY(LightApp) -ADD_SUBDIRECTORY(ResExporter) ## # Python-based packages, part 2 (LightApp-dependent) diff --git a/src/ResExporter/CMakeLists.txt b/src/ResExporter/CMakeLists.txt deleted file mode 100755 index 01304db37..000000000 --- a/src/ResExporter/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# --- options --- - -# additional include directories -INCLUDE_DIRECTORIES( - ${QT_INCLUDES} - ${PROJECT_BINARY_DIR} - ${PROJECT_SOURCE_DIR}/src/Qtx - ${PROJECT_SOURCE_DIR}/src/SUIT -) - -# additional preprocessor / compiler flags -ADD_DEFINITIONS(${QT_DEFINITIONS}) - -# libraries to link to -SET(_link_LIBRARIES ${QT_LIBRARIES} qtx suit) - -# --- rules --- - -ADD_EXECUTABLE(ResourceExporter ResourceExporter.cxx) -TARGET_LINK_LIBRARIES(ResourceExporter SUITApp ${_link_LIBRARIES}) -INSTALL(TARGETS ResourceExporter EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) diff --git a/src/ResExporter/ResourceExporter.cxx b/src/ResExporter/ResourceExporter.cxx deleted file mode 100644 index d9ef9cd6d..000000000 --- a/src/ResExporter/ResourceExporter.cxx +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// File : ResourceExporter.cxx -// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) -// -/* - This tool provides command-line interface allowing to modify user preferences. - The tool can be used by the compilation procedures in order to set default preferences for the module. - - Usage: - ResourceExporter - Parameters have the following format: - '
:=' - to set for the user - preference from the
section; - '
:+=[|]' - the is appended to the current value - of the preference from the
section; - separator is used to concatenate old and new values, - by default comma (',') symbol is used - '-
:' - to remove user preference from the
- section. Note that only use preference file is - influenced, you may need to use '
:=""' - option - The number of parameters is limeted only by maximum possible length of the command line. -*/ - -#include "GUI_version.h" -#include "SUIT_ResourceMgr.h" -#include -#include -#include -#include -#include - -/*! - \return the SALOME version number -*/ -static QString salomeVersion() -{ - return GUI_VERSION_STR; -} - -/*! - print the help information -*/ -static void help() -{ - std::cout << "" << std::endl; - std::cout << "ResourceExporter: provides command-line interface to modify user preferences." << std::endl; - std::cout << "" << std::endl; - std::cout << "Usage:" << std::endl; - std::cout << " ResourceExporter " << std::endl; - std::cout << "Parameters have the following format:" << std::endl; - std::cout << " '
:=' - to set for the user " << std::endl; - std::cout << " preference from the
section;" << std::endl; - std::cout << " '
:+=[|]' - the is appended to the current value " << std::endl; - std::cout << " of the preference from the
section;" << std::endl; - std::cout << " separator is used to concatenate old and new values," << std::endl; - std::cout << " by default comma (',') symbol is used" << std::endl; - std::cout << " '-
:' - to remove user preference from the
" << std::endl; - std::cout << " section. Note that only use preference file is " << std::endl; - std::cout << " influenced, you may need to use '
:=""'" << std::endl; - std::cout << " option" << std::endl; - std::cout << "The number of parameters is limeted only by maximum possible length of the command line." << std::endl; - std::cout << "" << std::endl; -} - -/*! - application main() function -*/ -int main( int argc, char** argv ) -{ - QApplication app( argc, argv ); - if ( argc > 1 ) { - SUIT_ResourceMgr* resMgr = new SUIT_ResourceMgr( QString( "SalomeApp" ), QString( "%1Config" ) ); - resMgr->setVersion( salomeVersion() ); - resMgr->setCurrentFormat( QString( "xml" ) ); - resMgr->loadLanguage(); - for ( int i = 1; i < argc; i ++ ) { - QString anArg = QString( argv[i] ).trimmed(); - if ( anArg.startsWith( "-" ) ) { - anArg.remove( 0, 1 ); - if ( anArg.contains( ":" ) ) { - QStringList vals = anArg.split( ":", QString::SkipEmptyParts ); - QString section = vals[ 0 ].trimmed(); - QString param = vals[ 1 ].trimmed(); - if ( section.isEmpty() || param.isEmpty() ) continue; - resMgr->remove( section, param ); - } - } - else if ( anArg.contains( "+=" ) ) { - QStringList vals = anArg.split( "+=", QString::SkipEmptyParts ); - if ( vals[ 0 ].contains( ":" ) ) { - QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts ); - QString section = vals1[ 0 ].trimmed(); - QString param = vals1[ 1 ].trimmed(); - QString newValue = vals [ 1 ].trimmed(); - QString separ = ","; // default separator - if ( newValue.contains( "|" ) ) { - QStringList vals2 = newValue.split( "|", QString::SkipEmptyParts ); - newValue = vals2[ 0 ].trimmed(); - separ = vals2[ 1 ].trimmed(); - } - if ( section.isEmpty() || param.isEmpty() || newValue.isEmpty() || separ.isEmpty() ) continue; - QString value = resMgr->stringValue( section, param ); - QStringList valsOld = value.split( separ, QString::SkipEmptyParts ); - QStringList valsNew = newValue.split( separ, QString::SkipEmptyParts ); - for ( int i = 0; i < (int)valsNew.count(); i++ ) - if ( !valsOld.contains( valsNew[i] ) ) - valsOld.append( valsNew[i] ); - resMgr->setValue( section, param, valsOld.join( separ ) ); - } - } - else if ( anArg.contains( "=" ) ) { - QStringList vals = anArg.split( "=", QString::SkipEmptyParts ); - if ( vals[ 0 ].contains( ":" ) ) { - QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts ); - QString section = vals1[ 0 ].trimmed(); - QString param = vals1[ 1 ].trimmed(); - QString value = vals [ 1 ].trimmed(); - if ( section.isEmpty() || param.isEmpty() ) continue; - resMgr->setValue( section, param, value ); - } - } - } - resMgr->save(); - delete resMgr; - } - else { - help(); - } - return 0; -} -- 2.39.2