summaryrefslogtreecommitdiff
path: root/src/bibletime_dbus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bibletime_dbus.cpp')
-rw-r--r--src/bibletime_dbus.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/bibletime_dbus.cpp b/src/bibletime_dbus.cpp
index 6adf71c..e3013db 100644
--- a/src/bibletime_dbus.cpp
+++ b/src/bibletime_dbus.cpp
@@ -2,7 +2,7 @@
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
-* Copyright 1999-2008 by the BibleTime developers.
+* Copyright 1999-2011 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/
@@ -60,7 +60,7 @@ void BibleTime::syncAllVerseBasedModules(const QString& key) {
void BibleTime::openWindow(const QString& moduleName, const QString& key) {
qDebug() << "DBUS: open window for module" << moduleName.toLatin1() << "and key" << key.toLatin1();
- CSwordModuleInfo* module = CPointers::backend()->findModuleByName(moduleName);
+ CSwordModuleInfo* module = CSwordBackend::instance()->findModuleByName(moduleName);
if (module) {
createReadDisplayWindow(module, key);
}
@@ -77,16 +77,17 @@ void BibleTime::openDefaultBible(const QString& key) {
QStringList BibleTime::searchInModule(const QString& moduleName, const QString& searchText) {
qDebug() << "DBUS: searchInModule" << moduleName.toLatin1();
QStringList ret;
- CSwordModuleInfo* mod = CPointers::backend()->findModuleByName(moduleName);
+ CSwordModuleInfo* mod = CSwordBackend::instance()->findModuleByName(moduleName);
if (mod) {
+ sword::ListKey result;
+
//mod->search(searchText, CSwordModuleSearch::multipleWords, sword::ListKey());
sword::ListKey scope;
- mod->searchIndexed( searchText, scope );
+ mod->searchIndexed(searchText, scope, result);
- sword::ListKey result = mod->searchResult();
const QString lead = QString("[%1] ").arg(moduleName);
- ;
+
for ( int i = 0; i < result.Count(); ++i ) {
sword::SWKey* key = result.getElement(i);
Q_ASSERT(key);
@@ -111,9 +112,9 @@ QStringList BibleTime::searchInOpenModules(const QString& searchText) {
QStringList ret;
foreach (QMdiSubWindow* subWindow, m_mdi->subWindowList()) {
if (CDisplayWindow* w = dynamic_cast<CDisplayWindow*>(subWindow->widget())) {
- QList<CSwordModuleInfo*> windowModules = w->modules();
- QList<CSwordModuleInfo*>::iterator end_it = windowModules.end();
- for (QList<CSwordModuleInfo*>::iterator it(windowModules.begin()); it != end_it; ++it) {
+ QList<const CSwordModuleInfo*> windowModules = w->modules();
+ QList<const CSwordModuleInfo*>::iterator end_it = windowModules.end();
+ for (QList<const CSwordModuleInfo*>::iterator it(windowModules.begin()); it != end_it; ++it) {
ret += searchInModule((*it)->name(), searchText);
}
}
@@ -189,7 +190,7 @@ QStringList BibleTime::getModulesOfType(const QString& type) {
modType = CSwordModuleInfo::GenericBook;
}
- QList<CSwordModuleInfo*> modList = CPointers::backend()->moduleList();
+ QList<CSwordModuleInfo*> modList = CSwordBackend::instance()->moduleList();
for (QList<CSwordModuleInfo*>::iterator it( modList.begin() ); it != modList.end(); ++it) {
if ((*it)->type() == modType) {
ret.append( (*it)->name() );