summaryrefslogtreecommitdiffstats
path: root/kbabel/kbabeldict/modules/dbsearchengine
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-06-01 17:54:31 +0900
committerSlávek Banko <slavek.banko@axis.cz>2020-06-01 20:54:41 +0200
commitd27bcb302f5a7ccb65f0e6a16c9d844f11f5db01 (patch)
tree6dbda9810a34c0a401cefe59807d3e963422e0be /kbabel/kbabeldict/modules/dbsearchengine
parent9a844b5265daaa9ca0e360b3c46989481c374300 (diff)
downloadtdesdk-d27bcb302f5a7ccb65f0e6a16c9d844f11f5db01.tar.gz
tdesdk-d27bcb302f5a7ccb65f0e6a16c9d844f11f5db01.zip
KBabel: fixed support for Berkekey DB. This resolves issue #7.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 75c62476a59c681f3e8e7ee2ac46b4c8e6dc3c96)
Diffstat (limited to 'kbabel/kbabeldict/modules/dbsearchengine')
-rw-r--r--kbabel/kbabeldict/modules/dbsearchengine/database.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/kbabel/kbabeldict/modules/dbsearchengine/database.cpp b/kbabel/kbabeldict/modules/dbsearchengine/database.cpp
index 5fa69de0..a059eeed 100644
--- a/kbabel/kbabeldict/modules/dbsearchengine/database.cpp
+++ b/kbabel/kbabeldict/modules/dbsearchengine/database.cpp
@@ -341,7 +341,7 @@ DataBaseManager::openDataBase ()
db_create (&indexDb, 0, 0);
ret = db->open (db,
-#if DB_VERSION_MINOR > 0
+#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0) || (DB_VERSION_MAJOR >= 5)
NULL,
#endif
transfilename.local8Bit (), 0, DB_BTREE, 0, 0644);
@@ -457,7 +457,7 @@ DataBaseManager::openDataBase ()
keysFile.unlink ();
ret = db->open (db,
-#if DB_VERSION_MINOR > 0
+#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0) || (DB_VERSION_MAJOR >= 5)
NULL,
#endif
transfilename.local8Bit (), 0, DB_BTREE, 0,
@@ -483,7 +483,7 @@ DataBaseManager::openDataBase ()
ret = infoDb->open (infoDb,
-#if DB_VERSION_MINOR > 0
+#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0) || (DB_VERSION_MAJOR >= 5)
NULL,
#endif
infofilename.local8Bit (), 0, DB_RECNO, 0, 0644);
@@ -501,7 +501,7 @@ DataBaseManager::openDataBase ()
// Words index database
ret = wordDb->open (wordDb,
-#if DB_VERSION_MINOR > 0
+#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0) || (DB_VERSION_MAJOR >= 5)
NULL,
#endif
wordsfilename.local8Bit (), 0, DB_BTREE, 0, 0644);
@@ -515,7 +515,7 @@ DataBaseManager::openDataBase ()
//Index of keys.
ret = indexDb->open (indexDb,
-#if DB_VERSION_MINOR > 0
+#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0) || (DB_VERSION_MAJOR >= 5)
NULL,
#endif
keysfilename.local8Bit (), 0, DB_RECNO, 0, 0644);
@@ -800,7 +800,7 @@ DataBaseManager::createDataBase (TQString directory,
db->set_flags (db, DB_RECNUM);
ret = db->open (db,
-#if DB_VERSION_MINOR > 0
+#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0) || (DB_VERSION_MAJOR >= 5)
NULL,
#endif
filename.local8Bit (), 0, DB_BTREE, DB_CREATE | DB_EXCL,
@@ -818,7 +818,7 @@ DataBaseManager::createDataBase (TQString directory,
db_create (&infoDb, 0, 0);
ret = infoDb->open (infoDb,
-#if DB_VERSION_MINOR > 0
+#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0) || (DB_VERSION_MAJOR >= 5)
NULL,
#endif
filename.local8Bit (), 0, DB_RECNO, DB_CREATE, mode);
@@ -833,7 +833,7 @@ DataBaseManager::createDataBase (TQString directory,
db_create (&wordDb, 0, 0);
ret = wordDb->open (wordDb,
-#if DB_VERSION_MINOR > 0
+#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0) || (DB_VERSION_MAJOR >= 5)
NULL,
#endif
filename.local8Bit (), 0, DB_BTREE, DB_CREATE, mode);
@@ -848,7 +848,7 @@ DataBaseManager::createDataBase (TQString directory,
db_create (&indexDb, 0, 0);
ret = indexDb->open (indexDb,
-#if DB_VERSION_MINOR > 0
+#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0) || (DB_VERSION_MAJOR >= 5)
NULL,
#endif
filename.local8Bit (), 0, DB_RECNO, DB_CREATE, mode);