summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordominique.leuenberger <dominique.leuenberger@c587cffe-e639-0410-9787-d7902ae8ed56>2009-10-03 13:47:01 +0000
committerdominique.leuenberger <dominique.leuenberger@c587cffe-e639-0410-9787-d7902ae8ed56>2009-10-03 13:47:01 +0000
commitd31b2b01e4d6ee6d6a2b0a068378e3db9d88102b (patch)
treec05bf1608acd730bf0beb89a5541fc799fcec3f0
parente430e45d2ca297616f1ec80d730a42d1f8acaabb (diff)
downloadlibproxy-d31b2b01e4d6ee6d6a2b0a068378e3db9d88102b.tar.gz
config_kde: New a C++ module, linking against Qt and kdecore.
git-svn-id: http://libproxy.googlecode.com/svn/trunk@441 c587cffe-e639-0410-9787-d7902ae8ed56
-rw-r--r--Makefile.am2
-rw-r--r--NEWS13
-rw-r--r--configure.ac31
-rw-r--r--src/modules/Makefile.am14
-rw-r--r--src/modules/config_kde.cc (renamed from src/modules/config_kde.c)15
5 files changed, 49 insertions, 26 deletions
diff --git a/Makefile.am b/Makefile.am
index 9e49d4e..3c47eea 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
SUBDIRS = src
-EXTRA_DIST = libproxy-1.0.pc.in
+EXTRA_DIST = libproxy-1.0.pc.in runtestsuite.sh test.d
CLEANFILES = mingw32-config.cache
pkgconfigdir = $(libdir)/pkgconfig
diff --git a/NEWS b/NEWS
index e7262f5..f14a594 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,16 @@
+New in version 0.3.1
+====================
+- Bugfixes
+ + config file parser reads all sections
+ + KDE session detection based on environment varibales,
+ as suggested by KDE upstream.
+- KDE configuration module is the first module in C++ and
+ now links to libkdecore4 in order to properly detec the
+ configuration folder for kde.
+- At the moment we're not compatible with KDE3. Sorry.
+- .NET bindings can now properly be installed and it should
+ be possible for packagers to provide them.
+
New in version 0.3.0
====================
* WARNING!!! Slight API change!!! see docs
diff --git a/configure.ac b/configure.ac
index 8a1657c..d98caaf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,6 +34,7 @@ PKG_CHECK_MODULES(mozjs, xulrunner-js, have_mozjs=yes,
[PKG_CHECK_MODULES(mozjs, seamonkey-js, have_mozjs=yes,have_mozjs=no)])])])
PKG_CHECK_MODULES(NetworkManager, NetworkManager dbus-1,
have_networkmanager=yes, have_networkmanager=no)
+PKG_CHECK_MODULES(QtCore, QtCore, have_qtcore=yes, have_qtcore=no)
# Direct
AC_ARG_WITH([direct],
@@ -83,28 +84,28 @@ fi
AM_CONDITIONAL([WITH_GNOME], [test x$with_gnome = xyes])
# KDE
-AC_ARG_WITH([kde],
- [AS_HELP_STRING([--with-kde],
- [build KDE configuration module @<:@automatic@:>@])],
+AC_ARG_WITH([kde4],
+ [AS_HELP_STRING([--with-kde4],
+ [build KDE4 configuration module @<:@automatic@:>@])],
[],
- [test x$have_x11 = xyes &&
- test x$have_xmu = xyes &&
- with_kde=yes])
-if test x$with_kde = xyes; then
- if test x$have_x11 = xyes && \
+ [test x$have_qtcore = xyes &&
+ test x$have_xmu = xyes &&
+ with_kde4=yes])
+if test x$with_kde4 = xyes; then
+ if test x$have_qtcore = xyes && \
test x$have_xmu = xyes; then
- KDE_CFLAGS="$x11_CFLAGS $xmu_CFLAGS"
- KDE_LIBS="$x11_LIBS $xmu_LIBS"
- AC_SUBST(KDE_CFLAGS)
- AC_SUBST(KDE_LIBS)
+ KDE4_CFLAGS="$QtCore_CFLAGS"
+ KDE4_LIBS="$QtCore_LIBS"
+ AC_SUBST(KDE4_CFLAGS)
+ AC_SUBST(KDE4_LIBS)
else
- echo "KDE module requires: x11 and xmu!"
+ echo "KDE4 module requires: QtCore and libkdecore"
exit 1
fi
else
with_kde=no
fi
-AM_CONDITIONAL([WITH_KDE], [test x$with_kde = xyes])
+AM_CONDITIONAL([WITH_KDE4], [test x$with_kde4 = xyes])
# WPAD
AC_ARG_WITH([wpad],
@@ -257,7 +258,7 @@ echo -e "\t\tdirect : $with_direct"
echo -e "\t\tenvvar : $with_envvar"
echo -e "\t\tfile : $with_file"
echo -e "\t\tgnome : $with_gnome"
-echo -e "\t\tkde : $with_kde"
+echo -e "\t\tkde4 : $with_kde4"
echo -e "\t\twpad : $with_wpad"
echo -e "\t\tnetworkmanager : $with_networkmanager"
echo -e "\t\tmozjs : $with_mozjs"
diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am
index d2a94d1..4b9fa27 100644
--- a/src/modules/Makefile.am
+++ b/src/modules/Makefile.am
@@ -17,8 +17,8 @@ endif
if WITH_GNOME
module_LTLIBRARIES += config_gnome.la
endif
-if WITH_KDE
-module_LTLIBRARIES += config_kde.la
+if WITH_KDE4
+module_LTLIBRARIES += config_kde4.la
endif
if WITH_WPAD
module_LTLIBRARIES += config_wpad.la wpad_dns.la wpad_dnsdevolution.la
@@ -54,11 +54,11 @@ config_gnome_la_CPPFLAGS = -I$(top_srcdir)/src/lib -D_POSIX_C_SOURCE=2
config_gnome_la_LIBADD = ../lib/libproxy.la
config_gnome_la_LDFLAGS = $(AM_LDFLAGS) @GNOME_LIBS@
-# KDE Config Module
-config_kde_la_SOURCES = config_kde.c
-config_kde_la_CPPFLAGS = -I$(top_srcdir)/src/lib @KDE_CFLAGS@
-config_kde_la_LIBADD = ../lib/libproxy.la
-config_kde_la_LDFLAGS = $(AM_LDFLAGS) @KDE_LIBS@
+# KDE4 Config Module
+config_kde4_la_SOURCES = config_kde.cc
+config_kde4_la_CPPFLAGS = -I$(top_srcdir)/src/lib @KDE4_CFLAGS@
+config_kde4_la_LIBADD = ../lib/libproxy.la
+config_kde4_la_LDFLAGS = $(AM_LDFLAGS) @KDE4_LIBS@ -lkdecore
# Windows Registry Config Module
config_w32reg_la_SOURCES = config_w32reg.c
diff --git a/src/modules/config_kde.c b/src/modules/config_kde.cc
index edea22d..9e4db2e 100644
--- a/src/modules/config_kde.c
+++ b/src/modules/config_kde.cc
@@ -20,10 +20,14 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
+#include <stdio.h>
#include <misc.h>
#include <modules.h>
#include <config_file.h>
+#include <QtGui/QApplication>
+#include <kstandarddirs.h>
+
typedef struct _pxKConfigConfigModule {
PX_MODULE_SUBCLASS(pxConfigModule);
@@ -42,6 +46,8 @@ _destructor(void *s)
static char *
_get_config(pxConfigModule *s, pxURL *url)
{
+// QApplication *app = new QApplication(0,NULL,0);
+// KGlobal::dirs();
pxKConfigConfigModule *self = (pxKConfigConfigModule *) s;
// TODO: make ignores work w/ KDE
@@ -53,7 +59,10 @@ _get_config(pxConfigModule *s, pxURL *url)
if (!cf || px_config_file_is_stale(cf))
{
if (cf) px_config_file_free(cf);
- tmp = px_strcat(getenv("HOME"), "/.kde/share/config/kioslaverc", NULL);
+// QString localdir = KGlobal::dirs()->localkdedir();
+ QString localdir = KStandardDirs().localkdedir();
+ QByteArray ba = localdir.toLatin1();
+ tmp = px_strcat(ba.data(), "/share/config/kioslaverc", NULL);
cf = px_config_file_new(tmp);
px_free(tmp);
self->cf = cf;
@@ -117,12 +126,12 @@ _set_credentials(pxConfigModule *self, pxURL *proxy, const char *username, const
static void *
_constructor()
{
- pxKConfigConfigModule *self = px_malloc0(sizeof(pxKConfigConfigModule));
+ pxKConfigConfigModule *self = (pxKConfigConfigModule *)px_malloc0(sizeof(pxKConfigConfigModule));
PX_CONFIG_MODULE_BUILD(self, PX_CONFIG_MODULE_CATEGORY_SESSION, _get_config, _get_ignore, _get_credentials, _set_credentials);
return self;
}
-bool
+extern "C" bool
px_module_load(pxModuleManager *self)
{
// If we are running in KDE, then make sure this plugin is registered.