Beautifier: create temporary file in input file dir

It fixes finding .clang-format file for "clang-format -style=file"

Task-number: QTCREATORBUG-12057
Change-Id: Idd02de1535eef30e1a1eaf146ef0f9ac9d54c5fa
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 560fd9bc
......@@ -123,7 +123,8 @@ QString BeautifierPlugin::format(const QString &text, QStringList command, const
// Save text to temporary file
QFileInfo fi(fileName);
Utils::TempFileSaver sourceFile(QLatin1String("qtc_beautifier_XXXXXXXX.") + fi.suffix());
Utils::TempFileSaver sourceFile(fi.absolutePath() + QLatin1String("/qtc_beautifier_XXXXXXXX.")
+ fi.suffix());
sourceFile.setAutoRemove(true);
sourceFile.write(text.toUtf8());
if (!sourceFile.finalize()) {
......
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