#include "gettext.h"
#include "support/filefilterlist.h"
+#include "support/os.h"
/** when this is defined, the code will use
* QFileDialog::getOpenFileName and friends to create filedialogs.
namespace lyx {
using support::FileFilterList;
+using support::os::internal_path;
using std::endl;
#ifdef USE_NATIVE_FILEDIALOG
docstring const startsWith
= lyx::from_utf8(makeAbsPath(lyx::to_utf8(suggested), lyx::to_utf8(path)));
- result.second = qstring_to_ucs4(QFileDialog::getSaveFileName(
- qApp->focusWidget(),
- toqstr(title_), toqstr(startsWith), toqstr(filters.as_string()) ));
+ result.second = lyx::from_utf8(internal_path(fromqstr(
+ QFileDialog::getSaveFileName(qApp->focusWidget(),
+ toqstr(title_), toqstr(startsWith), toqstr(filters.as_string()) ))));
#else
LyXFileDialog dlg(title_, path, filters, private_->b1, private_->b2);
dlg.setFileMode(QFileDialog::AnyFile);
int res = dlg.exec();
lyxerr[Debug::GUI] << "result " << res << endl;
if (res == QDialog::Accepted)
- result.second = qstring_to_ucs4(dlg.selectedFiles()[0]);
+ result.second = lyx::from_utf8(internal_path(
+ fromqstr(dlg.selectedFiles()[0])));
dlg.hide();
#endif
return result;
#ifdef USE_NATIVE_FILEDIALOG
docstring const startsWith =
lyx::from_utf8(makeAbsPath(lyx::to_utf8(suggested), lyx::to_utf8(path)));
- result.second = qstring_to_ucs4(QFileDialog::getOpenFileName(
- qApp->focusWidget(),
- toqstr(title_), toqstr(startsWith), toqstr(filters.as_string()) ));
+ result.second = lyx::from_utf8(internal_path(fromqstr(
+ QFileDialog::getOpenFileName(qApp->focusWidget(),
+ toqstr(title_), toqstr(startsWith), toqstr(filters.as_string()) ))));
#else
LyXFileDialog dlg(title_, path, filters, private_->b1, private_->b2);
int res = dlg.exec();
lyxerr[Debug::GUI] << "result " << res << endl;
if (res == QDialog::Accepted)
- result.second = qstring_to_ucs4(dlg.selectedFiles()[0]);
+ result.second = lyx::from_utf8(internal_path(
+ fromqstr(dlg.selectedFiles()[0])));
dlg.hide();
#endif
return result;
#ifdef USE_NATIVE_FILEDIALOG
docstring const startsWith
= lyx::from_utf8(makeAbsPath(lyx::to_utf8(suggested), lyx::to_utf8(path)));
- result.second = qstring_to_ucs4(QFileDialog::getExistingDirectory(
- qApp->focusWidget(),
- toqstr(title_),toqstr(startsWith) ));
+ result.second = lyx::from_utf8(internal_path(fromqstr(
+ QFileDialog::getExistingDirectory(qApp->focusWidget(),
+ toqstr(title_),toqstr(startsWith)))));
#else
FileFilterList const filter(_("Directories"));
int res = dlg.exec();
lyxerr[Debug::GUI] << "result " << res << endl;
if (res == QDialog::Accepted)
- result.second = qstring_to_ucs4(dlg.selectedFiles()[0]);
+ result.second = lyx::from_utf8(internal_path(
+ fromqstr(dlg.selectedFiles()[0])));
dlg.hide();
#endif
return result;