mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Port away from deprecated QFlags(Zero) constructor
This change gets rid of a few GCC's -Wdeprecated-declarations warnings.
This commit is contained in:
parent
4dcbb958dc
commit
8af4c01a03
@ -317,7 +317,7 @@ QVariant ComicModel::data(const QModelIndex &index, int role) const
|
||||
Qt::ItemFlags ComicModel::flags(const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return 0;
|
||||
return {};
|
||||
if (index.column() == ComicModel::Rating)
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled;
|
||||
|
@ -144,7 +144,7 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const
|
||||
Qt::ItemFlags FolderModel::flags(const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return 0;
|
||||
return {};
|
||||
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled;
|
||||
}
|
||||
|
@ -101,11 +101,11 @@ QVariant ReadingListModel::data(const QModelIndex &index, int role) const
|
||||
Qt::ItemFlags ReadingListModel::flags(const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return 0;
|
||||
return {};
|
||||
|
||||
auto item = static_cast<ListItem *>(index.internalPointer());
|
||||
if (typeid(*item) == typeid(ReadingListSeparatorItem))
|
||||
return 0;
|
||||
return {};
|
||||
|
||||
if (typeid(*item) == typeid(ReadingListItem) && static_cast<ReadingListItem *>(item)->parent->getId() != 0)
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled; //only sublists are dragable
|
||||
|
@ -33,7 +33,7 @@ QModelIndex ActionsShortcutsModel::index(int row, int column, const QModelIndex
|
||||
Qt::ItemFlags ActionsShortcutsModel::flags(const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return 0;
|
||||
return {};
|
||||
if (index.column() == KEYS)
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
|
||||
|
Loading…
Reference in New Issue
Block a user