There are some more places with the wrong separator. The most important in
kileinfo.cpp and kilelauncher.cpp. So I attached an improved fix for this bug.
Fritz Meier <[email protected]> schrieb am 7:17 Montag, 18.November 2013:
Installing the current KileOnWindows version (based on the Git repository of
Kile), I found that it works already quite well. Except LivePreview. Searching
with Google I found a lot of reports concerning this bug.
When I studied this problem, I found that the TEXINPUTS variable was set
absolutely wrong, when starting the LivePreview. This variable should contain
at least the temporary LivePreview directory and the directory, which contains
the TEX file. So using Windows it should look like
TEXINPUTS=directory1;directory2
But it looks like
TEXINPUTS=directory1:directory2
In a real example, this environment variable was set to
TEXINPUTS=C:/Users/fritz/AppData/Roaming/.kde/share/apps/kile/livepreview/preview-iIhaaa/:C:/Users/fritz/Documents:
You see, that not ';' is taken as separator using Windows, but ':'. So the TEX
file couldn't be found by Kile's LivePreview.
I attached a fix, which solves this problem. I also sent this patch to the
maintainer of Kile, but didn't get an answer so far.
_______________________________________________
Kde-windows mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-windows
diff --git a/kile/src/dialogs/texdocumentationdialog.cpp b/kile-win/src/dialogs/texdocumentationdialog.cpp
index 18265f0..c838bcd 100644
--- a/kile/src/dialogs/texdocumentationdialog.cpp
+++ b/kile-win/src/dialogs/texdocumentationdialog.cpp
@@ -254,7 +254,12 @@ bool TexDocDialog::eventFilter(QObject *o, QEvent *e)
QString TexDocDialog::searchFile(const QString &docfilename, const QString &listofpaths, const QString &subdir)
{
+#ifdef Q_WS_WIN
+ QStringList pathlist = listofpaths.split(';');
+#else
QStringList pathlist = listofpaths.split(':');
+#endif
+
QStringList extlist = QString(",.gz,.bz2").split(',', QString::KeepEmptyParts);
QString filename;
diff --git a/kile/src/kileinfo.cpp b/kile-win/src/kileinfo.cpp
index 419c5b9..2d9f569 100644
--- a/kile/src/kileinfo.cpp
+++ b/kile-win/src/kileinfo.cpp
@@ -401,16 +401,22 @@ QString KileInfo::checkOtherPaths(const QString &path,const QString &file, int t
QString configpaths;
QFileInfo info;
+#ifdef Q_WS_WIN
+ QChar sep = ';';
+#else
+ QChar sep = ':';
+#endif
+
switch(type)
{
case bibinputs:
- configpaths = KileConfig::bibInputPaths() + ":$BIBINPUTS";
+ configpaths = KileConfig::bibInputPaths() + sep + "$BIBINPUTS";
break;
case texinputs:
- configpaths = KileConfig::teXPaths() + ":$TEXINPUTS";
+ configpaths = KileConfig::teXPaths() + sep + "$TEXINPUTS";
break;
case bstinputs:
- configpaths = KileConfig::bstInputPaths() + ":$BSTINPUTS";
+ configpaths = KileConfig::bstInputPaths() + sep + "$BSTINPUTS";
break;
default:
KILE_DEBUG() << "Unknown type in checkOtherPaths" << endl;
@@ -418,7 +424,7 @@ QString KileInfo::checkOtherPaths(const QString &path,const QString &file, int t
break;
}
- inputpaths = expandEnvironmentVars(configpaths).split(':');
+ inputpaths = expandEnvironmentVars(configpaths).split(sep);
inputpaths.prepend(path);
// the first match is supposed to be the correct one
diff --git a/kile/src/kilelauncher.cpp b/kile-win/src/kilelauncher.cpp
index 3c7e4e9..0a40417 100644
--- a/kile/src/kilelauncher.cpp
+++ b/kile-win/src/kilelauncher.cpp
@@ -189,22 +189,28 @@ namespace KileTool {
bibInputPaths = KileConfig::previewBibInputPaths();
}
+#ifdef Q_WS_WIN
+ QChar sep = ';';
+#else
+ QChar sep = ':';
+#endif
+
KILE_DEBUG() << "$PATH=" << tool()->manager()->info()->expandEnvironmentVars("$PATH");
- KILE_DEBUG() << "$TEXINPUTS=" << tool()->manager()->info()->expandEnvironmentVars(teXInputPaths + ":$TEXINPUTS");
- KILE_DEBUG() << "$BIBINPUTS=" << tool()->manager()->info()->expandEnvironmentVars(bibInputPaths + ":$BIBINPUTS");
- KILE_DEBUG() << "$BSTINPUTS=" << tool()->manager()->info()->expandEnvironmentVars(bstInputPaths + ":$BSTINPUTS");
+ KILE_DEBUG() << "$TEXINPUTS=" << tool()->manager()->info()->expandEnvironmentVars(teXInputPaths + sep + "$TEXINPUTS");
+ KILE_DEBUG() << "$BIBINPUTS=" << tool()->manager()->info()->expandEnvironmentVars(bibInputPaths + sep + "$BIBINPUTS");
+ KILE_DEBUG() << "$BSTINPUTS=" << tool()->manager()->info()->expandEnvironmentVars(bstInputPaths + sep + "$BSTINPUTS");
KILE_DEBUG() << "Tool name is "<< tool()->name();
m_proc->setEnv("PATH", tool()->manager()->info()->expandEnvironmentVars("$PATH"));
if(!teXInputPaths.isEmpty()) {
- m_proc->setEnv("TEXINPUTS", tool()->manager()->info()->expandEnvironmentVars(teXInputPaths + ":$TEXINPUTS"));
+ m_proc->setEnv("TEXINPUTS", tool()->manager()->info()->expandEnvironmentVars(teXInputPaths + sep + "$TEXINPUTS"));
}
if(!bibInputPaths.isEmpty()) {
- m_proc->setEnv("BIBINPUTS", tool()->manager()->info()->expandEnvironmentVars(bibInputPaths + ":$BIBINPUTS"));
+ m_proc->setEnv("BIBINPUTS", tool()->manager()->info()->expandEnvironmentVars(bibInputPaths + sep + "$BIBINPUTS"));
}
if(!bstInputPaths.isEmpty()) {
- m_proc->setEnv("BSTINPUTS", tool()->manager()->info()->expandEnvironmentVars(bstInputPaths + ":$BSTINPUTS"));
+ m_proc->setEnv("BSTINPUTS", tool()->manager()->info()->expandEnvironmentVars(bstInputPaths + sep + "$BSTINPUTS"));
}
out += "*****\n";
diff --git a/kile/src/livepreview.cpp b/kile-win/src/livepreview.cpp
index 38e54c0..77c6dc4 100644
--- a/kile/src/livepreview.cpp
+++ b/kile-win/src/livepreview.cpp
@@ -1013,12 +1013,19 @@ void LivePreviewManager::compilePreview(KileDocument::LaTeXInfo *latexInfo, KTex
fileInfo = QFileInfo(m_ki->getCompileName());
}
- const QString inputDir = previewInformation->getTempDir() + ':' + fileInfo.absolutePath();
+ // set PATH separator for different systems
+#ifdef Q_WS_WIN
+ QChar sep = ';';
+#else
+ QChar sep = ':';
+#endif
+
+ const QString inputDir = previewInformation->getTempDir() + sep + fileInfo.absolutePath();
// set value of texinput path (only for LivePreviewManager tools)
QString texInputPath = KileConfig::teXPaths();
if(!texInputPath.isEmpty()) {
- texInputPath = inputDir + ':' + texInputPath;
+ texInputPath = inputDir + sep + texInputPath;
}
else {
texInputPath = inputDir;
@@ -1027,7 +1034,7 @@ void LivePreviewManager::compilePreview(KileDocument::LaTeXInfo *latexInfo, KTex
QString bibInputPath = KileConfig::bibInputPaths();
if(!bibInputPath.isEmpty()) {
- bibInputPath = inputDir + ':' + bibInputPath;
+ bibInputPath = inputDir + sep + bibInputPath;
}
else {
bibInputPath = inputDir;
@@ -1036,7 +1043,7 @@ void LivePreviewManager::compilePreview(KileDocument::LaTeXInfo *latexInfo, KTex
QString bstInputPath = KileConfig::bstInputPaths();
if(!bstInputPath.isEmpty()) {
- bstInputPath = inputDir + ':' + bstInputPath;
+ bstInputPath = inputDir + sep + bstInputPath;
}
else {
bstInputPath = inputDir;
diff --git a/kile/src/quickpreview.cpp b/kile-win/src/quickpreview.cpp
index 5c02838..662f9e7 100644
--- a/kile/src/quickpreview.cpp
+++ b/kile-win/src/quickpreview.cpp
@@ -270,7 +270,11 @@ bool QuickPreview::run(const QString &text,const QString &textfilename,int start
QString texinputpath = KileConfig::teXPaths();
QString inputdir = QFileInfo(m_ki->getCompileName()).absolutePath();
if(!texinputpath.isEmpty()) {
+#ifdef Q_WS_WIN
+ inputdir += ';' + texinputpath;
+#else
inputdir += ':' + texinputpath;
+#endif
}
KileConfig::setPreviewTeXPaths(inputdir);
KILE_DEBUG() << "\tQuickPreview: inputdir is '" << inputdir << "'" << endl;
_______________________________________________
Kde-windows mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-windows