]> git.lyx.org Git - features.git/commitdiff
compile fix
authorAndré Pönitz <poenitz@gmx.net>
Mon, 21 Apr 2008 06:30:46 +0000 (06:30 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Mon, 21 Apr 2008 06:30:46 +0000 (06:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24405 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/FileDialog.cpp
src/frontends/qt4/qt_helpers.h

index dc4e10ad307a1a435215802700004feb1f929639..91b5a71b464c12f9049bfb10824239f300dcdccb 100644 (file)
 
 #include "support/debug.h"
 #include "support/FileName.h"
+#include "support/filetools.h"
 #include "support/gettext.h"
 #include "support/os.h"
 
+#include <string>
+
 /** when this is defined, the code will use
  * QFileDialog::getOpenFileName and friends to create filedialogs.
  * Effects:
@@ -42,7 +45,7 @@
 
 namespace lyx {
 
-using support::os::internal_path;
+using namespace support;
 
 
 class FileDialog::Private {
@@ -91,8 +94,9 @@ FileDialog::Result FileDialog::save(QString const & path,
        QString const startsWith = makeAbsPath(suggested, path);
        QString const name = 
                QFileDialog::getSaveFileName(qApp->focusWidget(),
-            title_, startsWith, filters, 0, QFileDialog::DontConfirmOverwrite);
-       result.second = toqstr(internal_path(fromqstr(name)));
+            title_, startsWith, filters.join(";;"),
+                        0, QFileDialog::DontConfirmOverwrite);
+       result.second = toqstr(os::internal_path(fromqstr(name)));
 #else
        LyXFileDialog dlg(title_, path, filters, private_->b1, private_->b2);
 #if QT_VERSION != 0x040203
@@ -126,9 +130,9 @@ FileDialog::Result FileDialog::open(QString const & path,
 
 #ifdef USE_NATIVE_FILEDIALOG
        QString const startsWith = makeAbsPath(suggested, path);
-       result.second = internalPath(
-               QFileDialog::getOpenFileName(qApp->focusWidget(),
-               title_, startsWith, filters));
+       QString const file = QFileDialog::getOpenFileName(qApp->focusWidget(),
+               title_, startsWith, filters.join(";;"));
+       result.second = internalPath(file);
 #else
        LyXFileDialog dlg(title_, path, filters, private_->b1, private_->b2);
 
@@ -155,8 +159,9 @@ FileDialog::Result FileDialog::opendir(QString const & path,
        result.first = FileDialog::Chosen;
 
 #ifdef USE_NATIVE_FILEDIALOG
-       QString const startsWith = makeAbsPath(suggested, path);
-       result.second = toqstr(internal_path(fromqstr(
+       QString const startsWith = toqstr(makeAbsPath(fromqstr(suggested),
+               fromqstr(path)).absFilename());
+       result.second = toqstr(os::internal_path(fromqstr(
                QFileDialog::getExistingDirectory(qApp->focusWidget(),
                title_, startsWith))));
 #else
index efa581f77e743edfeb8ce453e35166e01e6333fd..ed082e1e33bb4c7d73121310deb460e20a552ad1 100644 (file)
@@ -125,6 +125,7 @@ QString addExtension(QString const & name, QString const & extension);
 
 /// Return the extension of the file (not including the .)
 QString getExtension(QString const & name);
+QString makeAbsPath(QString const & relpath, QString const & base);
 
 } // namespace lyx