ClangFormat: Synchronize with C++ code style settings

And remove UI for default code style settings because
it does not affect anything when ClangFormat plugin is
enabled.

Change-Id: Ie348b7d2691b09ea2b4868da987f2a27347ea0f3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-11-08 10:35:23 +01:00
parent 3de607f4e0
commit 0e5c7f51fa
9 changed files with 253 additions and 69 deletions

View File

@@ -34,18 +34,12 @@
namespace ClangFormat {
inline void createStyleFileIfNeeded(Utils::FileName styleConfigPath)
{
const QString configFile = styleConfigPath.appendPath(".clang-format").toString();
if (QFile::exists(configFile))
return;
void createStyleFileIfNeeded(Utils::FileName styleConfigPath, bool isGlobal);
clang::format::FormatStyle newStyle = clang::format::getLLVMStyle();
std::fstream newStyleFile(configFile.toStdString(), std::fstream::out);
if (newStyleFile.is_open()) {
newStyleFile << clang::format::configurationAsText(newStyle);
newStyleFile.close();
}
}
clang::format::FormatStyle currentProjectStyle();
clang::format::FormatStyle currentGlobalStyle();
Utils::FileName currentStyleConfigPath();
clang::format::FormatStyle currentStyle();
}