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.
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;
_______________________________________________
Kde-windows mailing list
Kde-windows@kde.org
https://mail.kde.org/mailman/listinfo/kde-windows

Reply via email to