Hello community,
here is the log from the commit of package kdeaddons3
checked in at Fri Apr 20 23:31:39 CEST 2007.
--------
--- KDE/kdeaddons3/kdeaddons3.changes 2007-01-26 09:57:31.000000000 +0100
+++ /mounts/work_src_done/STABLE/kdeaddons3/kdeaddons3.changes 2007-04-20 16:21:39.000000000 +0200
@@ -1,0 +2,5 @@
+Fri Apr 20 16:21:19 CEST 2007 - dmueller@suse.de
+
+- use C version of db
+
+-------------------------------------------------------------------
New:
----
use-db.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kdeaddons3.spec ++++++
--- /var/tmp/diff_new_pack.hO1008/_old 2007-04-20 23:31:24.000000000 +0200
+++ /var/tmp/diff_new_pack.hO1008/_new 2007-04-20 23:31:24.000000000 +0200
@@ -20,7 +20,7 @@
Summary: Additional Modules for Kate, Kicker, Konqueror, and Noatun
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Version: 3.5.6
-Release: 2
+Release: 3
Url: http://www.kde.org
Requires: kdelibs3 >= %(rpm -q --queryformat '%{VERSION}' kdelibs3)
Source: kdeaddons-%{version}.tar.bz2
@@ -29,6 +29,7 @@
Patch2: fix-kimgalleryplugin-output.diff
Patch3: google-suggest.diff
Patch4: permanent-searchbar.diff
+Patch5: use-db.diff
%description
This package contains some fun and useful additional modules:
@@ -163,6 +164,7 @@
%patch2
%patch3
%patch4
+%patch5
. /etc/opt/kde3/common_options
update_admin
@@ -340,7 +342,9 @@
/opt/kde3/share/services/kaddressbook/geo_xxport.desktop
/opt/kde3/share/icons/*/*/*/ksig.*
-%changelog -n kdeaddons3
+%changelog
+* Fri Apr 20 2007 - dmueller@suse.de
+- use C version of db
* Fri Jan 26 2007 - stbinner@suse.de
- add 3_5_BRANCH.diff to fix minor privacy issue in webarchiver
* Tue Jan 16 2007 - stbinner@suse.de
++++++ use-db.diff ++++++
--- noatun-plugins/oblique/base.cpp
+++ noatun-plugins/oblique/base.cpp
@@ -14,14 +14,13 @@
#include <cstdlib>
#include
-#include
-
-
+#include <iostream>
+#include
struct Base::Private
{
- Private() : db(0, DB_CXX_NO_EXCEPTIONS) { }
- Db db;
+ Private() : db(0) { db_create(&db, NULL, 0); }
+ DB* db;
typedef KDbt<FileId> Key;
typedef KDbt<QStringList> Data;
@@ -43,17 +42,15 @@ Base::Base(const QString &file)
QCString filename = QFile::encodeName(file);
bool create = true;
- if (d->db.open(
-#if DB_VERSION_MINOR > 0 && DB_VERSION_MAJOR >= 4
+ if (d->db->open( d->db,
NULL,
-#endif
filename,
0, DB_BTREE, DB_NOMMAP, 0
- )==0)
+ )== 0)
{ // success
Private::Data data;
Private::Key key(0);
- if (d->db.get(0, &key, &data, 0)==0)
+ if (d->db->get(d->db, NULL, &key, &data, 0)==0)
{
QStringList strs;
data.get(strs);
@@ -72,10 +69,9 @@ Base::Base(const QString &file)
if (create)
{ // failure
QFile(filename).remove();
- d->db.open(
-#if DB_VERSION_MINOR > 0 && DB_VERSION_MAJOR >= 4
+ d->db->open(
+ d->db,
NULL,
-#endif
filename,0, DB_BTREE, DB_NOMMAP|DB_CREATE,0
);
@@ -91,7 +87,7 @@ Base::Base(const QString &file)
// "the high extreme (auto-increment counter in SQL terminology)",
// "the metaxml"
// }
- d->db.put(0, &key, &data, 0);
+ d->db->put(d->db, 0, &key, &data, 0);
}
}
@@ -108,9 +104,9 @@ Base::~Base()
Private::Data data(strs);
Private::Key key(0);
- d->db.put(0, &key, &data, 0);
- d->db.sync(0);
- d->db.close(0);
+ d->db->put(d->db, 0, &key, &data, 0);
+ d->db->sync(d->db, 0);
+ d->db->close(d->db, 0);
delete d;
}
@@ -121,7 +117,7 @@ File Base::add(const QString &file)
properties << "file" << file;
Private::Data data(properties);
- unless (d->db.put(0, &key, &data, 0))
+ unless (d->db->put(d->db, 0, &key, &data, 0))
{
// success !
File f(this, d->high);
@@ -140,7 +136,7 @@ File Base::find(FileId id)
Private::Key key(id);
Private::Data data;
- unless (d->db.get(0, &key, &data, 0))
+ unless (d->db->get(d->db, 0, &key, &data, 0))
{
// exists
return File(this, id);
@@ -205,8 +201,8 @@ void Base::setProperty(FileId id, const
Private::Data data(props);
Private::Key dbkey(id);
- d->db.put(0, &dbkey, &data, 0);
- d->db.sync(0);
+ d->db->put(d->db, 0, &dbkey, &data, 0);
+ d->db->sync(d->db, 0);
emit modified(File(this, id));
}
@@ -243,8 +239,8 @@ void Base::clearProperty(FileId id, cons
Private::Data data(props);
Private::Key dbkey(id);
- d->db.put(0, &dbkey, &data, 0);
- d->db.sync(0);
+ d->db->put(d->db, 0, &dbkey, &data, 0);
+ d->db->sync(d->db, 0);
emit modified(File(this, id));
}
@@ -253,7 +249,7 @@ void Base::remove(File file)
{
Private::Key key(file.id());
- unless (d->db.del(0, &key, 0))
+ unless (d->db->del(d->db, 0, &key, 0))
{
emit removed(file);
if (file.id() == d->high)
@@ -261,7 +257,7 @@ void Base::remove(File file)
d->high--; // optimization
}
}
- d->db.sync(0);
+ d->db->sync(d->db, 0);
}
void Base::loadIntoCache(FileId id) const
@@ -273,7 +269,7 @@ void Base::loadIntoCache(FileId id) cons
Private::Key key(id);
Private::Data data;
- unless (d->db.get(0, &key, &data, 0))
+ unless (d->db->get(d->db, 0, &key, &data, 0))
{
QStringList props;
data.get(props);
@@ -317,14 +313,14 @@ void Base::move(FileId oldid, FileId new
{
Private::Key key(oldid);
Private::Data data;
- unless (d->db.get(0, &key, &data, 0))
+ unless (d->db->get(d->db, 0, &key, &data, 0))
{
QStringList props;
data.get(props);
- d->db.del(0, &key, 0);
+ d->db->del(d->db, 0, &key, 0);
Private::Key key2(newid);
- d->db.put(0, &key2, &data, 0);
+ d->db->put(d->db, 0, &key2, &data, 0);
}
}
--- noatun-plugins/oblique/configure.in.in
+++ noatun-plugins/oblique/configure.in.in
@@ -1,29 +1,29 @@
AC_ARG_WITH(berkeley-db,
- [AC_HELP_STRING([--with-berkeley-db],[enable support for Berkeley DB++ @<:@default=check@:>@])],
+ [AC_HELP_STRING([--with-berkeley-db],[enable support for Berkeley DB @<:@default=check@:>@])],
[], with_berkeley_db=check)
AC_ARG_WITH(db-lib,
- [AC_HELP_STRING([--with-db-lib=NAME],[name of the Berkeley DB++ library @<:@default=db_cxx@:>@])],
- [ac_db_name="$withval"], [ac_db_name="db_cxx"])
+ [AC_HELP_STRING([--with-db-lib=NAME],[name of the Berkeley DB library @<:@default=db@:>@])],
+ [ac_db_name="$withval"], [ac_db_name="db"])
berkeley_db=no
if test "x$with_berkeley_db" != xno; then
berkeley_db=yes
- KDE_CHECK_HEADER([db_cxx.h],
+ KDE_CHECK_HEADER([db.h],
[:], [berkeley_db=no])
AC_CHECK_LIB([$ac_db_name], [main],
[:], [berkeley_db=no])
if test "x$berkeley_db" = xyes; then
- AC_DEFINE(BERKELEY_DB, 1, [Define if you have Berkeley DB++ installed])
+ AC_DEFINE(BERKELEY_DB, 1, [Define if you have Berkeley DB installed])
BERKELEY_DB_LIBS="-l$ac_db_name"
AC_SUBST(BERKELEY_DB_LIBS)
fi
if test "x$with_berkeley_db" != xcheck && test "x$berkeley_db" != xyes; then
- AC_MSG_ERROR([--with-berkeley-db was given, but test for Berkeley DB++ failed])
+ AC_MSG_ERROR([--with-berkeley-db was given, but test for Berkeley DB failed])
fi
fi
--- noatun-plugins/oblique/kdbt.h
+++ noatun-plugins/oblique/kdbt.h
@@ -6,17 +6,17 @@
#ifndef KDbt_Interface
#define KDbt_Interface
-#include
#include
#include
#include "kbuffer.h"
+#include "db.h"
/**A generic wrapper for "database thang" class that abstracts binary streaming operations.
*@author Eray Ozkural (exa)
*/
template <typename T>
-class KDbt : public Dbt {
+class KDbt : public DBT {
public:
/* assume streaming operators on QDataStream
QDataStream & operator>> ( QDataStream& >>, T &);
@@ -28,32 +28,24 @@ public:
KDbt(const T& obj) {
set(obj);
}
-// operator Dbt() {
-// return Dbt(thang.data(), thang.size());
-// }
/** set "thang" to the contents of obj */
void set(const T& obj) {
-// KBuffer buffer(thang);
- QDataStream ds(&thang);
+ QDataStream ds(thang, IO_WriteOnly);
ds << obj;
-// std::cerr << "thang size " << thang.size() << endl;
-// buffer.close();
-// set_data(thang.data());
-// set_size(buffer.size());
- set_data(thang.data());
- set_size(thang.size());
+ data = thang.data();
+ size = thang.size();
}
+
void get(T& obj) {
QByteArray buffer;
- buffer.setRawData((char*)get_data(),get_size());
+ buffer.setRawData((char*)data,size);
QDataStream ds(buffer,IO_ReadWrite);
ds >> obj;
- buffer.resetRawData((char*)get_data(),get_size());
+ buffer.resetRawData((char*)data,size);
}
private:
/** Internal data */
-// QByteArray thang;
- KBuffer thang;
+ QByteArray thang;
};
#endif
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org