Changeset View
Changeset View
Standalone View
Standalone View
part/archivemodel.cpp
Show All 22 Lines | |||||
23 | */ | 23 | */ | ||
24 | 24 | | |||
25 | #include "archivemodel.h" | 25 | #include "archivemodel.h" | ||
26 | #include "ark_debug.h" | 26 | #include "ark_debug.h" | ||
27 | #include "jobs.h" | 27 | #include "jobs.h" | ||
28 | 28 | | |||
29 | #include <KIO/Global> | 29 | #include <KIO/Global> | ||
30 | #include <KLocalizedString> | 30 | #include <KLocalizedString> | ||
31 | #include <KIconLoader> | | |||
32 | 31 | | |||
32 | #include <QApplication> | ||||
33 | #include <QDBusConnection> | 33 | #include <QDBusConnection> | ||
34 | #include <QMimeData> | 34 | #include <QMimeData> | ||
35 | #include <QMimeDatabase> | 35 | #include <QMimeDatabase> | ||
36 | #include <QRegularExpression> | 36 | #include <QRegularExpression> | ||
37 | #include <QStyle> | ||||
37 | #include <QUrl> | 38 | #include <QUrl> | ||
38 | 39 | | |||
39 | using namespace Kerfuffle; | 40 | using namespace Kerfuffle; | ||
40 | 41 | | |||
41 | // Used to speed up the loading of large archives. | 42 | // Used to speed up the loading of large archives. | ||
42 | static Archive::Entry *s_previousMatch = nullptr; | 43 | static Archive::Entry *s_previousMatch = nullptr; | ||
43 | Q_GLOBAL_STATIC(QStringList, s_previousPieces) | 44 | Q_GLOBAL_STATIC(QStringList, s_previousPieces) | ||
44 | 45 | | |||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 81 | case Qt::DisplayRole: { | |||
127 | default: | 128 | default: | ||
128 | return entry->property(m_propertiesMap[column].constData()); | 129 | return entry->property(m_propertiesMap[column].constData()); | ||
129 | } | 130 | } | ||
130 | } | 131 | } | ||
131 | case Qt::DecorationRole: | 132 | case Qt::DecorationRole: | ||
132 | if (index.column() == 0) { | 133 | if (index.column() == 0) { | ||
133 | const Archive::Entry *e = static_cast<Archive::Entry*>(index.internalPointer()); | 134 | const Archive::Entry *e = static_cast<Archive::Entry*>(index.internalPointer()); | ||
134 | QIcon::Mode mode = (filesToMove.contains(e->fullPath())) ? QIcon::Disabled : QIcon::Normal; | 135 | QIcon::Mode mode = (filesToMove.contains(e->fullPath())) ? QIcon::Disabled : QIcon::Normal; | ||
135 | return m_entryIcons.value(e->fullPath(NoTrailingSlash)).pixmap(IconSize(KIconLoader::Small), IconSize(KIconLoader::Small), mode); | 136 | return m_entryIcons.value(e->fullPath(NoTrailingSlash)).pixmap(QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize), mode); | ||
136 | } | 137 | } | ||
137 | return QVariant(); | 138 | return QVariant(); | ||
138 | case Qt::FontRole: { | 139 | case Qt::FontRole: { | ||
139 | QFont f; | 140 | QFont f; | ||
140 | f.setItalic(entry->property("isPasswordProtected").toBool()); | 141 | f.setItalic(entry->property("isPasswordProtected").toBool()); | ||
141 | return f; | 142 | return f; | ||
142 | } | 143 | } | ||
143 | default: | 144 | default: | ||
▲ Show 20 Lines • Show All 777 Lines • Show Last 20 Lines |