diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2010-12-15 15:23:52 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2010-12-15 15:25:37 +0100 |
commit | ff3f9438fb8be5d624a48f7142efbd5dfb075817 (patch) | |
tree | 8121ece133c8352f2cd872151f70372630221b0f /fpicker | |
parent | 78307607676ed03f68eb47504cc250ce80f5f62a (diff) |
save with the proper .doc variant (fdo#32219)
KFileDialog::currentFilter() returns only the pattern and not
the full filter text, so *.doc alone is ambiguous.
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/unx/kde4/KDE4FilePicker.cxx | 11 | ||||
-rw-r--r-- | fpicker/source/unx/kde4/KDE4FilePicker.hxx | 3 |
2 files changed, 5 insertions, 9 deletions
diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.cxx b/fpicker/source/unx/kde4/KDE4FilePicker.cxx index 6b222e9cf0da..695fc83e3fe4 100644 --- a/fpicker/source/unx/kde4/KDE4FilePicker.cxx +++ b/fpicker/source/unx/kde4/KDE4FilePicker.cxx @@ -299,10 +299,7 @@ void SAL_CALL KDE4FilePicker::appendFilter( const ::rtl::OUString &title, const if (!_filter.isNull()) _filter.append("\n"); - //add to hash map for reverse lookup in getCurrentFilter - _filters.insert(f, t); - - // '/' meed to be escaped to else they are assumed to be mime types by kfiledialog + // '/' need to be escaped else they are assumed to be mime types by kfiledialog //see the docs t.replace("/", "\\/"); @@ -323,7 +320,10 @@ void SAL_CALL KDE4FilePicker::setCurrentFilter( const rtl::OUString &title ) rtl::OUString SAL_CALL KDE4FilePicker::getCurrentFilter() throw( uno::RuntimeException ) { - QString filter = _filters[_dialog->currentFilter()]; + // _dialog->currentFilter() wouldn't quite work, because it returns only e.g. "*.doc", + // without the description, and there may be several filters with the same pattern + QString filter = _dialog->filterWidget()->currentText(); + filter.replace( "\\/", "/" ); //default if not found if (filter.isNull()) @@ -608,7 +608,6 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args ) throw( uno::Exception, uno::RuntimeException ) { _filter.clear(); - _filters.clear(); // parameter checking uno::Any arg; diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.hxx b/fpicker/source/unx/kde4/KDE4FilePicker.hxx index 6f73cc36ff9a..edef224c003e 100644 --- a/fpicker/source/unx/kde4/KDE4FilePicker.hxx +++ b/fpicker/source/unx/kde4/KDE4FilePicker.hxx @@ -79,9 +79,6 @@ protected: //running filter string to add to dialog QString _filter; - //filter for reverse lookup of filter text - QHash<QString, QString> _filters; - //mapping of SAL control ID's to created custom controls QHash<sal_Int16, QWidget*> _customWidgets; |