diff options
author | Roland Knall <rknall@gmail.com> | 2019-10-28 12:16:31 +0100 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2019-10-28 15:06:01 +0000 |
commit | f577d5b3ea0c277bc15168f563a2f2fdd0b87c40 (patch) | |
tree | 694fd0ea411e7a79f14b0e2706885ad933fc03ac /ui | |
parent | 551745998ef4a9352bca2a0035780bc1a96e55eb (diff) |
Qt: Add Shortcut methods for active profile
Change-Id: Ied32cf386074b97cfea38ffe6b8be6b916164712
Reviewed-on: https://code.wireshark.org/review/34873
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/models/profile_model.cpp | 14 | ||||
-rw-r--r-- | ui/qt/models/profile_model.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/ui/qt/models/profile_model.cpp b/ui/qt/models/profile_model.cpp index 830484e241..af0b913878 100644 --- a/ui/qt/models/profile_model.cpp +++ b/ui/qt/models/profile_model.cpp @@ -1280,6 +1280,20 @@ bool ProfileModel::checkNameValidity(QString name, QString *msg) return true; } +QString ProfileModel::activeProfileName() +{ + ProfileModel model; + QModelIndex idx = model.activeProfile(); + return idx.data(ProfileModel::COL_NAME).toString(); +} + +QString ProfileModel::activeProfilePath() +{ + ProfileModel model; + QModelIndex idx = model.activeProfile(); + return idx.data(ProfileModel::DATA_PATH).toString(); +} + /* * Editor modelines * diff --git a/ui/qt/models/profile_model.h b/ui/qt/models/profile_model.h index 9b7fa88854..6bce7e9bca 100644 --- a/ui/qt/models/profile_model.h +++ b/ui/qt/models/profile_model.h @@ -90,6 +90,8 @@ public: bool resetDefault() const; QModelIndex activeProfile() const; + static QString activeProfileName(); + static QString activeProfilePath(); GList * at(int row) const; |