#include <QLabel>
#include <QListView>
#include <QPainter>
+#include <QScroller>
#include <QShowEvent>
#include <QSortFilterProxyModel>
#include <QSpinBox>
QLabel* showPreviewsLabel = new QLabel(i18nc("@title:group", "Show previews in the view for:"), this);
m_listView = new QListView(this);
+ QScroller::grabGesture(m_listView->viewport(), QScroller::TouchGesture);
ServiceItemDelegate* delegate = new ServiceItemDelegate(m_listView, m_listView);
connect(delegate, &ServiceItemDelegate::requestServiceConfiguration,
m_listView->setModel(proxyModel);
m_listView->setItemDelegate(delegate);
m_listView->setVerticalScrollMode(QListView::ScrollPerPixel);
+ m_listView->setUniformItemSizes(true);
QLabel* localFileSizeLabel = new QLabel(i18n("Skip previews for local files above:"), this);
m_localFileSizeBox = new QSpinBox(this);
m_localFileSizeBox->setSingleStep(1);
- m_localFileSizeBox->setSuffix(QStringLiteral(" MB"));
+ m_localFileSizeBox->setSuffix(i18nc("Mebibytes; used as a suffix in a spinbox showing e.g. '3 MiB'", " MiB"));
m_localFileSizeBox->setRange(0, 9999999); /* MB */
m_localFileSizeBox->setSpecialValueText(i18n("No limit"));
m_remoteFileSizeBox = new QSpinBox(this);
m_remoteFileSizeBox->setSingleStep(1);
- m_remoteFileSizeBox->setSuffix(QStringLiteral(" MB"));
+ m_remoteFileSizeBox->setSuffix(i18nc("Mebibytes; used as a suffix in a spinbox showing e.g. '3 MiB'", " MiB"));
m_remoteFileSizeBox->setRange(0, 9999999); /* MB */
m_remoteFileSizeBox->setSpecialValueText(i18n("No previews"));
QAbstractItemModel* model = m_listView->model();
const KService::List plugins = KServiceTypeTrader::self()->query(QStringLiteral("ThumbCreator"));
- foreach (const KService::Ptr& service, plugins) {
+ for (const KService::Ptr& service : plugins) {
const bool configurable = service->property(QStringLiteral("Configurable"), QVariant::Bool).toBool();
const bool show = m_enabledPreviewPlugins.contains(service->desktopEntryName());