[education/rkward] rkward/windows: Change filename of preview template to clarify that it is not intended to be worked with

Thomas Friedrichsmeier null at kde.org
Fri Jun 17 20:55:12 BST 2022


Git commit 13caec352da8ea265cca6f1e45f9721fadd372ab by Thomas Friedrichsmeier.
Committed on 17/06/2022 at 19:54.
Pushed by tfry into branch 'master'.

Change filename of preview template to clarify that it is not intended to be worked with

M  +4    -4    rkward/windows/rkcommandeditorwindow.cpp

https://invent.kde.org/education/rkward/commit/13caec352da8ea265cca6f1e45f9721fadd372ab

diff --git a/rkward/windows/rkcommandeditorwindow.cpp b/rkward/windows/rkcommandeditorwindow.cpp
index b3fc4f35..13425c04 100644
--- a/rkward/windows/rkcommandeditorwindow.cpp
+++ b/rkward/windows/rkcommandeditorwindow.cpp
@@ -862,10 +862,10 @@ void RKCommandEditorWindow::doRenderPreview () {
 		} else {
 			// If the file is already saved, save the preview input as a temp file in the same folder.
 			// esp. .Rmd files might try to include other files by relative path.
-			QString tempfiletemplate = m_doc->url ().toLocalFile ();
-			tempfiletemplate.append ("_XXXXXX.rkward_preview.R");
-			if (mode == RMarkdownPreview) tempfiletemplate.append ("md");
-			preview_input_file = new QTemporaryFile (tempfiletemplate);
+			QString tempfiletemplate = m_doc->url().adjusted(QUrl::RemoveFilename).toLocalFile();
+			tempfiletemplate.append(".tmp_XXXXXX.rkward_preview.R");
+			if (mode == RMarkdownPreview) tempfiletemplate.append("md");
+			preview_input_file = new QTemporaryFile(tempfiletemplate);
 		}
 	}
 


More information about the rkward-tracker mailing list