summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2010-12-15 15:23:52 +0100
committerJan Holesovsky <kendy@suse.cz>2010-12-15 15:41:10 +0100
commit65dc25b5ee9431d2fc7354d7871c5db3494db3f8 (patch)
tree8f9a91a062a49b8fb4f3ae91464a8738434e2a09
parentd2d5e0d1e55ee692632aa547f17f6a48179af2b7 (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. Signed-off-by: Jan Holesovsky <kendy@suse.cz>
-rw-r--r--fpicker/source/unx/kde4/KDE4FilePicker.cxx11
-rw-r--r--fpicker/source/unx/kde4/KDE4FilePicker.hxx3
2 files changed, 5 insertions, 9 deletions
diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.cxx b/fpicker/source/unx/kde4/KDE4FilePicker.cxx
index 3c2bdd8929..9a8b762327 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 e806c11316..e1b8a15e1b 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;