diff options
| author | Peter LaFosse <peter@vector35.com> | 2020-08-13 11:57:47 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2020-08-13 11:57:47 -0400 |
| commit | d3349f3f14d6e32dc1c1e21a05f3bd0d045c6b4d (patch) | |
| tree | d262f9c8fcc82054039e82b2e9593d99730da7d7 | |
| parent | 297ea6f73fe5c482611cf4e0d72090df73d9c16f (diff) | |
Prioritize recent commands in command palette
| -rw-r--r-- | ui/commandpalette.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/commandpalette.h b/ui/commandpalette.h index c0d268b4..66072c12 100644 --- a/ui/commandpalette.h +++ b/ui/commandpalette.h @@ -39,6 +39,9 @@ class BINARYNINJAUIAPI CommandListModel: public QAbstractItemModel std::vector<CommandListItem> m_items; std::vector<CommandListItem> m_allItems; + std::vector<QString> m_recentItems; + size_t m_maxRecentItems; + bool isFilterMatch(const QString& name, const QString& filter); int getFilterMatchScore(const QString& name, const QString& filter); @@ -54,6 +57,8 @@ public: QString getActionForItem(int row); void setFilterText(const QString& text); + size_t getRecentPosition(const QString& name) const; + void addRecentItem(const QString& name); }; class BINARYNINJAUIAPI CommandList: public QListView @@ -72,6 +77,7 @@ public: QString getActionForItem(int row); QModelIndex index(int row, int col, const QModelIndex& parent = QModelIndex()) const; + void addRecentItem(const QString& name); protected: virtual void keyPressEvent(QKeyEvent* event) override; |
