Skip to content

Commit 38a2a07

Browse files
Copilotxusheng6
andcommitted
Final fixes for TTD Events widget - handle null pointers and complete specialized widget implementation
Co-authored-by: xusheng6 <[email protected]>
1 parent f95b6c3 commit 38a2a07

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

ui/ttdeventswidget.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,10 @@ void TTDEventsQueryWidget::performQuery()
363363
}
364364

365365
updateStatus("Querying all TTD events...");
366-
m_queryButton->setEnabled(false);
366+
367+
// Only disable button if it exists (AllEvents widgets have buttons, specialized don't)
368+
if (m_queryButton)
369+
m_queryButton->setEnabled(false);
367370

368371
try
369372
{
@@ -372,16 +375,25 @@ void TTDEventsQueryWidget::performQuery()
372375

373376
updateStatus(QString("Query completed. Loaded %1 total events.").arg(m_allEvents.size()));
374377

375-
// Filter and display events based on current checkbox settings
376-
filterAndDisplayEvents();
378+
// Filter and display events based on widget type
379+
if (m_widgetType == AllEvents)
380+
{
381+
filterAndDisplayEvents();
382+
}
383+
else
384+
{
385+
filterAndDisplaySpecializedEvents();
386+
}
377387
}
378388
catch (const std::exception& e)
379389
{
380390
updateStatus(QString("Query failed: %1").arg(e.what()));
381391
QMessageBox::warning(this, "TTD Events Query Error", QString("Failed to query TTD events:\n%1").arg(e.what()));
382392
}
383393

384-
m_queryButton->setEnabled(true);
394+
// Only re-enable button if it exists
395+
if (m_queryButton)
396+
m_queryButton->setEnabled(true);
385397
}
386398

387399
void TTDEventsQueryWidget::filterAndDisplayEvents()

0 commit comments

Comments
 (0)