Commit 352d971d authored by Igor Kushnir's avatar Igor Kushnir Committed by Nicolás Alvarez
Browse files

CustomScriptPlugin: remove a temporary file after formatting

CustomScriptPlugin::formatSourceWithStyle() creates a code.* file in the
temporary directory if the current custom script style's command
contains $TMPFILE variable. One predefined style - kdev_format_source -
has this variable in its command. This temporary file is never used
after the function that creates it returns. Let us keep QTemporaryFile's
default auto-remove mode to save space in the temporary directory.

28770089 added the line removed in this
commit. But I don't understand why it was beneficial back in 2011.
Perhaps it was a temporary change, which the commit's author forgot to
revert. Keeping the temporary file is most likely not useful today.
parent 4d7435ee
Pipeline #95962 canceled with stage
in 3 minutes and 40 seconds
......@@ -130,7 +130,6 @@ QString CustomScriptPlugin::formatSourceWithStyle(SourceFormatterStyle style, co
if (command.contains(QLatin1String("$TMPFILE"))) {
tmpFile.reset(new QTemporaryFile(QDir::tempPath() + QLatin1String("/code")));
tmpFile->setAutoRemove(false);
if (tmpFile->open()) {
qCDebug(CUSTOMSCRIPT) << "using temporary file" << tmpFile->fileName();
command.replace(QLatin1String("$TMPFILE"), tmpFile->fileName());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment