mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-02-04 19:27:33 +01:00
more precise logic for dropping
This commit is contained in:
parent
15b16aa4bf
commit
2bc172dd24
@ -44,6 +44,26 @@ FeedsProxyModel::~FeedsProxyModel() {
|
||||
qDebugNN << LOGSEC_FEEDMODEL << "Destroying FeedsProxyModel instance";
|
||||
}
|
||||
|
||||
bool FeedsProxyModel::canDropMimeData(const QMimeData* data,
|
||||
Qt::DropAction action,
|
||||
int row,
|
||||
int column,
|
||||
const QModelIndex& parent) const {
|
||||
|
||||
auto src_idx = row < 0 ? mapToSource(parent) : mapToSource(index(row, column, parent));
|
||||
auto* src_item = m_sourceModel->itemForIndex(src_idx);
|
||||
|
||||
if (src_item != nullptr) {
|
||||
auto can_drop = src_item->kind() == RootItem::Kind::ServiceRoot || src_item->kind() == RootItem::Kind::Category ||
|
||||
src_item->kind() == RootItem::Kind::Feed;
|
||||
|
||||
return QSortFilterProxyModel::canDropMimeData(data, action, row, column, parent) && can_drop;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
QModelIndexList FeedsProxyModel::match(const QModelIndex& start,
|
||||
int role,
|
||||
const QVariant& value,
|
||||
|
@ -17,6 +17,11 @@ class FeedsProxyModel : public QSortFilterProxyModel {
|
||||
explicit FeedsProxyModel(FeedsModel* source_model, QObject* parent = nullptr);
|
||||
virtual ~FeedsProxyModel();
|
||||
|
||||
virtual bool canDropMimeData(const QMimeData* data,
|
||||
Qt::DropAction action,
|
||||
int row,
|
||||
int column,
|
||||
const QModelIndex& parent) const;
|
||||
virtual bool dropMimeData(const QMimeData* data,
|
||||
Qt::DropAction action,
|
||||
int row,
|
||||
|
@ -215,18 +215,18 @@
|
||||
#define APP_SKIN_USER_FOLDER "skins"
|
||||
#define APP_SKIN_DEFAULT "nudus-light"
|
||||
#define APP_SKIN_METADATA_FILE "metadata.xml"
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
#define APP_STYLE_DEFAULT "windowsvista"
|
||||
#else
|
||||
#define APP_STYLE_DEFAULT "Fusion"
|
||||
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) && !defined(FORCE_BUNDLE_ICONS)
|
||||
#define APP_THEME_DEFAULT ""
|
||||
#else
|
||||
#define APP_THEME_DEFAULT "Breeze"
|
||||
#endif
|
||||
|
||||
#if defined(FORCE_BUNDLE_ICONS)
|
||||
// Forcibly bundle icons.
|
||||
#define APP_THEME_DEFAULT "Breeze"
|
||||
#elif defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||
// DO NOT icons on Linux.
|
||||
#define APP_THEME_DEFAULT ""
|
||||
#else
|
||||
// Bundle icons otherwise.
|
||||
|
@ -45,7 +45,7 @@ void SkinFactory::loadCurrentSkin() {
|
||||
}
|
||||
|
||||
bool SkinFactory::isStyleGoodForAlternativeStylePalette(const QString& style_name) const {
|
||||
static QRegularExpression re = QRegularExpression("^(fusion)|(qt[56]ct-style)$");
|
||||
static QRegularExpression re = QRegularExpression("^(fusion|windows|qt[56]ct-style)$");
|
||||
|
||||
return re.match(style_name.toLower()).hasMatch();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user