]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/FileDialog.cpp
Amend f441590c
[lyx.git] / src / frontends / qt4 / FileDialog.cpp
index ca27df9f271021a814640a2c8a4af518b8efb554..119702fec66b33354206cb58eb60d59ee99a1b44 100644 (file)
@@ -35,7 +35,7 @@
  *
  * Therefore there is a tradeoff in enabling or disabling this (JMarc)
  */
-#if defined(Q_WS_MACX) || (defined(Q_WS_WIN) && !defined(Q_OS_CYGWIN))
+#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
 #define USE_NATIVE_FILEDIALOG 1
 #endif
 
@@ -55,8 +55,8 @@ public:
 };
 
 
-FileDialog::FileDialog(QString const & t, FuncCode s)
-       : private_(new FileDialog::Private), title_(t), success_(s)
+FileDialog::FileDialog(QString const & t)
+       : private_(new FileDialog::Private), title_(t)
 {}
 
 
@@ -103,11 +103,11 @@ FileDialog::Result FileDialog::save(QString const & path,
                result.second = toqstr(os::internal_path(fromqstr(name)));
 #else
        LyXFileDialog dlg(title_, path, filters, private_->b1, private_->b2);
-#if QT_VERSION != 0x040203
        dlg.setFileMode(QFileDialog::AnyFile);
-#endif
        dlg.setAcceptMode(QFileDialog::AcceptSave);
        dlg.setConfirmOverwrite(false);
+       if (selectedFilter != 0 && !selectedFilter->isEmpty())
+               dlg.selectNameFilter(*selectedFilter);
 
        if (!suggested.isEmpty())
                dlg.selectFile(suggested);