refactor: fix deprecation up to Qt 5.15

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu
2022-05-02 19:10:45 +02:00
parent c1bcbf8c63
commit 984692dc62
54 changed files with 199 additions and 1352 deletions

View File

@ -86,7 +86,11 @@ void IconList::directoryChanged(const QString &path)
QString &foo = (*it);
foo = m_dir.filePath(foo);
}
#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)
{
@ -94,7 +98,11 @@ void IconList::directoryChanged(const QString &path)
continue;
current_list.push_back(it.m_images[IconType::FileBased].filename);
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QSet<QString> current_set(current_list.begin(), current_list.end());
#else
QSet<QString> current_set = current_list.toSet();
#endif
QSet<QString> to_remove = current_set;
to_remove -= new_set;

View File

@ -15,7 +15,7 @@
#include "MMCIcon.h"
#include <QFileInfo>
#include <xdgicon.h>
#include <QIcon>
IconType operator--(IconType &t, int)
{
@ -63,7 +63,7 @@ QIcon MMCIcon::icon() const
if(!icon.isNull())
return icon;
// FIXME: inject this.
return XdgIcon::fromTheme(m_images[m_current_type].key);
return QIcon::fromTheme(m_images[m_current_type].key);
}
void MMCIcon::remove(IconType rm_type)