Remove sword version conditionals for 1.6 and 1.7

These checks are no longer necessary since sword 1.7+ is required.

Signed-off-by: mio <stigma@disroot.org>
pull/33/head
mio 2 months ago
parent 81a2561d12
commit 4b1fdd0cf2

@ -31,12 +31,6 @@ pkg_search_module( SWORD sword>=1.7 )
if( NOT SWORD_FOUND )
tde_message_fatal( "sword library is required but not found on your system" )
endif()
if( NOT SWORD_VERSION VERSION_LESS "1.6" )
set( SWORD_MULTIVERSE 1 )
endif()
if( NOT SWORD_VERSION VERSION_LESS "1.7" )
set( SWORD_API_1_7 1 )
endif()
check_cxx_source_compiles("
#include <signal.h>

@ -47,7 +47,6 @@ public:
*/
virtual const TQString text( const ListCSwordModuleInfo& modules, const TQString& key, const CSwordBackend::DisplayOptions displayOptions, const CSwordBackend::FilterOptions filterOptions);
#ifdef SWORD_API_1_7
/** casts a module to a character pointer and displays it to
* raw output (overriden for different display types and
* module types if necessary)
@ -56,7 +55,6 @@ public:
* @return error status
*/
virtual char display(SWModule &imodule) { return 0; };
#endif
};

@ -181,45 +181,9 @@ const unsigned int CSwordBibleModuleInfo::bookNumber(const TQString &book) {
boost::scoped_ptr<sword::VerseKey> key((sword::VerseKey *)module()->CreateKey());
(*key) = sword::TOP;
#ifdef SWORD_MULTIVERSE
key->setBookName(book.utf8().data());
bookNumber = ((key->Testament() > 1) ? key->BMAX[0] : 0) + key->Book();
#else
bool found = false;
int min = 0;
int max = 1;
if ((m_hasOT>0 && m_hasNT>0) || (m_hasOT == -1 && m_hasNT == -1)) {
min = 0;
max = 1;
bookNumber = 0;
}
else if (m_hasOT>0 && !m_hasNT) {
min = 0;
max = 0;
bookNumber = 0;
}
else if (!m_hasOT && m_hasNT>0) {
min = 1;
max = 1;
bookNumber = key->BMAX[0];
}
else if (!m_hasOT && !m_hasNT) {
min = 0;
max = -1; //no loop
bookNumber = 0;
}
for (int i = min; i <= max && !found; ++i) {
for ( int j = 0; j < key->BMAX[i] && !found; ++j) {
++bookNumber;
if (book == TQString::fromUtf8( key->books[i][j].name) )
found = true;
}
}
#endif
return bookNumber;
}

@ -88,23 +88,7 @@ const TQString CSwordVerseKey::book( const TQString& newBook ) {
}
if (!newBook.isEmpty()) {
#ifdef SWORD_MULTIVERSE
setBookName(newBook.utf8().data());
#else
bool finished = false;
for (int testament = min; testament <= max && !finished; ++testament) {
for (int book = 0; book < BMAX[testament] && !finished; ++book) {
if ( !strcmp(newBook.utf8().data(), books[testament][book].name ) ) {
Testament(testament+1);
Book(book+1);
finished = true;
}
}
}
#endif
}
if ( (Testament() >= min+1) && (Testament() <= max+1) && (Book() <= BMAX[min]) ) {

@ -311,11 +311,7 @@ void BibleTime::processCommandline() {
KRandomSequence rs;
int newIndex = rs.getLong(maxIndex);
vk.setPosition(sword::TOP);
#ifdef SWORD_API_1_7
vk.setIndex(newIndex);
#else
vk.Index(newIndex);
#endif
bibleKey = vk.key();
}
createReadDisplayWindow(bible, bibleKey);

@ -275,7 +275,6 @@ namespace BookshelfManager {
this->setFTPPassive(true);
}
#ifdef SWORD_INTERNET_WARNING
bool BTInstallMgr::isUserDisclaimerConfirmed() const
{
TDEConfig* config = CBTConfig::getConfig();
@ -295,7 +294,6 @@ namespace BookshelfManager {
}
}
}
#endif
BTInstallMgr::~BTInstallMgr() {
terminate(); //make sure to close the connection

@ -27,10 +27,6 @@
#include <tqstring.h>
#include <tqstringlist.h>
#ifdef SWORD_MULTIVERSE
#define SWORD_INTERNET_WARNING 1
#endif
namespace BookshelfManager {
typedef TQPtrList<sword::InstallSource> InstallSourceList;
@ -85,11 +81,9 @@ private:
BTInstallMgr();
virtual ~BTInstallMgr();
#ifdef SWORD_INTERNET_WARNING
public:
/** Re-implemented from sword::InstallMgr. */
virtual bool isUserDisclaimerConfirmed() const;
#endif
protected:
/* Reimplementations of method in StatusReporter */

@ -8,11 +8,5 @@
significant byte first (like Motorola and SPARC, unlike Intel). */
#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
/* Define if sword library API >= 1.6 */
#cmakedefine SWORD_MULTIVERSE 1
/* Define if sword library API >= 1.7 */
#cmakedefine SWORD_API_1_7 1
/* Define if clucene library API >= 2.0 */
#cmakedefine CLUCENE_V2 1

Loading…
Cancel
Save