refactor: cleanup brackets around blocks
This commit is contained in:
+8
-5
@@ -397,10 +397,6 @@ void MainWindow::buildUi()
|
|||||||
m_splitter->addWidget(m_rightSidebar);
|
m_splitter->addWidget(m_rightSidebar);
|
||||||
|
|
||||||
// ── Network detail widget (hidden by default) ──
|
// ── 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();
|
m_statusBar = new QStatusBar();
|
||||||
setStatusBar(m_statusBar);
|
setStatusBar(m_statusBar);
|
||||||
@@ -450,7 +446,6 @@ void MainWindow::setupModels()
|
|||||||
// Create store (data loaded after sign-in via loadStartupData)
|
// Create store (data loaded after sign-in via loadStartupData)
|
||||||
m_store = new Store(this);
|
m_store = new Store(this);
|
||||||
|
|
||||||
// Now create the network detail widget (needs store)
|
|
||||||
m_networkDetailWidget = new NetworkDetailWidget(m_store);
|
m_networkDetailWidget = new NetworkDetailWidget(m_store);
|
||||||
m_splitter->addWidget(m_networkDetailWidget);
|
m_splitter->addWidget(m_networkDetailWidget);
|
||||||
m_networkDetailWidget->hide();
|
m_networkDetailWidget->hide();
|
||||||
@@ -602,7 +597,9 @@ void MainWindow::onParticleSelectionChanged(const QItemSelection &selected, cons
|
|||||||
{
|
{
|
||||||
QStringList acked;
|
QStringList acked;
|
||||||
for (const auto &email : particle->ackedByEmails)
|
for (const auto &email : particle->ackedByEmails)
|
||||||
|
{
|
||||||
acked.append(email);
|
acked.append(email);
|
||||||
|
}
|
||||||
m_ackLabel->setText("Acked by: " + acked.join(", "));
|
m_ackLabel->setText("Acked by: " + acked.join(", "));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -694,7 +691,9 @@ void MainWindow::updateStatusBar()
|
|||||||
{
|
{
|
||||||
QJsonObject dataObj;
|
QJsonObject dataObj;
|
||||||
for (auto it = particle->data.constBegin(); it != particle->data.constEnd(); ++it)
|
for (auto it = particle->data.constBegin(); it != particle->data.constEnd(); ++it)
|
||||||
|
{
|
||||||
dataObj.insert(it.key(), QJsonValue::fromVariant(it.value()));
|
dataObj.insert(it.key(), QJsonValue::fromVariant(it.value()));
|
||||||
|
}
|
||||||
int bytes = QJsonDocument(dataObj).toJson(QJsonDocument::Compact).size();
|
int bytes = QJsonDocument(dataObj).toJson(QJsonDocument::Compact).size();
|
||||||
if (bytes < 1024)
|
if (bytes < 1024)
|
||||||
m_storageLabel->setText(QString::number(bytes) + " B");
|
m_storageLabel->setText(QString::number(bytes) + " B");
|
||||||
@@ -722,7 +721,9 @@ void MainWindow::updateStatusBar()
|
|||||||
void MainWindow::showTextInputDialog()
|
void MainWindow::showTextInputDialog()
|
||||||
{
|
{
|
||||||
if (m_selectedStreamId.isEmpty())
|
if (m_selectedStreamId.isEmpty())
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_textInputDialog->show();
|
m_textInputDialog->show();
|
||||||
m_textInputDialog->raise();
|
m_textInputDialog->raise();
|
||||||
@@ -751,7 +752,9 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event)
|
|||||||
void MainWindow::onTextMessageSubmitted(const QString &text)
|
void MainWindow::onTextMessageSubmitted(const QString &text)
|
||||||
{
|
{
|
||||||
if (m_selectedStreamId.isEmpty())
|
if (m_selectedStreamId.isEmpty())
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto *op = m_store->createParticle(m_selectedStreamId, "text", {{"content", text}});
|
auto *op = m_store->createParticle(m_selectedStreamId, "text", {{"content", text}});
|
||||||
connect(op, &Operation::success, this, [this](const QJsonDocument &) {
|
connect(op, &Operation::success, this, [this](const QJsonDocument &) {
|
||||||
|
|||||||
Reference in New Issue
Block a user