On Thu, Apr 18, 2019 at 6:23 PM Yordan Karadzhov <ykaradzhov@xxxxxxxxxx> wrote: > > Markers can point to entries that are filtered out. When switching > the marker it may happen that new Active Marker points to an entry > that is filtered. In this case no actions must be taken and a warning > message for the user must be displayed. > > Signed-off-by: Yordan Karadzhov <ykaradzhov@xxxxxxxxxx> > --- > kernel-shark/src/KsTraceViewer.cpp | 27 +++++++++++++++++---------- > kernel-shark/src/KsTraceViewer.hpp | 2 ++ > 2 files changed, 19 insertions(+), 10 deletions(-) > > diff --git a/kernel-shark/src/KsTraceViewer.cpp b/kernel-shark/src/KsTraceViewer.cpp > index 04a38b8..85da64f 100644 > --- a/kernel-shark/src/KsTraceViewer.cpp > +++ b/kernel-shark/src/KsTraceViewer.cpp > @@ -61,7 +61,8 @@ KsTraceViewer::KsTraceViewer(QWidget *parent) > _graphFollowsCheckBox(this), > _graphFollows(true), > _mState(nullptr), > - _data(nullptr) > + _data(nullptr), > + _em(this) > { > this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); > > @@ -493,15 +494,21 @@ void KsTraceViewer::markSwitch() > QModelIndex index = > _proxyModel.mapFromSource(_model.index(row, 0)); > > - /* > - * The row of the active marker will be colored according to > - * the assigned property of the current state of the Dual > - * marker. Auto-scrolling is temporarily disabled because we > - * do not want to scroll to the position of the marker yet. > - */ > - _view.setAutoScroll(false); > - _view.selectRow(index.row()); > - _view.setAutoScroll(true); > + if (index.isValid()) { > + /* > + * The row of the active marker will be colored according to > + * the assigned property of the current state of the Dual > + * marker. Auto-scrolling is temporarily disabled because we > + * do not want to scroll to the position of the marker yet. > + */ > + _view.setAutoScroll(false); > + _view.selectRow(index.row()); > + _view.setAutoScroll(true); > + } else { > + _view.clearSelection(); > + QString err("The marker's entry is filtered out."); > + _em.showMessage(err); When is this error message going to be cleared? I don't think it changes atm unless a new error comes along. -- Slavi