a bug on Windows due to an unnecessary conversion to external style.
* src/insets/ExternalSupport.C
(subst_path): avoid a bug in the external material inset on Windows
by don't using external_path. The filename will be quoted and thus
there will be no problems with forward slashes.
* src/frontends/qt4/QGraphics.C
* src/frontends/qt4/QExternal.C
* src/frontends/qt4/QInclude.C:
(Qxxx::apply): On Windows, the user could input an absolute path in
native style by hand (without using the file dialog), so make sure
that no backslashes can slip in by this way.
* src/frontends/qt4/QPrefsDialog.C
(internal_path_list, external_path_list): new wrappers for the
corresponding functions in the os namespace.
(PrefPaths::apply): make sure that path_prefix is stored in the
internal style, i.e., without backslashes.
(PrefPaths::update): make sure that path_prefix is displayed to
the user in the native style.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16659
a592a061-630c-0410-9148-
cb99ea01b6c8
#include "support/lstrings.h"
#include "support/convert.h"
+#include "support/os.h"
#include "QExternal.h"
#include "QExternalDialog.h"
using lyx::support::token;
using lyx::support::trim;
+using lyx::support::os::internal_path;
+
using std::string;
using std::vector;
using std::find;
{
InsetExternalParams params = controller().params();
- params.filename.set(fromqstr(dialog_->fileED->text()),
+ params.filename.set(internal_path(fromqstr(dialog_->fileED->text())),
kernel().bufferFilepath());
params.settemplate(controller().getTemplate(
#include "support/convert.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
+#include "support/os.h"
#include <QLineEdit>
#include <QPushButton>
using lyx::support::float_equal;
using lyx::support::token;
+using lyx::support::os::internal_path;
+
#ifndef CXX_GLOBAL_CSTD
using std::floor;
#endif
{
InsetGraphicsParams & igp = controller().params();
- igp.filename.set(fromqstr(dialog_->filename->text()),
+ igp.filename.set(internal_path(fromqstr(dialog_->filename->text())),
kernel().bufferFilepath());
// the bb section
#include <config.h>
+#include "support/os.h"
+
#include "QIncludeDialog.h"
#include "QInclude.h"
using std::string;
+using lyx::support::os::internal_path;
+
namespace lyx {
namespace frontend {
{
InsetCommandParams params = controller().params();
- params["filename"] = qstring_to_ucs4(dialog_->filenameED->text());
+ params["filename"] = from_utf8(internal_path(fromqstr(dialog_->filenameED->text())));
params.preview(dialog_->previewCB->isChecked());
int const item = dialog_->typeCO->currentIndex();
}
+QString const external_path_list(string const & input)
+{
+ return toqstr(lyx::support::os::external_path_list(input));
+}
+
+
string const internal_path(QString const & input)
{
return lyx::support::os::internal_path(fromqstr(input));
}
+
+string const internal_path_list(QString const & input)
+{
+ return lyx::support::os::internal_path_list(fromqstr(input));
+}
+
} // end namespace anon
rc.template_path = internal_path(templateDirED->text());
rc.backupdir_path = internal_path(backupDirED->text());
rc.tempdir_path = internal_path(tempDirED->text());
- rc.path_prefix = fromqstr(pathPrefixED->text());
+ rc.path_prefix = internal_path_list(pathPrefixED->text());
// FIXME: should be a checkbox only
rc.lyxpipes = internal_path(lyxserverDirED->text());
}
templateDirED->setText(external_path(rc.template_path));
backupDirED->setText(external_path(rc.backupdir_path));
tempDirED->setText(external_path(rc.tempdir_path));
- pathPrefixED->setText(toqstr(rc.path_prefix));
+ pathPrefixED->setText(external_path_list(rc.path_prefix));
// FIXME: should be a checkbox only
lyxserverDirED->setText(external_path(rc.lyxpipes));
}
{
if (input.find(placeholder) == string::npos)
return input;
+ // Don't use external_path here when use_latex_path is false, as the
+ // path will be compared with another one in internal style later
+ // in Converters::move.
string const path2 = use_latex_path ?
- support::latex_path(path, ext, dots) :
- support::os::external_path(path);
+ support::latex_path(path, ext, dots) : path;
return support::subst(input, placeholder, path2);
}