@@ -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);
+ }
} else {
_view.clearSelection();
}
@@ -119,6 +119,8 @@ private:
KsDataStore *_data;
+ QErrorMessage _em;
+
enum Condition
{
Containes = 0,
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@vmware.com> --- kernel-shark/src/KsTraceViewer.cpp | 27 +++++++++++++++++---------- kernel-shark/src/KsTraceViewer.hpp | 2 ++ 2 files changed, 19 insertions(+), 10 deletions(-)