Skip to content

Commit d0a4618

Browse files
committed
gui: address code reviews,
check for invalid objects, rename function, remove unecessary selectedCaptureRowChanged() Signed-off-by: Augusto Berndt <[email protected]>
1 parent 5dbc619 commit d0a4618

File tree

5 files changed

+20
-15
lines changed

5 files changed

+20
-15
lines changed

src/gui/include/gui/gui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ class Gui
773773
int width_px = 0,
774774
int height_px = 0);
775775

776-
void showWorstPath(bool setup);
776+
void showWorstTimingPath(bool setup);
777777

778778
// modify display controls
779779
void setDisplayControlsVisible(const std::string& name, bool value);

src/gui/src/gui.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,11 +864,12 @@ void Gui::saveHistogramImage(const std::string& filename,
864864
filename, chart_mode, width, height);
865865
}
866866

867-
void Gui::showWorstPath(bool setup)
867+
void Gui::showWorstTimingPath(bool setup)
868868
{
869-
if (main_window->getTimingWidget()) {
870-
main_window->getTimingWidget()->showWorstPath(setup);
869+
if (!enabled()) {
870+
return;
871871
}
872+
main_window->getTimingWidget()->showWorstTimingPath(setup);
872873
}
873874

874875
void Gui::selectClockviewerClock(const std::string& clock_name,

src/gui/src/gui.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ void show_worst_path(bool setup = true)
338338
return;
339339
}
340340
auto gui = gui::Gui::get();
341-
gui->showWorstPath(setup);
341+
gui->showWorstTimingPath(setup);
342342
}
343343

344344
void clear_rulers()

src/gui/src/timingWidget.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -789,9 +789,18 @@ void TimingWidget::hideEvent(QHideEvent* event)
789789
toggleRenderer(false);
790790
}
791791

792-
void TimingWidget::showWorstPath(bool setup)
792+
void TimingWidget::showWorstTimingPath(bool setup)
793793
{
794-
populatePaths();
794+
if (setup_timing_paths_model_ == nullptr
795+
|| hold_timing_paths_model_ == nullptr) {
796+
return;
797+
}
798+
799+
if (setup_timing_paths_model_->rowCount() == 0
800+
&& hold_timing_paths_model_->rowCount() == 0) {
801+
populatePaths();
802+
}
803+
795804
QTableView* table_view
796805
= setup ? setup_timing_table_view_ : hold_timing_table_view_;
797806
QAbstractItemModel* model = table_view->model();
@@ -800,13 +809,8 @@ void TimingWidget::showWorstPath(bool setup)
800809
table_view->setCurrentIndex(index);
801810
// Ensure the selection signal is emitted even if the index was already
802811
// selected
803-
if (setup) {
804-
selectedRowChanged(table_view->selectionModel()->selection(),
805-
QItemSelection());
806-
} else {
807-
selectedCaptureRowChanged(table_view->selectionModel()->selection(),
808-
QItemSelection());
809-
}
812+
selectedRowChanged(table_view->selectionModel()->selection(),
813+
QItemSelection());
810814
}
811815
}
812816

src/gui/src/timingWidget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class TimingWidget : public QDockWidget
7171
void updatePaths();
7272
void reportSlackHistogramPaths(const std::set<const sta::Pin*>& report_pins,
7373
const std::string& path_group_name);
74-
void showWorstPath(bool setup);
74+
void showWorstTimingPath(bool setup);
7575

7676
signals:
7777
void highlightTimingPath(TimingPath* timing_path);

0 commit comments

Comments
 (0)