From 4b1fdd0cf286a1aea332f221fb4ba9fef43d3c13 Mon Sep 17 00:00:00 2001 From: mio Date: Thu, 15 May 2025 17:19:52 +1000 Subject: [PATCH] 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 --- ConfigureChecks.cmake | 6 ---- bibletime/backend/centrydisplay.h | 2 -- bibletime/backend/cswordbiblemoduleinfo.cpp | 36 --------------------- bibletime/backend/cswordversekey.cpp | 16 --------- bibletime/bibletime.cpp | 4 --- bibletime/frontend/btinstallmgr.cpp | 2 -- bibletime/frontend/btinstallmgr.h | 6 ---- config.h.cmake | 6 ---- 8 files changed, 78 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index c432698..84147b5 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -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 diff --git a/bibletime/backend/centrydisplay.h b/bibletime/backend/centrydisplay.h index 832dd5f..62f3d6c 100644 --- a/bibletime/backend/centrydisplay.h +++ b/bibletime/backend/centrydisplay.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 }; diff --git a/bibletime/backend/cswordbiblemoduleinfo.cpp b/bibletime/backend/cswordbiblemoduleinfo.cpp index 8f500d3..e1710c7 100644 --- a/bibletime/backend/cswordbiblemoduleinfo.cpp +++ b/bibletime/backend/cswordbiblemoduleinfo.cpp @@ -181,45 +181,9 @@ const unsigned int CSwordBibleModuleInfo::bookNumber(const TQString &book) { boost::scoped_ptr 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; } diff --git a/bibletime/backend/cswordversekey.cpp b/bibletime/backend/cswordversekey.cpp index d099061..63b4d56 100644 --- a/bibletime/backend/cswordversekey.cpp +++ b/bibletime/backend/cswordversekey.cpp @@ -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]) ) { diff --git a/bibletime/bibletime.cpp b/bibletime/bibletime.cpp index 5fa8112..f03c0e3 100644 --- a/bibletime/bibletime.cpp +++ b/bibletime/bibletime.cpp @@ -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); diff --git a/bibletime/frontend/btinstallmgr.cpp b/bibletime/frontend/btinstallmgr.cpp index 233c2e6..a604682 100644 --- a/bibletime/frontend/btinstallmgr.cpp +++ b/bibletime/frontend/btinstallmgr.cpp @@ -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 diff --git a/bibletime/frontend/btinstallmgr.h b/bibletime/frontend/btinstallmgr.h index 5e48f5f..f353a21 100644 --- a/bibletime/frontend/btinstallmgr.h +++ b/bibletime/frontend/btinstallmgr.h @@ -27,10 +27,6 @@ #include #include -#ifdef SWORD_MULTIVERSE -#define SWORD_INTERNET_WARNING 1 -#endif - namespace BookshelfManager { typedef TQPtrList 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 */ diff --git a/config.h.cmake b/config.h.cmake index 81f555c..a52d767 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -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