From 25a43ab4da36f1414884e1ddd92ac99cc39c6934 Mon Sep 17 00:00:00 2001 From: talksik Date: Sat, 7 Feb 2026 09:02:14 -0800 Subject: [PATCH] refactor: cleanup brackets around blocks --- src/MainWindow.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index fcaceb1..b11e75a 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -397,10 +397,6 @@ void MainWindow::buildUi() m_splitter->addWidget(m_rightSidebar); // ── Network detail widget (hidden by default) ── - // Store is created in setupModels, so we pass nullptr now and set store later - // Actually, store is created in setupModels which is called after buildUi. - // We need to create it after store exists. We'll create it in the constructor after setupModels. - // For now just reserve the splitter slot — we'll add the widget after setupModels(). m_statusBar = new QStatusBar(); setStatusBar(m_statusBar); @@ -450,7 +446,6 @@ void MainWindow::setupModels() // Create store (data loaded after sign-in via loadStartupData) m_store = new Store(this); - // Now create the network detail widget (needs store) m_networkDetailWidget = new NetworkDetailWidget(m_store); m_splitter->addWidget(m_networkDetailWidget); m_networkDetailWidget->hide(); @@ -602,7 +597,9 @@ void MainWindow::onParticleSelectionChanged(const QItemSelection &selected, cons { QStringList acked; for (const auto &email : particle->ackedByEmails) + { acked.append(email); + } m_ackLabel->setText("Acked by: " + acked.join(", ")); } else @@ -694,7 +691,9 @@ void MainWindow::updateStatusBar() { QJsonObject dataObj; for (auto it = particle->data.constBegin(); it != particle->data.constEnd(); ++it) + { dataObj.insert(it.key(), QJsonValue::fromVariant(it.value())); + } int bytes = QJsonDocument(dataObj).toJson(QJsonDocument::Compact).size(); if (bytes < 1024) m_storageLabel->setText(QString::number(bytes) + " B"); @@ -722,7 +721,9 @@ void MainWindow::updateStatusBar() void MainWindow::showTextInputDialog() { if (m_selectedStreamId.isEmpty()) + { return; + } m_textInputDialog->show(); m_textInputDialog->raise(); @@ -751,7 +752,9 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) void MainWindow::onTextMessageSubmitted(const QString &text) { if (m_selectedStreamId.isEmpty()) + { return; + } auto *op = m_store->createParticle(m_selectedStreamId, "text", {{"content", text}}); connect(op, &Operation::success, this, [this](const QJsonDocument &) {