forked from qt-creator/qt-creator
ClangFormat: Proliferate FilePath use
Change-Id: I82ea75be92a7b247bad9717bf167cda8bb72cae7 Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -207,7 +207,7 @@ void ClangFormatConfigWidget::createStyleFileIfNeeded(bool isGlobal)
|
|||||||
if (configFile.exists())
|
if (configFile.exists())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QDir().mkpath(path.toString());
|
path.ensureWritableDir();
|
||||||
if (!isGlobal) {
|
if (!isGlobal) {
|
||||||
FilePath possibleProjectConfig = d->project->rootProjectDirectory()
|
FilePath possibleProjectConfig = d->project->rootProjectDirectory()
|
||||||
/ Constants::SETTINGS_FILE_NAME;
|
/ Constants::SETTINGS_FILE_NAME;
|
||||||
@@ -218,11 +218,8 @@ void ClangFormatConfigWidget::createStyleFileIfNeeded(bool isGlobal)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::fstream newStyleFile(configFile.toString().toStdString(), std::fstream::out);
|
const std::string config = clang::format::configurationAsText(constructStyle());
|
||||||
if (newStyleFile.is_open()) {
|
configFile.writeFileContents(QByteArray::fromStdString(config));
|
||||||
newStyleFile << clang::format::configurationAsText(constructStyle());
|
|
||||||
newStyleFile.close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClangFormatConfigWidget::showOrHideWidgets()
|
void ClangFormatConfigWidget::showOrHideWidgets()
|
||||||
|
|||||||
Reference in New Issue
Block a user