Skip to content

Commit

Permalink
chore: forgot clang-format on recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mwerle committed Aug 29, 2023
1 parent 1d73792 commit fac4e01
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 19 deletions.
10 changes: 4 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

add_compile_options(-Werror=switch)
# Uncomment to compile with more warnings
#add_compile_options(-Wall)
# Uncomment to compile with even more warnings
#add_compile_options(-Wextra)
# TODO: currently there are too many unused parameters which overwhelms the
# warning output with `-Wall`. So let's leave fixing these for later.
# Uncomment to compile with more warnings add_compile_options(-Wall) Uncomment
# to compile with even more warnings add_compile_options(-Wextra) TODO:
# currently there are too many unused parameters which overwhelms the warning
# output with `-Wall`. So let's leave fixing these for later.
add_compile_options(-Wno-unused-parameter)

add_subdirectory(util)
Expand Down
4 changes: 2 additions & 2 deletions src/app/CustomTheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ QColor CustomTheme::heatMap(HeatMap color) {
return QColor(heatmap.value("cold").toString());
}
throw std::runtime_error("unreachable; value=" +
std::to_string(static_cast<int>(color)));
std::to_string(static_cast<int>(color)));
}

QColor CustomTheme::remoteComment(Comment color) {
Expand All @@ -498,7 +498,7 @@ QColor CustomTheme::remoteComment(Comment color) {
return QColor(comment.value("timestamp").toString());
}
throw std::runtime_error("unreachable; value=" +
std::to_string(static_cast<int>(color)));
std::to_string(static_cast<int>(color)));
}

QColor CustomTheme::star() {
Expand Down
2 changes: 1 addition & 1 deletion src/conf/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ QString Settings::promptDescription(Prompt::Kind kind) const {
return tr("Prompt to stage large files");
}
throw std::runtime_error("unreachable; value=" +
std::to_string(static_cast<int>(kind)));
std::to_string(static_cast<int>(kind)));
}

void Settings::setHotkey(const QString &action, const QString &hotkey) {
Expand Down
2 changes: 1 addition & 1 deletion src/git/Diff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void Diff::sort(SortRole role, Qt::SortOrder order) {
}
}
throw std::runtime_error("unreachable; value=" +
std::to_string(static_cast<int>(role)));
std::to_string(static_cast<int>(role)));
});
}

Expand Down
3 changes: 2 additions & 1 deletion src/git/Patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ QByteArray Patch::lineContent(int hidx, int ln) const {

const git_diff_line *line = nullptr;
int result = git_patch_get_line_in_hunk(&line, d.data(), hidx, ln);
return (GIT_OK == result) ? QByteArray(line->content, line->content_len) : QByteArray();
return (GIT_OK == result) ? QByteArray(line->content, line->content_len)
: QByteArray();
}

Patch::ConflictResolution Patch::conflictResolution(int hidx) {
Expand Down
12 changes: 5 additions & 7 deletions src/host/Account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ const QString kThemeIconFmt = ":/%1_%2.png";
} // namespace

Account::Account(const QString &username)
: mUsername(username),
mError(new AccountError(this)),
mProgress(new AccountProgress(this)),
mMgr(new QNetworkAccessManager()) {
: mUsername(username), mError(new AccountError(this)),
mProgress(new AccountProgress(this)), mMgr(new QNetworkAccessManager()) {
QObject::connect(
mMgr, &QNetworkAccessManager::sslErrors,
[this](QNetworkReply *reply, const QList<QSslError> &errors) {
Expand Down Expand Up @@ -207,7 +205,7 @@ QString Account::helpText(Kind kind) {
return QString();
}
throw std::runtime_error("unreachable; value=" +
std::to_string(static_cast<int>(kind)));
std::to_string(static_cast<int>(kind)));
}

QString Account::defaultUrl(Kind kind) {
Expand All @@ -224,7 +222,7 @@ QString Account::defaultUrl(Kind kind) {
return GitLab::defaultUrl();
}
throw std::runtime_error("unreachable; value=" +
std::to_string(static_cast<int>(kind)));
std::to_string(static_cast<int>(kind)));
}

Account::Kind Account::kindFromString(const QString &kind, bool *ok) {
Expand Down Expand Up @@ -265,7 +263,7 @@ QString Account::kindToString(Kind kind) {
return "gitlab";
}
throw std::runtime_error("unreachable; value=" +
std::to_string(static_cast<int>(kind)));
std::to_string(static_cast<int>(kind)));
}

void Account::startProgress() {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/Plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ QVariant Plugin::optionValue(const QString &key) const {
return config().value<QString>(kKeyFmt.arg(mName, key), value.toString());
}
throw std::runtime_error("unreachable; value=" +
std::to_string(static_cast<int>(optionKind(key))));
std::to_string(static_cast<int>(optionKind(key))));
}

Plugin::OptionKind Plugin::optionKind(const QString &key) const {
Expand Down

0 comments on commit fac4e01

Please sign in to comment.