Git commit d95fc799d1b98095f621eb7a5ddaf591254cb74d by Thomas Friedrichsmei= er. Committed on 29/09/2018 at 05:46. Pushed by tfry into branch 'master'. Fix build to earlier versions of Qt M +1 -0 ChangeLog M +4 -4 rkward/windows/rkcommandeditorwindow.cpp https://commits.kde.org/rkward/d95fc799d1b98095f621eb7a5ddaf591254cb74d diff --git a/ChangeLog b/ChangeLog index 1dcf2c5e..f794e6ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ --- Version 0.7.1 - UNRELEASED +- Add various live-preview options for R scripts, including a preview of R= markdown rendering - Make it possible to "link" to specific settings pages from the internal = documentation - Slighlty less confusing output in case a package is installed from requi= re(), such as in many plugins - Fixed: RKWard icon was missing for the "enhances RKWard" column in packa= ge installation dialog diff --git a/rkward/windows/rkcommandeditorwindow.cpp b/rkward/windows/rkco= mmandeditorwindow.cpp index 5e8e224b..f31a6069 100644 --- a/rkward/windows/rkcommandeditorwindow.cpp +++ b/rkward/windows/rkcommandeditorwindow.cpp @@ -832,8 +832,8 @@ void RKCommandEditorWindow::doRenderPreview () { if (!preview_manager->needsCommand ()) return; = if (!preview_dir) preview_dir =3D new QTemporaryDir (); - QFile save (preview_dir->filePath ("script.R")); - if (actionmenu_preview->currentItem () =3D=3D RMarkdownPreview) save.setF= ileName (preview_dir->filePath ("markdownscript.Rmd")); + QFile save (QDir (preview_dir->path()).absoluteFilePath ("script.R")); + if (actionmenu_preview->currentItem () =3D=3D RMarkdownPreview) save.setF= ileName (QDir (preview_dir->path()).absoluteFilePath ("markdownscript.Rmd")= ); RK_ASSERT (save.open (QIODevice::WriteOnly)); QTextStream out (&save); out.setCodec ("UTF-8"); // make sure that all characters can be saved= , without nagging the user @@ -860,7 +860,7 @@ void RKCommandEditorWindow::doRenderPreview () { command =3D command.arg (RObject::rQuote (save.fileName ()), RObject::rQ= uote (save.fileName () + ".html")); } else if (actionmenu_preview->currentItem () =3D=3D RKOutputPreview) { preview->setLabel (i18n ("Preview of generated RKWard output")); - QString output_file =3D preview_dir->filePath ("output.html"); + QString output_file =3D QDir (preview_dir->path()).absoluteFilePath ("ou= tput.html"); command =3D "output <- rk.set.output.html.file(%2, silent=3DTRUE)\n" "try(rk.flush.output(ask=3DFALSE, style=3D\"preview\", silent= =3DTRUE))\n" "try(source(%1, local=3DTRUE))\n" @@ -882,7 +882,7 @@ void RKCommandEditorWindow::doRenderPreview () { = if (actionmenu_preview->currentItem () =3D=3D ConsolePreview) { // somew= hat hacky, I admit... preview->setLabel (i18n ("Preview of script running in interactive R Con= sole")); - QString output_file =3D RObject::rQuote (preview_dir->filePath ("output.= html")); + QString output_file =3D RObject::rQuote (QDir (preview_dir->path()).abso= luteFilePath ("output.html")); RKGlobals::rInterface ()->issueCommand (QString ( "rk.assign.preview.data(%1, rk.s= et.output.html.file(%2, silent=3DTRUE))\n" "rk.flush.output(ask=3DFALSE, st= yle=3D\"preview\", silent=3DTRUE)\n").arg (RObject::rQuote (preview_manager= ->previewId ()), output_file), RCommand::App | RCommand::Sync);