aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangformat
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-05-17 13:28:38 +0200
committerhjk <hjk@qt.io>2019-05-20 14:37:13 +0000
commit0595e67c82d718240d40c1f689a0b3d7923e3590 (patch)
treeccb17bd890ee0a76f0484a9b443e4d813778e66d /src/plugins/clangformat
parent7729c81f024973ddf176c5b162ba21e4f9c271b4 (diff)
More FileName::pathAppended()
Change-Id: Ie20ec34ea9712b3ec49e6233b23cef84c2019f03 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/clangformat')
-rw-r--r--src/plugins/clangformat/clangformatutils.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp
index 1d0369f0f39..7af95e64f33 100644
--- a/src/plugins/clangformat/clangformatutils.cpp
+++ b/src/plugins/clangformat/clangformatutils.cpp
@@ -243,16 +243,16 @@ static clang::format::FormatStyle constructStyle(const QByteArray &baseStyle = Q
void createStyleFileIfNeeded(bool isGlobal)
{
- Utils::FileName path = isGlobal ? globalPath() : projectPath();
- const QString configFile = path.appendPath(Constants::SETTINGS_FILE_NAME).toString();
+ const Utils::FileName path = isGlobal ? globalPath() : projectPath();
+ const QString configFile = path.pathAppended(Constants::SETTINGS_FILE_NAME).toString();
if (QFile::exists(configFile))
return;
- QDir().mkpath(path.parentDir().toString());
+ QDir().mkpath(path.toString());
if (!isGlobal) {
const Project *project = SessionManager::startupProject();
- Utils::FileName possibleProjectConfig = project->rootProjectDirectory().appendPath(
+ Utils::FileName possibleProjectConfig = project->rootProjectDirectory().pathAppended(
Constants::SETTINGS_FILE_NAME);
if (possibleProjectConfig.exists()) {
// Just copy th .clang-format if current project has one.
@@ -296,7 +296,7 @@ static clang::format::FormatStyle styleForFile(Utils::FileName fileName, bool ch
if (configFile.isEmpty()) {
// If no configuration is found create a global one (if it does not yet exist) and use it.
createStyleFileIfNeeded(true);
- configFile = globalPath().appendPath(Constants::SETTINGS_FILE_NAME).toString();
+ configFile = globalPath().pathAppended(Constants::SETTINGS_FILE_NAME).toString();
}
fileName = assumedPathForConfig(configFile);
@@ -334,23 +334,23 @@ static std::string readFile(const QString &path)
std::string currentProjectConfigText()
{
- const QString configPath = projectPath().appendPath(Constants::SETTINGS_FILE_NAME).toString();
+ const QString configPath = projectPath().pathAppended(Constants::SETTINGS_FILE_NAME).toString();
return readFile(configPath);
}
std::string currentGlobalConfigText()
{
- const QString configPath = globalPath().appendPath(Constants::SETTINGS_FILE_NAME).toString();
+ const QString configPath = globalPath().pathAppended(Constants::SETTINGS_FILE_NAME).toString();
return readFile(configPath);
}
clang::format::FormatStyle currentProjectStyle()
{
- return styleForFile(projectPath().appendPath(Constants::SAMPLE_FILE_NAME), false);
+ return styleForFile(projectPath().pathAppended(Constants::SAMPLE_FILE_NAME), false);
}
clang::format::FormatStyle currentGlobalStyle()
{
- return styleForFile(globalPath().appendPath(Constants::SAMPLE_FILE_NAME), false);
+ return styleForFile(globalPath().pathAppended(Constants::SAMPLE_FILE_NAME), false);
}
} // namespace ClangFormat