The RecentItems class encapsulates a list of items that were recently interacted with. The class keeps a record of these items stored in preferences. Useful for keeping track of recently opened files.
More...
#include <recentitems.h>
The RecentItems class encapsulates a list of items that were recently interacted with. The class keeps a record of these items stored in preferences. Useful for keeping track of recently opened files.
◆ RecentItems() [1/3]
geometrize::RecentItems::RecentItems |
( |
const QString & |
group, |
|
|
unsigned int |
maxItems |
|
) |
| |
RecentItems Creates a new RecentItems instance.
- Parameters
-
group | The base path group to use for storing the recent items in settings e.g. "recent_image_paths", "recent_video_names" etc. |
maxItems | The maximum number of items to load. The most recent items will be loaded initially, and the oldest items will be replaced when new items are added over the limit. |
164 :
d{std::make_unique<RecentItemsImpl>(group, maxItems)}
◆ RecentItems() [2/3]
◆ RecentItems() [3/3]
geometrize::RecentItems::RecentItems |
( |
RecentItems && |
| ) |
|
|
delete |
◆ ~RecentItems()
geometrize::RecentItems::~RecentItems |
( |
| ) |
|
|
virtual |
◆ add()
void geometrize::RecentItems::add |
( |
const QString & |
itemId, |
|
|
const QString & |
itemDisplayName |
|
) |
| |
add Adds an item to the recent items.
- Parameters
-
itemId | A unique id for the item (e.g. a complete file path). |
itemDisplayName | A display name for the item (e.g. a file name). |
179 if(
d->getItemCount() >
d->getMaxItemCount()) {
183 const bool preexisting{
d->contains(itemId)};
185 const RecentItem item{
d->addItem(itemId, itemDisplayName)};
◆ clear()
void geometrize::RecentItems::clear |
( |
| ) |
|
clear Removes all items from the recent items.
◆ getItems()
QList< RecentItem > geometrize::RecentItems::getItems |
( |
| ) |
const |
getItems Gets the recent items.
- Returns
- A list of the recent items, sorted from most recently interacted with to oldest.
174 return d->getItems();
◆ operator=()
◆ remove()
void geometrize::RecentItems::remove |
( |
const QString & |
itemId | ) |
|
remove Removes an item from the recent items.
- Parameters
-
itemId | The item id to remove. |
192 d->removeItem(itemId);
◆ signal_added
void geometrize::RecentItems::signal_added |
( |
const RecentItem & |
item | ) |
|
|
signal |
signal_added is emitted after an item is added.
- Parameters
-
item | The item that was added. |
◆ signal_cleared
void geometrize::RecentItems::signal_cleared |
( |
| ) |
|
|
signal |
signal_cleared is emitted after the recent items are cleared.
◆ signal_removed
void geometrize::RecentItems::signal_removed |
( |
const QString & |
itemId | ) |
|
|
signal |
signal_removed is emitted after an item is removed.
- Parameters
-
itemId | The id of the item that was removed. |
◆ swap
The documentation for this class was generated from the following files:
- /home/appveyor/projects/geometrize-docs/geometrize/geometrize/recents/recentitems.h
- /home/appveyor/projects/geometrize-docs/geometrize/geometrize/recents/recentitems.cpp