X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_WidgetFileSelector.cpp;h=c9ed766b4d862b18156e4d09b8eecd7ed8fa8cd4;hb=857b1f72d9703c46c6c8c9bb239821d314344c86;hp=0b91dc048ac2f79fa1e7083eee9f74c5f3f234f6;hpb=5352bbb1915f98d1f02b1cb953a2de19b286a28c;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_WidgetFileSelector.cpp b/src/PartSet/PartSet_WidgetFileSelector.cpp index 0b91dc048..c9ed766b4 100644 --- a/src/PartSet/PartSet_WidgetFileSelector.cpp +++ b/src/PartSet/PartSet_WidgetFileSelector.cpp @@ -11,6 +11,8 @@ #include +#include + PartSet_WidgetFileSelector::PartSet_WidgetFileSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, const Config_WidgetAPI* theData, @@ -20,17 +22,17 @@ PartSet_WidgetFileSelector::PartSet_WidgetFileSelector(QWidget* theParent, { } -bool PartSet_WidgetFileSelector::restoreValue() +bool PartSet_WidgetFileSelector::restoreValueCustom() { // A rare case when plugin was not loaded. if (!myFeature) return false; DataPtr aData = myFeature->data(); - AttributeStringPtr aStringAttr = aData->string("export_file_format"); + AttributeStringPtr aStringAttr = aData->string(ExchangePlugin_ExportFeature::FILE_PATH_ID()); mySelectedFilter = formatToFilter(shortFormatToFullFormat(QString::fromStdString(aStringAttr->value()))); - return ModuleBase_WidgetFileSelector::restoreValue(); + return ModuleBase_WidgetFileSelector::restoreValueCustom(); } bool PartSet_WidgetFileSelector::storeValueCustom() const @@ -40,17 +42,12 @@ bool PartSet_WidgetFileSelector::storeValueCustom() const return false; DataPtr aData = myFeature->data(); - AttributeStringPtr aStringAttr = aData->string("export_file_format"); + AttributeStringPtr aStringAttr = aData->string(ExchangePlugin_ExportFeature::FILE_FORMAT_ID()); aStringAttr->setValue(filterToShortFormat(mySelectedFilter).toStdString()); return ModuleBase_WidgetFileSelector::storeValueCustom(); } -QString PartSet_WidgetFileSelector::filterToShortFormat( const QString & theFilter ) -{ - return theFilter.section(' ', 0, 0); -} - QString PartSet_WidgetFileSelector::shortFormatToFullFormat( const QString & theFormat ) const { foreach(const QString & eachFormat, getValidatorFormats())