From 3ffcd7cdf21adec8f1763504d65f2fffdb9e6529 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Sun, 6 Nov 2016 21:52:09 +0300 Subject: [PATCH] [app] Housekeeping --- app/qml/BooksPager.qml | 2 +- app/src/BooksStorageModel.cpp | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app/qml/BooksPager.qml b/app/qml/BooksPager.qml index 3ea9a93..f12ee37 100644 --- a/app/qml/BooksPager.qml +++ b/app/qml/BooksPager.qml @@ -61,6 +61,6 @@ Item { secondaryColor: Settings.primaryPageToolColor highlightColor: Settings.highlightPageToolColor secondaryHighlightColor: Settings.highlightPageToolColor - onValueChanged: root.pageChanged(value) + onSliderValueChanged: root.pageChanged(value) } } diff --git a/app/src/BooksStorageModel.cpp b/app/src/BooksStorageModel.cpp index 48c276c..a646c58 100644 --- a/app/src/BooksStorageModel.cpp +++ b/app/src/BooksStorageModel.cpp @@ -220,16 +220,11 @@ void BooksStorageModel::onStorageRemoved(BooksStorage aStorage) void BooksStorageModel::onStorageReplaced(BooksStorage aOld, BooksStorage aNew) { int index = find(aOld); - if (index >=0) { + if (index >= 0) { QModelIndex modelIndex(createIndex(index, 0)); - QVector roles(4); - roles.append(BooksStorageRoot); - roles.append(BooksStorageDevice); - roles.append(BooksStorageRemovable); - roles.append(BooksStorageDeleteAllRequest); HWARN(aOld.root() << "->" << aNew.root()); iList.at(index)->iStorage = aNew; - Q_EMIT dataChanged(modelIndex, modelIndex, roles); + Q_EMIT dataChanged(modelIndex, modelIndex); } else { HWARN("device not found on the list"); }