Merge pull request #2800 from QazCetelic/advanced-icon-dialog

Add search and support for subdirectories to icon picker
This commit is contained in:
Alexandru Ionut Tripon 2024-12-06 12:37:45 +02:00 committed by GitHub
commit 28a471777a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 195 additions and 117 deletions

View File

@ -47,24 +47,24 @@
#define MAX_SIZE 1024 #define MAX_SIZE 1024
IconList::IconList(const QStringList& builtinPaths, QString path, QObject* parent) : QAbstractListModel(parent) IconList::IconList(const QStringList& builtinPaths, const QString& path, QObject* parent) : QAbstractListModel(parent)
{ {
QSet<QString> builtinNames; QSet<QString> builtinNames;
// add builtin icons // add builtin icons
for (auto& builtinPath : builtinPaths) { for (const auto& builtinPath : builtinPaths) {
QDir instance_icons(builtinPath); QDir instanceIcons(builtinPath);
auto file_info_list = instance_icons.entryInfoList(QDir::Files, QDir::Name); auto fileInfoList = instanceIcons.entryInfoList(QDir::Files, QDir::Name);
for (auto file_info : file_info_list) { for (const auto& fileInfo : fileInfoList) {
builtinNames.insert(file_info.completeBaseName()); builtinNames.insert(fileInfo.baseName());
} }
} }
for (auto& builtinName : builtinNames) { for (const auto& builtinName : builtinNames) {
addThemeIcon(builtinName); addThemeIcon(builtinName);
} }
m_watcher.reset(new QFileSystemWatcher()); m_watcher.reset(new QFileSystemWatcher());
is_watching = false; m_isWatching = false;
connect(m_watcher.get(), &QFileSystemWatcher::directoryChanged, this, &IconList::directoryChanged); connect(m_watcher.get(), &QFileSystemWatcher::directoryChanged, this, &IconList::directoryChanged);
connect(m_watcher.get(), &QFileSystemWatcher::fileChanged, this, &IconList::fileChanged); connect(m_watcher.get(), &QFileSystemWatcher::fileChanged, this, &IconList::fileChanged);
@ -77,91 +77,130 @@ IconList::IconList(const QStringList& builtinPaths, QString path, QObject* paren
void IconList::sortIconList() void IconList::sortIconList()
{ {
qDebug() << "Sorting icon list..."; qDebug() << "Sorting icon list...";
std::sort(icons.begin(), icons.end(), [](const MMCIcon& a, const MMCIcon& b) { return a.m_key.localeAwareCompare(b.m_key) < 0; }); std::sort(m_icons.begin(), m_icons.end(), [](const MMCIcon& a, const MMCIcon& b) {
bool aIsSubdir = a.m_key.contains(QDir::separator());
bool bIsSubdir = b.m_key.contains(QDir::separator());
if (aIsSubdir != bIsSubdir) {
return !aIsSubdir; // root-level icons come first
}
return a.m_key.localeAwareCompare(b.m_key) < 0;
});
reindex(); reindex();
} }
// Helper function to add directories recursively
bool IconList::addPathRecursively(const QString& path)
{
QDir dir(path);
if (!dir.exists())
return false;
// Add the directory itself
bool watching = m_watcher->addPath(path);
// Add all subdirectories
QFileInfoList entries = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
for (const QFileInfo& entry : entries) {
if (addPathRecursively(entry.absoluteFilePath())) {
watching = true;
}
}
return watching;
}
QStringList IconList::getIconFilePaths() const
{
QStringList iconFiles{};
QStringList directories{ m_dir.absolutePath() };
while (!directories.isEmpty()) {
QString first = directories.takeFirst();
QDir dir(first);
for (QFileInfo& fileInfo : dir.entryInfoList(QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot, QDir::Name)) {
if (fileInfo.isDir())
directories.push_back(fileInfo.absoluteFilePath());
else
iconFiles.push_back(fileInfo.absoluteFilePath());
}
}
return iconFiles;
}
QString formatName(const QDir& iconsDir, const QFileInfo& iconFile)
{
if (iconFile.dir() == iconsDir)
return iconFile.baseName();
constexpr auto delimiter = " » ";
QString relativePathWithoutExtension = iconsDir.relativeFilePath(iconFile.dir().path()) + QDir::separator() + iconFile.baseName();
return relativePathWithoutExtension.replace(QDir::separator(), delimiter);
}
/// Split into a separate function because the preprocessing impedes readability
QSet<QString> toStringSet(const QList<QString>& list)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QSet<QString> set(list.begin(), list.end());
#else
QSet<QString> set = list.toSet();
#endif
return set;
}
void IconList::directoryChanged(const QString& path) void IconList::directoryChanged(const QString& path)
{ {
QDir new_dir(path); QDir newDir(path);
if (m_dir.absolutePath() != new_dir.absolutePath()) { if (m_dir.absolutePath() != newDir.absolutePath()) {
m_dir.setPath(path); if (!path.startsWith(m_dir.absolutePath()))
m_dir.setPath(path);
m_dir.refresh(); m_dir.refresh();
if (is_watching) if (m_isWatching)
stopWatching(); stopWatching();
startWatching(); startWatching();
} }
if (!m_dir.exists()) if (!m_dir.exists() && !FS::ensureFolderPathExists(m_dir.absolutePath()))
if (!FS::ensureFolderPathExists(m_dir.absolutePath())) return;
return;
m_dir.refresh(); m_dir.refresh();
auto new_list = m_dir.entryList(QDir::Files, QDir::Name); const QStringList newFileNamesList = getIconFilePaths();
for (auto it = new_list.begin(); it != new_list.end(); it++) { const QSet<QString> newSet = toStringSet(newFileNamesList);
QString& foo = (*it); QSet<QString> currentSet;
foo = m_dir.filePath(foo); for (const MMCIcon& it : m_icons) {
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QSet<QString> new_set(new_list.begin(), new_list.end());
#else
auto new_set = new_list.toSet();
#endif
QList<QString> current_list;
for (auto& it : icons) {
if (!it.has(IconType::FileBased)) if (!it.has(IconType::FileBased))
continue; continue;
current_list.push_back(it.m_images[IconType::FileBased].filename); currentSet.insert(it.m_images[IconType::FileBased].filename);
} }
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) QSet<QString> toRemove = currentSet - newSet;
QSet<QString> current_set(current_list.begin(), current_list.end()); QSet<QString> toAdd = newSet - currentSet;
#else
QSet<QString> current_set = current_list.toSet();
#endif
QSet<QString> to_remove = current_set; for (const QString& removedPath : toRemove) {
to_remove -= new_set; qDebug() << "Removing icon " << removedPath;
QFileInfo removedFile(removedPath);
QSet<QString> to_add = new_set; QString key = m_dir.relativeFilePath(removedFile.absoluteFilePath());
to_add -= current_set;
for (auto remove : to_remove) {
qDebug() << "Removing " << remove;
QFileInfo rmfile(remove);
QString key = rmfile.completeBaseName();
QString suffix = rmfile.suffix();
// The icon doesnt have a suffix, but it can have other .s in the name, so we account for those as well
if (!IconUtils::isIconSuffix(suffix))
key = rmfile.fileName();
int idx = getIconIndex(key); int idx = getIconIndex(key);
if (idx == -1) if (idx == -1)
continue; continue;
icons[idx].remove(IconType::FileBased); m_icons[idx].remove(FileBased);
if (icons[idx].type() == IconType::ToBeDeleted) { if (m_icons[idx].type() == ToBeDeleted) {
beginRemoveRows(QModelIndex(), idx, idx); beginRemoveRows(QModelIndex(), idx, idx);
icons.remove(idx); m_icons.remove(idx);
reindex(); reindex();
endRemoveRows(); endRemoveRows();
} else { } else {
dataChanged(index(idx), index(idx)); dataChanged(index(idx), index(idx));
} }
m_watcher->removePath(remove); m_watcher->removePath(removedPath);
emit iconUpdated(key); emit iconUpdated(key);
} }
for (auto add : to_add) { for (const QString& addedPath : toAdd) {
qDebug() << "Adding " << add; qDebug() << "Adding icon " << addedPath;
QFileInfo addfile(add); QFileInfo addfile(addedPath);
QString key = addfile.completeBaseName(); QString key = m_dir.relativeFilePath(addfile.absoluteFilePath());
QString name = formatName(m_dir, addfile);
QString suffix = addfile.suffix(); if (addIcon(key, name, addfile.filePath(), IconType::FileBased)) {
// The icon doesnt have a suffix, but it can have other .s in the name, so we account for those as well m_watcher->addPath(addedPath);
if (!IconUtils::isIconSuffix(suffix))
key = addfile.fileName();
if (addIcon(key, QString(), addfile.filePath(), IconType::FileBased)) {
m_watcher->addPath(add);
emit iconUpdated(key); emit iconUpdated(key);
} }
} }
@ -171,24 +210,24 @@ void IconList::directoryChanged(const QString& path)
void IconList::fileChanged(const QString& path) void IconList::fileChanged(const QString& path)
{ {
qDebug() << "Checking " << path; qDebug() << "Checking icon " << path;
QFileInfo checkfile(path); QFileInfo checkfile(path);
if (!checkfile.exists()) if (!checkfile.exists())
return; return;
QString key = checkfile.completeBaseName(); QString key = m_dir.relativeFilePath(checkfile.absoluteFilePath());
int idx = getIconIndex(key); int idx = getIconIndex(key);
if (idx == -1) if (idx == -1)
return; return;
QIcon icon(path); QIcon icon(path);
if (!icon.availableSizes().size()) if (icon.availableSizes().empty())
return; return;
icons[idx].m_images[IconType::FileBased].icon = icon; m_icons[idx].m_images[IconType::FileBased].icon = icon;
dataChanged(index(idx), index(idx)); dataChanged(index(idx), index(idx));
emit iconUpdated(key); emit iconUpdated(key);
} }
void IconList::SettingChanged(const Setting& setting, QVariant value) void IconList::SettingChanged(const Setting& setting, const QVariant& value)
{ {
if (setting.id() != "IconsDir") if (setting.id() != "IconsDir")
return; return;
@ -200,8 +239,8 @@ void IconList::startWatching()
{ {
auto abs_path = m_dir.absolutePath(); auto abs_path = m_dir.absolutePath();
FS::ensureFolderPathExists(abs_path); FS::ensureFolderPathExists(abs_path);
is_watching = m_watcher->addPath(abs_path); m_isWatching = addPathRecursively(abs_path);
if (is_watching) { if (m_isWatching) {
qDebug() << "Started watching " << abs_path; qDebug() << "Started watching " << abs_path;
} else { } else {
qDebug() << "Failed to start watching " << abs_path; qDebug() << "Failed to start watching " << abs_path;
@ -212,7 +251,7 @@ void IconList::stopWatching()
{ {
m_watcher->removePaths(m_watcher->files()); m_watcher->removePaths(m_watcher->files());
m_watcher->removePaths(m_watcher->directories()); m_watcher->removePaths(m_watcher->directories());
is_watching = false; m_isWatching = false;
} }
QStringList IconList::mimeTypes() const QStringList IconList::mimeTypes() const
@ -242,7 +281,7 @@ bool IconList::dropMimeData(const QMimeData* data,
if (data->hasUrls()) { if (data->hasUrls()) {
auto urls = data->urls(); auto urls = data->urls();
QStringList iconFiles; QStringList iconFiles;
for (auto url : urls) { for (const auto& url : urls) {
// only local files may be dropped... // only local files may be dropped...
if (!url.isLocalFile()) if (!url.isLocalFile())
continue; continue;
@ -263,33 +302,33 @@ Qt::ItemFlags IconList::flags(const QModelIndex& index) const
QVariant IconList::data(const QModelIndex& index, int role) const QVariant IconList::data(const QModelIndex& index, int role) const
{ {
if (!index.isValid()) if (!index.isValid())
return QVariant(); return {};
int row = index.row(); int row = index.row();
if (row < 0 || row >= icons.size()) if (row < 0 || row >= m_icons.size())
return QVariant(); return {};
switch (role) { switch (role) {
case Qt::DecorationRole: case Qt::DecorationRole:
return icons[row].icon(); return m_icons[row].icon();
case Qt::DisplayRole: case Qt::DisplayRole:
return icons[row].name(); return m_icons[row].name();
case Qt::UserRole: case Qt::UserRole:
return icons[row].m_key; return m_icons[row].m_key;
default: default:
return QVariant(); return {};
} }
} }
int IconList::rowCount(const QModelIndex& parent) const int IconList::rowCount(const QModelIndex& parent) const
{ {
return parent.isValid() ? 0 : icons.size(); return parent.isValid() ? 0 : m_icons.size();
} }
void IconList::installIcons(const QStringList& iconFiles) void IconList::installIcons(const QStringList& iconFiles)
{ {
for (QString file : iconFiles) for (const QString& file : iconFiles)
installIcon(file, {}); installIcon(file, {});
} }
@ -312,12 +351,13 @@ bool IconList::iconFileExists(const QString& key) const
return iconEntry && iconEntry->has(IconType::FileBased); return iconEntry && iconEntry->has(IconType::FileBased);
} }
/// Returns the icon with the given key or nullptr if it doesn't exist.
const MMCIcon* IconList::icon(const QString& key) const const MMCIcon* IconList::icon(const QString& key) const
{ {
int iconIdx = getIconIndex(key); int iconIdx = getIconIndex(key);
if (iconIdx == -1) if (iconIdx == -1)
return nullptr; return nullptr;
return &icons[iconIdx]; return &m_icons[iconIdx];
} }
bool IconList::deleteIcon(const QString& key) bool IconList::deleteIcon(const QString& key)
@ -332,22 +372,22 @@ bool IconList::trashIcon(const QString& key)
bool IconList::addThemeIcon(const QString& key) bool IconList::addThemeIcon(const QString& key)
{ {
auto iter = name_index.find(key); auto iter = m_nameIndex.find(key);
if (iter != name_index.end()) { if (iter != m_nameIndex.end()) {
auto& oldOne = icons[*iter]; auto& oldOne = m_icons[*iter];
oldOne.replace(Builtin, key); oldOne.replace(Builtin, key);
dataChanged(index(*iter), index(*iter)); dataChanged(index(*iter), index(*iter));
return true; return true;
} }
// add a new icon // add a new icon
beginInsertRows(QModelIndex(), icons.size(), icons.size()); beginInsertRows(QModelIndex(), m_icons.size(), m_icons.size());
{ {
MMCIcon mmc_icon; MMCIcon mmc_icon;
mmc_icon.m_name = key; mmc_icon.m_name = key;
mmc_icon.m_key = key; mmc_icon.m_key = key;
mmc_icon.replace(Builtin, key); mmc_icon.replace(Builtin, key);
icons.push_back(mmc_icon); m_icons.push_back(mmc_icon);
name_index[key] = icons.size() - 1; m_nameIndex[key] = m_icons.size() - 1;
} }
endInsertRows(); endInsertRows();
return true; return true;
@ -359,22 +399,22 @@ bool IconList::addIcon(const QString& key, const QString& name, const QString& p
QIcon icon(path); QIcon icon(path);
if (icon.isNull()) if (icon.isNull())
return false; return false;
auto iter = name_index.find(key); auto iter = m_nameIndex.find(key);
if (iter != name_index.end()) { if (iter != m_nameIndex.end()) {
auto& oldOne = icons[*iter]; auto& oldOne = m_icons[*iter];
oldOne.replace(type, icon, path); oldOne.replace(type, icon, path);
dataChanged(index(*iter), index(*iter)); dataChanged(index(*iter), index(*iter));
return true; return true;
} }
// add a new icon // add a new icon
beginInsertRows(QModelIndex(), icons.size(), icons.size()); beginInsertRows(QModelIndex(), m_icons.size(), m_icons.size());
{ {
MMCIcon mmc_icon; MMCIcon mmc_icon;
mmc_icon.m_name = name; mmc_icon.m_name = name;
mmc_icon.m_key = key; mmc_icon.m_key = key;
mmc_icon.replace(type, icon, path); mmc_icon.replace(type, icon, path);
icons.push_back(mmc_icon); m_icons.push_back(mmc_icon);
name_index[key] = icons.size() - 1; m_nameIndex[key] = m_icons.size() - 1;
} }
endInsertRows(); endInsertRows();
return true; return true;
@ -389,33 +429,32 @@ void IconList::saveIcon(const QString& key, const QString& path, const char* for
void IconList::reindex() void IconList::reindex()
{ {
name_index.clear(); m_nameIndex.clear();
int i = 0; for (int i = 0; i < m_icons.size(); i++) {
for (auto& iter : icons) { m_nameIndex[m_icons[i].m_key] = i;
name_index[iter.m_key] = i; emit iconUpdated(m_icons[i].m_key); // prevents incorrect indices with proxy model
i++;
} }
} }
QIcon IconList::getIcon(const QString& key) const QIcon IconList::getIcon(const QString& key) const
{ {
int icon_index = getIconIndex(key); int iconIndex = getIconIndex(key);
if (icon_index != -1) if (iconIndex != -1)
return icons[icon_index].icon(); return m_icons[iconIndex].icon();
// Fallback for icons that don't exist. // Fallback for icons that don't exist.b
icon_index = getIconIndex("grass"); iconIndex = getIconIndex("grass");
if (icon_index != -1) if (iconIndex != -1)
return icons[icon_index].icon(); return m_icons[iconIndex].icon();
return QIcon(); return {};
} }
int IconList::getIconIndex(const QString& key) const int IconList::getIconIndex(const QString& key) const
{ {
auto iter = name_index.find(key == "default" ? "grass" : key); auto iter = m_nameIndex.find(key == "default" ? "grass" : key);
if (iter != name_index.end()) if (iter != m_nameIndex.end())
return *iter; return *iter;
return -1; return -1;
@ -425,3 +464,15 @@ QString IconList::getDirectory() const
{ {
return m_dir.absolutePath(); return m_dir.absolutePath();
} }
/// Returns the directory of the icon with the given key or the default directory if it's a builtin icon.
QString IconList::iconDirectory(const QString& key) const
{
for (const auto& mmcIcon : m_icons) {
if (mmcIcon.m_key == key && mmcIcon.has(IconType::FileBased)) {
QFileInfo iconFile(mmcIcon.getFilePath());
return iconFile.dir().path();
}
}
return getDirectory();
}

View File

@ -51,7 +51,7 @@ class QFileSystemWatcher;
class IconList : public QAbstractListModel { class IconList : public QAbstractListModel {
Q_OBJECT Q_OBJECT
public: public:
explicit IconList(const QStringList& builtinPaths, QString path, QObject* parent = 0); explicit IconList(const QStringList& builtinPaths, const QString& path, QObject* parent = 0);
virtual ~IconList() {}; virtual ~IconList() {};
QIcon getIcon(const QString& key) const; QIcon getIcon(const QString& key) const;
@ -72,6 +72,7 @@ class IconList : public QAbstractListModel {
bool deleteIcon(const QString& key); bool deleteIcon(const QString& key);
bool trashIcon(const QString& key); bool trashIcon(const QString& key);
bool iconFileExists(const QString& key) const; bool iconFileExists(const QString& key) const;
QString iconDirectory(const QString& key) const;
void installIcons(const QStringList& iconFiles); void installIcons(const QStringList& iconFiles);
void installIcon(const QString& file, const QString& name); void installIcon(const QString& file, const QString& name);
@ -91,18 +92,20 @@ class IconList : public QAbstractListModel {
IconList& operator=(const IconList&) = delete; IconList& operator=(const IconList&) = delete;
void reindex(); void reindex();
void sortIconList(); void sortIconList();
bool addPathRecursively(const QString& path);
QStringList getIconFilePaths() const;
public slots: public slots:
void directoryChanged(const QString& path); void directoryChanged(const QString& path);
protected slots: protected slots:
void fileChanged(const QString& path); void fileChanged(const QString& path);
void SettingChanged(const Setting& setting, QVariant value); void SettingChanged(const Setting& setting, const QVariant& value);
private: private:
shared_qobject_ptr<QFileSystemWatcher> m_watcher; shared_qobject_ptr<QFileSystemWatcher> m_watcher;
bool is_watching; bool m_isWatching;
QMap<QString, int> name_index; QMap<QString, int> m_nameIndex;
QVector<MMCIcon> icons; QVector<MMCIcon> m_icons;
QDir m_dir; QDir m_dir;
}; };

View File

@ -15,7 +15,9 @@
#include <QFileDialog> #include <QFileDialog>
#include <QKeyEvent> #include <QKeyEvent>
#include <QLineEdit>
#include <QPushButton> #include <QPushButton>
#include <QSortFilterProxyModel>
#include "Application.h" #include "Application.h"
@ -33,6 +35,15 @@ IconPickerDialog::IconPickerDialog(QWidget* parent) : QDialog(parent), ui(new Ui
ui->setupUi(this); ui->setupUi(this);
setWindowModality(Qt::WindowModal); setWindowModality(Qt::WindowModal);
searchBar = new QLineEdit(this);
searchBar->setPlaceholderText(tr("Search..."));
ui->verticalLayout->insertWidget(0, searchBar);
proxyModel = new QSortFilterProxyModel(this);
proxyModel->setSourceModel(APPLICATION->icons().get());
proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
ui->iconView->setModel(proxyModel);
auto contentsWidget = ui->iconView; auto contentsWidget = ui->iconView;
contentsWidget->setViewMode(QListView::IconMode); contentsWidget->setViewMode(QListView::IconMode);
contentsWidget->setFlow(QListView::LeftToRight); contentsWidget->setFlow(QListView::LeftToRight);
@ -57,7 +68,7 @@ IconPickerDialog::IconPickerDialog(QWidget* parent) : QDialog(parent), ui(new Ui
contentsWidget->installEventFilter(this); contentsWidget->installEventFilter(this);
contentsWidget->setModel(APPLICATION->icons().get()); contentsWidget->setModel(proxyModel);
// NOTE: ResetRole forces the button to be on the left, while the OK/Cancel ones are on the right. We win. // NOTE: ResetRole forces the button to be on the left, while the OK/Cancel ones are on the right. We win.
auto buttonAdd = ui->buttonBox->addButton(tr("Add Icon"), QDialogButtonBox::ResetRole); auto buttonAdd = ui->buttonBox->addButton(tr("Add Icon"), QDialogButtonBox::ResetRole);
@ -76,6 +87,9 @@ IconPickerDialog::IconPickerDialog(QWidget* parent) : QDialog(parent), ui(new Ui
auto buttonFolder = ui->buttonBox->addButton(tr("Open Folder"), QDialogButtonBox::ResetRole); auto buttonFolder = ui->buttonBox->addButton(tr("Open Folder"), QDialogButtonBox::ResetRole);
connect(buttonFolder, &QPushButton::clicked, this, &IconPickerDialog::openFolder); connect(buttonFolder, &QPushButton::clicked, this, &IconPickerDialog::openFolder);
connect(searchBar, &QLineEdit::textChanged, this, &IconPickerDialog::filterIcons);
// Prevent incorrect indices from e.g. filesystem changes
connect(APPLICATION->icons().get(), &IconList::iconUpdated, this, [this]() { proxyModel->invalidate(); });
} }
bool IconPickerDialog::eventFilter(QObject* obj, QEvent* evt) bool IconPickerDialog::eventFilter(QObject* obj, QEvent* evt)
@ -162,5 +176,10 @@ IconPickerDialog::~IconPickerDialog()
void IconPickerDialog::openFolder() void IconPickerDialog::openFolder()
{ {
DesktopServices::openPath(APPLICATION->icons()->getDirectory(), true); DesktopServices::openPath(APPLICATION->icons()->iconDirectory(selectedIconKey), true);
}
void IconPickerDialog::filterIcons(const QString& query)
{
proxyModel->setFilterFixedString(query);
} }

View File

@ -16,6 +16,8 @@
#pragma once #pragma once
#include <QDialog> #include <QDialog>
#include <QItemSelection> #include <QItemSelection>
#include <QLineEdit>
#include <QSortFilterProxyModel>
namespace Ui { namespace Ui {
class IconPickerDialog; class IconPickerDialog;
@ -36,6 +38,8 @@ class IconPickerDialog : public QDialog {
private: private:
Ui::IconPickerDialog* ui; Ui::IconPickerDialog* ui;
QPushButton* buttonRemove; QPushButton* buttonRemove;
QLineEdit* searchBar;
QSortFilterProxyModel* proxyModel;
private slots: private slots:
void selectionChanged(QItemSelection, QItemSelection); void selectionChanged(QItemSelection, QItemSelection);
@ -44,4 +48,5 @@ class IconPickerDialog : public QDialog {
void addNewIcon(); void addNewIcon();
void removeSelectedIcon(); void removeSelectedIcon();
void openFolder(); void openFolder();
void filterIcons(const QString& text);
}; };