Wireshark 4.7.2
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
CaptureFilterBookmarkModel Class Reference

Saved-capture-filter bookmarks backed by FilterListModel(Capture). More...

#include <capture_filter_bookmark_model.h>

Inheritance diagram for CaptureFilterBookmarkModel:
BookmarkModel

Public Slots

void reload ()
 Reloads from the saved-filters store (e.g. on external change).

Public Member Functions

 CaptureFilterBookmarkModel (QObject *parent=nullptr)
int rowCount (const QModelIndex &parent=QModelIndex()) const override
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
bool contains (const QString &expression) const override
 Returns true when expression exactly matches a saved entry.
void addBookmark (const QString &name, const QString &expression)
 Adds a saved filter and persists the list.
void removeBookmark (const QString &expression)
 Removes the saved filter matching expression and persists.
Public Member Functions inherited from BookmarkModel
 BookmarkModel (QObject *parent=nullptr)

Additional Inherited Members

Public Types inherited from BookmarkModel
enum  Roles { ExpressionRole = Qt::UserRole + 1 , NameRole }
 Item-data roles exposed by every bookmark model. More...

Detailed Description

Saved-capture-filter bookmarks backed by FilterListModel(Capture).

Presents the saved capture filters as a flat list with ExpressionRole and NameRole, persisting through the underlying FilterListModel (the same store the Capture Filters manager edits). contains() drives the bookmark menu's "remove current" enablement.

Member Function Documentation

◆ contains()

bool CaptureFilterBookmarkModel::contains ( const QString & expression) const
overridevirtual

Returns true when expression exactly matches a saved entry.

Drives the enablement of the bookmark menu's "remove current" action, centralising logic that the old edits duplicated inside checkFilter().

Implements BookmarkModel.


The documentation for this class was generated from the following files: