added brace wrapping after if and for
This commit is contained in:
@@ -129,14 +129,17 @@ AboutPage::AboutPage()
|
||||
|
||||
QString line;
|
||||
|
||||
while (stream.readLineInto(&line)) {
|
||||
if (line.isEmpty() || line.startsWith('#')) {
|
||||
while (stream.readLineInto(&line))
|
||||
{
|
||||
if (line.isEmpty() || line.startsWith('#'))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
QStringList contributorParts = line.split("|");
|
||||
|
||||
if (contributorParts.size() != 4) {
|
||||
if (contributorParts.size() != 4)
|
||||
{
|
||||
log("Missing parts in line '{}'", line);
|
||||
continue;
|
||||
}
|
||||
@@ -154,7 +157,8 @@ AboutPage::AboutPage()
|
||||
auto contributorBox2 = l.emplace<QHBoxLayout>();
|
||||
|
||||
const auto addAvatar = [&avatarUrl, &contributorBox2] {
|
||||
if (!avatarUrl.isEmpty()) {
|
||||
if (!avatarUrl.isEmpty())
|
||||
{
|
||||
QPixmap avatarPixmap;
|
||||
avatarPixmap.load(avatarUrl);
|
||||
|
||||
|
||||
@@ -98,12 +98,14 @@ void IgnoresPage::onShow()
|
||||
|
||||
auto user = app->accounts->twitch.getCurrent();
|
||||
|
||||
if (user->isAnon()) {
|
||||
if (user->isAnon())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QStringList users;
|
||||
for (const auto &ignoredUser : user->getIgnores()) {
|
||||
for (const auto &ignoredUser : user->getIgnores())
|
||||
{
|
||||
users << ignoredUser.name;
|
||||
}
|
||||
this->userListModel_.setStringList(users);
|
||||
|
||||
@@ -181,7 +181,8 @@ void LookPage::addMessageTab(LayoutCreator<QVBoxLayout> layout)
|
||||
|
||||
const auto currentIndex = []() -> int {
|
||||
auto val = getSettings()->collpseMessagesMinLines.getValue();
|
||||
if (val > 0) {
|
||||
if (val > 0)
|
||||
{
|
||||
--val;
|
||||
}
|
||||
return val;
|
||||
@@ -332,7 +333,8 @@ void LookPage::addLastReadMessageIndicatorPatternSelector(
|
||||
combo->addItems({"Dotted line", "Solid line"});
|
||||
|
||||
const auto currentIndex = []() -> int {
|
||||
switch (getSettings()->lastMessagePattern.getValue()) {
|
||||
switch (getSettings()->lastMessagePattern.getValue())
|
||||
{
|
||||
case Qt::SolidLine:
|
||||
return 1;
|
||||
case Qt::VerPattern:
|
||||
@@ -347,7 +349,8 @@ void LookPage::addLastReadMessageIndicatorPatternSelector(
|
||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
[](int index) {
|
||||
getSettings()->lastMessagePattern = [&] {
|
||||
switch (index) {
|
||||
switch (index)
|
||||
{
|
||||
case 1:
|
||||
return Qt::SolidPattern;
|
||||
case 0:
|
||||
@@ -386,7 +389,8 @@ void LookPage::addLastReadMessageIndicatorPatternSelector(
|
||||
QObject::connect(
|
||||
button, &QPushButton::clicked, [updatePreviewColor, getCurrentColor]() {
|
||||
QColor newColor = QColorDialog::getColor(getCurrentColor());
|
||||
if (newColor.isValid()) {
|
||||
if (newColor.isValid())
|
||||
{
|
||||
updatePreviewColor(newColor);
|
||||
getSettings()->lastMessageColor = newColor.name();
|
||||
}
|
||||
|
||||
@@ -32,7 +32,8 @@ qint64 dirSize(QString dirPath)
|
||||
QDir dir(dirPath);
|
||||
// calculate total size of current directories' files
|
||||
QDir::Filters fileFilters = QDir::Files | QDir::System | QDir::Hidden;
|
||||
for (QString filePath : dir.entryList(fileFilters)) {
|
||||
for (QString filePath : dir.entryList(fileFilters))
|
||||
{
|
||||
QFileInfo fi(dir, filePath);
|
||||
size += fi.size();
|
||||
}
|
||||
@@ -49,8 +50,10 @@ QString formatSize(qint64 size)
|
||||
QStringList units = {"Bytes", "KB", "MB", "GB", "TB", "PB"};
|
||||
int i;
|
||||
double outputSize = size;
|
||||
for (i = 0; i < units.size() - 1; i++) {
|
||||
if (outputSize < 1024) break;
|
||||
for (i = 0; i < units.size() - 1; i++)
|
||||
{
|
||||
if (outputSize < 1024)
|
||||
break;
|
||||
outputSize = outputSize / 1024;
|
||||
}
|
||||
return QString("%0 %1").arg(outputSize, 0, 'f', 2).arg(units[i]);
|
||||
@@ -59,9 +62,12 @@ QString formatSize(qint64 size)
|
||||
QString fetchLogDirectorySize()
|
||||
{
|
||||
QString logPathDirectory;
|
||||
if (getSettings()->logPath == "") {
|
||||
if (getSettings()->logPath == "")
|
||||
{
|
||||
logPathDirectory = getPaths()->messageLogDirectory;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
logPathDirectory = getSettings()->logPath;
|
||||
}
|
||||
qint64 logsSize = dirSize(logPathDirectory);
|
||||
@@ -93,9 +99,12 @@ ModerationPage::ModerationPage()
|
||||
[logsPathLabel](const QString &logPath, auto) mutable {
|
||||
QString pathOriginal;
|
||||
|
||||
if (logPath == "") {
|
||||
if (logPath == "")
|
||||
{
|
||||
pathOriginal = getPaths()->messageLogDirectory;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
pathOriginal = logPath;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user