Commit 83da9cf6 authored by Przemyslaw Gorszkowski's avatar Przemyslaw Gorszkowski
Browse files

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: default 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 ...@@ -123,7 +123,8 @@ QString BeautifierPlugin::format(const QString &text, QStringList command, const
// Save text to temporary file // Save text to temporary file
QFileInfo fi(fileName); 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.setAutoRemove(true);
sourceFile.write(text.toUtf8()); sourceFile.write(text.toUtf8());
if (!sourceFile.finalize()) { if (!sourceFile.finalize()) {
......
Supports Markdown
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