Commit 2354ed69 authored by Fabio Bas's avatar Fabio Bas
Browse files

Require Qt4 >=4.8.0; remove some ifdefs on qt version

parent c4458b16
...@@ -76,7 +76,7 @@ FIND_PACKAGE(Qt5Widgets) ...@@ -76,7 +76,7 @@ FIND_PACKAGE(Qt5Widgets)
IF(Qt5Widgets_FOUND) IF(Qt5Widgets_FOUND)
MESSAGE(STATUS "Found Qt ${Qt5Widgets_VERSION_STRING}") MESSAGE(STATUS "Found Qt ${Qt5Widgets_VERSION_STRING}")
ELSE() ELSE()
FIND_PACKAGE(Qt4 REQUIRED) FIND_PACKAGE(Qt4 4.8.0 REQUIRED)
IF(Qt4_FOUND) IF(Qt4_FOUND)
MESSAGE(STATUS "Found Qt ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}") MESSAGE(STATUS "Found Qt ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}")
ELSE() ELSE()
......
...@@ -68,9 +68,7 @@ QVariant CardDatabaseModel::headerData(int section, Qt::Orientation orientation, ...@@ -68,9 +68,7 @@ QVariant CardDatabaseModel::headerData(int section, Qt::Orientation orientation,
void CardDatabaseModel::updateCardList() void CardDatabaseModel::updateCardList()
{ {
#if QT_VERSION >= 0x050000
beginResetModel(); beginResetModel();
#endif
for (int i = 0; i < cardList.size(); ++i) for (int i = 0; i < cardList.size(); ++i)
disconnect(cardList[i], 0, this, 0); disconnect(cardList[i], 0, this, 0);
...@@ -79,11 +77,7 @@ void CardDatabaseModel::updateCardList() ...@@ -79,11 +77,7 @@ void CardDatabaseModel::updateCardList()
for (int i = 0; i < cardList.size(); ++i) for (int i = 0; i < cardList.size(); ++i)
connect(cardList[i], SIGNAL(cardInfoChanged(CardInfo *)), this, SLOT(cardInfoChanged(CardInfo *))); connect(cardList[i], SIGNAL(cardInfoChanged(CardInfo *)), this, SLOT(cardInfoChanged(CardInfo *)));
#if QT_VERSION < 0x050000
reset();
#else
endResetModel(); endResetModel();
#endif
} }
void CardDatabaseModel::cardInfoChanged(CardInfo *card) void CardDatabaseModel::cardInfoChanged(CardInfo *card)
......
...@@ -30,9 +30,7 @@ DeckListModel::~DeckListModel() ...@@ -30,9 +30,7 @@ DeckListModel::~DeckListModel()
void DeckListModel::rebuildTree() void DeckListModel::rebuildTree()
{ {
#if QT_VERSION >= 0x050000
beginResetModel(); beginResetModel();
#endif
root->clearTree(); root->clearTree();
InnerDecklistNode *listRoot = deckList->getRoot(); InnerDecklistNode *listRoot = deckList->getRoot();
...@@ -59,11 +57,7 @@ void DeckListModel::rebuildTree() ...@@ -59,11 +57,7 @@ void DeckListModel::rebuildTree()
} }
} }
#if QT_VERSION < 0x050000
reset();
#else
endResetModel(); endResetModel();
#endif
} }
int DeckListModel::rowCount(const QModelIndex &parent) const int DeckListModel::rowCount(const QModelIndex &parent) const
......
...@@ -258,17 +258,11 @@ void RemoteDeckList_TreeModel::deckListFinished(const Response &r) ...@@ -258,17 +258,11 @@ void RemoteDeckList_TreeModel::deckListFinished(const Response &r)
{ {
const Response_DeckList &resp = r.GetExtension(Response_DeckList::ext); const Response_DeckList &resp = r.GetExtension(Response_DeckList::ext);
#if QT_VERSION >= 0x050000
beginResetModel(); beginResetModel();
#endif
root->clearTree(); root->clearTree();
#if QT_VERSION < 0x050000
reset();
#else
endResetModel(); endResetModel();
#endif
ServerInfo_DeckStorage_TreeItem tempRoot; ServerInfo_DeckStorage_TreeItem tempRoot;
tempRoot.set_id(0); tempRoot.set_id(0);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment