refactor: fix clang-tidy auto*, const&, and curly braces (#5083)

This commit is contained in:
pajlada
2024-01-14 17:54:52 +01:00
committed by GitHub
parent 292f9b9734
commit 5b6675abb4
78 changed files with 647 additions and 228 deletions
+9 -5
View File
@@ -136,7 +136,7 @@ void Window::closeEvent(QCloseEvent *)
{
if (this->type_ == WindowType::Main)
{
auto app = getApp();
auto *app = getApp();
app->windows->save();
app->windows->closeAll();
}
@@ -171,9 +171,13 @@ void Window::addLayout()
void Window::addCustomTitlebarButtons()
{
if (!this->hasCustomWindowFrame())
{
return;
}
if (this->type_ != WindowType::Main)
{
return;
}
// settings
this->addTitleBarButton(TitleBarButtonStyle::Settings, [this] {
@@ -181,7 +185,7 @@ void Window::addCustomTitlebarButtons()
});
// updates
auto update = this->addTitleBarButton(TitleBarButtonStyle::None, [] {});
auto *update = this->addTitleBarButton(TitleBarButtonStyle::None, [] {});
initUpdateButton(*update, this->signalHolder_);
@@ -384,10 +388,10 @@ void Window::addShortcuts()
}
if (arguments.at(0) == "split")
{
if (auto page = dynamic_cast<SplitContainer *>(
if (auto *page = dynamic_cast<SplitContainer *>(
this->notebook_->getSelectedPage()))
{
if (auto split = page->getSelectedSplit())
if (auto *split = page->getSelectedSplit())
{
split->popup();
}
@@ -395,7 +399,7 @@ void Window::addShortcuts()
}
else if (arguments.at(0) == "window")
{
if (auto page = dynamic_cast<SplitContainer *>(
if (auto *page = dynamic_cast<SplitContainer *>(
this->notebook_->getSelectedPage()))
{
page->popup();