summaryrefslogtreecommitdiff
path: root/src/backend/keys
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/keys')
-rw-r--r--src/backend/keys/cswordkey.cpp207
-rw-r--r--src/backend/keys/cswordkey.h227
-rw-r--r--src/backend/keys/cswordldkey.cpp6
-rw-r--r--src/backend/keys/cswordldkey.h4
-rw-r--r--src/backend/keys/cswordtreekey.cpp6
-rw-r--r--src/backend/keys/cswordtreekey.h4
-rw-r--r--src/backend/keys/cswordversekey.cpp38
-rw-r--r--src/backend/keys/cswordversekey.h4
8 files changed, 255 insertions, 241 deletions
diff --git a/src/backend/keys/cswordkey.cpp b/src/backend/keys/cswordkey.cpp
index a685b27..5fc37bd 100644
--- a/src/backend/keys/cswordkey.cpp
+++ b/src/backend/keys/cswordkey.cpp
@@ -2,7 +2,7 @@
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
-* Copyright 1999-2011 by the BibleTime developers.
+* Copyright 1999-2014 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/
@@ -16,7 +16,6 @@
#include "backend/keys/cswordldkey.h"
#include "backend/keys/cswordtreekey.h"
#include "backend/keys/cswordversekey.h"
-#include "util/btsignal.h"
// Sword includes:
#include <swkey.h>
@@ -27,170 +26,168 @@
#include <versekey.h>
-const QTextCodec *CSwordKey::m_cp1252Codec = QTextCodec::codecForName("Windows-1252");
-
-CSwordKey::CSwordKey(const CSwordModuleInfo * const module)
- : m_module(module),
- m_signal(0) {}
-
-CSwordKey::CSwordKey(const CSwordKey& k)
- : m_signal(0) {
- m_module = k.m_module;
-}
-
-CSwordKey::~CSwordKey() {
- delete m_signal;
-}
+const QTextCodec * CSwordKey::m_cp1252Codec = QTextCodec::codecForName("Windows-1252");
QString CSwordKey::rawText() {
- if (!m_module) return QString::null;
+ if (!m_module)
+ return QString::null;
- if (dynamic_cast<sword::SWKey*>(this)) {
+ if (dynamic_cast<sword::SWKey*>(this))
m_module->module()->getKey()->setText( rawKey() );
- }
- if (key().isNull()) return QString::null;
+ if (key().isNull())
+ return QString::null;
- return QString::fromUtf8( m_module->module()->getRawEntry() );
+ return QString::fromUtf8(m_module->module()->getRawEntry());
}
-QString CSwordKey::renderedText( const CSwordKey::TextRenderType mode ) {
+QString CSwordKey::renderedText(const CSwordKey::TextRenderType mode) {
Q_ASSERT(m_module);
- sword::SWKey* const k = dynamic_cast<sword::SWKey*>(this);
+ sword::SWKey * const k = dynamic_cast<sword::SWKey *>(this);
if (k) {
- sword::VerseKey* vk_mod = dynamic_cast<sword::VerseKey*>(m_module->module()->getKey());
- if (vk_mod) {
- vk_mod->Headings(1);
- }
+ sword::VerseKey * vk_mod = dynamic_cast<sword::VerseKey *>(m_module->module()->getKey());
+ if (vk_mod)
+ vk_mod->setIntros(true);
- m_module->module()->getKey()->setText( rawKey() );
+ m_module->module()->getKey()->setText(rawKey());
if (m_module->type() == CSwordModuleInfo::Lexicon) {
m_module->snap();
/* In lexicons make sure that our key (e.g. 123) was successfully set to the module,
i.e. the module key contains this key (e.g. 0123 contains 123) */
- if ( sword::stricmp(m_module->module()->getKey()->getText(), rawKey())
- && !strstr(m_module->module()->getKey()->getText(), rawKey())
- ) {
+ if (sword::stricmp(m_module->module()->getKey()->getText(), rawKey())
+ && !strstr(m_module->module()->getKey()->getText(), rawKey()))
+ {
qDebug("return an empty key for %s", m_module->module()->getKey()->getText());
return QString::null;
}
}
}
- //Q_ASSERT(!key().isNull());
- if (!key().isNull()) { //we have valid text
- bool DoRender = mode != ProcessEntryAttributesOnly;
- QString text = QString::fromUtf8( m_module->module()->RenderText(0,-1, DoRender));
- if (!DoRender)
- return QString::null;
-
- // This is yucky, but if we want strong lexicon refs we have to do it here.
- if (m_module->type() == CSwordModuleInfo::Lexicon) {
- QString t(text);
- QRegExp rx("(GREEK|HEBREW) for 0*([1-9]\\d*)"); // ignore 0's before number
- int pos = 0;
- while ( (pos = rx.indexIn(t, pos)) != -1 ) {
- QString language = rx.cap(1);
- QString langcode = QString(language.at(0)); // "G" or "H"
- QString number = rx.cap(2);
- QString paddednumber = number.rightJustified(5, '0'); // Form 00123
-
- text.replace(
- QRegExp( QString(
- "(>[^<>]+)" // Avoid replacing inside tags
- "\\b(0*%1)\\b").arg(number) ), // And span around 0's
- QString("\\1<span lemma=\"%1%2\"><a href=\"strongs://%3/%4\">\\2</a></span>")
+ if (key().isNull())
+ return QString::null;
+
+ bool DoRender = mode != ProcessEntryAttributesOnly;
+ QString text = QString::fromUtf8(m_module->module()->renderText(0, -1, DoRender));
+ if (!DoRender)
+ return QString::null;
+
+ // This is yucky, but if we want strong lexicon refs we have to do it here.
+ if (m_module->type() == CSwordModuleInfo::Lexicon) {
+ const QString t(text);
+ const QRegExp rx("(GREEK|HEBREW) for 0*([1-9]\\d*)"); // ignore 0's before number
+ int pos = 0;
+ while ((pos = rx.indexIn(t, pos)) != -1) {
+ const QString language = rx.cap(1);
+ const QString langcode = QString(language.at(0)); // "G" or "H"
+ const QString number = rx.cap(2);
+ const QString paddednumber = number.rightJustified(5, '0'); // Form 00123
+
+ text.replace(
+ QRegExp(QString(
+ "(>[^<>]+)" // Avoid replacing inside tags
+ "\\b(0*%1)\\b").arg(number)), // And span around 0's
+ QString("\\1<span lemma=\"%1%2\"><a href=\"strongs://%3/%4\">\\2</a></span>")
.arg(langcode, paddednumber, language, paddednumber)
- );
- pos += rx.matchedLength();
- }
+ );
+ pos += rx.matchedLength();
}
+ }
- if (mode == HTMLEscaped) {
- /*
- Here we encode all non-latin1 characters as HTML unicode entities
- in the form &#<decimal unicode value here>;
- */
- QString ret;
-
- // Reserve characters to reduce number of memory allocations:
- ret.reserve(text.size());
-
- for (int i = 0; i < text.size(); ++i) {
- const QChar c = text.at(i);
-
- if (c.toLatin1()) {
- ret.append(c);
- } else {
- ret.append("&#").append(c.unicode()).append(";");
- }
+ if (mode == HTMLEscaped) {
+ /*
+ Here we encode all non-latin1 characters as HTML unicode entities
+ in the form &#<decimal unicode value here>;
+ */
+ QString ret;
+
+ // Reserve characters to reduce number of memory allocations:
+ ret.reserve(text.size());
+
+ for (const QChar * c = text.constBegin(); c != text.constEnd(); c++) {
+ if (c->toLatin1()) {
+ ret.append(*c);
+ } else {
+ ret.append("&#").append(c->unicode()).append(";");
}
-
- return ret;
- }
- else {
- return text;
}
- }
- return QString::null;
+ return ret;
+ }
+ else {
+ return text;
+ }
}
QString CSwordKey::strippedText() {
- if (!m_module) return QString::null;
+ if (!m_module)
+ return QString::null;
if (dynamic_cast<sword::SWKey*>(this)) {
char * buffer = new char[strlen(rawKey()) + 1];
strcpy(buffer, rawKey());
- m_module->module()->getKey()->setText( buffer );
+ m_module->module()->getKey()->setText(buffer);
delete [] buffer;
}
- return QString::fromUtf8( m_module->module()->StripText() );
+ return QString::fromUtf8(m_module->module()->stripText());
}
void CSwordKey::emitBeforeChanged() {
- if (m_signal.isNull())
- return;
- m_signal->emitBeforeChanged();
+ if (!m_beforeChangedSignaller.isNull())
+ m_beforeChangedSignaller->emitSignal();
}
-void CSwordKey::emitChanged() {
- if (m_signal.isNull())
- return;
- m_signal->emitChanged();
+void CSwordKey::emitAfterChanged() {
+ if (!m_afterChangedSignaller.isNull())
+ m_afterChangedSignaller->emitSignal();
}
-/** This will create a proper key object from a given module */
-CSwordKey *CSwordKey::createInstance(const CSwordModuleInfo *module) {
- if (!module) {
+CSwordKey * CSwordKey::createInstance(const CSwordModuleInfo * module) {
+ if (!module)
return 0;
- }
- switch ( module->type() ) {
+ sword::SWKey * const key = module->module()->getKey();
- case CSwordModuleInfo::Bible://fall through
+ switch (module->type()) {
+ case CSwordModuleInfo::Bible: // Fall through
case CSwordModuleInfo::Commentary:
- return new CSwordVerseKey( (sword::VerseKey *) ( (sword::SWKey *)(*module->module()) ), module );
+
+ Q_ASSERT(dynamic_cast<sword::VerseKey *>(key) != 0);
+ return new CSwordVerseKey(static_cast<sword::VerseKey *>(key),
+ module);
case CSwordModuleInfo::Lexicon:
- return new CSwordLDKey( (sword::SWKey *)(*module->module()), module);
+
+ return new CSwordLDKey(key, module);
case CSwordModuleInfo::GenericBook:
- return new CSwordTreeKey( (sword::TreeKeyIdx*)((sword::SWKey *)(*module->module())), module );
+
+ Q_ASSERT(dynamic_cast<sword::TreeKeyIdx *>(key) != 0);
+ return new CSwordTreeKey(dynamic_cast<sword::TreeKeyIdx *>(key),
+ module );
default:
+
return 0;
+
}
}
-const BtSignal* CSwordKey::signaler() {
- if (m_signal.isNull())
- m_signal = new BtSignal();
- return m_signal;
+const BtSignal * CSwordKey::beforeChangedSignaller() {
+ if (m_beforeChangedSignaller.isNull())
+ m_beforeChangedSignaller = new BtSignal();
+
+ return m_beforeChangedSignaller;
+}
+
+const BtSignal * CSwordKey::afterChangedSignaller() {
+ if (m_afterChangedSignaller.isNull())
+ m_afterChangedSignaller = new BtSignal();
+
+ return m_afterChangedSignaller;
}
diff --git a/src/backend/keys/cswordkey.h b/src/backend/keys/cswordkey.h
index 9b043b7..ee816a5 100644
--- a/src/backend/keys/cswordkey.h
+++ b/src/backend/keys/cswordkey.h
@@ -1,8 +1,10 @@
/*********
*
+* 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-2011 by the BibleTime developers.
+* Copyright 1999-2014 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/
@@ -12,120 +14,127 @@
#include <QPointer>
#include <QString>
+#include "util/btsignal.h"
class CSwordModuleInfo;
class QTextCodec;
-class BtSignal;
-/** Base class for all keys.
- * The base class for all Sword based keys.
- * @author The BibleTime team
- * @version $Id: cswordkey.h,v 1.27 2006/10/30 19:53:32 mgruner Exp $
- */
+/** Base class for all Sword based keys. */
class CSwordKey {
- protected:
- /**
- \param module The module which belongs to this key, may be NULL
- */
- CSwordKey(const CSwordModuleInfo * const module = 0);
-
- CSwordKey(const CSwordKey &copy);
-
- public:
- enum TextRenderType {
- Normal = 0,
- HTMLEscaped = 1,
- ProcessEntryAttributesOnly = 2 // in this case, renderText() will not return text, but only cause EntryAttribute processing
- };
-
- virtual ~CSwordKey();
-
- /** Returns the current key.
- * @return The key which belongs to the current object.
- */
- virtual QString key() const = 0;
-
- /**
- Sets the current key. Sets the key using a utf8 enabled QString.
- \param key The key which should be used to set the current one.
- */
- virtual bool setKey(const QString &key) = 0;
-
- /**
- Set the key using a utf8-decoded c-string.
- \param key The key which should be used to set the current one.
- */
- virtual bool setKey(const char *key) = 0;
-
- /** Clone this object. Clone this current object and return it.
- * @return A clone of the current object.
- */
- virtual CSwordKey* copy() const = 0;
-
- /**
- \returns the module which belongs to this key.
- */
- inline const CSwordModuleInfo *module() const {
- return m_module;
- }
-
- /**
- Sets the module which belongs to this key.
- \param[in] newModule the module to set.
- */
- virtual inline void setModule(const CSwordModuleInfo *newModule) {
- m_module = newModule;
- }
-
- /** Returns the raw, unchanged text. Returns the text without any filter modifications,
- * just in the way it comes out of the module.
- */
- QString rawText();
- /** Returns the rendered text. Returns the text of the current key after passing it through the
- * modules filters.
- */
- QString renderedText( const CSwordKey::TextRenderType mode = CSwordKey::Normal );
- /** Stripped down text. Returns the text after removing all markup tags from it.
- */
- QString strippedText();
-
- const BtSignal *signaler();
-
- /**
- * This returns a new object of the right CSwordKey* implementation
- * (e.g. CSwordVerseKey or CSwordLDKey)
- * The type is determined by the type of the module.
- * @see CSwordModuleInfo, CSwordBibleModuleInfo, CSwordCommentaryModuleInfo, CSwordLexiconModukleInfo
- */
- static CSwordKey* createInstance(const CSwordModuleInfo *module);
-
- /**
- * This is called before a key change to emit a signal
- * */
- void emitBeforeChanged();
- /**
- * This is called after a key change to emit a signal
- * */
- void emitChanged();
-
- protected:
- /**
- * Returns the encoded key appropriate for use directly with Sword.
- */
- virtual const char * rawKey() const = 0;
- static inline const QTextCodec *cp1252Codec() { return m_cp1252Codec; };
-
- private:
- /**
- * Disable the assignment operator
- */
- CSwordKey& operator= ( const CSwordKey & );
-
- protected:
- static const QTextCodec *m_cp1252Codec;
- const CSwordModuleInfo *m_module;
- QPointer<BtSignal> m_signal;
+
+public: /* Types: */
+
+ enum TextRenderType {
+ Normal = 0,
+ HTMLEscaped = 1,
+ ProcessEntryAttributesOnly = 2 // in this case, renderText() will not return text, but only cause EntryAttribute processing
+ };
+
+ virtual inline ~CSwordKey() { delete m_beforeChangedSignaller; }
+
+ /**
+ \returns The key which belongs to the current object.
+ */
+ virtual QString key() const = 0;
+
+ /**
+ Sets the current key using a utf8 enabled QString.
+ \param[in] key The key which should be used to set the current one.
+ */
+ virtual bool setKey(const QString & key) = 0;
+
+ /**
+ Set the key using a utf8-decoded c-string.
+ \param[in] key The key which should be used to set the current one.
+ */
+ virtual bool setKey(const char * key) = 0;
+
+ /**
+ \returns a clone of this object.
+ */
+ virtual CSwordKey * copy() const = 0;
+
+ /**
+ \returns the module which belongs to this key.
+ */
+ inline const CSwordModuleInfo * module() const {
+ return m_module;
+ }
+
+ /**
+ Sets the module which belongs to this key.
+ \param[in] newModule the module to set.
+ */
+ virtual inline void setModule(const CSwordModuleInfo * newModule) {
+ m_module = newModule;
+ }
+
+ /**
+ \returns the raw, unchanged text from the module (i.e. without any filter
+ modifications).
+ */
+ QString rawText();
+
+ /**
+ \returns the rendered text by passing the text under the current key
+ through the filters.
+ */
+ QString renderedText(const CSwordKey::TextRenderType mode = CSwordKey::Normal);
+
+ /**
+ \returns the text after removing all markup tags from it.
+ */
+ QString strippedText();
+
+ const BtSignal * beforeChangedSignaller();
+ const BtSignal * afterChangedSignaller();
+
+ /**
+ \returns a new CSwordkey subclass instance for the given module, depending
+ on the type of the module.
+ */
+ static CSwordKey * createInstance(const CSwordModuleInfo * module);
+
+ /**
+ This is called before a key change to emit a signal
+ */
+ void emitBeforeChanged();
+
+ /**
+ This is called after a key change to emit a signal
+ */
+ void emitAfterChanged();
+
+protected: /* Methods: */
+
+ inline CSwordKey(const CSwordModuleInfo * const module = 0)
+ : m_module(module) {}
+
+ inline CSwordKey(const CSwordKey & copy)
+ : m_module(copy.m_module) {}
+
+ /**
+ \returns the encoded key appropriate for use directly with Sword.
+ */
+ virtual const char * rawKey() const = 0;
+
+ static inline const QTextCodec * cp1252Codec() { return m_cp1252Codec; }
+
+private: /* Methods: */
+
+ /**
+ Disable the assignment operator
+ */
+ CSwordKey & operator=(const CSwordKey &);
+
+protected: /* Fields: */
+
+ static const QTextCodec * m_cp1252Codec;
+ const CSwordModuleInfo * m_module;
+ QPointer<BtSignal> m_beforeChangedSignaller;
+ QPointer<BtSignal> m_afterChangedSignaller;
+
};
#endif
diff --git a/src/backend/keys/cswordldkey.cpp b/src/backend/keys/cswordldkey.cpp
index 822da8c..f6ffb25 100644
--- a/src/backend/keys/cswordldkey.cpp
+++ b/src/backend/keys/cswordldkey.cpp
@@ -2,7 +2,7 @@
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
-* Copyright 1999-2011 by the BibleTime developers.
+* Copyright 1999-2014 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/
@@ -75,7 +75,7 @@ bool CSwordLDKey::setKey(const QString &newKey) {
return setKey(newKey.toUtf8().constData());
}
else {
- return setKey((const char*)cp1252Codec()->fromUnicode(newKey));
+ return setKey(cp1252Codec()->fromUnicode(newKey).constData());
}
}
@@ -90,7 +90,7 @@ bool CSwordLDKey::setKey(const char *newKey) {
m_module->snap();
}
- return !Error();
+ return !popError();
}
/** Uses the parameter to returns the next entry afer this key. */
diff --git a/src/backend/keys/cswordldkey.h b/src/backend/keys/cswordldkey.h
index ed43ce7..e8fba24 100644
--- a/src/backend/keys/cswordldkey.h
+++ b/src/backend/keys/cswordldkey.h
@@ -1,8 +1,10 @@
/*********
*
+* 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-2011 by the BibleTime developers.
+* Copyright 1999-2014 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/
diff --git a/src/backend/keys/cswordtreekey.cpp b/src/backend/keys/cswordtreekey.cpp
index 4ea624f..2823e5f 100644
--- a/src/backend/keys/cswordtreekey.cpp
+++ b/src/backend/keys/cswordtreekey.cpp
@@ -2,7 +2,7 @@
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
-* Copyright 1999-2011 by the BibleTime developers.
+* Copyright 1999-2014 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/
@@ -51,7 +51,7 @@ bool CSwordTreeKey::setKey(const QString &newKey) {
return setKey(newKey.toUtf8().constData());
}
else {
- return setKey((const char*)cp1252Codec()->fromUnicode(newKey));
+ return setKey(cp1252Codec()->fromUnicode(newKey).constData());
}
}
@@ -65,7 +65,7 @@ bool CSwordTreeKey::setKey(const char *newKey) {
root();
}
- return !Error();
+ return !popError();
}
QString CSwordTreeKey::getLocalNameUnicode() {
diff --git a/src/backend/keys/cswordtreekey.h b/src/backend/keys/cswordtreekey.h
index d6eb5ec..2bdfd6c 100644
--- a/src/backend/keys/cswordtreekey.h
+++ b/src/backend/keys/cswordtreekey.h
@@ -1,8 +1,10 @@
/*********
*
+* 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-2011 by the BibleTime developers.
+* Copyright 1999-2014 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/
diff --git a/src/backend/keys/cswordversekey.cpp b/src/backend/keys/cswordversekey.cpp
index de4fd0e..3dc0c75 100644
--- a/src/backend/keys/cswordversekey.cpp
+++ b/src/backend/keys/cswordversekey.cpp
@@ -2,7 +2,7 @@
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
-* Copyright 1999-2011 by the BibleTime developers.
+* Copyright 1999-2014 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/
@@ -150,14 +150,14 @@ bool CSwordVerseKey::setKey(const char *newKey) {
}
/// \todo Do we ALWAYS need to emit this signal and check for errors?
- emitChanged();
- return !Error();
+ emitAfterChanged();
+ return !popError();
}
bool CSwordVerseKey::next( const JumpType type ) {
typedef CSwordBibleModuleInfo CSBMI;
- Error(); //clear Error status
+ popError(); //clear Error status
bool ret = true;
switch (type) {
@@ -186,21 +186,22 @@ bool CSwordVerseKey::next( const JumpType type ) {
case UseVerse: {
if (m_module && m_module->module()) {
- const bool oldStatus = m_module->module()->getSkipConsecutiveLinks();
+ const bool oldStatus = m_module->module()->isSkipConsecutiveLinks();
m_module->module()->setSkipConsecutiveLinks(true);
//disable headings for next verse
const bool useHeaders = 1; //(Verse() == 0);
- const bool oldHeadingsStatus = ((VerseKey*)(m_module->module()->getKey()))->Headings( useHeaders );
+ const bool oldHeadingsStatus = ((VerseKey*)(m_module->module()->getKey()))->isIntros();
+ ((VerseKey*)(m_module->module()->getKey()))->setIntros( useHeaders );
//don't use setKey(), that would create a new key without Headings set
m_module->module()->getKey()->setText( key().toUtf8().constData() );
(*(m_module->module()) )++;
- ((VerseKey*)(m_module->module()->getKey()))->Headings(oldHeadingsStatus);
+ ((VerseKey*)(m_module->module()->getKey()))->setIntros(oldHeadingsStatus);
m_module->module()->setSkipConsecutiveLinks(oldStatus);
- if (!m_module->module()->Error()) {
+ if (!m_module->module()->popError()) {
setKey(QString::fromUtf8(m_module->module()->getKeyText()));
}
else {
@@ -237,14 +238,14 @@ bool CSwordVerseKey::next( const JumpType type ) {
ret = false;
}
- emitChanged();
+ emitAfterChanged();
return ret;
}
- else if (Error()) { //we have no module, so take care of VerseKey::Error()
+ else if (popError()) { //we have no module, so take care of VerseKey::Error()
return false;
}
- emitChanged();
+ emitAfterChanged();
return ret;
}
@@ -278,18 +279,19 @@ bool CSwordVerseKey::previous( const JumpType type ) {
case UseVerse: {
if (m_module && m_module->module()) {
const bool useHeaders = 1; //(Verse() == 0);
- const bool oldHeadingsStatus = ((VerseKey*)(m_module->module()->getKey()))->Headings( useHeaders );
+ const bool oldHeadingsStatus = ((VerseKey*)(m_module->module()->getKey()))->isIntros();
+ ((VerseKey*)(m_module->module()->getKey()))->setIntros( useHeaders );
m_module->module()->getKey()->setText( key().toUtf8().constData() );
- const bool oldStatus = m_module->module()->getSkipConsecutiveLinks();
+ const bool oldStatus = m_module->module()->isSkipConsecutiveLinks();
m_module->module()->setSkipConsecutiveLinks(true);
( *( m_module->module() ) )--;
- ((VerseKey*)(m_module->module()->getKey()))->Headings( oldHeadingsStatus );
+ ((VerseKey*)(m_module->module()->getKey()))->setIntros( oldHeadingsStatus );
m_module->module()->setSkipConsecutiveLinks(oldStatus);
- if (!m_module->module()->Error()) {
+ if (!m_module->module()->popError()) {
setKey(QString::fromUtf8(m_module->module()->getKeyText())); // don't use fromUtf8
}
else {
@@ -323,13 +325,13 @@ bool CSwordVerseKey::previous( const JumpType type ) {
ret = false;
}
- emitChanged();
+ emitAfterChanged();
return ret;
}
- else if (Error()) {
+ else if (popError()) {
return false;
}
- emitChanged();
+ emitAfterChanged();
return ret;
}
diff --git a/src/backend/keys/cswordversekey.h b/src/backend/keys/cswordversekey.h
index 2769cbf..4f33521 100644
--- a/src/backend/keys/cswordversekey.h
+++ b/src/backend/keys/cswordversekey.h
@@ -1,8 +1,10 @@
/*********
*
+* 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-2011 by the BibleTime developers.
+* Copyright 1999-2014 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/