Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
ProfileItem Class Reference

Represents a single configuration profile entry in the profile manager, tracking its name, origin, lifecycle status, and auto-switch filter. More...

#include <profile_model.h>

Public Types

enum  StatusType { New = 0 , Existing , Changed , Copy }
 Lifecycle status of a profile item within the model. More...
 

Public Member Functions

 ProfileItem (profile_def *profile)
 Constructs a ProfileItem from a raw libwireshark profile definition.
 
 ProfileItem (QString name, QString reference, StatusType status, bool isGlobal, bool fromGlobal, bool isImport)
 Constructs a ProfileItem from individual field values.
 
const QString & getName () const
 Returns the current display name of the profile.
 
const QString getType () const
 Returns a localised string describing the profile type (e.g. "Personal", "Global").
 
const QString & getAutoSwitchFilter () const
 Returns the display-filter expression used for automatic profile switching.
 
StatusType getStatus () const
 Returns the current lifecycle status of this profile item.
 
bool isGlobal () const
 Returns whether this is a read-only global (system-wide) profile.
 
bool isFromGlobal () const
 Returns whether this profile was originally copied from a global profile.
 
bool isChanged () const
 Returns whether the profile has unsaved changes relative to its on-disk state.
 
bool isDefault () const
 Returns whether this is the built-in default profile.
 
bool isImport () const
 Returns whether this profile was imported from an external source.
 
bool isDeleted () const
 Returns whether this profile is marked for deletion on the next apply.
 
const QString & getReference () const
 Returns the original name of the profile at creation time.
 
QString getProfilePath (QString profileName="") const
 Returns the filesystem path for this profile.
 
void setName (QString value)
 Sets a new display name for the profile and marks it as changed if applicable.
 
void setStatus (StatusType status)
 Updates the lifecycle status of the profile.
 
void setAutoSwitchFilter (QString value)
 Sets the display-filter expression used for automatic profile switching.
 
void setForDeletion ()
 Marks this profile for deletion on the next call to ProfileModel::applyChanges().
 

Detailed Description

Represents a single configuration profile entry in the profile manager, tracking its name, origin, lifecycle status, and auto-switch filter.

Member Enumeration Documentation

◆ StatusType

Lifecycle status of a profile item within the model.

Enumerator
New 

Newly created profile, not yet persisted.

Existing 

Profile loaded from an existing on-disk profile directory.

Changed 

Existing profile whose name or settings have been modified.

Copy 

Profile created as a duplicate of another profile.

Constructor & Destructor Documentation

◆ ProfileItem() [1/2]

ProfileItem::ProfileItem ( profile_def profile)

Constructs a ProfileItem from a raw libwireshark profile definition.

Parameters
profilePointer to the profile_def to wrap.

◆ ProfileItem() [2/2]

ProfileItem::ProfileItem ( QString  name,
QString  reference,
StatusType  status,
bool  isGlobal,
bool  fromGlobal,
bool  isImport 
)

Constructs a ProfileItem from individual field values.

Parameters
nameDisplay name of the profile.
referenceOriginal name of the profile at creation time (used to locate the on-disk directory).
statusInitial lifecycle status.
isGlobaltrue if this is a read-only global (system) profile.
fromGlobaltrue if this profile was copied from a global profile.
isImporttrue if this profile was imported from an external archive or directory.

Member Function Documentation

◆ getAutoSwitchFilter()

const QString & ProfileItem::getAutoSwitchFilter ( ) const
inline

Returns the display-filter expression used for automatic profile switching.

Returns
Const reference to the auto-switch filter string, or an empty string if none is set.

◆ getName()

const QString & ProfileItem::getName ( ) const
inline

Returns the current display name of the profile.

Returns
Const reference to the profile name string.

◆ getProfilePath()

QString ProfileItem::getProfilePath ( QString  profileName = "") const

Returns the filesystem path for this profile.

Parameters
profileNameName to append to the base profile directory path. If empty, the current profile name (name_) is used.
Returns
Absolute path string for the profile directory.

◆ getReference()

const QString & ProfileItem::getReference ( ) const
inline

Returns the original name of the profile at creation time.

Used to locate the corresponding on-disk directory when the display name has been changed.

Returns
Const reference to the reference name string.

◆ getStatus()

StatusType ProfileItem::getStatus ( ) const
inline

Returns the current lifecycle status of this profile item.

Returns
Current StatusType value.

◆ getType()

const QString ProfileItem::getType ( ) const

Returns a localised string describing the profile type (e.g. "Personal", "Global").

Returns
Profile type string.

◆ isChanged()

bool ProfileItem::isChanged ( ) const
inline

Returns whether the profile has unsaved changes relative to its on-disk state.

Returns
true if the profile has been modified.

◆ isDefault()

bool ProfileItem::isDefault ( ) const

Returns whether this is the built-in default profile.

Returns
true for the default profile.

◆ isDeleted()

bool ProfileItem::isDeleted ( ) const
inline

Returns whether this profile is marked for deletion on the next apply.

Returns
true if the profile is pending deletion.

◆ isFromGlobal()

bool ProfileItem::isFromGlobal ( ) const
inline

Returns whether this profile was originally copied from a global profile.

Returns
true if the profile originated from a global profile.

◆ isGlobal()

bool ProfileItem::isGlobal ( ) const
inline

Returns whether this is a read-only global (system-wide) profile.

Returns
true for global profiles.

◆ isImport()

bool ProfileItem::isImport ( ) const
inline

Returns whether this profile was imported from an external source.

Returns
true if the profile was imported.

◆ setAutoSwitchFilter()

void ProfileItem::setAutoSwitchFilter ( QString  value)

Sets the display-filter expression used for automatic profile switching.

Parameters
valueDisplay-filter string; an empty string disables auto-switching.

◆ setName()

void ProfileItem::setName ( QString  value)

Sets a new display name for the profile and marks it as changed if applicable.

Parameters
valueNew profile name.

◆ setStatus()

void ProfileItem::setStatus ( StatusType  status)
inline

Updates the lifecycle status of the profile.

Parameters
statusNew StatusType value to assign.

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