summaryrefslogtreecommitdiff
path: root/src/mobile/ui/modulechooser.cpp
diff options
context:
space:
mode:
authorTeus Benschop <teusjannette@gmail.com>2017-10-06 12:24:31 +0200
committerTeus Benschop <teusjannette@gmail.com>2017-10-06 12:24:31 +0200
commit90d2181239761f8950b95768d3b037843e9e8b50 (patch)
tree6cc667ab420cc04029de2de7e361d2305e214595 /src/mobile/ui/modulechooser.cpp
parent1ea03c0fce8066c1e22188447b4a6ca4dcef1201 (diff)
New upstream version 2.11.0
Diffstat (limited to 'src/mobile/ui/modulechooser.cpp')
-rw-r--r--src/mobile/ui/modulechooser.cpp40
1 files changed, 27 insertions, 13 deletions
diff --git a/src/mobile/ui/modulechooser.cpp b/src/mobile/ui/modulechooser.cpp
index bc3d582..fad2f02 100644
--- a/src/mobile/ui/modulechooser.cpp
+++ b/src/mobile/ui/modulechooser.cpp
@@ -1,44 +1,58 @@
+/*********
+*
+* In the name of the Father, and of the Son, and of the Holy Spirit.
+*
+* This file is part of BibleTime's source code, http://www.bibletime.info/.
+*
+* Copyright 1999-2016 by the BibleTime developers.
+* The BibleTime source code is licensed under the GNU General Public License
+* version 2.0.
+*
+**********/
#include "modulechooser.h"
-#include "qtquick2applicationviewer.h"
-
-#include "backend/bookshelfmodel/btbookshelftreemodel.h"
-#include "backend/managers/cswordbackend.h"
#include <cmath>
#include <QQuickItem>
#include <QQmlProperty>
+#include "backend/bookshelfmodel/btbookshelftreemodel.h"
+#include "backend/managers/cswordbackend.h"
#include "btwindowinterface.h"
#include "mobile/util/findqmlobject.h"
+#include "qtquick2applicationviewer.h"
+#include "util/btassert.h"
+#include "util/btconnect.h"
+
namespace btm {
-ModuleChooser::ModuleChooser(QtQuick2ApplicationViewer* viewer, BtWindowInterface* bibleVerse)
+ModuleChooser::ModuleChooser(QtQuick2ApplicationViewer* viewer, BtWindowInterface* windowInterface)
: viewer_(viewer),
- bibleVerse_(bibleVerse) {
+ windowInterface_(windowInterface) {
}
void ModuleChooser::open() {
QQuickItem* item = findQmlObject("moduleChooser");
- Q_ASSERT(item != 0);
- if (item == 0)
+ BT_ASSERT(item);
+ if (item == nullptr)
return;
item->setProperty("visible", true);
- bool ok = connect(item, SIGNAL(moduleSelected()), this, SLOT(moduleSelectedSlot()));
- Q_ASSERT(ok);
+ disconnect(item, SIGNAL(moduleSelected()), nullptr, nullptr);
+ BT_CONNECT(item, SIGNAL(moduleSelected()),
+ this, SLOT(moduleSelectedSlot()));
}
void ModuleChooser::moduleSelectedSlot() {
QQuickItem* item = findQmlObject("moduleChooser");
- Q_ASSERT(item != 0);
- if (item == 0)
+ BT_ASSERT(item);
+ if (item == nullptr)
return;
item->setProperty("visible", false);
QVariant v = item->property("selectedModule");
QString moduleName = v.toString();
- bibleVerse_->setModuleName(moduleName);
+ windowInterface_->moduleNameChanged(moduleName);
}
} // end namespace