summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-11 03:46:01 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-11 03:46:01 +0000
commit865f314dd5ed55508f45a32973b709b79a541e36 (patch)
treedc1a3a884bb2fc10a89a3c46313897d22c5771eb
parentce4a32fe52ef09d8f5ff1dd22c001110902b60a2 (diff)
downloadtdelibs-865f314dd5ed55508f45a32973b709b79a541e36.tar.gz
tdelibs-865f314dd5ed55508f45a32973b709b79a541e36.zip
kdelibs update to Trinity v3.5.11
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1061230 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--Makefile.am.in2
-rw-r--r--arts/kde/Makefile.am2
-rw-r--r--arts/knotify/Makefile.am2
-rw-r--r--configure.in.in6
-rw-r--r--dcop/Makefile.am2
-rwxr-xr-xdcop/dcopidlng/dcopidlng7
-rw-r--r--dnssd/Makefile.am4
-rw-r--r--dnssd/README7
-rw-r--r--dnssd/configure.in.in49
-rw-r--r--dnssd/domainbrowser.cpp75
-rw-r--r--dnssd/publicservice.cpp192
-rw-r--r--dnssd/publicservice.h5
-rw-r--r--dnssd/query.cpp132
-rw-r--r--dnssd/remoteservice.cpp105
-rw-r--r--dnssd/responder.cpp75
-rw-r--r--dnssd/responder.h34
-rw-r--r--dnssd/sdevent.h9
-rw-r--r--dnssd/servicebase.cpp2
-rw-r--r--dnssd/servicebrowser.cpp25
-rw-r--r--interfaces/kimproxy/library/Makefile.am2
-rw-r--r--interfaces/kmediaplayer/Makefile.am2
-rw-r--r--interfaces/kmediaplayer/kfileaudiopreview/Makefile.am2
-rw-r--r--interfaces/kscript/Makefile.am2
-rw-r--r--interfaces/kscript/sample/Makefile.am2
-rw-r--r--interfaces/ktexteditor/Makefile.am2
-rw-r--r--interfaces/terminal/kde_terminal_interface.h2
-rw-r--r--kabc/Makefile.am2
-rw-r--r--kabc/formats/Makefile.am2
-rw-r--r--kabc/plugins/dir/Makefile.am4
-rw-r--r--kabc/plugins/file/Makefile.am4
-rw-r--r--kabc/plugins/ldapkio/Makefile.am4
-rw-r--r--kabc/vcard/Makefile.am2
-rw-r--r--kate/data/Makefile.am6
-rw-r--r--kate/interfaces/Makefile.am2
-rw-r--r--kate/part/Makefile.am2
-rw-r--r--kate/part/katesearch.cpp32
-rw-r--r--kate/plugins/insertfile/Makefile.am2
-rw-r--r--kate/plugins/isearch/Makefile.am2
-rw-r--r--kate/plugins/kdatatool/Makefile.am2
-rw-r--r--kate/plugins/wordcompletion/Makefile.am2
-rw-r--r--kcert/Makefile.am2
-rw-r--r--kcmshell/Makefile.am2
-rw-r--r--kconf_update/Makefile.am2
-rw-r--r--kdecore/Makefile.am12
-rw-r--r--kdecore/kaccel.cpp3
-rw-r--r--kdecore/kconfigbackend.cpp51
-rw-r--r--kdecore/kconfigbackend.h6
-rw-r--r--kdecore/kcrash.cpp2
-rw-r--r--kdecore/kdebug.cpp3
-rw-r--r--kdecore/kdebugrc2
-rw-r--r--kdecore/kdeversion.h4
-rw-r--r--kdecore/kglobalsettings.cpp51
-rw-r--r--kdecore/kiconeffect.cpp148
-rw-r--r--kdecore/kiconeffect.h1
-rw-r--r--kdecore/kicontheme.cpp2
-rw-r--r--kdecore/klocale.cpp17
-rw-r--r--kdecore/kpty.cpp192
-rw-r--r--kdecore/kpty.h10
-rw-r--r--kdecore/kstandarddirs.cpp12
-rw-r--r--kdecore/kstartupinfo.cpp38
-rw-r--r--kdecore/kstartupinfo.h24
-rw-r--r--kdecore/netwm.cpp17
-rw-r--r--kdecore/netwm_def.h1
-rw-r--r--kdecore/network/kresolverworkerbase.cpp3
-rw-r--r--kded/Makefile.am6
-rw-r--r--kded/applications.menu84
-rw-r--r--kded/kbuildservicefactory.cpp2
-rw-r--r--kded/kded.cpp15
-rw-r--r--kded/vfolder_menu.cpp4
-rw-r--r--kdefx/Makefile.am2
-rw-r--r--kdefx/kstyle.cpp52
-rw-r--r--kdelibs.lsm6
-rw-r--r--kdeprint/Makefile.am4
-rw-r--r--kdeprint/configure.in.in5
-rw-r--r--kdeprint/cups/Makefile.am2
-rw-r--r--kdeprint/cups/cupsdconf2/Makefile.am2
-rw-r--r--kdeprint/cups/cupsdconf2/cupsd.conf.template14
-rw-r--r--kdeprint/cups/cupsdconf2/cupsdconf.cpp6
-rw-r--r--kdeprint/cups/cupsdconf2/cupsddialog.cpp11
-rw-r--r--kdeprint/cups/kmcupsmanager.cpp2
-rw-r--r--kdeprint/ext/Makefile.am2
-rw-r--r--kdeprint/filters/psnup.xml9
-rw-r--r--kdeprint/kprinter.cpp2
-rw-r--r--kdeprint/lpdunix/Makefile.am2
-rw-r--r--kdeprint/lpr/Makefile.am3
-rw-r--r--kdeprint/management/Makefile.am6
-rw-r--r--kdeprint/management/kmmainview.cpp8
-rw-r--r--kdeprint/management/kmmainview.h1
-rw-r--r--kdeprint/management/smbview.cpp20
-rw-r--r--kdeprint/rlpr/Makefile.am2
-rw-r--r--kdeprint/tools/escputil/Makefile.am2
-rw-r--r--kdesu/Makefile.am4
-rw-r--r--kdeui/Makefile.am6
-rw-r--r--kdeui/kaboutapplication.cpp4
-rw-r--r--kdeui/kaboutkde.cpp52
-rw-r--r--kdeui/kbugreport.cpp30
-rw-r--r--kdeui/kbugreport.h2
-rw-r--r--kdeui/kdetrayproxy/Makefile.am2
-rw-r--r--kdeui/khelpmenu.cpp2
-rw-r--r--kdeui/kiconview.cpp8
-rw-r--r--kdeui/kstdaction_p.h2
-rw-r--r--kdeui/ktabwidget.cpp2
-rw-r--r--kdewidgets/Makefile.am2
-rw-r--r--kdoctools/Makefile.am7
-rw-r--r--kdoctools/meinproc.cpp20
-rw-r--r--khtml/Makefile.am2
-rw-r--r--khtml/html/html_elementimpl.cpp7
-rw-r--r--khtml/html/html_formimpl.cpp12
-rw-r--r--khtml/java/Makefile.am2
-rw-r--r--khtml/kmultipart/Makefile.am2
-rw-r--r--khtml/misc/Makefile.am4
-rw-r--r--khtml/misc/knsplugininstaller.cpp672
-rw-r--r--khtml/misc/knsplugininstaller.h269
-rw-r--r--khtml/rendering/render_frames.cpp35
-rw-r--r--kimgio/Makefile.am18
-rw-r--r--kinit/Makefile.am2
-rw-r--r--kinit/autostart.cpp8
-rw-r--r--kinit/kinit.cpp10
-rw-r--r--kinit/kstartupconfig.cpp2
-rw-r--r--kinit/lnusertemp.c5
-rw-r--r--kinit/wrapper.c2
-rw-r--r--kio/Makefile.am5
-rw-r--r--kio/kfile/kfilespeedbar.cpp50
-rw-r--r--kio/kfile/kpropertiesdialog.cpp9
-rw-r--r--kio/kio/kdirwatch.cpp28
-rw-r--r--kio/kio/kdirwatch.cpp.orig1770
-rw-r--r--kio/kio/krun.cpp102
-rw-r--r--kio/kio/krun.h11
-rw-r--r--kio/kio/kservice.cpp33
-rw-r--r--kio/kio/kurlcompletion.cpp3
-rw-r--r--kio/kpasswdserver/Makefile.am2
-rw-r--r--kio/misc/Makefile.am2
-rwxr-xr-xkio/misc/fileshareset7
-rw-r--r--kio/misc/kdesasl/Makefile.am2
-rw-r--r--kio/misc/kntlm/Makefile.am2
-rw-r--r--kio/misc/kpac/Makefile.am4
-rw-r--r--kio/misc/kssld/Makefile.am2
-rw-r--r--kio/misc/kwalletd/Makefile.am2
-rw-r--r--kio/misc/kwalletd/kwalletd.cpp48
-rw-r--r--kioslave/bzip2/Makefile.am2
-rw-r--r--kioslave/file/Makefile.am2
-rw-r--r--kioslave/file/file.cc8
-rw-r--r--kioslave/ftp/Makefile.am2
-rw-r--r--kioslave/gzip/Makefile.am2
-rw-r--r--kioslave/http/Makefile.am6
-rw-r--r--kioslave/http/kcookiejar/Makefile.am4
-rw-r--r--kioslave/metainfo/Makefile.am2
-rw-r--r--kjs/configure.in.in4
-rw-r--r--kjs/dtoa.cpp247
-rw-r--r--kmdi/Makefile.am2
-rw-r--r--kmdi/kmdi/Makefile.am2
-rw-r--r--knewstuff/Makefile.am2
-rw-r--r--kparts/Makefile.am2
-rw-r--r--kresources/Makefile.am4
-rw-r--r--kspell2/Makefile.am1
-rw-r--r--kspell2/plugins/aspell/Makefile.am2
-rw-r--r--kspell2/plugins/hspell/Makefile.am2
-rw-r--r--kspell2/plugins/ispell/Makefile.am2
-rw-r--r--kspell2/tests/Makefile.am4
-rw-r--r--kspell2/ui/Makefile.am2
-rw-r--r--kstyles/highcolor/Makefile.am2
-rw-r--r--kstyles/highcontrast/Makefile.am2
-rw-r--r--kstyles/highcontrast/config/Makefile.am2
-rw-r--r--kstyles/keramik/Makefile.am2
-rw-r--r--kstyles/kthemestyle/Makefile.am2
-rw-r--r--kstyles/plastik/Makefile.am2
-rw-r--r--kstyles/plastik/config/Makefile.am2
-rw-r--r--kstyles/utils/installtheme/Makefile.am2
-rw-r--r--kunittest/Makefile.am2
-rw-r--r--kutils/Makefile.am2
-rw-r--r--kutils/kcmoduleinfo.cpp4
-rw-r--r--kutils/kcmoduleloader.cpp20
-rw-r--r--kwallet/client/Makefile.am2
-rw-r--r--libkmid/Makefile.am2
-rw-r--r--libkmid/fmout.cc12
-rw-r--r--libkscreensaver/Makefile.am2
-rw-r--r--libltdl/ltdl.c1
-rw-r--r--mimetypes/application/Makefile.am20
-rw-r--r--mimetypes/application/vnd.ms-access.desktop9
-rw-r--r--mimetypes/application/vnd.ms-excel.addin.macroEnabled.12.desktop89
-rw-r--r--mimetypes/application/vnd.ms-excel.desktop1
-rw-r--r--mimetypes/application/vnd.ms-excel.sheet.binary.macroEnabled.12.desktop89
-rw-r--r--mimetypes/application/vnd.ms-excel.sheet.macroEnabled.12.desktop89
-rw-r--r--mimetypes/application/vnd.ms-excel.template.macroEnabled.12.desktop89
-rw-r--r--mimetypes/application/vnd.ms-powerpoint.addin.macroEnabled.12.desktop86
-rw-r--r--mimetypes/application/vnd.ms-powerpoint.desktop1
-rw-r--r--mimetypes/application/vnd.ms-powerpoint.presentation.macroEnabled.12.desktop86
-rw-r--r--mimetypes/application/vnd.ms-powerpoint.slideshow.macroEnabled.12.desktop86
-rw-r--r--mimetypes/application/vnd.ms-powerpoint.template.macroEnabled.12.desktop86
-rw-r--r--mimetypes/application/vnd.ms-word.desktop1
-rw-r--r--mimetypes/application/vnd.ms-word.document.macroEnabled.12.desktop91
-rw-r--r--mimetypes/application/vnd.ms-word.template.macroEnabled.12.desktop91
-rw-r--r--mimetypes/application/vnd.oasis.opendocument.database.desktop9
-rw-r--r--mimetypes/application/vnd.openxmlformats-officedocument.presentationml.presentation.desktop86
-rw-r--r--mimetypes/application/vnd.openxmlformats-officedocument.presentationml.slideshow.desktop86
-rw-r--r--mimetypes/application/vnd.openxmlformats-officedocument.presentationml.template.desktop86
-rw-r--r--mimetypes/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.desktop89
-rw-r--r--mimetypes/application/vnd.openxmlformats-officedocument.spreadsheetml.template.desktop89
-rw-r--r--mimetypes/application/vnd.openxmlformats-officedocument.wordprocessingml.document.desktop91
-rw-r--r--mimetypes/application/vnd.openxmlformats-officedocument.wordprocessingml.template.desktop91
-rw-r--r--mimetypes/application/x-nzb.desktop11
-rw-r--r--pics/Makefile.am2
202 files changed, 5893 insertions, 1001 deletions
diff --git a/Makefile.am.in b/Makefile.am.in
index ce881c64f..2cca5003a 100644
--- a/Makefile.am.in
+++ b/Makefile.am.in
@@ -18,7 +18,7 @@
# Boston, MA 02110-1301, USA.
-COMPILE_FIRST = dcop libltdl kdefx kdecore kunittest kdeui kdesu kjs kwallet kio
+COMPILE_FIRST = dcop libltdl kdefx kdecore kunittest kdeui kdesu kjs kwallet kio kded kded_post
COMPILE_BEFORE_doc = kdoctools
COMPILE_AFTER_kparts = kspell2 kmdi kdeprint kinit kate interfaces kcert khtml
COMPILE_AFTER_kdeprint = kate khtml
diff --git a/arts/kde/Makefile.am b/arts/kde/Makefile.am
index 5a933ba68..f402c136f 100644
--- a/arts/kde/Makefile.am
+++ b/arts/kde/Makefile.am
@@ -8,7 +8,7 @@ libartskde_la_SOURCES = artskde.cc kioinputstream_impl.cpp kplayobject.cc \
kartsserver.cpp kdatarequest_impl.cpp kaudioconverter.cc \
kvideowidget.cpp kplayobjectcreator.cc \
kaudiomanagerplay.cpp
-libartskde_la_LIBADD = $(LIB_KIO) -lqtmcop -lsoundserver_idl
+libartskde_la_LIBADD = $(LIB_KIO) -lqtmcop -lsoundserver_idl -lartsflow_idl -lmcop $(LIB_QT) $(LIB_KDECORE) -lkmedia2_idl -lartsflow $(LIB_KDEUI) $(LIB_X11)
libartskde_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 3:0:2
libartskde_la_METASOURCES = AUTO
libartskde_la_COMPILE_FIRST = artskde.h
diff --git a/arts/knotify/Makefile.am b/arts/knotify/Makefile.am
index bf743ce45..fd2a9c48e 100644
--- a/arts/knotify/Makefile.am
+++ b/arts/knotify/Makefile.am
@@ -7,7 +7,7 @@ kde_module_LTLIBRARIES = knotify.la
knotify_la_SOURCES = knotify.cpp knotify.skel
if include_ARTS
-knotify_la_LIBADD = -lsoundserver_idl -lqtmcop $(LIB_KDEUI) $(top_builddir)/arts/kde/libartskde.la
+knotify_la_LIBADD = -lsoundserver_idl $(LIB_KDEUI) $(top_builddir)/arts/kde/libartskde.la $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_KDECORE) -lartsflow_idl -lmcop
endif
knotify_la_LDFLAGS = $(all_libraries) -module -avoid-version
knotify_la_METASOURCES = AUTO
diff --git a/configure.in.in b/configure.in.in
index 35d0907ad..6548b353e 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -19,6 +19,8 @@ AC_ARG_PROGRAM
dnl Automake doc recommends to do this only here. (Janos)
AM_INIT_AUTOMAKE(@MODULENAME@, @VERSION@) dnl searches for some needed programs
+AM_MAINTAINER_MODE
+
AC_PROG_INSTALL
dnl generate the config header
@@ -46,7 +48,7 @@ dnl Checks for header files.
KDE_CHECK_STL
AC_HEADER_DIRENT
AC_HEADER_STDC
-AC_CHECK_HEADERS(sys/param.h sys/mman.h sys/time.h sysent.h strings.h sys/stat.h sys/select.h paths.h malloc.h limits.h sys/soundcard.h dlfcn.h termios.h)
+AC_CHECK_HEADERS(sys/param.h sys/mman.h sys/time.h sysent.h strings.h sys/stat.h sys/select.h paths.h malloc.h limits.h sys/soundcard.h dlfcn.h termios.h sys/prctl.h)
AC_ARG_WITH(acl,
[AC_HELP_STRING(--with-acl,
@@ -162,7 +164,7 @@ AC_CHECK_RANDOM
AC_CHECK_MKSTEMPS
AC_CHECK_MKSTEMP
AC_CHECK_MKDTEMP
-AC_CHECK_FUNCS(strtoll socket seteuid setegid strfmon stpcpy gettimeofday readdir_r setpriority)
+AC_CHECK_FUNCS(strtoll socket seteuid setegid strfmon stpcpy gettimeofday readdir_r setpriority tcgetattr tcsetattr)
AH_BOTTOM([
/* provide a definition for a 32 bit entity, usable as a typedef, possibly
diff --git a/dcop/Makefile.am b/dcop/Makefile.am
index 8dfa033ad..223d1c00b 100644
--- a/dcop/Makefile.am
+++ b/dcop/Makefile.am
@@ -46,7 +46,7 @@ libDCOP_la_SOURCES = dcopstub.cpp dcopref.cpp dcopobject.cpp dcopclient.cpp
kdeinit_LTLIBRARIES = dcopserver.la
dcopserver_la_LDFLAGS = -module -avoid-version $(all_libraries)
dcopserver_la_SOURCES = dcopserver.cpp dcopsignals.cpp
-dcopserver_la_LIBADD = libDCOP.la
+dcopserver_la_LIBADD = libDCOP.la $(LIB_QT)
dcopserver_shutdown_SOURCES = dcopserver_shutdown.c
diff --git a/dcop/dcopidlng/dcopidlng b/dcop/dcopidlng/dcopidlng
index 073614242..92ff412a1 100755
--- a/dcop/dcopidlng/dcopidlng
+++ b/dcop/dcopidlng/dcopidlng
@@ -1,15 +1,16 @@
#!/bin/sh
-trap "rm -f dcopidlng.stderr.$$" 0 1 2 15
+tmpfile=`mktemp -t dcopidlng.XXXXXX` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
+trap " [ -f \"$tmpfile\" ] && /bin/rm -f -- \"$tmpfile\"" 0 1 2 3 13 15
if test -z "$KDECONFIG"; then
KDECONFIG=kde-config
fi
LIBDIR="`$KDECONFIG --install data --expandvars`/dcopidlng"
-perl -I"$LIBDIR" "$LIBDIR/kalyptus" --allow_k_dcop_accessors -f dcopidl $1 2> dcopidlng.stderr.$$
+perl -I"$LIBDIR" "$LIBDIR/kalyptus" --allow_k_dcop_accessors -f dcopidl $1 2> $tmpfile
RET=$?
if [ $RET -ne 0 ]
then
- cat dcopidlng.stderr.$$ >&2
+ cat $tmpfile >&2
fi
exit $RET
diff --git a/dnssd/Makefile.am b/dnssd/Makefile.am
index 5c9edb9c4..268e72a5d 100644
--- a/dnssd/Makefile.am
+++ b/dnssd/Makefile.am
@@ -1,5 +1,5 @@
# set the include path for X, qt and KDE
-INCLUDES = -I$(top_srcdir) $(all_includes)
+INCLUDES = -I$(top_srcdir) $(all_includes) $(AVAHI_CFLAGS)
# these are the headers for your project
noinst_HEADERS = sdevent.h
@@ -14,7 +14,7 @@ libkdnssd_la_SOURCES = remoteservice.cpp responder.cpp servicebase.cpp \
dnssdincludedir = $(includedir)/dnssd
dnssdinclude_HEADERS = domainbrowser.h query.h remoteservice.h \
publicservice.h servicebase.h servicebrowser.h settings.h
-libkdnssd_la_LIBADD = ../kdecore/libkdecore.la $(LIB_DNSSD)
+libkdnssd_la_LIBADD = ../kdecore/libkdecore.la $(AVAHI_LIBS) $(LIB_QT)
libkdnssd_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -version-info 1:0
#kde_kcfg_DATA = kcm_kdnssd.kcfg
diff --git a/dnssd/README b/dnssd/README
index fd085df95..c797b2939 100644
--- a/dnssd/README
+++ b/dnssd/README
@@ -1,12 +1,11 @@
Checklist to ensure that zeroconf will work:
-1) Install Apple's mdnsd, at least version 85
-2) kdelibs (and kdebase for ksysguard) should be configured and compiled with dns_sd sdk (part
-of mdnsd installation) present - config.h should contain '#define HAVE_DNSSD 1'
+1) Install Avahi, at least version 0.3
+2) compile kdnssd-avahi and install it to replace 'stub' libkdnssd.so provided by kdelibs
3) check /etc/nsswitch.conf and ensure that there is 'mdns' before 'dns' in
line starting with 'host:'. It should be something like:
host: files mdns dns
-4) ensure that mdnsd is being started in initscripts
+4) ensure that avahi-daemon is being started in initscripts
5) for testing: use kpf kicker applet to publish a directory, then open 'zeroconf:/'
URL in konqueror. You should be able to see a local webserver with that published dir.
diff --git a/dnssd/configure.in.in b/dnssd/configure.in.in
index 022ffe871..4eac2441a 100644
--- a/dnssd/configure.in.in
+++ b/dnssd/configure.in.in
@@ -1,38 +1,17 @@
#MIN_CONFIG
-AC_ARG_ENABLE(dnssd, [ --disable-dnssd don't require libdns_sd (browsing and publishing DNS-SD services will not be possible) ], with_dnssd=$enableval, with_dnssd=yes)
-if test "$with_dnssd" = "yes"; then
-AC_MSG_CHECKING(for DNS-SD support)
-save_dnssdtest_LIBS="$LIBS"
-save_dnssdtest_LDFLAGS="$LDFLAGS"
-save_dnssdtest_CPPFLAGS="$CPPFLAGS"
-LDFLAGS="$all_libraries $LDFLAGS"
-CPPFLAGS="$CPPFLAGS $all_includes"
-case $host_os in
- darwin*) LIBS="" ;;
- *) LIBS="-ldns_sd" ;;
-esac
-have_libdns_sd="no"
-AC_TRY_LINK( [
- #include <dns_sd.h>
- ],[
- DNSServiceRefDeallocate( (DNSServiceRef) 0);
- TXTRecordDeallocate( (TXTRecordRef*) 0);
- ],[
- AC_DEFINE(HAVE_DNSSD,1,[Define if dns-sd is available])
- case $host_os in
- darwin*) LIB_DNSSD="" ;;
- *) LIB_DNSSD="-ldns_sd" ;;
- esac
- have_libdns_sd="yes"
- AC_MSG_RESULT(yes)
- ],[
- AC_MSG_RESULT(no)
- LIB_DNSSD=""
-])
-CPPFLAGS=$save_dnssdtest_CPPFLAGS
-LDFLAGS=$save_dnssdtest_LDFLAGS
-LIBS=$save_dnssdtest_LIBS
+# Check for pkg-config manually first, as if its not installed the
+# PKG_PROG_PKG_CONFIG macro won't be defined.
+m4_pattern_allow(PKG_CONFIG_MIN_VERSION)
+AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
+
+if test x"$have_pkg_config" == xno; then
+ AC_MSG_ERROR(pkg-config is required to install this program)
fi
-AC_SUBST(LIB_DNSSD)
-AM_CONDITIONAL(HAVE_DNSSD, test "$have_libdns_sd" = "yes")
+
+PKG_PROG_PKG_CONFIG
+
+PKG_CHECK_MODULES( AVAHI, [ avahi-qt3 >= 0.4 , avahi-client >= 0.4 ])
+AC_SUBST(AVAHI_CFLAGS)
+AC_SUBST(AVAHI_LIBS)
+PKG_CHECK_EXISTS( [ avahi-client >= 0.6], AC_DEFINE(AVAHI_API_0_6,1,[Avahi API 0.6] ) )
diff --git a/dnssd/domainbrowser.cpp b/dnssd/domainbrowser.cpp
index cad3307dd..294ce2576 100644
--- a/dnssd/domainbrowser.cpp
+++ b/dnssd/domainbrowser.cpp
@@ -27,46 +27,56 @@
#include "query.h"
#include "servicebrowser.h"
#include <kapplication.h>
+#ifdef AVAHI_API_0_6
+#include <avahi-client/lookup.h>
+#endif
namespace DNSSD
{
-#ifdef HAVE_DNSSD
-void domain_callback(DNSServiceRef, DNSServiceFlags flags, uint32_t, DNSServiceErrorType errorCode,
- const char *replyDomain, void *context);
+#ifdef AVAHI_API_0_6
+void domains_callback(AvahiDomainBrowser*, AvahiIfIndex, AvahiProtocol, AvahiBrowserEvent event, const char* replyDomain,
+ AvahiLookupResultFlags, void* context);
+#else
+void domains_callback(AvahiDomainBrowser*, AvahiIfIndex, AvahiProtocol, AvahiBrowserEvent event, const char* replyDomain,
+ void* context);
#endif
-class DomainBrowserPrivate : public Responder
+
+class DomainBrowserPrivate
{
public:
- DomainBrowserPrivate(DomainBrowser* owner) : Responder(), m_browseLAN(false), m_started(false), m_owner(owner) {}
+ DomainBrowserPrivate(DomainBrowser* owner) : m_browseLAN(false), m_started(false),
+ m_browser(0), m_owner(owner) {}
+ ~DomainBrowserPrivate() { if (m_browser) avahi_domain_browser_free(m_browser); }
QStringList m_domains;
virtual void customEvent(QCustomEvent* event);
bool m_browseLAN;
bool m_started;
+ AvahiDomainBrowser* m_browser;
DomainBrowser* m_owner;
};
void DomainBrowserPrivate::customEvent(QCustomEvent* event)
{
- if (event->type()==QEvent::User+SD_ERROR) stop();
if (event->type()==QEvent::User+SD_ADDREMOVE) {
AddRemoveEvent *aev = static_cast<AddRemoveEvent*>(event);
if (aev->m_op==AddRemoveEvent::Add) m_owner->gotNewDomain(aev->m_domain);
else m_owner->gotRemoveDomain(aev->m_domain);
}
}
+
DomainBrowser::DomainBrowser(QObject *parent) : QObject(parent)
{
d = new DomainBrowserPrivate(this);
- d->m_domains = Configuration::domainList();
+ d->m_domains = Configuration::domainList();
if (Configuration::browseLocal()) {
d->m_domains+="local.";
d->m_browseLAN=true;
}
- connect(KApplication::kApplication(),SIGNAL(kipcMessage(int,int)),this,
- SLOT(domainListChanged(int,int)));
+ connect(KApplication::kApplication(),SIGNAL(kipcMessage(int,int)),this,
+ SLOT(domainListChanged(int,int)));
}
DomainBrowser::DomainBrowser(const QStringList& domains, bool recursive, QObject *parent) : QObject(parent)
@@ -88,14 +98,15 @@ void DomainBrowser::startBrowse()
if (d->m_started) return;
d->m_started=true;
if (ServiceBrowser::isAvailable()!=ServiceBrowser::Working) return;
- QStringList::const_iterator itEnd = d->m_domains.end();
+ QStringList::const_iterator itEnd = d->m_domains.end();
for (QStringList::const_iterator it=d->m_domains.begin(); it!=itEnd; ++it ) emit domainAdded(*it);
-#ifdef HAVE_DNSSD
- if (d->m_browseLAN) {
- DNSServiceRef ref;
- if (DNSServiceEnumerateDomains(&ref,kDNSServiceFlagsBrowseDomains,0,domain_callback,
- reinterpret_cast<void*>(d))==kDNSServiceErr_NoError) d->setRef(ref);
- }
+ if (d->m_browseLAN)
+#ifdef AVAHI_API_0_6
+ d->m_browser = avahi_domain_browser_new(Responder::self().client(), AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC,
+ "local.", AVAHI_DOMAIN_BROWSER_BROWSE, (AvahiLookupFlags)0, domains_callback, this);
+#else
+ d->m_browser = avahi_domain_browser_new(Responder::self().client(), AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC,
+ "local.", AVAHI_DOMAIN_BROWSER_BROWSE, domains_callback, this);
#endif
}
@@ -115,9 +126,14 @@ void DomainBrowser::gotRemoveDomain(const QString& domain)
void DomainBrowser::domainListChanged(int message,int)
{
if (message!=KIPCDomainsChanged) return;
+
bool was_started = d->m_started;
- if (d->isRunning()) d->stop(); // LAN query
+ if (d->m_browser) {
+ avahi_domain_browser_free(d->m_browser); // LAN query
+ d->m_browser=0;
+ }
d->m_started = false;
+
// remove all domains and resolvers
if (was_started) {
QStringList::const_iterator itEnd = d->m_domains.end();
@@ -129,7 +145,7 @@ void DomainBrowser::domainListChanged(int message,int)
Configuration::self()->readConfig();
d->m_browseLAN = Configuration::browseLocal();
d->m_domains = Configuration::domainList();
- if (Configuration::browseLocal()) d->m_domains+="local.";
+ if (Configuration::browseLocal()) d->m_domains+="local";
// this will emit domainAdded() for every domain if necessary
if (was_started) startBrowse();
}
@@ -147,22 +163,21 @@ bool DomainBrowser::isRunning() const
void DomainBrowser::virtual_hook(int, void*)
{}
-#ifdef HAVE_DNSSD
-void domain_callback(DNSServiceRef, DNSServiceFlags flags, uint32_t, DNSServiceErrorType errorCode,
- const char *replyDomain, void *context)
+#ifdef AVAHI_API_0_6
+void domains_callback(AvahiDomainBrowser*, AvahiIfIndex, AvahiProtocol, AvahiBrowserEvent event, const char* replyDomain,
+ AvahiLookupResultFlags,void* context)
+#else
+void domains_callback(AvahiDomainBrowser*, AvahiIfIndex, AvahiProtocol, AvahiBrowserEvent event, const char* replyDomain,
+ void* context)
+#endif
{
QObject *obj = reinterpret_cast<QObject*>(context);
- if (errorCode != kDNSServiceErr_NoError) {
- ErrorEvent err;
- QApplication::sendEvent(obj, &err);
- } else {
- AddRemoveEvent arev((flags & kDNSServiceFlagsAdd) ? AddRemoveEvent::Add :
+ AddRemoveEvent* arev=new AddRemoveEvent((event==AVAHI_BROWSER_NEW) ? AddRemoveEvent::Add :
AddRemoveEvent::Remove, QString::null, QString::null,
- DNSToDomain(replyDomain), !(flags & kDNSServiceFlagsMoreComing));
- QApplication::sendEvent(obj, &arev);
- }
+ DNSToDomain(replyDomain));
+ QApplication::postEvent(obj, arev);
}
-#endif
+
}
#include "domainbrowser.moc"
diff --git a/dnssd/publicservice.cpp b/dnssd/publicservice.cpp
index 7ba749c53..ad1ebdbb6 100644
--- a/dnssd/publicservice.cpp
+++ b/dnssd/publicservice.cpp
@@ -30,6 +30,12 @@
#include <network/ksocketaddress.h>
#include <kurl.h>
#include <unistd.h>
+#include <avahi-client/client.h>
+#ifdef AVAHI_API_0_6
+#include <avahi-client/publish.h>
+#endif
+#include <avahi-common/alternative.h>
+#include <avahi-common/strlst.h>
#include "sdevent.h"
#include "responder.h"
#include "servicebrowser.h"
@@ -38,16 +44,23 @@
namespace DNSSD
{
static unsigned long publicIP();
-#ifdef HAVE_DNSSD
-void publish_callback (DNSServiceRef, DNSServiceFlags, DNSServiceErrorType errorCode, const char *name,
- const char*, const char*, void *context);
-#endif
-class PublicServicePrivate : public Responder
+
+void publish_callback (AvahiEntryGroup*, AvahiEntryGroupState s, void *context);
+
+class PublicServicePrivate
{
public:
- PublicServicePrivate() : m_published(false)
+ PublicServicePrivate() : m_published(false), m_running(false), m_collision(false), m_group(false)
{}
bool m_published;
+ bool m_running;
+ bool m_collision;
+ AvahiEntryGroup* m_group;
+ void commit()
+ {
+ if (!m_collision) avahi_entry_group_commit(m_group);
+ }
+
};
PublicService::PublicService(const QString& name, const QString& type, unsigned int port,
@@ -55,6 +68,10 @@ PublicService::PublicService(const QString& name, const QString& type, unsigned
: QObject(), ServiceBase(name, type, QString::null, domain, port)
{
d = new PublicServicePrivate;
+ if (Responder::self().client()) {
+ d->m_group = avahi_entry_group_new(Responder::self().client(), publish_callback,this);
+ connect(&Responder::self(),SIGNAL(stateChanged(AvahiClientState)),this,SLOT(clientState(AvahiClientState)));
+ }
if (domain.isNull())
if (Configuration::publishType()==Configuration::EnumPublishType::LAN) m_domain="local.";
else m_domain=Configuration::publishDomain();
@@ -63,114 +80,148 @@ PublicService::PublicService(const QString& name, const QString& type, unsigned
PublicService::~PublicService()
{
- stop();
+ if (d->m_group) avahi_entry_group_free(d->m_group);
delete d;
}
+void PublicService::tryApply()
+{
+ if (fillEntryGroup()) d->commit();
+ else {
+ stop();
+ emit published(false);
+ }
+}
+
void PublicService::setServiceName(const QString& serviceName)
{
m_serviceName = serviceName;
- if (d->isRunning()) {
- stop();
- publishAsync();
- }
+ if (d->m_running) {
+ avahi_entry_group_reset(d->m_group);
+ tryApply();
+ }
}
void PublicService::setDomain(const QString& domain)
{
m_domain = domain;
- if (d->isRunning()) {
- stop();
- publishAsync();
- }
+ if (d->m_running) {
+ avahi_entry_group_reset(d->m_group);
+ tryApply();
+ }
}
void PublicService::setType(const QString& type)
{
m_type = type;
- if (d->isRunning()) {
- stop();
- publishAsync();
- }
+ if (d->m_running) {
+ avahi_entry_group_reset(d->m_group);
+ tryApply();
+ }
}
void PublicService::setPort(unsigned short port)
{
m_port = port;
- if (d->isRunning()) {
- stop();
- publishAsync();
- }
+ if (d->m_running) {
+ avahi_entry_group_reset(d->m_group);
+ tryApply();
+ }
}
-bool PublicService::isPublished() const
+void PublicService::setTextData(const QMap<QString,QString>& textData)
{
- return d->m_published;
+ m_textData = textData;
+ if (d->m_running) {
+ avahi_entry_group_reset(d->m_group);
+ tryApply();
+ }
}
-void PublicService::setTextData(const QMap<QString,QString>& textData)
+bool PublicService::isPublished() const
{
- m_textData = textData;
- if (d->isRunning()) {
- stop();
- publishAsync();
- }
+ return d->m_published;
}
bool PublicService::publish()
{
publishAsync();
- while (d->isRunning() && !d->m_published) d->process();
+ while (d->m_running && !d->m_published) Responder::self().process();
return d->m_published;
}
void PublicService::stop()
{
- d->stop();
- d->m_published = false;
+ if (d->m_group) avahi_entry_group_reset(d->m_group);
+ d->m_published = false;
+}
+bool PublicService::fillEntryGroup()
+{
+ AvahiStringList *s=0;
+ QMap<QString,QString>::ConstIterator itEnd = m_textData.end();
+ for (QMap<QString,QString>::ConstIterator it = m_textData.begin(); it!=itEnd ; ++it)
+ s = avahi_string_list_add_pair(s, it.key().utf8(),it.data().utf8());
+#ifdef AVAHI_API_0_6
+ bool res = (!avahi_entry_group_add_service_strlst(d->m_group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, (AvahiPublishFlags)0,
+ m_serviceName.isNull() ? avahi_client_get_host_name(Responder::self().client()) : m_serviceName.utf8().data(),
+ m_type.ascii(),domainToDNS(m_domain),m_hostName.utf8(),m_port,s));
+#else
+ bool res = (!avahi_entry_group_add_service_strlst(d->m_group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC,
+ m_serviceName.isNull() ? avahi_client_get_host_name(Responder::self().client()) : m_serviceName.utf8().data(),
+ m_type.ascii(),m_domain.utf8(),m_hostName.utf8(),m_port,s));
+#endif
+ avahi_string_list_free(s);
+ return res;
}
+void PublicService::clientState(AvahiClientState s)
+{
+ if (!d->m_running) return;
+ switch (s) {
+#ifdef AVAHI_API_0_6
+ case AVAHI_CLIENT_FAILURE:
+#else
+ case AVAHI_CLIENT_S_INVALID:
+ case AVAHI_CLIENT_DISCONNECTED:
+#endif
+ stop();
+ emit published(false);
+ break;
+ case AVAHI_CLIENT_S_REGISTERING:
+ case AVAHI_CLIENT_S_COLLISION:
+ avahi_entry_group_reset(d->m_group);
+ d->m_collision=true;
+ break;
+ case AVAHI_CLIENT_S_RUNNING:
+ if (d->m_collision) {
+ d->m_collision=false;
+ tryApply();
+ }
+ }
+}
+
void PublicService::publishAsync()
{
- if (d->isRunning()) stop();
-#ifdef HAVE_DNSSD
- if (ServiceBrowser::isAvailable()==ServiceBrowser::Working) {
- TXTRecordRef txt;
- TXTRecordCreate(&txt,0,0);
- QMap<QString,QString>::ConstIterator itEnd = m_textData.end();
- for (QMap<QString,QString>::ConstIterator it = m_textData.begin(); it!=itEnd ; ++it) {
- QCString value = it.data().utf8();
- if (TXTRecordSetValue(&txt,it.key().utf8(),value.length(),value)!=kDNSServiceErr_NoError) {
- TXTRecordDeallocate(&txt);
- emit published(false);
- return;
- }
- }
- DNSServiceRef ref;
- if (DNSServiceRegister(&ref,0,0,m_serviceName.utf8(),m_type.ascii(),domainToDNS(m_domain),NULL,
- htons(m_port),TXTRecordGetLength(&txt),TXTRecordGetBytesPtr(&txt),publish_callback,
- reinterpret_cast<void*>(this)) == kDNSServiceErr_NoError) d->setRef(ref);
- TXTRecordDeallocate(&txt);
+ if (d->m_running) stop();
+
+ if (!d->m_group) {
+ emit published(false);
+ return;
}
-#endif
- if (!d->isRunning()) emit published(false);
+ AvahiClientState s=Responder::self().state();
+ d->m_running=true;
+ d->m_collision=true; // make it look like server is getting out of collision to force registering
+ clientState(s);
}
-#ifdef HAVE_DNSSD
-void publish_callback (DNSServiceRef, DNSServiceFlags, DNSServiceErrorType errorCode, const char *name,
- const char*, const char*, void *context)
+void publish_callback (AvahiEntryGroup*, AvahiEntryGroupState s, void *context)
{
QObject *obj = reinterpret_cast<QObject*>(context);
- if (errorCode != kDNSServiceErr_NoError) {
- ErrorEvent err;
- QApplication::sendEvent(obj, &err);
- } else {
- PublishEvent pev(QString::fromUtf8(name));
- QApplication::sendEvent(obj, &pev);
- }
+ if (s!=AVAHI_ENTRY_GROUP_ESTABLISHED && s!=AVAHI_ENTRY_GROUP_COLLISION) return;
+ PublishEvent* pev=new PublishEvent(s==AVAHI_ENTRY_GROUP_ESTABLISHED);
+ QApplication::postEvent(obj, pev);
}
-#endif
const KURL PublicService::toInvitation(const QString& host)
{
@@ -194,14 +245,13 @@ const KURL PublicService::toInvitation(const QString& host)
void PublicService::customEvent(QCustomEvent* event)
{
- if (event->type()==QEvent::User+SD_ERROR) {
- stop();
- emit published(false);
- }
if (event->type()==QEvent::User+SD_PUBLISH) {
+ if (!static_cast<PublishEvent*>(event)->m_ok) {
+ setServiceName(QString::fromUtf8(avahi_alternative_service_name(m_serviceName.utf8())));
+ return;
+ }
d->m_published=true;
emit published(true);
- m_serviceName = static_cast<PublishEvent*>(event)->m_name;
}
}
diff --git a/dnssd/publicservice.h b/dnssd/publicservice.h
index 480f071ee..ff090d354 100644
--- a/dnssd/publicservice.h
+++ b/dnssd/publicservice.h
@@ -23,6 +23,7 @@
#include <qobject.h>
#include <dnssd/servicebase.h>
+#include <avahi-client/client.h>
class KURL;
namespace DNSSD
@@ -137,6 +138,10 @@ signals:
void published(bool);
private:
PublicServicePrivate *d;
+ bool fillEntryGroup();
+ void tryApply();
+private slots:
+ void clientState(AvahiClientState);
protected:
virtual void customEvent(QCustomEvent* event);
diff --git a/dnssd/query.cpp b/dnssd/query.cpp
index bcb9c69f5..27b297816 100644
--- a/dnssd/query.cpp
+++ b/dnssd/query.cpp
@@ -22,26 +22,46 @@
#include "responder.h"
#include "remoteservice.h"
#include "sdevent.h"
-#include <kdebug.h>
+#include <qdatetime.h>
#include <qapplication.h>
#include <qtimer.h>
-#define TIMEOUT_WAN 2000
+#include <avahi-client/client.h>
+#ifdef AVAHI_API_0_6
+#include <avahi-client/lookup.h>
+#endif
+
#define TIMEOUT_LAN 200
namespace DNSSD
{
-#ifdef HAVE_DNSSD
-void query_callback (DNSServiceRef, DNSServiceFlags flags, uint32_t, DNSServiceErrorType errorCode,
- const char *serviceName, const char *regtype, const char *replyDomain, void *context);
+#ifdef AVAHI_API_0_6
+
+void services_callback(AvahiServiceBrowser*, AvahiIfIndex, AvahiProtocol, AvahiBrowserEvent event, const char* name,
+ const char* regtype, const char* domain, AvahiLookupResultFlags, void* context);
+void types_callback(AvahiServiceTypeBrowser*, AvahiIfIndex, AvahiProtocol, AvahiBrowserEvent event, const char* regtype,
+ const char* replyDomain, AvahiLookupResultFlags, void* context);
+#else
+void services_callback(AvahiServiceBrowser*, AvahiIfIndex, AvahiProtocol, AvahiBrowserEvent event, const char* name,
+ const char* regtype, const char* domain, void* context);
+void types_callback(AvahiServiceTypeBrowser*, AvahiIfIndex, AvahiProtocol, AvahiBrowserEvent event, const char* regtype,
+ const char* replyDomain, void* context);
+void domains_callback(AvahiDomainBrowser*, AvahiIfIndex, AvahiProtocol, AvahiBrowserEvent event, const char* replyDomain,
+ void* context);
#endif
-class QueryPrivate : public Responder
+
+enum BrowserType { Types, Services };
+
+class QueryPrivate
{
public:
- QueryPrivate(const QString& type, const QString& domain) : Responder(), m_finished(false),
- m_domain(domain), m_type(type)
- {};
+ QueryPrivate(const QString& type, const QString& domain) : m_finished(false), m_browser(0),
+ m_running(false), m_domain(domain), m_type(type) {}
+
bool m_finished;
+ BrowserType m_browserType;
+ void* m_browser;
+ bool m_running;
QString m_domain;
QTimer timeout;
QString m_type;
@@ -56,12 +76,18 @@ Query::Query(const QString& type, const QString& domain)
Query::~Query()
{
+ if (d->m_browser) {
+ switch (d->m_browserType) {
+ case Services: avahi_service_browser_free((AvahiServiceBrowser*)d->m_browser); break;
+ case Types: avahi_service_type_browser_free((AvahiServiceTypeBrowser*)d->m_browser); break;
+ }
+ }
delete d;
}
bool Query::isRunning() const
{
- return d->isRunning();
+ return d->m_running;
}
bool Query::isFinished() const
@@ -76,16 +102,31 @@ const QString& Query::domain() const
void Query::startQuery()
{
- if (d->isRunning()) return;
+ if (d->m_running) return;
d->m_finished = false;
-#ifdef HAVE_DNSSD
- DNSServiceRef ref;
- if (DNSServiceBrowse(&ref,0,0, d->m_type.ascii(),
- domainToDNS(d->m_domain),query_callback,reinterpret_cast<void*>(this))
- == kDNSServiceErr_NoError) d->setRef(ref);
+ if (d->m_type=="_services._dns-sd._udp") {
+ d->m_browserType = Types;
+#ifdef AVAHI_API_0_6
+ d->m_browser = avahi_service_type_browser_new(Responder::self().client(), AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC,
+ domainToDNS(d->m_domain), (AvahiLookupFlags)0, types_callback, this);
+#else
+ d->m_browser = avahi_service_type_browser_new(Responder::self().client(), AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC,
+ d->m_domain.utf8(), types_callback, this);
#endif
- if (!d->isRunning()) emit finished();
- else d->timeout.start(domainIsLocal(d->m_domain) ? TIMEOUT_LAN : TIMEOUT_WAN,true);
+ } else {
+ d->m_browserType = Services;
+#ifdef AVAHI_API_0_6
+ d->m_browser = avahi_service_browser_new(Responder::self().client(), AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC,
+ d->m_type.ascii(),domainToDNS(d->m_domain), (AvahiLookupFlags)0, services_callback,this);
+#else
+ d->m_browser = avahi_service_browser_new(Responder::self().client(), AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC,
+ d->m_type.ascii(),d->m_domain.utf8(),services_callback,this);
+#endif
+ }
+ if (d->m_browser) {
+ d->m_running=true;
+ d->timeout.start(TIMEOUT_LAN,true);
+ } else emit finished();
}
void Query::virtual_hook(int, void*)
{
@@ -93,24 +134,15 @@ void Query::virtual_hook(int, void*)
void Query::customEvent(QCustomEvent* event)
{
- if (event->type()==QEvent::User+SD_ERROR) {
- d->stop();
- d->m_finished=false;
- emit finished();
- }
if (event->type()==QEvent::User+SD_ADDREMOVE) {
- RemoteService* svr;
+ d->timeout.start(TIMEOUT_LAN,true);
+ d->m_finished=false;
AddRemoveEvent *aev = static_cast<AddRemoveEvent*>(event);
// m_type has useless trailing dot
- QString type=aev->m_type.left(aev->m_type.length()-1);
- // label is badly splitted here - _http _tcp.local. . - rely on decode()
- if (d->m_type=="_services._dns-sd._udp") svr = new RemoteService(aev->m_name+"."+
- type+"."+aev->m_domain);
- else svr = new RemoteService(aev->m_name, type, aev->m_domain);
+ RemoteService* svr = new RemoteService(aev->m_name,
+ aev->m_type,aev->m_domain);
if (aev->m_op==AddRemoveEvent::Add) emit serviceAdded(svr);
else emit serviceRemoved(svr);
- d->m_finished = aev->m_last;
- if (d->m_finished) emit finished();
}
}
@@ -119,22 +151,36 @@ void Query::timeout()
d->m_finished=true;
emit finished();
}
-#ifdef HAVE_DNSSD
-void query_callback (DNSServiceRef, DNSServiceFlags flags, uint32_t, DNSServiceErrorType errorCode,
- const char *serviceName, const char *regtype, const char *replyDomain,
- void *context)
+
+#ifdef AVAHI_API_0_6
+void services_callback (AvahiServiceBrowser*, AvahiIfIndex, AvahiProtocol, AvahiBrowserEvent event,
+ const char* serviceName, const char* regtype, const char* replyDomain, AvahiLookupResultFlags, void* context)
+#else
+void services_callback (AvahiServiceBrowser*, AvahiIfIndex, AvahiProtocol, AvahiBrowserEvent event,
+ const char* serviceName, const char* regtype, const char* replyDomain, void* context)
+#endif
{
QObject *obj = reinterpret_cast<QObject*>(context);
- if (errorCode != kDNSServiceErr_NoError) {
- ErrorEvent err;
- QApplication::sendEvent(obj, &err);
- } else {
- AddRemoveEvent arev((flags & kDNSServiceFlagsAdd) ? AddRemoveEvent::Add :
+ AddRemoveEvent* arev = new AddRemoveEvent((event==AVAHI_BROWSER_NEW) ? AddRemoveEvent::Add :
AddRemoveEvent::Remove, QString::fromUtf8(serviceName), regtype,
- DNSToDomain(replyDomain), !(flags & kDNSServiceFlagsMoreComing));
- QApplication::sendEvent(obj, &arev);
- }
+ DNSToDomain(replyDomain));
+ QApplication::postEvent(obj, arev);
}
+
+#ifdef AVAHI_API_0_6
+void types_callback(AvahiServiceTypeBrowser*, AvahiIfIndex, AvahiProtocol, AvahiBrowserEvent event, const char* regtype,
+ const char* replyDomain, AvahiLookupResultFlags, void* context)
+#else
+void types_callback(AvahiServiceTypeBrowser*, AvahiIfIndex, AvahiProtocol, AvahiBrowserEvent event, const char* regtype,
+ const char* replyDomain, void* context)
#endif
+{
+ QObject *obj = reinterpret_cast<QObject*>(context);
+ AddRemoveEvent* arev = new AddRemoveEvent((event==AVAHI_BROWSER_NEW) ? AddRemoveEvent::Add :
+ AddRemoveEvent::Remove, QString::null, regtype,
+ DNSToDomain(replyDomain));
+ QApplication::postEvent(obj, arev);
+}
+
}
#include "query.moc"
diff --git a/dnssd/remoteservice.cpp b/dnssd/remoteservice.cpp
index 9d3e4abb6..9fa1a3fe2 100644
--- a/dnssd/remoteservice.cpp
+++ b/dnssd/remoteservice.cpp
@@ -27,33 +27,39 @@
#include <sys/types.h>
#endif
#include <netinet/in.h>
+#include <avahi-client/client.h>
+#include <avahi-common/strlst.h>
+#ifdef AVAHI_API_0_6
+#include <avahi-client/lookup.h>
+#endif
#include "remoteservice.h"
#include "responder.h"
#include "sdevent.h"
-#include <kdebug.h>
namespace DNSSD
{
-#ifdef HAVE_DNSSD
-void resolve_callback ( DNSServiceRef,
- DNSServiceFlags,
- uint32_t,
- DNSServiceErrorType errorCode,
- const char*,
- const char *hosttarget,
- uint16_t port,
- uint16_t txtLen,
- const unsigned char *txtRecord,
- void *context
- );
-
+#ifdef AVAHI_API_0_6
+void resolve_callback(AvahiServiceResolver*, AvahiIfIndex, AvahiProtocol proto, AvahiResolverEvent e,
+ const char* name, const char* type, const char* domain, const char* hostname, const AvahiAddress* a,
+ uint16_t port, AvahiStringList* txt, AvahiLookupResultFlags, void* context);
+#else
+void resolve_callback(AvahiServiceResolver*, AvahiIfIndex, AvahiProtocol proto, AvahiResolverEvent e,
+ const char* name, const char* type, const char* domain, const char* hostname, const AvahiAddress* a,
+ uint16_t port, AvahiStringList* txt, void* context);
#endif
+
class RemoteServicePrivate : public Responder
{
public:
- RemoteServicePrivate() : Responder(), m_resolved(false)
- {};
+ RemoteServicePrivate() : m_resolved(false), m_running(false), m_resolver(0) {}
bool m_resolved;
+ bool m_running;
+ AvahiServiceResolver* m_resolver;
+ void stop() {
+ m_running = false;
+ if (m_resolver) avahi_service_resolver_free(m_resolver);
+ m_resolver=0;
+ }
};
RemoteService::RemoteService(const QString& label)
@@ -83,29 +89,33 @@ RemoteService::RemoteService(const KURL& url)
RemoteService::~RemoteService()
{
+ if (d->m_resolver) avahi_service_resolver_free(d->m_resolver);
delete d;
}
bool RemoteService::resolve()
{
resolveAsync();
- while (d->isRunning() && !d->m_resolved) d->process();
+ while (d->m_running && !d->m_resolved) Responder::self().process();
d->stop();
return d->m_resolved;
}
void RemoteService::resolveAsync()
{
- if (d->isRunning()) return;
+ if (d->m_running) return;
d->m_resolved = false;
- kdDebug() << this << ":Starting resolve of : " << m_serviceName << " " << m_type << " " << m_domain << "\n";
-#ifdef HAVE_DNSSD
- DNSServiceRef ref;
- if (DNSServiceResolve(&ref,0,0,m_serviceName.utf8(), m_type.ascii(),
- domainToDNS(m_domain),(DNSServiceResolveReply)resolve_callback,reinterpret_cast<void*>(this))
- == kDNSServiceErr_NoError) d->setRef(ref);
+ // FIXME: first protocol should be set?
+#ifdef AVAHI_API_0_6
+ d->m_resolver = avahi_service_resolver_new(Responder::self().client(),AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC,
+ m_serviceName.utf8(), m_type.ascii(), domainToDNS(m_domain), AVAHI_PROTO_UNSPEC, AVAHI_LOOKUP_NO_ADDRESS,
+ resolve_callback, this);
+#else
+ d->m_resolver = avahi_service_resolver_new(Responder::self().client(),AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC,
+ m_serviceName.utf8(), m_type.ascii(), m_domain.utf8(), AVAHI_PROTO_UNSPEC, resolve_callback, this);
#endif
- if (!d->isRunning()) emit resolved(false);
+ if (d->m_resolver) d->m_running=true;
+ else emit resolved(false);
}
bool RemoteService::isResolved() const
@@ -154,42 +164,33 @@ QDataStream & operator>> (QDataStream & s, RemoteService & a)
return s;
}
-
-#ifdef HAVE_DNSSD
-void resolve_callback ( DNSServiceRef,
- DNSServiceFlags,
- uint32_t,
- DNSServiceErrorType errorCode,
- const char*,
- const char *hosttarget,
- uint16_t port,
- uint16_t txtLen,
- const unsigned char *txtRecord,
- void *context
- )
+#ifdef AVAHI_API_0_6
+void resolve_callback(AvahiServiceResolver*, AvahiIfIndex, AvahiProtocol, AvahiResolverEvent e,
+ const char*, const char*, const char*, const char* hostname, const AvahiAddress*,
+ uint16_t port, AvahiStringList* txt, AvahiLookupResultFlags, void* context)
+#else
+void resolve_callback(AvahiServiceResolver*, AvahiIfIndex, AvahiProtocol, AvahiResolverEvent e,
+ const char*, const char*, const char*, const char* hostname, const AvahiAddress*,
+ uint16_t port, AvahiStringList* txt, void* context)
+#endif
{
QObject *obj = reinterpret_cast<QObject*>(context);
- if (errorCode != kDNSServiceErr_NoError) {
+ if (e != AVAHI_RESOLVER_FOUND) {
ErrorEvent err;
QApplication::sendEvent(obj, &err);
return;
}
- char key[256];
- int index=0;
- unsigned char valueLen;
- kdDebug() << "Resolve callback\n";
QMap<QString,QString> map;
- const void *voidValue = 0;
- while (TXTRecordGetItemAtIndex(txtLen,txtRecord,index++,256,key,&valueLen,
- &voidValue) == kDNSServiceErr_NoError)
- {
- if (voidValue) map[QString::fromUtf8(key)]=QString::fromUtf8((const char*)voidValue,valueLen);
- else map[QString::fromUtf8(key)]=QString::null;
- }
- ResolveEvent rev(DNSToDomain(hosttarget),ntohs(port),map);
+ while (txt) {
+ char *key, *value;
+ size_t size;
+ if (avahi_string_list_get_pair(txt,&key,&value,&size)) break;
+ map[QString::fromUtf8(key)]=(value) ? QString::fromUtf8(value) : QString::null;
+ txt = txt->next;
+ }
+ ResolveEvent rev(DNSToDomain(hostname),port,map);
QApplication::sendEvent(obj, &rev);
}
-#endif
}
diff --git a/dnssd/responder.cpp b/dnssd/responder.cpp
index 3721d3aae..43be68b28 100644
--- a/dnssd/responder.cpp
+++ b/dnssd/responder.cpp
@@ -20,62 +20,61 @@
#include "responder.h"
#include <qapplication.h>
+#include <qeventloop.h>
+#include <kstaticdeleter.h>
#include <kidna.h>
+#include <kdebug.h>
+#include <avahi-qt3/qt-watch.h>
-// dns_sd.h API should care about proper encoding of non-latin1 characters
-// but for now it does not
-#define IDN_BROKEN_IN_MDNSRESPONDER
namespace DNSSD
{
-Responder::Responder(DNSServiceRef ref,QObject *parent, const char *name)
- : QObject(parent, name), m_ref(0), m_socket(0)
+static KStaticDeleter<Responder> responder_sd;
+Responder* Responder::m_self = 0;
+
+void client_callback(AvahiClient *, AvahiClientState s, void* u)
{
- setRef(ref);
+ Responder *r = reinterpret_cast<Responder*>(u);
+ emit (r->stateChanged(s));
}
-
-void Responder::setRef(DNSServiceRef ref)
+
+
+Responder::Responder()
{
- if (m_socket || m_ref) stop();
- m_running = false;
- m_ref = ref;
- if (m_ref == 0 ) return;
-#ifdef HAVE_DNSSD
- int fd = DNSServiceRefSockFD(ref);
- if (fd == -1) return;
- m_socket = new QSocketNotifier(fd,QSocketNotifier::Read,this);
- connect(m_socket,SIGNAL(activated(int)),this,SLOT(process()));
- m_running = true;
+ int error;
+ const AvahiPoll* poll = avahi_qt_poll_get();
+#ifdef AVAHI_API_0_6
+ m_client = avahi_client_new(poll, AVAHI_CLIENT_IGNORE_USER_CONFIG,client_callback, this, &error);
+#else
+ m_client = avahi_client_new(poll, client_callback, this, &error);
#endif
+ if (!m_client) kdWarning() << "Failed to create avahi client" << endl;
}
+
Responder::~Responder()
{
- stop();
+ if (m_client) avahi_client_free(m_client);
}
-void Responder::stop()
+Responder& Responder::self()
{
- if (m_socket) delete m_socket;
- m_socket = 0;
-#ifdef HAVE_DNSSD
- if (m_ref) DNSServiceRefDeallocate(m_ref);
-#endif
- m_ref = 0;
- m_running = false;
-}
-
+ if (!m_self) responder_sd.setObject(m_self, new Responder);
+ return *m_self;
+}
void Responder::process()
{
-#ifdef HAVE_DNSSD
- if ( DNSServiceProcessResult(m_ref) != kDNSServiceErr_NoError) stop();
-#endif
+ qApp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
}
-bool Responder::isRunning() const
+AvahiClientState Responder::state() const
{
- return m_running;
+#ifdef AVAHI_API_0_6
+ return (m_client) ? (avahi_client_get_state(m_client)) : AVAHI_CLIENT_FAILURE;
+#else
+ return (m_client) ? (avahi_client_get_state(m_client)) : AVAHI_CLIENT_DISCONNECTED;
+#endif
}
bool domainIsLocal(const QString& domain)
@@ -85,22 +84,14 @@ bool domainIsLocal(const QString& domain)
QCString domainToDNS(const QString &domain)
{
-#ifdef IDN_BROKEN_IN_MDNSRESPONDER
if (domainIsLocal(domain)) return domain.utf8();
else return KIDNA::toAsciiCString(domain);
-#else
- return domain.utf8();
-#endif
}
QString DNSToDomain(const char* domain)
{
-#ifdef IDN_BROKEN_IN_MDNSRESPONDER
if (domainIsLocal(domain)) return QString::fromUtf8(domain);
else return KIDNA::toUnicode(domain);
-#else
- return QString::fromUtf8(domain);
-#endif
}
diff --git a/dnssd/responder.h b/dnssd/responder.h
index 6e36d3357..32ccb7a0b 100644
--- a/dnssd/responder.h
+++ b/dnssd/responder.h
@@ -25,12 +25,7 @@
#include <qsocketnotifier.h>
#include <qsignal.h>
#include <config.h>
-#ifdef HAVE_DNSSD
-#include <dns_sd.h>
-#else
-#define DNSServiceRef void*
-#endif
-
+#include <avahi-client/client.h>
namespace DNSSD
{
@@ -38,30 +33,28 @@ namespace DNSSD
This class should not be used directly.
@author Jakub Stachowski
-@short Internal class wrapping dns_sd.h interface
+@short Internal class wrapping avahi client
*/
class Responder : public QObject
{
Q_OBJECT
public:
- Responder(DNSServiceRef ref=0,QObject *parent = 0, const char *name = 0);
+ Responder();
~Responder();
- /**
- Returns true if it is possible to use mDNS service publishing and discovery.
- It needs mDNSResponder running.
- */
- bool isRunning() const;
- void setRef(DNSServiceRef ref);
- void stop();
-public slots:
+ static Responder& self();
+ AvahiClientState state() const;
+ AvahiClient* client() const { return m_client; }
void process();
-protected:
- DNSServiceRef m_ref;
- bool m_running;
- QSocketNotifier *m_socket;
+signals:
+ void stateChanged(AvahiClientState);
+private:
+ AvahiClient* m_client;
+ static Responder* m_self;
+ friend void client_callback(AvahiClient*, AvahiClientState, void*);
+
};
/* Utils functions */
@@ -71,6 +64,7 @@ bool domainIsLocal(const QString& domain);
QCString domainToDNS(const QString &domain);
QString DNSToDomain(const char* domain);
+
}
#endif
diff --git a/dnssd/sdevent.h b/dnssd/sdevent.h
index 5104839a7..8530e730f 100644
--- a/dnssd/sdevent.h
+++ b/dnssd/sdevent.h
@@ -41,24 +41,23 @@ class AddRemoveEvent : public QCustomEvent
public:
enum Operation { Add, Remove };
AddRemoveEvent(Operation op,const QString& name,const QString& type,
- const QString& domain, bool last) : QCustomEvent(QEvent::User+SD_ADDREMOVE),
- m_op(op), m_name(name), m_type(type), m_domain(domain), m_last(last)
+ const QString& domain) : QCustomEvent(QEvent::User+SD_ADDREMOVE),
+ m_op(op), m_name(name), m_type(type), m_domain(domain)
{}
const Operation m_op;
const QString m_name;
const QString m_type;
const QString m_domain;
- const bool m_last;
};
class PublishEvent : public QCustomEvent
{
public:
- PublishEvent(const QString& name) : QCustomEvent(QEvent::User+SD_PUBLISH), m_name(name)
+ PublishEvent(bool ok) : QCustomEvent(QEvent::User+SD_PUBLISH), m_ok(ok)
{}
- const QString m_name;
+ bool m_ok;
};
class ResolveEvent : public QCustomEvent
diff --git a/dnssd/servicebase.cpp b/dnssd/servicebase.cpp
index ef2943b95..7fd1ef802 100644
--- a/dnssd/servicebase.cpp
+++ b/dnssd/servicebase.cpp
@@ -34,7 +34,7 @@ ServiceBase::~ServiceBase()
QString ServiceBase::encode()
{
- return m_serviceName.replace("\\","\\\\").replace(".","\\.") + QString(".") + m_type +
+ return m_serviceName.replace(".","\\.").replace("\\","\\\\") + QString(".") + m_type +
QString(".") + m_domain;
}
diff --git a/dnssd/servicebrowser.cpp b/dnssd/servicebrowser.cpp
index 017dc8102..542580c1b 100644
--- a/dnssd/servicebrowser.cpp
+++ b/dnssd/servicebrowser.cpp
@@ -23,14 +23,11 @@
#include <qstringlist.h>
#include <qfile.h>
#include "domainbrowser.h"
+#include "responder.h"
#include "query.h"
#include "servicebrowser.h"
+#include <avahi-client/client.h>
#include <config.h>
-#ifdef HAVE_DNSSD
-#include <dns_sd.h>
-#endif
-
-#define MDNSD_PID "/var/run/mdnsd.pid"
namespace DNSSD
{
@@ -85,20 +82,12 @@ ServiceBrowser::ServiceBrowser(const QString& type,const QString& domain,int fla
const ServiceBrowser::State ServiceBrowser::isAvailable()
{
-#ifdef HAVE_DNSSD
- QFile f(MDNSD_PID);
- if (!f.open(IO_ReadOnly)) return Stopped; // no pidfile
- QString line;
- if (f.readLine(line,16)<1) return Stopped;
- unsigned int pid = line.toUInt();
- if (pid==0) return Stopped; // not a pid
- return (kill(pid,0)==0 || errno==EPERM) ? Working : Stopped;
- // signal 0 only checks if process is running, mdnsd is probably owned by 'nobody' so we will
- // get EPERM, if mdnsd is not running error will be ESRCH
-
+ AvahiClientState s = Responder::self().state();
+#ifdef AVAHI_API_0_6
+ return (s==AVAHI_CLIENT_FAILURE) ? Stopped : Working;
#else
- return Unsupported;
-#endif
+ return (s==AVAHI_CLIENT_S_INVALID || s==AVAHI_CLIENT_DISCONNECTED) ? Stopped : Working;
+#endif
}
ServiceBrowser::~ ServiceBrowser()
{
diff --git a/interfaces/kimproxy/library/Makefile.am b/interfaces/kimproxy/library/Makefile.am
index 36cb7ea30..17ff95343 100644
--- a/interfaces/kimproxy/library/Makefile.am
+++ b/interfaces/kimproxy/library/Makefile.am
@@ -16,7 +16,7 @@ kimproxyinclude_HEADERS = kimproxy.h kimproxyiface.h
lib_LTLIBRARIES = libkimproxy.la
libkimproxy_la_LDFLAGS = -no-undefined $(all_libraries)
-libkimproxy_la_LIBADD = $(LIB_KIO)
+libkimproxy_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_KDECORE) $(top_builddir)/dcop/libDCOP.la $(LIB_KDEUI)
libkimproxy_la_SOURCES = kimproxy.cpp kimiface.stub kimproxyiface.skel
kimiface_DIR = $(top_srcdir)/interfaces/kimproxy/interface
diff --git a/interfaces/kmediaplayer/Makefile.am b/interfaces/kmediaplayer/Makefile.am
index 11838080a..9819f9040 100644
--- a/interfaces/kmediaplayer/Makefile.am
+++ b/interfaces/kmediaplayer/Makefile.am
@@ -9,7 +9,7 @@ lib_LTLIBRARIES = libkmediaplayer.la
libkmediaplayer_la_SOURCES = player.cpp playerdcopobject.skel view.cpp
libkmediaplayer_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -no-undefined
-libkmediaplayer_la_LIBADD = $(LIB_KPARTS)
+libkmediaplayer_la_LIBADD = $(LIB_KPARTS) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_KDEUI) $(LIB_KDECORE)
libkmediaplayer_la_METASOURCES = AUTO
kmediaplayerinclude_HEADERS = player.h playerdcopobject.h view.h
diff --git a/interfaces/kmediaplayer/kfileaudiopreview/Makefile.am b/interfaces/kmediaplayer/kfileaudiopreview/Makefile.am
index 3eb9b5da8..a40cff821 100644
--- a/interfaces/kmediaplayer/kfileaudiopreview/Makefile.am
+++ b/interfaces/kmediaplayer/kfileaudiopreview/Makefile.am
@@ -5,7 +5,7 @@ kde_module_LTLIBRARIES = kfileaudiopreview.la
kfileaudiopreview_la_SOURCES = kfileaudiopreview.cpp
kfileaudiopreview_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module -avoid-version -no-undefined
-kfileaudiopreview_la_LIBADD = $(top_builddir)/interfaces/kmediaplayer/libkmediaplayer.la $(top_builddir)/arts/kde/libartskde.la $(LIB_KIO)
+kfileaudiopreview_la_LIBADD = $(top_builddir)/interfaces/kmediaplayer/libkmediaplayer.la $(top_builddir)/arts/kde/libartskde.la $(LIB_KIO) $(LIB_QT) $(LIB_KDECORE)
noinst_HEADERS = kfileaudiopreview.h
diff --git a/interfaces/kscript/Makefile.am b/interfaces/kscript/Makefile.am
index a84d73863..41cf60792 100644
--- a/interfaces/kscript/Makefile.am
+++ b/interfaces/kscript/Makefile.am
@@ -10,7 +10,7 @@ lib_LTLIBRARIES = libkscript.la
libkscript_la_SOURCES = scriptmanager.cpp
libkscript_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -no-undefined
-libkscript_la_LIBADD = $(LIB_KIO)
+libkscript_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI)
kscriptinclude_HEADERS = scriptinterface.h scriptclientinterface.h scriptmanager.h
kscriptincludedir = $(includedir)
diff --git a/interfaces/kscript/sample/Makefile.am b/interfaces/kscript/sample/Makefile.am
index 96e8f0873..8781a41fb 100644
--- a/interfaces/kscript/sample/Makefile.am
+++ b/interfaces/kscript/sample/Makefile.am
@@ -4,7 +4,7 @@ kde_module_LTLIBRARIES = libshellscript.la
libshellscript_la_SOURCES = shellscript.cpp
libshellscript_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) -no-undefined -avoid-version
-libshellscript_la_LIBADD = ../libkscript.la
+libshellscript_la_LIBADD = ../libkscript.la $(LIB_QT) $(LIB_KDECORE) $(top_builddir)/dcop/libDCOP.la
METASOURCES = AUTO
diff --git a/interfaces/ktexteditor/Makefile.am b/interfaces/ktexteditor/Makefile.am
index 5a173b447..97ae82e2d 100644
--- a/interfaces/ktexteditor/Makefile.am
+++ b/interfaces/ktexteditor/Makefile.am
@@ -23,7 +23,7 @@ libktexteditor_la_SOURCES = ktexteditor.cpp \
libktexteditor_la_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-libktexteditor_la_LIBADD = $(LIB_KPARTS) $(top_builddir)/dcop/libDCOP.la $(top_builddir)/kabc/libkabc.la
+libktexteditor_la_LIBADD = $(LIB_KPARTS) $(top_builddir)/dcop/libDCOP.la $(LIB_KABC) $(LIB_KDECORE) $(LIB_QT) $(LIB_KFILE) $(LIB_KDEUI)
ktexteditorinclude_HEADERS = document.h view.h editor.h plugin.h editinterface.h undointerface.h \
selectioninterface.h cursorinterface.h \
diff --git a/interfaces/terminal/kde_terminal_interface.h b/interfaces/terminal/kde_terminal_interface.h
index 1abf297e0..a60c2d70c 100644
--- a/interfaces/terminal/kde_terminal_interface.h
+++ b/interfaces/terminal/kde_terminal_interface.h
@@ -163,6 +163,8 @@ public:
start another program instead or close it yourself.
*/
virtual void setAutoDestroy(bool enabled) = 0;
+
+ virtual bool setPtyFd(int master_pty) = 0;
};
#endif
diff --git a/kabc/Makefile.am b/kabc/Makefile.am
index b41946f34..7ca9bd473 100644
--- a/kabc/Makefile.am
+++ b/kabc/Makefile.am
@@ -22,7 +22,7 @@ CLEANFILES = addressee.h addressee.cpp field.cpp
lib_LTLIBRARIES = libkabc.la
libkabc_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 3:0:2 -no-undefined
libkabc_la_LIBADD = vcard/libvcard.la vcardparser/libvcards.la $(LIB_KIO) \
- $(top_builddir)/kresources/libkresources.la
+ $(top_builddir)/kresources/libkresources.la $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_KDEUI) $(LIB_KDECORE)
libkabc_la_COMPILE_FIRST = addressee.h
libkabc_la_SOURCES = \
diff --git a/kabc/formats/Makefile.am b/kabc/formats/Makefile.am
index 5de6d6485..0b5978b20 100644
--- a/kabc/formats/Makefile.am
+++ b/kabc/formats/Makefile.am
@@ -5,7 +5,7 @@ kde_module_LTLIBRARIES = kabcformat_binary.la
kabcformat_binary_la_SOURCES = binaryformat.cpp
kabcformat_binary_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) \
-no-undefined
-kabcformat_binary_la_LIBADD = $(top_builddir)/kabc/libkabc.la
+kabcformat_binary_la_LIBADD = $(LIB_KABC) $(LIB_QT) $(LIB_KDECORE)
kabcformat_binary_la_COMPILE_FIRST = $(top_builddir)/kabc/addressee.h
# these are the headers for your project
diff --git a/kabc/plugins/dir/Makefile.am b/kabc/plugins/dir/Makefile.am
index bf07e6af3..d06588266 100644
--- a/kabc/plugins/dir/Makefile.am
+++ b/kabc/plugins/dir/Makefile.am
@@ -6,13 +6,13 @@ noinst_HEADERS = resourcedirconfig.h
lib_LTLIBRARIES = libkabc_dir.la
libkabc_dir_la_SOURCES = resourcedir.cpp resourcedirconfig.cpp
libkabc_dir_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:0:0 -no-undefined
-libkabc_dir_la_LIBADD = $(LIB_KABC)
+libkabc_dir_la_LIBADD = $(LIB_KABC) $(LIB_QT) $(top_builddir)/kresources/libkresources.la $(LIB_KDECORE) $(LIB_KFILE) $(LIB_KDEUI)
libkabc_dir_la_COMPILE_FIRST = $(top_builddir)/kabc/addressee.h
kde_module_LTLIBRARIES = kabc_dir.la
kabc_dir_la_SOURCES = resourcedirplugin.cpp
kabc_dir_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) -no-undefined
-kabc_dir_la_LIBADD = libkabc_dir.la
+kabc_dir_la_LIBADD = libkabc_dir.la $(LIB_QT) $(LIB_KDECORE)
METASOURCES = AUTO
diff --git a/kabc/plugins/file/Makefile.am b/kabc/plugins/file/Makefile.am
index 9e3fc8360..2edbfe9c7 100644
--- a/kabc/plugins/file/Makefile.am
+++ b/kabc/plugins/file/Makefile.am
@@ -6,14 +6,14 @@ noinst_HEADERS = resourcefileconfig.h
lib_LTLIBRARIES = libkabc_file.la
libkabc_file_la_SOURCES = resourcefile.cpp resourcefileconfig.cpp
libkabc_file_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:0:0 -no-undefined
-libkabc_file_la_LIBADD = $(LIB_KABC)
+libkabc_file_la_LIBADD = $(LIB_KABC) $(LIB_QT) $(top_builddir)/kresources/libkresources.la $(LIB_KFILE) $(LIB_KDECORE) $(LIB_KDEUI)
libkabc_file_la_COMPILE_FIRST = $(top_builddir)/kabc/addressee.h
kde_module_LTLIBRARIES = kabc_file.la
kabc_file_la_SOURCES = resourcefileplugin.cpp
kabc_file_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) -no-undefined
-kabc_file_la_LIBADD = libkabc_file.la
+kabc_file_la_LIBADD = libkabc_file.la $(LIB_QT) $(LIB_KDECORE)
kabc_file_la_COMPILE_FIRST = $(top_builddir)/kabc/addressee.h
METASOURCES = AUTO
diff --git a/kabc/plugins/ldapkio/Makefile.am b/kabc/plugins/ldapkio/Makefile.am
index 64a72b8f2..1198070c9 100644
--- a/kabc/plugins/ldapkio/Makefile.am
+++ b/kabc/plugins/ldapkio/Makefile.am
@@ -6,13 +6,13 @@ noinst_HEADERS = resourceldapkioconfig.h
lib_LTLIBRARIES = libkabc_ldapkio.la
libkabc_ldapkio_la_SOURCES = resourceldapkio.cpp resourceldapkioconfig.cpp
libkabc_ldapkio_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:0:0 -no-undefined
-libkabc_ldapkio_la_LIBADD = $(top_builddir)/kabc/libkabc.la $(LIB_KIO)
+libkabc_ldapkio_la_LIBADD = $(LIB_KABC) $(LIB_KIO) $(LIB_QT) $(top_builddir)/kresources/libkresources.la $(LIB_KDEUI) $(LIB_KDECORE)
libkabc_ldapkio_la_COMPILE_FIRST = $(top_builddir)/kabc/addressee.h
kde_module_LTLIBRARIES = kabc_ldapkio.la
kabc_ldapkio_la_SOURCES = resourceldapkioplugin.cpp
kabc_ldapkio_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
-kabc_ldapkio_la_LIBADD = libkabc_ldapkio.la
+kabc_ldapkio_la_LIBADD = libkabc_ldapkio.la $(LIB_QT) $(LIB_KDECORE)
METASOURCES = AUTO
diff --git a/kabc/vcard/Makefile.am b/kabc/vcard/Makefile.am
index 86306fece..953857161 100644
--- a/kabc/vcard/Makefile.am
+++ b/kabc/vcard/Makefile.am
@@ -8,7 +8,7 @@ lib_LTLIBRARIES = libvcard.la
libvcard_la_SOURCES = vCard-all.cpp
libvcard_la_LDFLAGS = $(all_libraries)
-libvcard_la_LIBADD = $(LIB_KDECORE)
+libvcard_la_LIBADD = $(LIB_KDECORE) $(LIB_QT)
check_PROGRAMS = testwrite testread
diff --git a/kate/data/Makefile.am b/kate/data/Makefile.am
index da5febd95..720d9007d 100644
--- a/kate/data/Makefile.am
+++ b/kate/data/Makefile.am
@@ -19,7 +19,11 @@ syntaxkate_DATA = language.dtd syntax.template cpp.xml c.xml html.xml kbasic.xml
cg.xml html-php.xml css-php.xml javascript-php.xml ahdl.xml ansic89.xml tibasic.xml \
purebasic.xml mips.xml logtalk.xml txt2tags.xml xslt.xml stata.xml glsl.xml \
lilypond.xml abc.xml asp.xml asm-avr.xml rib.xml cmake.xml octave.xml javadoc.xml cgis.xml \
- spice.xml nasm.xml mediawiki.xml apache.xml m3u.xml ini.xml fstab.xml actionscript.xml
+ spice.xml nasm.xml mediawiki.xml apache.xml m3u.xml ini.xml fstab.xml actionscript.xml \
+ abap.xml ansys.xml asn1.xml asterisk.xml bmethod.xml ddoc.xml djangotemplate.xml \
+ doxygenlua.xml dtd.xml email.xml erlang.xml freebasic.xml gap.xml json.xml maxima.xml \
+ mergetagtext.xml modelica.xml monobasic.xml nemerle.xml noweb.xml objectivecpp.xml opal.xml \
+ pgn.xml rapidq.xml scala.xml sisu.xml systemc.xml texinfo.xml xorg.xml xul.xml yaml.xml zonnon.xml
partrcdir = $(kde_confdir)
partrc_DATA = katesyntaxhighlightingrc katefiletyperc
diff --git a/kate/interfaces/Makefile.am b/kate/interfaces/Makefile.am
index 175dcf381..9520fa750 100644
--- a/kate/interfaces/Makefile.am
+++ b/kate/interfaces/Makefile.am
@@ -3,7 +3,7 @@ METASOURCES = document.moc view.moc
lib_LTLIBRARIES = libkatepartinterfaces.la
libkatepartinterfaces_la_SOURCES = interfaces.cpp katecmd.cpp
-libkatepartinterfaces_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la
+libkatepartinterfaces_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la $(LIB_QT) $(LIB_KDEUI) $(LIB_KPARTS) $(LIB_KDECORE)
libkatepartinterfaces_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -no-undefined
kateinclude_HEADERS = document.h view.h
diff --git a/kate/part/Makefile.am b/kate/part/Makefile.am
index 4a182452e..9be7a9e6d 100644
--- a/kate/part/Makefile.am
+++ b/kate/part/Makefile.am
@@ -16,7 +16,7 @@ libkate_la_SOURCES = katesearch.cpp katebuffer.cpp katecmds.cpp \
libkatepart_la_SOURCES = dummy.cpp
-libkatepart_la_LIBADD = libkate.la ../interfaces/libkatepartinterfaces.la $(top_builddir)/kdeprint/libkdeprint.la $(top_builddir)/kutils/libkutils.la $(top_builddir)/kjs/libkjs.la $(LUA_LIBS)
+libkatepart_la_LIBADD = libkate.la ../interfaces/libkatepartinterfaces.la $(LIB_KDEPRINT) $(top_builddir)/kutils/libkutils.la $(top_builddir)/kjs/libkjs.la $(LUA_LIBS) $(LIB_QT) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_KPARTS) $(top_builddir)/interfaces/ktexteditor/libktexteditor.la $(LIB_KFILE) $(top_builddir)/dcop/libDCOP.la
libkatepart_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
diff --git a/kate/part/katesearch.cpp b/kate/part/katesearch.cpp
index 8f4911137..96f5128b0 100644
--- a/kate/part/katesearch.cpp
+++ b/kate/part/katesearch.cpp
@@ -377,23 +377,35 @@ void KateSearch::replaceOne()
{
QString replaceWith = m_replacement;
if ( s.flags.regExp && s.flags.useBackRefs ) {
- // replace each "(?!\)\d+" with the corresponding capture
- QRegExp br("\\\\(\\d+)");
+ // Replace each "\0"..."\9" with the corresponding capture,
+ // "\n" and "\t" with newline and tab,
+ // "\\" with "\",
+ // and remove the "\" for any other sequence.
+ QRegExp br("\\\\(.)");
int pos = br.search( replaceWith );
int ncaps = m_re.numCaptures();
while ( pos >= 0 ) {
- QString sc;
- if ( !pos || replaceWith.at( pos-1) != '\\' ) {
- int ccap = br.cap(1).toInt();
+ QString substitute;
+ QChar argument = br.cap(1).at(0);
+ if ( argument.isDigit() ) {
+ // the second character is a digit, this is a backreference
+ int ccap = argument.digitValue();
if (ccap <= ncaps ) {
- sc = m_re.cap( ccap );
- replaceWith.replace( pos, br.matchedLength(), sc );
- }
- else {
+ substitute = m_re.cap( ccap );
+ } else {
kdDebug()<<"KateSearch::replaceOne(): you don't have "<<ccap<<" backreferences in regexp '"<<m_re.pattern()<<"'"<<endl;
+ break;
}
+ } else if ( argument == 'n' ) {
+ substitute = '\n';
+ } else if ( argument == 't' ) {
+ substitute = '\t';
+ } else {
+ // handle a validly escaped backslash, or an invalid escape.
+ substitute = argument;
}
- pos = br.search( replaceWith, pos + (int)sc.length() );
+ replaceWith.replace( pos, br.matchedLength(), substitute );
+ pos = br.search( replaceWith, pos + substitute.length() );
}
}
diff --git a/kate/plugins/insertfile/Makefile.am b/kate/plugins/insertfile/Makefile.am
index 783e93e0f..b9a4981ae 100644
--- a/kate/plugins/insertfile/Makefile.am
+++ b/kate/plugins/insertfile/Makefile.am
@@ -5,7 +5,7 @@ METASOURCES = AUTO
kde_module_LTLIBRARIES = ktexteditor_insertfile.la
ktexteditor_insertfile_la_SOURCES = insertfileplugin.cpp
-ktexteditor_insertfile_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la
+ktexteditor_insertfile_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la $(LIB_QT) $(LIB_KDECORE) $(LIB_KFILE) $(LIB_KDEUI)
ktexteditor_insertfile_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
insertfiledatadir = $(kde_datadir)/ktexteditor_insertfile
diff --git a/kate/plugins/isearch/Makefile.am b/kate/plugins/isearch/Makefile.am
index 70327218e..3e630a0c7 100644
--- a/kate/plugins/isearch/Makefile.am
+++ b/kate/plugins/isearch/Makefile.am
@@ -5,7 +5,7 @@ METASOURCES = AUTO
kde_module_LTLIBRARIES = ktexteditor_isearch.la
ktexteditor_isearch_la_SOURCES = ISearchPlugin.cpp
-ktexteditor_isearch_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la
+ktexteditor_isearch_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI)
ktexteditor_isearch_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
isearchdatadir = $(kde_datadir)/ktexteditor_isearch
diff --git a/kate/plugins/kdatatool/Makefile.am b/kate/plugins/kdatatool/Makefile.am
index 115391ada..02aaff789 100644
--- a/kate/plugins/kdatatool/Makefile.am
+++ b/kate/plugins/kdatatool/Makefile.am
@@ -5,7 +5,7 @@ METASOURCES = AUTO
kde_module_LTLIBRARIES = ktexteditor_kdatatool.la
ktexteditor_kdatatool_la_SOURCES = kate_kdatatool.cpp
-ktexteditor_kdatatool_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la
+ktexteditor_kdatatool_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la $(LIB_QT) $(LIB_KDECORE) $(LIB_KFILE) $(LIB_KDEUI)
ktexteditor_kdatatool_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
kdatatooldatadir = $(kde_datadir)/ktexteditor_kdatatool
diff --git a/kate/plugins/wordcompletion/Makefile.am b/kate/plugins/wordcompletion/Makefile.am
index 5bddb895e..3dcab0ffd 100644
--- a/kate/plugins/wordcompletion/Makefile.am
+++ b/kate/plugins/wordcompletion/Makefile.am
@@ -5,7 +5,7 @@ METASOURCES = AUTO
kde_module_LTLIBRARIES = ktexteditor_docwordcompletion.la
ktexteditor_docwordcompletion_la_SOURCES = docwordcompletion.cpp
-ktexteditor_docwordcompletion_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la
+ktexteditor_docwordcompletion_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI)
ktexteditor_docwordcompletion_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
docwordcompletiondatadir = $(kde_datadir)/ktexteditor_docwordcompletion
diff --git a/kcert/Makefile.am b/kcert/Makefile.am
index aad4f2343..e568f558a 100644
--- a/kcert/Makefile.am
+++ b/kcert/Makefile.am
@@ -5,7 +5,7 @@ kde_module_LTLIBRARIES = libkcertpart.la
libkcertpart_la_SOURCES = kcertpart.cc
libkcertpart_la_LDFLAGS = $(KDE_PLUGIN) $(all_libraries)
-libkcertpart_la_LIBADD = $(LIB_KPARTS)
+libkcertpart_la_LIBADD = $(LIB_KPARTS) $(LIB_QT) $(LIB_KDEUI) $(LIB_KFILE) $(LIB_KDECORE)
libkcertpart_la_DEPENDENCIES = $(LIB_KPARTS)
libkcertpart_la_METASOURCES = AUTO
diff --git a/kcmshell/Makefile.am b/kcmshell/Makefile.am
index 81b3e2c8e..e26b0c6fa 100644
--- a/kcmshell/Makefile.am
+++ b/kcmshell/Makefile.am
@@ -26,7 +26,7 @@ bin_PROGRAMS =
kdeinit_LTLIBRARIES = kcmshell.la
kcmshell_la_SOURCES = main.cpp main.skel
-kcmshell_la_LIBADD = ../kutils/libkutils.la
+kcmshell_la_LIBADD = ../kutils/libkutils.la $(LIB_QT) $(LIB_KDEUI) $(top_builddir)/dcop/libDCOP.la $(LIB_KDECORE) $(LIB_KFILE)
kcmshell_la_LDFLAGS = $(all_libraries) -module -avoid-version
noinst_HEADERS = main.h
diff --git a/kconf_update/Makefile.am b/kconf_update/Makefile.am
index 334ffdb18..6d181faee 100644
--- a/kconf_update/Makefile.am
+++ b/kconf_update/Makefile.am
@@ -23,7 +23,7 @@ lib_LTLIBRARIES =
kdeinit_LTLIBRARIES = kconf_update.la
kconf_update_la_SOURCES = kconf_update.cpp
-kconf_update_la_LIBADD = $(LIB_KDECORE)
+kconf_update_la_LIBADD = $(LIB_KDECORE) $(LIB_QT)
kconf_update_la_LDFLAGS = $(all_libraries) -module -avoid-version
METASOURCES = AUTO
diff --git a/kdecore/Makefile.am b/kdecore/Makefile.am
index b312a0e24..b5a9c5a80 100644
--- a/kdecore/Makefile.am
+++ b/kdecore/Makefile.am
@@ -34,7 +34,7 @@ SUBDIRS = malloc network $(SVGICONS) . kconfig_compiler tests
AM_LDFLAGS = $(LDFLAGS_AS_NEEDED) $(LDFLAGS_NEW_DTAGS)
lib_LTLIBRARIES = libkdefakes.la libkdecore.la
-lib_LIBRARIES = libkdefakes_nonpic.a
+lib_LIBRARIES = libkdefakes_nonpic.a libkdefakes_pic.a
include_HEADERS = kconfig.h kconfigskeleton.h \
kconfigdata.h ksimpleconfig.h kconfigdialogmanager.h \
@@ -75,6 +75,12 @@ vsnprintf_nonpic.c: $(srcdir)/vsnprintf.c
-rm -f vsnprintf_nonpic.c
$(LN_S) $(srcdir)/vsnprintf.c vsnprintf_nonpic.c
+libkdefakes_pic.a: libkdefakes.la
+ -rm -f libkdefakes_pic.a fakes_pic.o vsnprintf_pic.o
+ cp -f .libs/fakes.o fakes_pic.o; cp -f .libs/vsnprintf.o vsnprintf_pic.o
+ ar cru libkdefakes_pic.a fakes_pic.o vsnprintf_pic.o
+ ranlib libkdefakes_pic.a
+
noinst_HEADERS = kaccelaction.h kaccelbase.h kaccelprivate.h kckey.h \
kcompletion_private.h netwm_p.h \
kglobalaccel_x11.h kglobalaccel_win.h kkeyserver_x11.h kkeyserver.h \
@@ -116,7 +122,8 @@ libkdecore_la_SOURCES = libintl.cpp kapplication.cpp \
kqiodevicegzip_p.cpp ktimezones.cpp
libkdecore_la_LDFLAGS = $(QT_LDFLAGS) $(KDE_RPATH) $(KDE_MT_LDFLAGS) $(X_LDFLAGS) $(USER_LDFLAGS) -version-info 6:0:2 -no-undefined
-libkdecore_la_LIBADD = malloc/libklmalloc.la network/libkdecorenetwork.la $(SVGICON_LIB) ../dcop/libDCOP.la ../libltdl/libltdlc.la $(LIB_XEXT) $(LIBRESOLV) $(LIBUTIL) $(LIBART_LIBS) $(LIB_IDN) ../kdefx/libkdefx.la
+libkdecore_la_LIBADD = malloc/libklmalloc.la network/libkdecorenetwork.la $(SVGICON_LIB) ../dcop/libDCOP.la ../libltdl/libltdlc.la \
+ $(LIBART_LIBS) $(LIB_IDN) $(top_builddir)/kdefx/libkdefx.la $(LIB_QT) $(LIBSM) $(LIB_X11) $(LIBZ) $(LIBDL)
libkdecore_la_NMCHECK = $(srcdir)/libkdecore.nmcheck
libkdecore_la_NMCHECKWEAK = $(srcdir)/libkdecore_weak.nmcheck $(srcdir)/libqt-mt_weak.nmcheck \
$(top_srcdir)/dcop/libDCOP_weak.nmcheck $(top_srcdir)/kdecore/standard_weak.nmcheck
@@ -170,7 +177,6 @@ kde_config_LDFLAGS = $(KDE_RPATH) $(KDE_MT_LDFLAGS)
kgrantpty_SOURCES = kgrantpty.c
kgrantpty_CFLAGS= $(KDE_USE_FPIE)
kgrantpty_LDFLAGS = $(KDE_USE_PIE) $(KDE_RPATH) $(all_libraries)
-kgrantpty_LDADD = ./libkdefakes.la
# kgrantpty needs to be installed setuid root
install-exec-hook:
diff --git a/kdecore/kaccel.cpp b/kdecore/kaccel.cpp
index 461666d31..fc984021a 100644
--- a/kdecore/kaccel.cpp
+++ b/kdecore/kaccel.cpp
@@ -127,7 +127,10 @@ bool KAccelEventHandler::x11Event( XEvent* pEvent )
return false;
if( pEvent->type == XKeyPress ) {
+ unsigned int tmp = pEvent->xkey.state;
+ pEvent->xkey.state &= ~0x2000;
KKeyNative keyNative( pEvent );
+ pEvent->xkey.state = tmp;
KKey key( keyNative );
key.simplify();
int keyCodeQt = key.keyCodeQt();
diff --git a/kdecore/kconfigbackend.cpp b/kdecore/kconfigbackend.cpp
index 37bafdced..153b9aa1a 100644
--- a/kdecore/kconfigbackend.cpp
+++ b/kdecore/kconfigbackend.cpp
@@ -505,6 +505,8 @@ qWarning("SIGBUS while reading %s", rFile.name().latin1());
bool fileOptionImmutable = false;
bool groupOptionImmutable = false;
bool groupSkip = false;
+ bool foundGettextDomain = false;
+ QCString gettextDomain;
int line = 0;
for(; s < eof; s++)
@@ -596,6 +598,7 @@ qWarning("SIGBUS while reading %s", rFile.name().latin1());
if (groupSkip && !bDefault)
goto sktoeol; // Skip entry
+
bool optionImmutable = groupOptionImmutable;
bool optionDeleted = false;
bool optionExpand = false;
@@ -695,6 +698,11 @@ qWarning("SIGBUS while reading %s", rFile.name().latin1());
QCString val = printableToString(st, s - st);
//qDebug("found key '%s' with value '%s'", key.data(), val.data());
+ if (QString(key.data()) == "X-Ubuntu-Gettext-Domain") {
+ gettextDomain = val.data();
+ foundGettextDomain = true;
+ }
+
KEntryKey aEntryKey(aCurrentGroup, decodeKey(key));
aEntryKey.bLocal = (locale != 0);
aEntryKey.bDefault = bDefault;
@@ -718,6 +726,34 @@ qWarning("SIGBUS while reading %s", rFile.name().latin1());
pConfig->putData(aEntryKey, aEntry, false);
}
}
+ // Look up translations using KLocale
+ // https://launchpad.net/distros/ubuntu/+spec/langpacks-desktopfiles-kde
+ // This calls KLocale up to 10 times for each config file (and each KConfig has up to 4 files)
+ // so I'll see how much of a performance hit it is
+ // it also only acts on the last group in a file
+ // Ideas: only translate most important fields, only translate "Desktop Entry" files,
+ // do translation per KConfig not per single file
+ if (!pWriteBackMap) {
+ QFile file("file.txt");
+ if (foundGettextDomain) {
+
+ KLocale locale(gettextDomain);
+
+ QString language = locale.language();
+ translateKey(locale, aCurrentGroup, QCString("Name"));
+ translateKey(locale, aCurrentGroup, QCString("Comment"));
+ translateKey(locale, aCurrentGroup, QCString("Language"));
+ translateKey(locale, aCurrentGroup, QCString("Keywords"));
+ translateKey(locale, aCurrentGroup, QCString("About"));
+ translateKey(locale, aCurrentGroup, QCString("Description"));
+ translateKey(locale, aCurrentGroup, QCString("GenericName"));
+ translateKey(locale, aCurrentGroup, QCString("Query"));
+ translateKey(locale, aCurrentGroup, QCString("ExtraNames"));
+ translateKey(locale, aCurrentGroup, QCString("X-KDE-Submenu"));
+ }
+ }
+
+
if (fileOptionImmutable)
bFileImmutable = true;
@@ -732,6 +768,21 @@ qWarning("SIGBUS while reading %s", rFile.name().latin1());
#endif
}
+void KConfigINIBackEnd::translateKey(KLocale& locale, QCString currentGroup, QCString key) {
+ KEntryKey entryKey = KEntryKey(currentGroup, key);
+ KEntry entry = pConfig->lookupData(entryKey);
+ if (QString(entry.mValue) != "") {
+ QString orig = key + "=" + entry.mValue;
+ QString translate = locale.translate(key + "=" + entry.mValue);
+ if (QString::compare(orig, translate) != 0) {
+ translate = translate.mid(key.length() + 1);
+ entry.mValue = translate.utf8();
+ entryKey.bLocal = true;
+ entry.bNLS = true;
+ pConfig->putData(entryKey, entry, false);
+ }
+ }
+}
void KConfigINIBackEnd::sync(bool bMerge)
{
diff --git a/kdecore/kconfigbackend.h b/kdecore/kconfigbackend.h
index 49e0e3e49..696062bf4 100644
--- a/kdecore/kconfigbackend.h
+++ b/kdecore/kconfigbackend.h
@@ -25,6 +25,7 @@
#include "kconfigdata.h"
#include <kconfigbase.h>
#include <klockfile.h>
+#include <klocale.h>
#include "kdelibs_export.h"
class QFile;
@@ -250,6 +251,11 @@ protected:
void parseSingleConfigFile(QFile& rFile, KEntryMap *pWriteBackMap = 0L,
bool bGlobal = false, bool bDefault = false);
+ // Kubuntu patch, 2006-08-03
+ // looks up a key in with KLocale
+ // see https://launchpad.net/distros/ubuntu/+spec/langpacks-desktopfiles-kde
+ void translateKey(KLocale& locale, QCString currentGroup, QCString key);
+
/**
* Writes configuration file back.
*
diff --git a/kdecore/kcrash.cpp b/kdecore/kcrash.cpp
index 61ba5f796..8fb8ed308 100644
--- a/kdecore/kcrash.cpp
+++ b/kdecore/kcrash.cpp
@@ -441,7 +441,7 @@ static int openSocket()
if (!kde_home || !kde_home[0])
{
- kde_home = "~/.kde/";
+ kde_home = "~/.kde3/";
}
if (kde_home[0] == '~')
diff --git a/kdecore/kdebug.cpp b/kdecore/kdebug.cpp
index 575f00e37..4c9c7cf14 100644
--- a/kdecore/kdebug.cpp
+++ b/kdecore/kdebug.cpp
@@ -238,7 +238,8 @@ static void kDebugBackend( unsigned short nLevel, unsigned int nArea, const char
break;
}
- short nOutput = kDebug_data->config ? kDebug_data->config->readNumEntry(key, 2) : 2;
+ // if no output mode is specified default to no debug output
+ short nOutput = kDebug_data->config ? kDebug_data->config->readNumEntry(key, 4) : 4;
// If the application doesn't have a QApplication object it can't use
// a messagebox.
diff --git a/kdecore/kdebugrc b/kdecore/kdebugrc
index dc8deb29d..58b09ae7a 100644
--- a/kdecore/kdebugrc
+++ b/kdecore/kdebugrc
@@ -86,7 +86,7 @@ InfoOutput=4
# KMail
[5006]
-InfoOutput=2
+InfoOutput=4
# KitchenSync (Syncing Algorithm)
[5250]
diff --git a/kdecore/kdeversion.h b/kdecore/kdeversion.h
index dbe094633..3e5b1b7a1 100644
--- a/kdecore/kdeversion.h
+++ b/kdecore/kdeversion.h
@@ -22,10 +22,10 @@
#include "kdelibs_export.h"
-#define KDE_VERSION_STRING "3.5.10"
+#define KDE_VERSION_STRING "3.5.11 [Trinity]"
#define KDE_VERSION_MAJOR 3
#define KDE_VERSION_MINOR 5
-#define KDE_VERSION_RELEASE 10
+#define KDE_VERSION_RELEASE 11
#define KDE_MAKE_VERSION( a,b,c ) (((a) << 16) | ((b) << 8) | (c))
#define KDE_VERSION \
diff --git a/kdecore/kglobalsettings.cpp b/kdecore/kglobalsettings.cpp
index b5539fb22..25e95f5c6 100644
--- a/kdecore/kglobalsettings.cpp
+++ b/kdecore/kglobalsettings.cpp
@@ -50,6 +50,10 @@ static QRgb qt_colorref2qrgb(COLORREF col)
#include <stdlib.h>
#include <kprotocolinfo.h>
+#include <qtextcodec.h>
+#include <qtextstream.h>
+#include <qfile.h>
+
#ifdef Q_WS_X11
#include <X11/Xlib.h>
#endif
@@ -77,6 +81,31 @@ QColor *KGlobalSettings::alternateColor = 0;
KGlobalSettings::KMouseSettings *KGlobalSettings::s_mouseSettings = 0;
+// helper function for reading xdg user dirs: it is required in order to take
+// care of locale stuff
+void readXdgUserDirs(QString *desktop, QString *documents)
+{
+ QFile f( QDir::homeDirPath() + "/.config/user-dirs.dirs" );
+
+ if (!f.open(IO_ReadOnly))
+ return;
+
+ // set the codec for the current locale
+ QTextStream s(&f);
+ s.setCodec( QTextCodec::codecForLocale() );
+
+ QString line = s.readLine();
+ while (!line.isNull())
+ {
+ if (line.startsWith("XDG_DESKTOP_DIR="))
+ *desktop = line.remove("XDG_DESKTOP_DIR=").remove("\"").replace("$HOME", QDir::homeDirPath());
+ else if (line.startsWith("XDG_DOCUMENTS_DIR="))
+ *documents = line.remove("XDG_DOCUMENTS_DIR=").remove("\"").replace("$HOME", QDir::homeDirPath());
+
+ line = s.readLine();
+ }
+}
+
int KGlobalSettings::dndEventDelay()
{
KConfigGroup g( KGlobal::config(), "General" );
@@ -483,13 +512,17 @@ void KGlobalSettings::initStatic() // should be called initPaths(). Don't put an
KConfigGroup g( KGlobal::config(), "Paths" );
- // Desktop Path
- *s_desktopPath = QDir::homeDirPath() + "/Desktop/";
- *s_desktopPath = g.readPathEntry( "Desktop", *s_desktopPath);
+ // Read desktop and documents path using XDG_USER_DIRS
+ readXdgUserDirs(s_desktopPath, s_documentPath);
+
*s_desktopPath = QDir::cleanDirPath( *s_desktopPath );
if ( !s_desktopPath->endsWith("/") )
s_desktopPath->append('/');
+ *s_documentPath = QDir::cleanDirPath( *s_documentPath );
+ if ( !s_documentPath->endsWith("/"))
+ s_documentPath->append('/');
+
// Trash Path - TODO remove in KDE4 (kio_trash can't use it for interoperability reasons)
*s_trashPath = *s_desktopPath + i18n("Trash") + "/";
*s_trashPath = g.readPathEntry( "Trash" , *s_trashPath);
@@ -510,18 +543,6 @@ void KGlobalSettings::initStatic() // should be called initPaths(). Don't put an
if ( !s_autostartPath->endsWith("/") )
s_autostartPath->append('/');
- // Document Path
- *s_documentPath = g.readPathEntry( "Documents",
-#ifdef Q_WS_WIN
- getWin32ShellFoldersPath("Personal")
-#else
- QDir::homeDirPath()
-#endif
- );
- *s_documentPath = QDir::cleanDirPath( *s_documentPath );
- if ( !s_documentPath->endsWith("/"))
- s_documentPath->append('/');
-
// Make sure this app gets the notifications about those paths
if (kapp)
kapp->addKipcEventMask(KIPC::SettingsChanged);
diff --git a/kdecore/kiconeffect.cpp b/kdecore/kiconeffect.cpp
index 7746e679e..780bea576 100644
--- a/kdecore/kiconeffect.cpp
+++ b/kdecore/kiconeffect.cpp
@@ -24,6 +24,9 @@
#include <qwidget.h>
#include <qpainter.h>
#include <qpen.h>
+#include <qapplication.h>
+#include <qpoint.h>
+#include <qrect.h>
#include <kdebug.h>
#include <kglobal.h>
@@ -768,3 +771,148 @@ KIconEffect::visualActivate(QWidget * widget, QRect rect)
}
}
+void
+KIconEffect::visualActivate(QWidget * widget, QRect rect, QPixmap *pixmap)
+{
+ if (!KGlobalSettings::visualActivate())
+ return;
+
+ // Image too big to display smoothly
+ if ((rect.width() > 160) || (rect.height() > 160)) {
+ visualActivate(widget, rect); // call old effect
+ return;
+ }
+
+ uint actSpeed = KGlobalSettings::visualActivateSpeed();
+ uint actCount = QMIN(rect.width(), rect.height()) / 4;
+
+
+ // Clip actCount to range 1..10.
+ if (actCount < 1)
+ actCount = 1;
+
+ else if (actCount > 10)
+ actCount = 10;
+
+ // Clip actSpeed to range 1..100.
+ if (actSpeed < 1)
+ actSpeed = 1;
+
+ else if (actSpeed > 100)
+ actSpeed = 100;
+
+ // actSpeed needs to be converted to actDelay.
+ // actDelay is inversely proportional to actSpeed and needs to be
+ // divided up into actCount portions.
+ // We also convert the us value to ms.
+
+ unsigned int actDelay = (1000 * (100 - actSpeed)) / actCount;
+
+ unsigned int deltaX = rect.width() / actCount * 1.5;
+ unsigned int deltaY = rect.height() / actCount * 1.5;
+
+ QPoint c = rect.center();
+ QRect maxRect(c.x() - (actCount * 2) * deltaX /2,
+ c.y() - (actCount * 2) * deltaY /2,
+ actCount * 2 * deltaX,
+ actCount * 2 * deltaY);
+
+ // convert rect to global coordinates if needed
+ if ((widget->rect().width() <= maxRect.width())
+ || (widget->rect().height() <= maxRect.height()))
+ {
+ QPoint topLeft(rect.x(), rect.y());
+ rect.moveLeft(widget->mapToGlobal(topLeft).x());
+ rect.moveTop(widget->mapToGlobal(topLeft).y());
+ c = rect.center();
+ maxRect.setRect(c.x() - (actCount * 2) * deltaX /2,
+ c.y() - (actCount * 2) * deltaY /2,
+ actCount * 2 * deltaX,
+ actCount * 2 * deltaY);
+ }
+
+ QPainter *p;
+ QImage img = pixmap->convertToImage();
+ QPixmap pix;
+ QPixmap composite(maxRect.width(), maxRect.height(), -1, QPixmap::BestOptim);
+ QPainter cPainter(&composite);
+ QPoint cComposite = composite.rect().center();
+
+ // enable alpha blending
+ img.setAlphaBuffer(true);
+
+ // Ugly hack... Get "Screenshot" to blt into and even do that on the
+ // root window if the display area of <widget> is too small
+ if ((widget->rect().width() <= maxRect.width())
+ || (widget->rect().height() <= maxRect.height()))
+ {
+ p = new QPainter(QApplication::desktop()->screen( -1 ), TRUE);
+ pix = QPixmap::grabWindow((QApplication::desktop()->screen( -1 ))->winId(),
+ maxRect.x(),
+ maxRect.y(),
+ maxRect.width(),
+ maxRect.height());
+ } else
+ {
+ // not as ugly as drawing directly to the screen
+ p = new QPainter(widget);
+ pix = QPixmap::grabWidget(widget,
+ maxRect.x(),
+ maxRect.y(),
+ maxRect.width(),
+ maxRect.height());
+ }
+ uchar deltaAlpha = 255 / (actCount * 1.2);
+
+ // Activate effect like MacOS X
+ for (unsigned int i = actCount; i < actCount * 2; i++) {
+
+ int w = i * deltaX;
+ int h = i * deltaY;
+
+ rect.setRect(cComposite.x() - w / 2, cComposite.y() - h / 2, w, h);
+
+ // draw offscreen
+ cPainter.drawPixmap(0, 0, pix, 0, 0, pix.width(), pix.height());
+ cPainter.drawImage(rect, img);
+ cPainter.flush();
+
+ // put onscreen
+ p->drawPixmap(maxRect, composite);
+ p->flush();
+
+ // Fade out Icon a bit more
+ int x, y;
+ if ((img.depth() == 32) && qt_use_xrender && qt_has_xft)
+ {
+ int width = img.width();
+ int height = img.height();
+
+ for (y=0; y<height; y++)
+ {
+#ifdef WORDS_BIGENDIAN
+ uchar *line = (uchar*) img.scanLine(y);
+#else
+ uchar *line = (uchar*) img.scanLine(y) + 3;
+#endif
+ for (x=0; x<width; x++)
+ {
+ *line = (*line < deltaAlpha) ? 0 : *line - deltaAlpha;
+ line += 4;
+ }
+ }
+ }
+ usleep(actDelay*3);
+ }
+
+ // remove traces of the effect
+ if ((widget->rect().width() <= maxRect.width())
+ || (widget->rect().height() <= maxRect.height()))
+ p->drawPixmap(maxRect, pix);
+ else {
+ p->drawPixmap(maxRect, pix);
+ widget->update(rect);
+ }
+
+ delete p;
+}
diff --git a/kdecore/kiconeffect.h b/kdecore/kiconeffect.h
index 6cc568ac2..de698f4ab 100644
--- a/kdecore/kiconeffect.h
+++ b/kdecore/kiconeffect.h
@@ -152,6 +152,7 @@ public:
* @param rect This rectangle defines the effect's borders
*/
static void visualActivate(QWidget *widget, QRect rect);
+ static void visualActivate(QWidget *widget, QRect rect, QPixmap *pixmap);
/**
* Tints an image gray.
diff --git a/kdecore/kicontheme.cpp b/kdecore/kicontheme.cpp
index f695052fe..62044d27e 100644
--- a/kdecore/kicontheme.cpp
+++ b/kdecore/kicontheme.cpp
@@ -408,7 +408,7 @@ KIcon KIconTheme::iconPath(const QString& name, int size, KIcon::MatchType match
it's a downscale, and we only had upscales befores.
This is to avoid scaling up unless we have to,
since that looks very ugly */
- if ((abs(dw) >= abs(delta)) ||
+ if (/*(abs(dw) >= abs(delta)) ||*/
(delta > 0 && dw < 0))
continue;
}
diff --git a/kdecore/klocale.cpp b/kdecore/klocale.cpp
index 1ca1f035e..59981d4b1 100644
--- a/kdecore/klocale.cpp
+++ b/kdecore/klocale.cpp
@@ -76,6 +76,7 @@ public:
#ifdef Q_WS_WIN
char win32SystemEncoding[3+7]; //"cp " + lang ID
#endif
+ bool useMainCatalogue;
};
static KLocale *this_klocale = 0;
@@ -118,8 +119,13 @@ void KLocale::initMainCatalogues(const QString & catalog)
{
// Use the first non-null string.
QString mainCatalogue = catalog;
- if (maincatalogue)
- mainCatalogue = QString::fromLatin1(maincatalogue);
+
+ // don't use main catalogue if we're looking up .desktop translations
+ if (mainCatalogue.contains("desktop") == 0 || mainCatalogue.contains("kdesktop") == 1) {
+ if (maincatalogue) {
+ mainCatalogue = QString::fromLatin1(maincatalogue);
+ }
+ }
if (mainCatalogue.isEmpty()) {
kdDebug(173) << "KLocale instance created called without valid "
@@ -129,8 +135,11 @@ void KLocale::initMainCatalogues(const QString & catalog)
else {
// do not use insertCatalogue here, that would already trigger updateCatalogs
d->catalogNames.append( mainCatalogue ); // application catalog
- d->catalogNames.append( SYSTEM_MESSAGES ); // always include kdelibs.mo
- d->catalogNames.append( "kio" ); // always include kio.mo
+ if (mainCatalogue.contains("desktop") == 0 || mainCatalogue.contains("kdesktop") == 1) { //don't bother if we're looking up desktop translations
+ d->catalogNames.append( SYSTEM_MESSAGES ); // always include kdelibs.mo
+ d->catalogNames.append( "kio" ); // always include kio.mo
+ d->catalogNames.append( "xdg-user-dirs" );
+ }
updateCatalogues(); // evaluate this for all languages
}
}
diff --git a/kdecore/kpty.cpp b/kdecore/kpty.cpp
index 27cc3c51b..af83e9eab 100644
--- a/kdecore/kpty.cpp
+++ b/kdecore/kpty.cpp
@@ -95,24 +95,24 @@ extern "C" {
# endif
#endif
-#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__bsdi__) || defined(__APPLE__) || defined (__DragonFly__)
+#if defined(HAVE_TCGETATTR)
+# define _tcgetattr(fd, ttmode) tcgetattr(fd, ttmode)
+#elif defined(TIOCGETA)
# define _tcgetattr(fd, ttmode) ioctl(fd, TIOCGETA, (char *)ttmode)
+#elif defined(TCGETS)
+# define _tcgetattr(fd, ttmode) ioctl(fd, TCGETS, (char *)ttmode)
#else
-# if defined(_HPUX_SOURCE) || defined(__Lynx__) || defined (__CYGWIN__)
-# define _tcgetattr(fd, ttmode) tcgetattr(fd, ttmode)
-# else
-# define _tcgetattr(fd, ttmode) ioctl(fd, TCGETS, (char *)ttmode)
-# endif
+# error
#endif
-#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__bsdi__) || defined(__APPLE__) || defined (__DragonFly__)
+#if defined(HAVE_TCSETATTR) && defined(TCSANOW)
+# define _tcsetattr(fd, ttmode) tcsetattr(fd, TCSANOW, ttmode)
+#elif defined(TIOCSETA)
# define _tcsetattr(fd, ttmode) ioctl(fd, TIOCSETA, (char *)ttmode)
+#elif defined(TCSETS)
+# define _tcsetattr(fd, ttmode) ioctl(fd, TCSETS, (char *)ttmode)
#else
-# if defined(_HPUX_SOURCE) || defined(__CYGWIN__)
-# define _tcsetattr(fd, ttmode) tcsetattr(fd, TCSANOW, ttmode)
-# else
-# define _tcsetattr(fd, ttmode) ioctl(fd, TCSETS, (char *)ttmode)
-# endif
+# error
#endif
#if defined (_HPUX_SOURCE)
@@ -201,87 +201,37 @@ KPty::~KPty()
delete d;
}
-bool KPty::open()
+bool KPty::setPty(int pty_master)
{
- if (d->masterFd >= 0)
- return true;
+ kdWarning(175)
+ << "setPty()" << endl;
+ // a pty is already open
+ if(d->masterFd >= 0) {
+ kdWarning(175)
+ << "d->masterFd >= 0" << endl;
+ return false;
+ }
+ d->masterFd = pty_master;
+ return _attachPty(pty_master);
+}
+bool KPty::_attachPty(int pty_master)
+{
QCString ptyName;
- // Find a master pty that we can open ////////////////////////////////
-
- // Because not all the pty animals are created equal, they want to
- // be opened by several different methods.
-
- // We try, as we know them, one by one.
-
+ kdWarning(175)
+ << "_attachPty() " << pty_master << endl;
#if defined(HAVE_PTSNAME) && defined(HAVE_GRANTPT)
-#ifdef _AIX
- d->masterFd = ::open("/dev/ptc",O_RDWR);
-#else
- d->masterFd = ::open("/dev/ptmx",O_RDWR);
-#endif
- if (d->masterFd >= 0)
- {
char *ptsn = ptsname(d->masterFd);
if (ptsn) {
grantpt(d->masterFd);
d->ttyName = ptsn;
- goto gotpty;
} else {
::close(d->masterFd);
d->masterFd = -1;
}
- }
#endif
- // Linux device names, FIXME: Trouble on other systems?
- for (const char* s3 = "pqrstuvwxyzabcdefghijklmno"; *s3; s3++)
- {
- for (const char* s4 = "0123456789abcdefghijklmnopqrstuvwxyz"; *s4; s4++)
- {
- ptyName.sprintf("/dev/pty%c%c", *s3, *s4);
- d->ttyName.sprintf("/dev/tty%c%c", *s3, *s4);
-
- d->masterFd = ::open(ptyName.data(), O_RDWR);
- if (d->masterFd >= 0)
- {
-#ifdef __sun
- /* Need to check the process group of the pty.
- * If it exists, then the slave pty is in use,
- * and we need to get another one.
- */
- int pgrp_rtn;
- if (ioctl(d->masterFd, TIOCGPGRP, &pgrp_rtn) == 0 || errno != EIO) {
- ::close(d->masterFd);
- d->masterFd = -1;
- continue;
- }
-#endif /* sun */
- if (!access(d->ttyName.data(),R_OK|W_OK)) // checks availability based on permission bits
- {
- if (!geteuid())
- {
- struct group* p = getgrnam(TTY_GROUP);
- if (!p)
- p = getgrnam("wheel");
- gid_t gid = p ? p->gr_gid : getgid ();
-
- chown(d->ttyName.data(), getuid(), gid);
- chmod(d->ttyName.data(), S_IRUSR|S_IWUSR|S_IWGRP);
- }
- goto gotpty;
- }
- ::close(d->masterFd);
- d->masterFd = -1;
- }
- }
- }
-
- kdWarning(175) << "Can't open a pseudo teletype" << endl;
- return false;
-
- gotpty:
struct stat st;
if (stat(d->ttyName.data(), &st))
return false; // this just cannot happen ... *cough* Yeah right, I just
@@ -354,6 +304,92 @@ bool KPty::open()
return true;
}
+bool KPty::open()
+{
+ if (d->masterFd >= 0)
+ return true;
+
+ QCString ptyName;
+
+ // Find a master pty that we can open ////////////////////////////////
+
+ // Because not all the pty animals are created equal, they want to
+ // be opened by several different methods.
+
+ // We try, as we know them, one by one.
+
+#if defined(HAVE_PTSNAME) && defined(HAVE_GRANTPT)
+#ifdef _AIX
+ d->masterFd = ::open("/dev/ptc",O_RDWR);
+#else
+ d->masterFd = ::open("/dev/ptmx",O_RDWR);
+#endif
+ if (d->masterFd >= 0)
+ {
+ char *ptsn = ptsname(d->masterFd);
+ if (ptsn) {
+ grantpt(d->masterFd);
+ d->ttyName = ptsn;
+ goto gotpty;
+ } else {
+ ::close(d->masterFd);
+ d->masterFd = -1;
+ }
+ }
+#endif
+
+ // Linux device names, FIXME: Trouble on other systems?
+ for (const char* s3 = "pqrstuvwxyzabcdefghijklmno"; *s3; s3++)
+ {
+ for (const char* s4 = "0123456789abcdefghijklmnopqrstuvwxyz"; *s4; s4++)
+ {
+ ptyName.sprintf("/dev/pty%c%c", *s3, *s4);
+ d->ttyName.sprintf("/dev/tty%c%c", *s3, *s4);
+
+ d->masterFd = ::open(ptyName.data(), O_RDWR);
+ if (d->masterFd >= 0)
+ {
+#ifdef __sun
+ /* Need to check the process group of the pty.
+ * If it exists, then the slave pty is in use,
+ * and we need to get another one.
+ */
+ int pgrp_rtn;
+ if (ioctl(d->masterFd, TIOCGPGRP, &pgrp_rtn) == 0 || errno != EIO) {
+ ::close(d->masterFd);
+ d->masterFd = -1;
+ continue;
+ }
+#endif /* sun */
+ if (!access(d->ttyName.data(),R_OK|W_OK)) // checks availability based on permission bits
+ {
+ if (!geteuid())
+ {
+ struct group* p = getgrnam(TTY_GROUP);
+ if (!p)
+ p = getgrnam("wheel");
+ gid_t gid = p ? p->gr_gid : getgid ();
+
+ chown(d->ttyName.data(), getuid(), gid);
+ chmod(d->ttyName.data(), S_IRUSR|S_IWUSR|S_IWGRP);
+ }
+ goto gotpty;
+ }
+ ::close(d->masterFd);
+ d->masterFd = -1;
+ }
+ }
+ }
+
+ kdWarning(175) << "Can't open a pseudo teletype" << endl;
+ return false;
+
+ gotpty:
+ return _attachPty(d->masterFd);
+
+ return true;
+}
+
void KPty::close()
{
if (d->masterFd < 0)
diff --git a/kdecore/kpty.h b/kdecore/kpty.h
index 51d069ac0..a2ae33b28 100644
--- a/kdecore/kpty.h
+++ b/kdecore/kpty.h
@@ -61,6 +61,13 @@ public:
*/
bool open();
+ /**
+ * Attach a existing pty master
+ *
+ * @return true if the pty was successfully added
+ */
+ bool setPty(int pty_master);
+
/**
* Close the pty master/slave pair.
*/
@@ -138,6 +145,9 @@ public:
*/
int slaveFd() const;
+protected:
+ bool _attachPty(int pty_master);
+
private:
bool chownpty(bool grant);
diff --git a/kdecore/kstandarddirs.cpp b/kdecore/kstandarddirs.cpp
index 015590c2d..28568b74e 100644
--- a/kdecore/kstandarddirs.cpp
+++ b/kdecore/kstandarddirs.cpp
@@ -834,6 +834,10 @@ QStringList KStandardDirs::resourceDirs(const char *type) const
if ((local || testdir.exists()) && !candidates->contains(path))
candidates->append(path);
}
+ // UGLY HACK - Chris CHeney
+ if (local && (!strcmp("config", type)))
+ candidates->append("/etc/kde3/");
+ //
local = false;
}
}
@@ -1021,7 +1025,7 @@ QString KStandardDirs::kde_default(const char *type) {
if (!strcmp(type, "data"))
return "share/apps/";
if (!strcmp(type, "html"))
- return "share/doc/HTML/";
+ return "share/doc/kde/HTML/";
if (!strcmp(type, "icon"))
return "share/icons/";
if (!strcmp(type, "config"))
@@ -1041,7 +1045,7 @@ QString KStandardDirs::kde_default(const char *type) {
if (!strcmp(type, "mime"))
return "share/mimelnk/";
if (!strcmp(type, "cgi"))
- return "cgi-bin/";
+ return "lib/cgi-bin/";
if (!strcmp(type, "wallpaper"))
return "share/wallpapers/";
if (!strcmp(type, "templates"))
@@ -1315,7 +1319,7 @@ void KStandardDirs::addKDEDefaults()
}
else
{
- localKdeDir = QDir::homeDirPath() + "/.kde/";
+ localKdeDir = QDir::homeDirPath() + "/.kde3/";
}
if (localKdeDir != "-/")
@@ -1425,6 +1429,8 @@ void KStandardDirs::addKDEDefaults()
}
addResourceDir("home", QDir::homeDirPath());
+
+ addResourceDir("locale", "/usr/share/locale-langpack/", true);
}
void KStandardDirs::checkConfig() const
diff --git a/kdecore/kstartupinfo.cpp b/kdecore/kstartupinfo.cpp
index 3de0cb288..93107c128 100644
--- a/kdecore/kstartupinfo.cpp
+++ b/kdecore/kstartupinfo.cpp
@@ -1109,7 +1109,7 @@ unsigned long KStartupInfoId::timestamp() const
struct KStartupInfoDataPrivate
{
KStartupInfoDataPrivate() : desktop( 0 ), wmclass( "" ), hostname( "" ),
- silent( KStartupInfoData::Unknown ), timestamp( -1U ), screen( -1 ) {}
+ silent( KStartupInfoData::Unknown ), timestamp( -1U ), screen( -1 ), xinerama( -1 ), launched_by( 0 ) {}
QString bin;
QString name;
QString description;
@@ -1121,6 +1121,8 @@ struct KStartupInfoDataPrivate
KStartupInfoData::TriState silent;
unsigned long timestamp;
int screen;
+ int xinerama;
+ WId launched_by;
};
QString KStartupInfoData::to_text() const
@@ -1151,6 +1153,10 @@ QString KStartupInfoData::to_text() const
ret += QString::fromLatin1( " TIMESTAMP=%1" ).arg( d->timestamp );
if( d->screen != -1 )
ret += QString::fromLatin1( " SCREEN=%1" ).arg( d->screen );
+ if( d->xinerama != -1 )
+ ret += QString::fromLatin1( " XINERAMA=%1" ).arg( d->xinerama );
+ if( d->launched_by != 0 )
+ ret += QString::fromLatin1( " LAUNCHED_BY=%1" ).arg( d->launched_by );
return ret;
}
@@ -1169,6 +1175,8 @@ KStartupInfoData::KStartupInfoData( const QString& txt_P )
const QString silent_str = QString::fromLatin1( "SILENT=" );
const QString timestamp_str = QString::fromLatin1( "TIMESTAMP=" );
const QString screen_str = QString::fromLatin1( "SCREEN=" );
+ const QString xinerama_str = QString::fromLatin1( "XINERAMA=" );
+ const QString launched_by_str = QString::fromLatin1( "LAUNCHED_BY=" );
for( QStringList::Iterator it = items.begin();
it != items.end();
++it )
@@ -1199,6 +1207,10 @@ KStartupInfoData::KStartupInfoData( const QString& txt_P )
d->timestamp = get_unum( *it );
else if( ( *it ).startsWith( screen_str ))
d->screen = get_num( *it );
+ else if( ( *it ).startsWith( xinerama_str ))
+ d->xinerama = get_num( *it );
+ else if( ( *it ).startsWith( launched_by_str ))
+ d->launched_by = get_num( *it );
}
}
@@ -1242,6 +1254,10 @@ void KStartupInfoData::update( const KStartupInfoData& data_P )
d->timestamp = data_P.timestamp();
if( data_P.screen() != -1 )
d->screen = data_P.screen();
+ if( data_P.xinerama() != -1 && xinerama() != -1 ) // don't overwrite
+ d->xinerama = data_P.xinerama();
+ if( data_P.launchedBy() != 0 && launchedBy() != 0 ) // don't overwrite
+ d->launched_by = data_P.launchedBy();
}
KStartupInfoData::KStartupInfoData()
@@ -1412,6 +1428,26 @@ int KStartupInfoData::screen() const
return d->screen;
}
+void KStartupInfoData::setXinerama( int xinerama )
+ {
+ d->xinerama = xinerama;
+ }
+
+int KStartupInfoData::xinerama() const
+ {
+ return d->xinerama;
+ }
+
+void KStartupInfoData::setLaunchedBy( WId window )
+ {
+ d->launched_by = window;
+ }
+
+WId KStartupInfoData::launchedBy() const
+ {
+ return d->launched_by;
+ }
+
static
long get_num( const QString& item_P )
{
diff --git a/kdecore/kstartupinfo.h b/kdecore/kstartupinfo.h
index e77944dd3..ca8b21c66 100644
--- a/kdecore/kstartupinfo.h
+++ b/kdecore/kstartupinfo.h
@@ -635,6 +635,30 @@ class KDECORE_EXPORT KStartupInfoData
* This is usually not necessary to set, as it's set by default to qt_xscreen().
*/
void setScreen( int screen );
+
+ /**
+ * The Xinerama screen for the startup notification, -1 if unknown.
+ */
+ int xinerama() const;
+
+ /**
+ * Sets the Xinerama screen for the startup notification ( i.e. the screeen on which
+ * the starting application should appear ).
+ * @param xinerama the Xinerama screen for the startup notification
+ */
+ void setXinerama( int xinerama );
+
+ /**
+ * The toplevel window of the application that caused this startup notification,
+ * 0 if unknown.
+ */
+ WId launchedBy() const;
+
+ /**
+ * Sets the toplevel window of the application that caused this startup notification.
+ * @param window window ID of the toplevel window that is responsible for this startup
+ */
+ void setLaunchedBy( WId window );
/**
* Updates the notification data from the given data. Some data, such as the desktop
diff --git a/kdecore/netwm.cpp b/kdecore/netwm.cpp
index e0685abc7..9e7d4580e 100644
--- a/kdecore/netwm.cpp
+++ b/kdecore/netwm.cpp
@@ -145,6 +145,9 @@ static Atom net_wm_state_stays_on_top = 0;
// used to determine whether application window is managed or not
static Atom xa_wm_state = 0;
+// ability flags
+static Atom net_wm_full_placement = 0;
+
static Bool netwm_atoms_created = False;
const unsigned long netwm_sendevent_mask = (SubstructureRedirectMask|
SubstructureNotifyMask);
@@ -236,7 +239,7 @@ static int wcmp(const void *a, const void *b) {
}
-static const int netAtomCount = 84;
+static const int netAtomCount = 85;
static void create_atoms(Display *d) {
static const char * const names[netAtomCount] =
{
@@ -330,7 +333,9 @@ static void create_atoms(Display *d) {
"_KDE_NET_WM_TEMPORARY_RULES",
"WM_STATE",
- "WM_PROTOCOLS"
+ "WM_PROTOCOLS",
+
+ "_NET_WM_FULL_PLACEMENT"
};
Atom atoms[netAtomCount], *atomsp[netAtomCount] =
@@ -425,7 +430,9 @@ static void create_atoms(Display *d) {
&kde_net_wm_temporary_rules,
&xa_wm_state,
- &wm_protocols
+ &wm_protocols,
+
+ &net_wm_full_placement
};
assert( !netwm_atoms_created );
@@ -1355,6 +1362,8 @@ void NETRootInfo::setSupported() {
if (p->properties[ PROTOCOLS2 ] & WM2KDETemporaryRules)
atoms[pnum++] = kde_net_wm_temporary_rules;
+ if (p->properties[ PROTOCOLS2 ] & WM2FullPlacement)
+ atoms[pnum++] = net_wm_full_placement;
XChangeProperty(p->display, p->root, net_supported, XA_ATOM, 32,
PropModeReplace, (unsigned char *) atoms, pnum);
@@ -1587,6 +1596,8 @@ void NETRootInfo::updateSupportedProperties( Atom atom )
else if( atom == kde_net_wm_temporary_rules )
p->properties[ PROTOCOLS2 ] |= WM2KDETemporaryRules;
+ else if( atom == net_wm_full_placement )
+ p->properties[ PROTOCOLS2 ] |= WM2FullPlacement;
}
extern Time qt_x_user_time;
diff --git a/kdecore/netwm_def.h b/kdecore/netwm_def.h
index f2e11505d..94042cf1c 100644
--- a/kdecore/netwm_def.h
+++ b/kdecore/netwm_def.h
@@ -610,6 +610,7 @@ public:
WM2WindowRole = 1<<11, ///< @since 3.3
WM2ClientMachine = 1<<12, ///< @since 3.3
WM2ShowingDesktop = 1<<13, ///< @since 3.5
+ WM2FullPlacement = 1<<14,
WM2DesktopLayout = 1<<15 ///< @since 3.5.8
};
diff --git a/kdecore/network/kresolverworkerbase.cpp b/kdecore/network/kresolverworkerbase.cpp
index 32a32da2a..5d8cdaa9b 100644
--- a/kdecore/network/kresolverworkerbase.cpp
+++ b/kdecore/network/kresolverworkerbase.cpp
@@ -127,19 +127,16 @@ bool KResolverWorkerBase::enqueue(KResolverWorkerBase* worker)
bool KResolverWorkerBase::checkResolver()
{
- assert(th != 0L);
return th->checkResolver();
}
void KResolverWorkerBase::acquireResolver()
{
- assert(th != 0L);
th->acquireResolver();
}
void KResolverWorkerBase::releaseResolver()
{
- assert(th != 0L);
th->releaseResolver();
}
diff --git a/kded/Makefile.am b/kded/Makefile.am
index 8750d0486..8437919f0 100644
--- a/kded/Makefile.am
+++ b/kded/Makefile.am
@@ -23,11 +23,11 @@ lib_LTLIBRARIES =
kdeinit_LTLIBRARIES = kded.la kbuildsycoca.la
kded_la_LDFLAGS = $(all_libraries) -module -avoid-version
-kded_la_LIBADD = $(LIB_KIO)
+kded_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_KDECORE) $(top_builddir)/dcop/libDCOP.la $(LIB_X11)
kded_la_SOURCES = kded.cpp kdedmodule.cpp
kbuildsycoca_la_LDFLAGS = $(all_libraries) -module -avoid-version
-kbuildsycoca_la_LIBADD = $(LIB_KIO)
+kbuildsycoca_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_KDECORE)
kbuildsycoca_la_SOURCES = kbuildsycoca.cpp kbuildservicetypefactory.cpp \
kbuildservicefactory.cpp \
kbuildservicegroupfactory.cpp \
@@ -43,7 +43,7 @@ kdontchangethehostname_LDADD = $(LIB_KDECORE)
kdontchangethehostname_SOURCES = khostname.cpp
kde_menu_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-kde_menu_LDADD = $(LIB_KIO)
+kde_menu_LDADD = $(LIB_KIO)
kde_menu_SOURCES = kde-menu.cpp
METASOURCES = AUTO
diff --git a/kded/applications.menu b/kded/applications.menu
index be08eb848..16cfb24d1 100644
--- a/kded/applications.menu
+++ b/kded/applications.menu
@@ -248,6 +248,7 @@
<And>
<Category>Graphics</Category>
<Not><Category>X-KDE-More</Category></Not>
+ <Not><Filename>ooo-draw.desktop</Filename></Not>
</And>
</Include>
<Menu>
@@ -325,6 +326,7 @@
<Category>Office</Category>
<Not><Category>X-KDE-More</Category></Not>
</And>
+ <Filename>ooo-draw.desktop</Filename>
</Include>
<Menu>
<Name>More</Name>
@@ -376,74 +378,20 @@
<Name>Utilities</Name>
<Directory>kde-utilities.directory</Directory>
<Include>
- <And>
+ <And>
+ <Or>
<Category>Utility</Category>
- <Not><Category>Accessibility</Category></Not>
- <Not><Category>X-KDE-Utilities-Desktop</Category></Not>
- <Not><Category>X-KDE-Utilities-File</Category></Not>
- <Not><Category>X-KDE-Utilities-Peripherals</Category></Not>
- <Not><Category>X-KDE-Utilities-PIM</Category></Not>
+ <Category>TextEditor</Category>
+ <Category>X-KDE-Utilities-File</Category>
+ <Category>X-KDE-Utilities-Desktop</Category>
+ <Category>X-KDE-Utilities-Peripherals</Category>
+ <Category>X-KDE-Utilities-PIM</Category>
+ <Category>Accessibility</Category>
+ </Or>
<Not><Category>X-KDE-More</Category></Not>
- </And>
+ </And>
</Include>
<Menu>
- <Name>Accessibility</Name>
- <Directory>kde-utilities-accessibility.directory</Directory>
- <Include>
- <And>
- <Category>Utility</Category>
- <Category>Accessibility</Category>
- </And>
- </Include>
- </Menu>
- <Menu>
- <Name>Desktop</Name>
- <Directory>kde-utilities-desktop.directory</Directory>
- <Include>
- <And>
- <Category>Utility</Category>
- <Category>X-KDE-Utilities-Desktop</Category>
- </And>
- </Include>
- </Menu>
- <Menu>
- <Name>Editors</Name>
- <Directory>kde-editors.directory</Directory>
- <Include>
- <Category>TextEditor</Category>
- </Include>
- </Menu>
- <Menu>
- <Name>File</Name>
- <Directory>kde-utilities-file.directory</Directory>
- <Include>
- <And>
- <Category>Utility</Category>
- <Category>X-KDE-Utilities-File</Category>
- </And>
- </Include>
- </Menu>
- <Menu>
- <Name>Peripherals</Name>
- <Directory>kde-utilities-peripherals.directory</Directory>
- <Include>
- <And>
- <Category>Utility</Category>
- <Category>X-KDE-Utilities-Peripherals</Category>
- </And>
- </Include>
- </Menu>
- <Menu>
- <Name>PIM</Name>
- <Directory>kde-utilities-pim.directory</Directory>
- <Include>
- <And>
- <Category>Utility</Category>
- <Category>X-KDE-Utilities-PIM</Category>
- </And>
- </Include>
- </Menu>
- <Menu>
<Name>XUtilities</Name>
<Directory>kde-utilities-xutils.directory</Directory>
</Menu>
@@ -465,5 +413,13 @@
</And>
</Include>
<DefaultMergeDirs/>
+
+ <Menu>
+ <Name>Debian</Name>
+ <Directory>debian.directory</Directory>
+ <MergeFile>debian-menu.menu</MergeFile>
+ </Menu>
+
+ <MergeDir>applications-merged</MergeDir>
<MergeFile>applications-kmenuedit.menu</MergeFile>
</Menu>
diff --git a/kded/kbuildservicefactory.cpp b/kded/kbuildservicefactory.cpp
index a824aa28d..18aef1d29 100644
--- a/kded/kbuildservicefactory.cpp
+++ b/kded/kbuildservicefactory.cpp
@@ -158,7 +158,7 @@ KBuildServiceFactory::saveOfferList(QDataStream &str)
KServiceType::Ptr serviceType = KServiceType::serviceType(*it);
if (!serviceType)
{
- kdWarning() << "'"<< service->desktopEntryPath() << "' specifies undefined mimetype/servicetype '"<< (*it) << "'" << endl;
+ // kdWarning() << "'"<< service->desktopEntryPath() << "' specifies undefined mimetype/servicetype '"<< (*it) << "'" << endl;
continue;
}
serviceTypes.append(serviceType);
diff --git a/kded/kded.cpp b/kded/kded.cpp
index ed4c5e75e..df16faddb 100644
--- a/kded/kded.cpp
+++ b/kded/kded.cpp
@@ -162,12 +162,27 @@ void Kded::initModules()
kde_running = false;
// Preload kded modules.
KService::List kdedModules = KServiceType::offers("KDEDModule");
+ QString version = getenv( "KDE_SESSION_VERSION" );
+ QStringList blacklist;
+ if ( version >= "4" )
+ {
+ kdDebug(7020) << "KDE4 is running." << endl;
+ blacklist << "mediamanager" << "medianotifier" << "kmilod" << "kwrited";
+ }
for(KService::List::ConstIterator it = kdedModules.begin(); it != kdedModules.end(); ++it)
{
KService::Ptr service = *it;
bool autoload = service->property("X-KDE-Kded-autoload", QVariant::Bool).toBool();
config->setGroup(QString("Module-%1").arg(service->desktopEntryName()));
autoload = config->readBoolEntry("autoload", autoload);
+ for (QStringList::Iterator module = blacklist.begin(); module != blacklist.end(); ++module)
+ {
+ if (service->desktopEntryName() == *module)
+ {
+ autoload = false;
+ break;
+ }
+ }
if( m_newStartup )
{
// see ksmserver's README for description of the phases
diff --git a/kded/vfolder_menu.cpp b/kded/vfolder_menu.cpp
index f73ef0c8e..baa3c88b0 100644
--- a/kded/vfolder_menu.cpp
+++ b/kded/vfolder_menu.cpp
@@ -774,7 +774,9 @@ VFolderMenu::locateMenuFile(const QString &fileName)
QString result;
- QString xdgMenuPrefix = QString::fromLocal8Bit(getenv("XDG_MENU_PREFIX"));
+ //QString xdgMenuPrefix = QString::fromLocal8Bit(getenv("XDG_MENU_PREFIX"));
+ // hardcode xdgMenuPrefix to "kde-" string until proper upstream fix
+ QString xdgMenuPrefix = "kde-";
if (!xdgMenuPrefix.isEmpty())
{
QFileInfo fileInfo(fileName);
diff --git a/kdefx/Makefile.am b/kdefx/Makefile.am
index d584ed2cb..52744c9cf 100644
--- a/kdefx/Makefile.am
+++ b/kdefx/Makefile.am
@@ -24,7 +24,7 @@ INCLUDES= $(all_includes)
lib_LTLIBRARIES = libkdefx.la
libkdefx_la_LDFLAGS = $(KDE_RPATH) $(KDE_MT_LDFLAGS) $(all_libraries) -no-undefined -version-info 6:0:2
-libkdefx_la_LIBADD = $(LIB_QT) $(LIB_XRENDER)
+libkdefx_la_LIBADD = $(LIB_QT) $(LIB_XRENDER) $(LIB_X11)
libkdefx_la_NMCHECK = $(srcdir)/libkdefx.nmcheck
libkdefx_la_NMCHECKWEAK = $(srcdir)/libkdefx_weak.nmcheck $(top_srcdir)/kdecore/libqt-mt_weak.nmcheck \
$(top_srcdir)/kdecore/standard_weak.nmcheck
diff --git a/kdefx/kstyle.cpp b/kdefx/kstyle.cpp
index 5ce02012b..08fe94995 100644
--- a/kdefx/kstyle.cpp
+++ b/kdefx/kstyle.cpp
@@ -154,6 +154,7 @@ struct KStylePrivate
bool menuAltKeyNavigation : 1;
bool menuDropShadow : 1;
bool sloppySubMenus : 1;
+ bool semiTransparentRubberband : 1;
int popupMenuDelay;
float menuOpacity;
@@ -187,6 +188,7 @@ KStyle::KStyle( KStyleFlags flags, KStyleScrollBarType sbtype )
d->menuAltKeyNavigation = settings.readBoolEntry("/KStyle/Settings/MenuAltKeyNavigation", true);
d->scrollablePopupmenus = settings.readBoolEntry("/KStyle/Settings/ScrollablePopupMenus", false);
d->menuDropShadow = settings.readBoolEntry("/KStyle/Settings/MenuDropShadow", false);
+ d->semiTransparentRubberband = settings.readBoolEntry("/KStyle/Settings/SemiTransparentRubberband", false);
d->menuHandler = NULL;
if (useMenuTransparency) {
@@ -553,7 +555,57 @@ void KStyle::drawPrimitive( PrimitiveElement pe,
else
// General handle, probably a kicker applet handle.
drawKStylePrimitive( KPE_GeneralHandle, p, widget, r, cg, flags, opt );
+#if QT_VERSION >= 0x030300
+#ifdef HAVE_XRENDER
+ } else if ( d->semiTransparentRubberband && pe == QStyle::PE_RubberBand ) {
+ QRect rect = r.normalize();
+ QPoint point;
+ point = p->xForm( point );
+
+ static XRenderColor clr = { 0, 0, 0, 0 };
+ static unsigned long fillColor = 0;
+ if ( fillColor != cg.highlight().rgb() ) {
+ fillColor = cg.highlight().rgb();
+
+ unsigned long color = fillColor << 8 | 0x40;
+
+ int red = (color >> 24) & 0xff;
+ int green = (color >> 16) & 0xff;
+ int blue = (color >> 8) & 0xff;
+ int alpha = (color >> 0) & 0xff;
+
+ red = red * alpha / 255;
+ green = green * alpha / 255;
+ blue = blue * alpha / 255;
+ clr.red = (red << 8) + red;
+ clr.green = (green << 8) + green;
+ clr.blue = (blue << 8) + blue;
+ clr.alpha = (alpha << 8) + alpha;
+ }
+
+ XRenderFillRectangle(
+ p->device()->x11Display(),
+ PictOpOver,
+ p->device()->x11RenderHandle(),
+ &clr,
+ rect.x() + point.x(),
+ rect.y() + point.y(),
+ rect.width(),
+ rect.height() );
+
+ p->save();
+ p->setRasterOp( Qt::CopyROP );
+ p->setPen( QPen( cg.highlight().dark( 160 ), 1 ) );
+ p->setBrush( NoBrush );
+ p->drawRect(
+ rect.x() + point.x(),
+ rect.y() + point.y(),
+ rect.width(),
+ rect.height() );
+ p->restore();
+#endif
+#endif
} else
QCommonStyle::drawPrimitive( pe, p, r, cg, flags, opt );
}
diff --git a/kdelibs.lsm b/kdelibs.lsm
index ef521f81c..9501ab846 100644
--- a/kdelibs.lsm
+++ b/kdelibs.lsm
@@ -1,11 +1,11 @@
Begin4
Title: kdelibs
-Version: 3.5.10
+Version: Trinity 3.5.11
Entered-date: 2008-08-26
Description: libraries for the K Desktop Environment (KDE)
Keywords: KDE X11 desktop Qt
-Author: http://bugs.kde.org/ (KDE Bugtracking System)
-Primary-site: http://www.kde.org/download/
+Author: http://bugs.pearsoncomputing.net/ (KDE Trinity Bugtracking System)
+Primary-site: http://trinity.pearsoncomputing.net/
Platforms: Unix, Qt
Copying-policy: LGPL, Artistic
End
diff --git a/kdeprint/Makefile.am b/kdeprint/Makefile.am
index 2379e5f02..06f3a583c 100644
--- a/kdeprint/Makefile.am
+++ b/kdeprint/Makefile.am
@@ -11,7 +11,7 @@ INCLUDES= -I$(top_srcdir)/kdefx -I$(top_srcdir)/kded -I$(top_srcdir) $(all_inclu
kde_module_LTLIBRARIES = kded_kdeprintd.la
kded_kdeprintd_la_SOURCES = kdeprintd.skel kdeprintd.cpp kprintprocess.cpp
-kded_kdeprintd_la_LIBADD = $(LIB_KIO) $(LIB_KDED)
+kded_kdeprintd_la_LIBADD = $(LIB_KIO) $(LIB_KDED) $(LIB_QT) $(LIB_KDEUI) $(top_builddir)/dcop/libDCOP.la $(LIB_KDECORE) $(top_builddir)/kded/libkdeinit_kded.la
kded_kdeprintd_la_LDFLAGS = $(all_libraries) -module -avoid-version
#kded_kdeprintd_la_METASOURCES = AUTO
@@ -30,7 +30,7 @@ libkdeprint_la_SOURCES = kmfactory.cpp kmjob.cpp kmjobmanager.cpp kmmanager.cpp
fooparser.cpp fooscanner.cpp ppdparser.cpp ppdscanner.cpp ppdloader.cpp
libkdeprint_la_LDFLAGS = $(all_libraries) -version-info 6:0:2 -no-undefined
-libkdeprint_la_LIBADD = $(LIB_KPARTS) $(LIBZ)
+libkdeprint_la_LIBADD = $(LIBZ) $(LIB_QT) $(LIB_KDEUI) $(top_builddir)/dcop/libDCOP.la $(LIB_KDECORE) $(LIB_KFILE)
libkdeprint_la_DEPENDENCIES = $(LIB_KPARTS)
libkdeprint_la_METASOURCES = AUTO
diff --git a/kdeprint/configure.in.in b/kdeprint/configure.in.in
index 8dd3880d6..3165cc4c4 100644
--- a/kdeprint/configure.in.in
+++ b/kdeprint/configure.in.in
@@ -51,10 +51,11 @@ if test "$ac_use_cups" = "yes"; then
ac_LDFLAGS_save="$LDFLAGS"
LDFLAGS="$LDFLAGS $all_libraries"
kde_cups_config=
- kde_cups_libs="-lcups $LIBDL $LIBSOCKET"
+ kde_cups_libs="-lcups"
AC_PATH_PROG(kde_cups_config,cups-config)
if test -n "$kde_cups_config"; then
- kde_cups_libs=`$kde_cups_config --libs`
+# kde_cups_libs=`$kde_cups_config --libs`
+ kde_cups_libs="$kde_cups_libs"
else
AC_MSG_RESULT(cups-config not found, using default libraries: $kde_cups_libs. You should consider upgrading CUPS)
fi
diff --git a/kdeprint/cups/Makefile.am b/kdeprint/cups/Makefile.am
index 60bd22c08..4e21a545e 100644
--- a/kdeprint/cups/Makefile.am
+++ b/kdeprint/cups/Makefile.am
@@ -15,7 +15,7 @@ kdeprint_cups_la_SOURCES = cupsinfos.cpp ipprequest.cpp kmcupsfactory.cpp kmcups
kptextpage.cpp kphpgl2page.cpp cupsaddsmb2.cpp kmwother.cpp ippreportdlg.cpp \
kptagspage.cpp
kdeprint_cups_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
-kdeprint_cups_la_LIBADD = $(top_builddir)/kdeprint/management/libkdeprint_management.la $(LIB_KIO) $(LIB_CUPS) $(top_builddir)/kdecore/libkdefakes.la
+kdeprint_cups_la_LIBADD = $(top_builddir)/kdeprint/management/libkdeprint_management.la $(LIB_KIO) $(LIB_CUPS) $(LIB_QT) $(LIB_KDEPRINT) $(LIB_KDECORE) $(LIB_KDEUI)
kdeprint_cups_la_METASOURCES = AUTO
noinst_HEADERS = cupsinfos.h ipprequest.h kmcupsjobmanager.h kmcupsmanager.h kmcupsuimanager.h \
diff --git a/kdeprint/cups/cupsdconf2/Makefile.am b/kdeprint/cups/cupsdconf2/Makefile.am
index 84c68ae98..58c83dc6d 100644
--- a/kdeprint/cups/cupsdconf2/Makefile.am
+++ b/kdeprint/cups/cupsdconf2/Makefile.am
@@ -15,7 +15,7 @@ cupsdconf_la_SOURCES = cupsdconf.cpp cupsddialog.cpp cupsdpage.cpp cupsdcomment.
qdirmultilineedit.cpp sizewidget.cpp main.cpp
cupsdconf_la_METASOURCES = AUTO
cupsdconf_la_LDFLAGS = -avoid-version -module $(all_libraries) $(KDE_RPATH)
-cupsdconf_la_LIBADD = $(LIB_KIO) $(LIB_CUPS)
+cupsdconf_la_LIBADD = $(LIB_KIO) $(LIB_CUPS) $(LIB_QT) $(LIB_KDEUI) $(LIB_KDECORE)
noinst_HEADERS = cupsdconf.h cupsdpage.h cupsddialog.h cupsdcomment.h cupsdsplash.h \
cupsdserverpage.h cupsdlogpage.h cupsdjobspage.h cupsdfilterpage.h \
diff --git a/kdeprint/cups/cupsdconf2/cupsd.conf.template b/kdeprint/cups/cupsdconf2/cupsd.conf.template
index c91f0dfa3..ae1a4c362 100644
--- a/kdeprint/cups/cupsdconf2/cupsd.conf.template
+++ b/kdeprint/cups/cupsdconf2/cupsd.conf.template
@@ -100,9 +100,9 @@ $$
# The root directory for HTTP documents that are served.
# By default the compiled-in directory.</p>
# <p>
-# <i>ex</i>: /usr/share/cups/doc</p>
+# <i>ex</i>: /usr/share/cups/doc-root</p>
$$
-#DocumentRoot /usr/share/cups/doc
+#DocumentRoot /usr/share/cups/doc-root
@@
%%errorlog
@@ -272,12 +272,12 @@ $$
# <b>Group (Group)</b>
# <p>
# The group the server runs under. Normally this
-# must be <b>sys</b>, however you can configure things for another
+# must be <b>lpadmin</b>, however you can configure things for another
# group as needed.</p>
# <p>
-# <i>ex</i>: sys</p>
+# <i>ex</i>: lpadmin</p>
$$
-#Group sys
+#Group lpadmin
@@
%%ripcache
@@ -592,9 +592,9 @@ $$
# access. The default varies depending on the operating system, but
# will be <b>sys</b>, <b>system</b>, or <b>root</b> (checked for in that order).</p>
# <p>
-# <i>ex</i>: sys</p>
+# <i>ex</i>: lpadmin</p>
$$
-#SystemGroup sys
+#SystemGroup lpadmin
@@
%%servercertificate
diff --git a/kdeprint/cups/cupsdconf2/cupsdconf.cpp b/kdeprint/cups/cupsdconf2/cupsdconf.cpp
index 4018ab2fb..1794d693d 100644
--- a/kdeprint/cups/cupsdconf2/cupsdconf.cpp
+++ b/kdeprint/cups/cupsdconf2/cupsdconf.cpp
@@ -66,7 +66,7 @@ CupsdConf::CupsdConf()
<< "/usr/local/share/cups"
<< "/opt/share/cups"
<< "/opt/local/share/cups");
- documentdir_ = findDir(QStringList(datadir_+"/doc")
+ documentdir_ = findDir(QStringList(datadir_+"/doc-root")
<< datadir_.left(datadir_.length()-5)+"/doc/cups");
//fontpath_ << (datadir_+"/fonts");
requestdir_ = findDir(QStringList("/var/spool/cups")
@@ -90,7 +90,7 @@ CupsdConf::CupsdConf()
printcap_ = "/etc/printcap";
printcapformat_ = PRINTCAP_BSD;
remoteroot_ = "remroot";
- systemgroup_ = "sys";
+ systemgroup_ = "lpadmin";
encryptcert_ = serverfiles_+"/ssl/server.crt";
encryptkey_ = serverfiles_+"/ssl/server.key";
hostnamelookup_ = HOSTNAME_OFF;
@@ -115,7 +115,7 @@ CupsdConf::CupsdConf()
maxjobsperprinter_ = 0;
maxjobsperuser_ = 0;
user_ = "lp";
- group_ = "sys";
+ group_ = "lpadmin";
ripcache_ = "8m";
filterlimit_ = 0;
browsing_ = true;
diff --git a/kdeprint/cups/cupsdconf2/cupsddialog.cpp b/kdeprint/cups/cupsdconf2/cupsddialog.cpp
index a70b5b59e..92f8eef51 100644
--- a/kdeprint/cups/cupsdconf2/cupsddialog.cpp
+++ b/kdeprint/cups/cupsdconf2/cupsddialog.cpp
@@ -206,14 +206,9 @@ bool CupsdDialog::restartServer(QString& msg)
else
{
bool success = false;
- if (getuid() == 0 )
- success = (::kill(serverPid, SIGHUP) == 0);
- else
- {
- KProcess proc;
- proc << "kdesu" << "-c" << "kill -SIGHUP " + QString::number( serverPid );
- success = proc.start( KProcess::Block ) && proc.normalExit();
- }
+ KProcess proc;
+ proc << "kdesu" << "-c" << "/etc/init.d/cupsys restart";
+ success = proc.start( KProcess::Block ) && proc.normalExit();
if( !success )
msg = i18n("Unable to restart CUPS server (pid = %1)").arg(serverPid);
}
diff --git a/kdeprint/cups/kmcupsmanager.cpp b/kdeprint/cups/kmcupsmanager.cpp
index bc17bb93d..003d408fc 100644
--- a/kdeprint/cups/kmcupsmanager.cpp
+++ b/kdeprint/cups/kmcupsmanager.cpp
@@ -95,7 +95,7 @@ KMCupsManager::~KMCupsManager()
QString KMCupsManager::driverDbCreationProgram()
{
- return QString::fromLatin1("make_driver_db_cups");
+ return QString::fromLatin1("/opt/kde3/bin/make_driver_db_cups");
}
QString KMCupsManager::driverDirectory()
diff --git a/kdeprint/ext/Makefile.am b/kdeprint/ext/Makefile.am
index a280e1451..1cb50d9fb 100644
--- a/kdeprint/ext/Makefile.am
+++ b/kdeprint/ext/Makefile.am
@@ -6,7 +6,7 @@ kde_module_LTLIBRARIES = kdeprint_ext.la
kdeprint_ext_la_SOURCES = kmextfactory.cpp kmextmanager.cpp kextprinterimpl.cpp kmextuimanager.cpp
kdeprint_ext_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
-kdeprint_ext_la_LIBADD = $(top_builddir)/kdeprint/libkdeprint.la
+kdeprint_ext_la_LIBADD = $(LIB_KDEPRINT) $(LIB_QT) $(LIB_KDECORE)
kdeprint_ext_la_METASOURCES = AUTO
noinst_HEADERS = kmextmanager.h kextprinterimpl.h kmextuimanager.h
diff --git a/kdeprint/filters/psnup.xml b/kdeprint/filters/psnup.xml
index 76436f81c..54b71531f 100644
--- a/kdeprint/filters/psnup.xml
+++ b/kdeprint/filters/psnup.xml
@@ -11,6 +11,15 @@
</filterarg>
<filterarg name="box" description="Border line width" format="-d%value" type="int" min="0" max="20" default="0" />
<filterarg name="margin" description="Additional margin" format="-b%value" type="int" min="0" max="100" default="0" />
+ <filterarg name="orientation" description="Orientation" format="%value" type="list" default="">
+ <value name="" description="Normal" />
+ <value name="-l" description="Landscape" />
+ <value name="-r" description="Seascape" />
+ </filterarg>
+ <filterarg name="layout" description="Layout" format="%value" type="list" default="">
+ <value name="" description="Row-Major" />
+ <value name="-c" description="Column-Major" />
+ </filterarg>
</filterargs>
<filterinput>
<filterarg name="file" format="%in" />
diff --git a/kdeprint/kprinter.cpp b/kdeprint/kprinter.cpp
index e6a0d0eb7..bba70e62d 100644
--- a/kdeprint/kprinter.cpp
+++ b/kdeprint/kprinter.cpp
@@ -403,7 +403,7 @@ bool KPrinter::printFiles(const QStringList& l, bool flag, bool startviewer)
}
else
{
- if (/* !outputToFile() && */ startviewer)
+ if (/* !outputToFile() && */ startviewer && !QFile::exists("/etc/xdg/autostart/system-config-printer-applet-kde.desktop") )
{
QStringList args;
args << "-d";
diff --git a/kdeprint/lpdunix/Makefile.am b/kdeprint/lpdunix/Makefile.am
index 79d4dce56..89b08d839 100644
--- a/kdeprint/lpdunix/Makefile.am
+++ b/kdeprint/lpdunix/Makefile.am
@@ -6,7 +6,7 @@ kde_module_LTLIBRARIES = kdeprint_lpdunix.la
kdeprint_lpdunix_la_SOURCES = kmlpdunixfactory.cpp kmlpdunixmanager.cpp klpdunixprinterimpl.cpp kmlpdunixuimanager.cpp
kdeprint_lpdunix_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
-kdeprint_lpdunix_la_LIBADD = $(top_builddir)/kdeprint/management/libkdeprint_management.la
+kdeprint_lpdunix_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEPRINT)
kdeprint_lpdunix_la_METASOURCES = AUTO
noinst_HEADERS = kmlpdunixmanager.h klpdunixprinterimpl.h kmlpdunixuimanager.h
diff --git a/kdeprint/lpr/Makefile.am b/kdeprint/lpr/Makefile.am
index 4ee2545ca..29944f348 100644
--- a/kdeprint/lpr/Makefile.am
+++ b/kdeprint/lpr/Makefile.am
@@ -13,7 +13,8 @@ kdeprint_lpr_la_SOURCES = printcapreader.cpp lprhandler.cpp \
lprngtoolhandler.cpp \
editentrydialog.cpp
kdeprint_lpr_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
-kdeprint_lpr_la_LIBADD = $(top_builddir)/kdeprint/management/libkdeprint_management.la $(top_builddir)/kdecore/libkdefakes.la
+kdeprint_lpr_la_LIBADD = $(top_builddir)/kdeprint/management/libkdeprint_management.la \
+ $(LIB_QT) $(LIB_KDEPRINT) $(LIB_KDEUI) $(LIB_KDECORE)
kdeprint_lpr_la_METASOURCES = AUTO
noinst_HEADERS = printcapreader.h \
diff --git a/kdeprint/management/Makefile.am b/kdeprint/management/Makefile.am
index b6485fdfb..42bdeba4d 100644
--- a/kdeprint/management/Makefile.am
+++ b/kdeprint/management/Makefile.am
@@ -8,7 +8,7 @@ kdeinit_LTLIBRARIES = kaddprinterwizard.la
bin_PROGRAMS =
kaddprinterwizard_la_SOURCES = kaddprinterwizard.cpp
-kaddprinterwizard_la_LIBADD = libkdeprint_management.la
+kaddprinterwizard_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEPRINT) $(LIB_KDEUI)
kaddprinterwizard_la_LDFLAGS = -module -avoid-version $(all_libraries) $(KDE_RPATH)
libkdeprint_management_la_SOURCES = \
@@ -26,12 +26,12 @@ libkdeprint_management_la_SOURCES = \
pluginaction.cpp kxmlcommanddlg.cpp kxmlcommandselector.cpp kmconfigcommand.cpp \
kmconfigfilter.cpp kmconfigfonts.cpp kmconfigjobs.cpp networkscanner.cpp
libkdeprint_management_la_LDFLAGS = $(all_libraries) -version-info 6:0:2 -no-undefined
-libkdeprint_management_la_LIBADD = ../libkdeprint.la
+libkdeprint_management_la_LIBADD = ../libkdeprint.la $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KFILE)
libkdeprint_management_la_METASOURCES = AUTO
libkdeprint_management_module_la_SOURCES = kdeprint_management_module.cpp
libkdeprint_management_module_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) -no-undefined
-libkdeprint_management_module_la_LIBADD = libkdeprint_management.la
+libkdeprint_management_module_la_LIBADD = libkdeprint_management.la $(LIB_QT) $(LIB_KDEUI) $(LIB_KDECORE)
kdeprint_HEADERS = kmmainview.h kmjobviewer.h kmprinterpage.h kiconselectaction.h kmtimer.h
kdeprintdir = $(includedir)/kdeprint
diff --git a/kdeprint/management/kmmainview.cpp b/kdeprint/management/kmmainview.cpp
index c506725af..a1ecd6bbc 100644
--- a/kdeprint/management/kmmainview.cpp
+++ b/kdeprint/management/kmmainview.cpp
@@ -209,6 +209,7 @@ void KMMainView::initActions()
new KAction(i18n("R&estart Server"),"kdeprint_restartsrv",0,this,SLOT(slotServerRestart()),m_actions,"server_restart");
new KAction(i18n("Configure &Server..."),"kdeprint_configsrv",0,this,SLOT(slotServerConfigure()),m_actions,"server_configure");
+ new KAction(i18n("Configure Server Access..."),"kdeprint_configsrv",0,this,SLOT(slotServerAccessConfigure()),m_actions,"server_access_configure");
KToggleAction *tact = new KToggleAction(i18n("Show &Toolbar"),0,m_actions,"view_toolbar");
tact->setCheckedState(i18n("Hide &Toolbar"));
@@ -691,6 +692,13 @@ void KMMainView::slotServerConfigure()
}
}
+void KMMainView::slotServerConfigureAccess()
+{
+ KProcess *proc = new KProcess;
+ *proc << "/usr/bin/system-config-printer-kde";
+ proc->start(KProcess::DontCare);
+}
+
void KMMainView::slotToggleToolBar(bool on)
{
if (on) m_toolbar->show();
diff --git a/kdeprint/management/kmmainview.h b/kdeprint/management/kmmainview.h
index 150ee9129..2e521e50f 100644
--- a/kdeprint/management/kmmainview.h
+++ b/kdeprint/management/kmmainview.h
@@ -78,6 +78,7 @@ public slots:
void slotTest();
void slotServerRestart();
void slotServerConfigure();
+ void slotServerConfigureAccess();
void slotManagerConfigure();
void slotAddSpecial();
void slotRefresh();
diff --git a/kdeprint/management/smbview.cpp b/kdeprint/management/smbview.cpp
index 79e088209..6cf5ee4c8 100644
--- a/kdeprint/management/smbview.cpp
+++ b/kdeprint/management/smbview.cpp
@@ -179,11 +179,8 @@ void SmbView::setOpen(QListViewItem *item, bool on)
m_current = item;
*m_proc << "nmblookup"+m_wins_server+"-M ";
*m_proc << KProcess::quote(item->text(0));
- *m_proc << " -S | grep '<20>' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*<20>.*//' | xargs -Iserv_name smbclient -N -L 'serv_name' -W ";
- *m_proc << KProcess::quote(item->text(0));
- *m_proc << " -A ";
- *m_proc << KProcess::quote(m_passwdFile->name());
- startProcess(ServerListing);
+ *m_proc << " -S";
+ startProcess(ServerListing);
}
else if (item->depth() == 1)
{ // opening server
@@ -192,8 +189,11 @@ void SmbView::setOpen(QListViewItem *item, bool on)
*m_proc << KProcess::quote(item->text(0));
*m_proc << " -W ";
*m_proc << KProcess::quote(item->parent()->text(0));
- *m_proc << " -A ";
- *m_proc << KProcess::quote(m_passwdFile->name());
+ if (m_login != QString::null)
+ {
+ *m_proc << " -A ";
+ *m_proc << KProcess::quote(m_passwdFile->name());
+ }
startProcess(ShareListing);
}
}
@@ -220,16 +220,14 @@ void SmbView::processServers()
QStringList lines = QStringList::split('\n',m_buffer,true);
QString line;
uint index(0);
- for (;index < lines.count();index++)
- if (lines[index].stripWhiteSpace().startsWith("Server"))
- break;
- index += 2;
while (index < lines.count())
{
line = lines[index++].stripWhiteSpace();
if (line.isEmpty())
break;
QStringList words = QStringList::split(' ',line,false);
+ if (words[1] != "<00>" || words[3] == "<GROUP>")
+ continue;
QListViewItem *item = new QListViewItem(m_current,words[0]);
item->setExpandable(true);
item->setPixmap(0,SmallIcon("kdeprint_computer"));
diff --git a/kdeprint/rlpr/Makefile.am b/kdeprint/rlpr/Makefile.am
index ce075fb7c..d0ea535ec 100644
--- a/kdeprint/rlpr/Makefile.am
+++ b/kdeprint/rlpr/Makefile.am
@@ -7,7 +7,7 @@ kde_module_LTLIBRARIES = kdeprint_rlpr.la
kdeprint_rlpr_la_SOURCES = kmrlprfactory.cpp kmrlprmanager.cpp krlprprinterimpl.cpp kmrlpruimanager.cpp \
kmwrlpr.cpp kmproprlpr.cpp kmproxywidget.cpp kmconfigproxy.cpp
kdeprint_rlpr_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
-kdeprint_rlpr_la_LIBADD = $(top_builddir)/kdeprint/management/libkdeprint_management.la
+kdeprint_rlpr_la_LIBADD = $(top_builddir)/kdeprint/management/libkdeprint_management.la $(LIB_QT) $(LIB_KDEPRINT) $(LIB_KDECORE) $(LIB_KDEUI)
kdeprint_rlpr_la_METASOURCES = AUTO
noinst_HEADERS = kmrlprmanager.h krlprprinterimpl.h kmrlpruimanager.h kmwrlpr.h kmproprlpr.h \
diff --git a/kdeprint/tools/escputil/Makefile.am b/kdeprint/tools/escputil/Makefile.am
index 71a4a63b7..beb7c2a5e 100644
--- a/kdeprint/tools/escputil/Makefile.am
+++ b/kdeprint/tools/escputil/Makefile.am
@@ -4,7 +4,7 @@ kde_module_LTLIBRARIES = kdeprint_tool_escputil.la
kdeprint_tool_escputil_la_SOURCES = escpwidget.cpp
kdeprint_tool_escputil_la_METASOURCES = AUTO
kdeprint_tool_escputil_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
-kdeprint_tool_escputil_la_LIBADD = $(LIB_KDEUI)
+kdeprint_tool_escputil_la_LIBADD = $(LIB_KDEUI) $(LIB_QT) $(LIB_KDECORE)
noinst_HEADERS = escpwidget.h
diff --git a/kdesu/Makefile.am b/kdesu/Makefile.am
index 211d8d422..691068966 100644
--- a/kdesu/Makefile.am
+++ b/kdesu/Makefile.am
@@ -5,7 +5,7 @@ INCLUDES = -I$(top_srcdir)/kio/ $(all_includes)
lib_LTLIBRARIES = libkdesu.la
libkdesu_la_SOURCES = client.cpp process.cpp kcookie.cpp su.cpp ssh.cpp stub.cpp kdesu_pty.cpp
libkdesu_la_LDFLAGS = -version-info 6:0:2 -no-undefined $(all_libraries)
-libkdesu_la_LIBADD = $(LIB_KDECORE) $(LIBUTIL)
+libkdesu_la_LIBADD = $(LIB_KDECORE) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la
libkdesu_la_NMCHECK = $(srcdir)/libkdesu.nmcheck
libkdesu_la_NMCHECKWEAK = $(srcdir)/libkdesu_weak.nmcheck $(top_srcdir)/kdecore/libkdecore_weak.nmcheck \
$(top_srcdir)/dcop/libDCOP_weak.nmcheck $(top_srcdir)/kdecore/libqt-mt_weak.nmcheck
@@ -24,7 +24,7 @@ uninstall-local:
bin_PROGRAMS = kdesu_stub
kdesu_stub_SOURCES = kdesu_stub.c
kdesu_stub_LDFLAGS = $(all_libraries)
-kdesu_stub_LDADD = ../kdecore/libkdefakes.la
+kdesu_stub_LDADD =
include $(top_srcdir)/admin/Doxyfile.am
diff --git a/kdeui/Makefile.am b/kdeui/Makefile.am
index 6524105b1..70157796a 100644
--- a/kdeui/Makefile.am
+++ b/kdeui/Makefile.am
@@ -18,7 +18,8 @@
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
-SUBDIRS = . kdetrayproxy tests about
+SUBDIRS = . tests about
+DIST_SUBDIRS = kdetrayproxy
INCLUDES= -I$(top_srcdir)/kdefx -I$(top_srcdir)/interfaces $(all_includes)
@@ -28,10 +29,9 @@ AM_LDFLAGS = $(LDFLAGS_AS_NEEDED) $(LDFLAGS_NEW_DTAGS)
lib_LTLIBRARIES = libkdeui.la libkspell.la
libkdeui_la_LDFLAGS = $(KDE_MT_LDFLAGS) -no-undefined -version-info 6:0:2
-libkdeui_la_LIBADD = ../kdecore/libkdecore.la
+libkdeui_la_LIBADD = ../kdecore/libkdecore.la $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_X11) $(top_builddir)/kdefx/libkdefx.la $(LIB_XEXT)
libkspell_la_LDFLAGS = $(KDE_MT_LDFLAGS) -version-info 6:0:2 -no-undefined
-libkspell_la_LIBADD = libkdeui.la
libkspell_la_SOURCES = dummy.cpp
picsdir = $(kde_datadir)/kdeui/pics
diff --git a/kdeui/kaboutapplication.cpp b/kdeui/kaboutapplication.cpp
index 594e2a1f5..dff83b19f 100644
--- a/kdeui/kaboutapplication.cpp
+++ b/kdeui/kaboutapplication.cpp
@@ -113,8 +113,8 @@ void KAboutApplication::buildDialog( const KAboutData *aboutData )
KActiveLabel* activeLabel = new KActiveLabel( authorPage );
if (!aboutData->customAuthorTextEnabled())
{
- if ( aboutData->bugAddress().isEmpty() || aboutData->bugAddress() == "submit@bugs.kde.org")
- text = i18n( "Please use <a href=\"http://bugs.kde.org\">http://bugs.kde.org</a> to report bugs.\n" );
+ if ( aboutData->bugAddress().isEmpty() || aboutData->bugAddress() == "submit@bugs.pearsoncomputing.net")
+ text = i18n( "Please use <a href=\"http://bugs.pearsoncomputing.net\">http://bugs.pearsoncomputing.net</a> to report bugs.\n" );
else {
if( aboutData->authors().count() == 1 && ( aboutData->authors().first().emailAddress() == aboutData->bugAddress() ) )
{
diff --git a/kdeui/kaboutkde.cpp b/kdeui/kaboutkde.cpp
index f6fe8cde9..ba4e84fad 100644
--- a/kdeui/kaboutkde.cpp
+++ b/kdeui/kaboutkde.cpp
@@ -32,20 +32,22 @@ KAboutKDE::KAboutKDE( QWidget *parent, const char *name, bool modal )
parent, name, modal )
{
const QString text1 = i18n(""
- "The <b>K Desktop Environment</b> is written and maintained by the "
- "KDE Team, a world-wide network of software engineers committed to "
- "<a href=\"http://www.gnu.org/philosophy/free-sw.html\">Free Software</a> development.<br><br>"
- "No single group, company or organization controls the KDE source "
- "code. Everyone is welcome to contribute to KDE.<br><br>"
- "Visit <A HREF=\"http://www.kde.org/\">http://www.kde.org</A> for "
- "more information on the KDE project. ");
+ "The <b>Trinity Desktop Environment</b> is a fork of the "
+ "K Desktop Environment version 3.5, which was originally written by the KDE Team, "
+ "a world-wide network of software engineers committed to <a "
+ "href=\"http://www.gnu.org/philosophy/free-sw.html\">Free Software</a> "
+ "development.<br><br>No single group, company or organization controls the "
+ "Trinity source code. Everyone is welcome to contribute to Trinity.<br><br>Visit <A "
+ "HREF=\"http://trinity.pearsoncomputing.net/\">http://trinity.pearsoncomputing.net</A> for more information "
+ "about Trinity, and <A HREF=\"http://www.kde.org/\">http://www.kde.org</A> "
+ "for more information on the KDE project. ");
const QString text2 = i18n(""
- "Software can always be improved, and the KDE Team is ready to "
+ "Software can always be improved, and the Trinity Team is ready to "
"do so. However, you - the user - must tell us when "
"something does not work as expected or could be done better.<br><br>"
- "The K Desktop Environment has a bug tracking system. Visit "
- "<A HREF=\"http://bugs.kde.org/\">http://bugs.kde.org</A> or "
+ "The Trinity Desktop Environment has a bug tracking system. Visit "
+ "<A HREF=\"http://bugs.pearsoncomputing.net/\">http://bugs.pearsoncomputing.net</A> or "
"use the \"Report Bug...\" dialog from the \"Help\" menu to report bugs.<br><br>"
"If you have a suggestion for improvement then you are welcome to use "
"the bug tracking system to register your wish. Make sure you use the "
@@ -53,37 +55,33 @@ KAboutKDE::KAboutKDE( QWidget *parent, const char *name, bool modal )
const QString text3 = i18n(""
"You do not have to be a software developer to be a member of the "
- "KDE team. You can join the national teams that translate "
+ "Trinity team. You can join the national teams that translate "
"program interfaces. You can provide graphics, themes, sounds, and "
"improved documentation. You decide!"
"<br><br>"
"Visit "
- "<A HREF=\"http://www.kde.org/jobs/\">http://www.kde.org/jobs/</A> "
+ "<A HREF=\"http://trinity.pearsoncomputing.net/jobs/\">http://trinity.pearsoncomputing.net/jobs/</A> "
"for information on some projects in which you can participate."
"<br><br>"
"If you need more information or documentation, then a visit to "
- "<A HREF=\"http://developer.kde.org/\">http://developer.kde.org</A> "
+ "<A HREF=\"http://trinity.pearsoncomputing.net/docs/\">http://trinity.pearsoncomputing.net/docs/</A> "
"will provide you with what you need.");
const QString text4 = i18n(""
- "KDE is available free of charge, but making it is not free.<br><br>"
- "Thus, the KDE team formed the KDE e.V., a non-profit organization"
- " legally founded in Tuebingen, Germany. The KDE e.V. represents"
- " the KDE project in legal and financial matters."
- " See <a href=\"http://www.kde-ev.org/\">http://www.kde-ev.org</a>"
- " for information on the KDE e.V.<br><br>"
- "The KDE team does need financial support. Most of the money is used to "
+ "Trinity is available free of charge, but making it is not free.<br><br>"
+ "<br><br>"
+ "The Trinity team does need financial support. Most of the money is used to "
"reimburse members and others on expenses they experienced when "
- "contributing to KDE. You are encouraged to support KDE through a financial "
+ "contributing to Trinity. You are encouraged to support Trinity through a financial "
"donation, using one of the ways described at "
- "<a href=\"http://www.kde.org/support/\">http://www.kde.org/support/</a>."
- "<br><br>Thank you very much in advance for your support.");
+ "<a href=\"http://trinity.pearsoncomputing.net/support/\">http://trinity.pearsoncomputing.net/support/</a>."
+ "<br><br>Thank you very much in advance for your support!");
setHelp( QString::fromLatin1("khelpcenter/main.html"), QString::null );
- setTitle(i18n("K Desktop Environment. Release %1").
+ setTitle(i18n("Trinity Desktop Environment. Release %1").
arg(QString::fromLatin1(KDE_VERSION_STRING)) );
- addTextPage( i18n("About KDE","&About"), text1, true );
+ addTextPage( i18n("About Trinity","&About"), text1, true );
addTextPage( i18n("&Report Bugs or Wishes"), text2, true );
- addTextPage( i18n("&Join the KDE Team"), text3, true );
- addTextPage( i18n("&Support KDE"), text4, true );
+ addTextPage( i18n("&Join the Trinity Team"), text3, true );
+ addTextPage( i18n("&Support Trinity"), text4, true );
setImage( locate( "data", QString::fromLatin1("kdeui/pics/aboutkde.png")) );
setImageBackgroundColor( white );
}
diff --git a/kdeui/kbugreport.cpp b/kdeui/kbugreport.cpp
index f6f529197..ad261eebd 100644
--- a/kdeui/kbugreport.cpp
+++ b/kdeui/kbugreport.cpp
@@ -88,12 +88,13 @@ KBugReport::KBugReport( QWidget * parentw, bool modal, const KAboutData *aboutDa
QWidget * parent = plainPage();
d->submitBugButton = 0;
- if ( m_aboutData->bugAddress() == QString::fromLatin1("submit@bugs.kde.org") )
- {
- // This is a core KDE application -> redirect to the web form
+ //if ( m_aboutData->bugAddress() == QString::fromLatin1("submit@bugs.pearsoncomputing.net") )
+ //{
+ // // This is a core KDE application -> redirect to the web form
+ // Always redirect to the Web form for Trinity
d->submitBugButton = new QPushButton( parent );
setButtonCancel( KStdGuiItem::close() );
- }
+ //}
QLabel * tmpLabel;
QVBoxLayout * lay = new QVBoxLayout( parent, 0, spacingHint() );
@@ -250,7 +251,7 @@ KBugReport::KBugReport( QWidget * parentw, bool modal, const KAboutData *aboutDa
lay->addSpacing(10);
QString text = i18n("To submit a bug report, click on the button below.\n"
- "This will open a web browser window on http://bugs.kde.org where you will find a form to fill in.\n"
+ "This will open a web browser window on http://bugs.pearsoncomputing.net where you will find a form to fill in.\n"
"The information displayed above will be transferred to that server.");
QLabel * label = new QLabel( text, parent, "label");
lay->addWidget( label );
@@ -274,13 +275,14 @@ KBugReport::~KBugReport()
void KBugReport::updateURL()
{
- KURL url ( "http://bugs.kde.org/wizard.cgi" );
- url.addQueryItem( "os", d->os );
- url.addQueryItem( "compiler", KDE_COMPILER_VERSION );
- url.addQueryItem( "kdeVersion", d->kde_version );
- url.addQueryItem( "appVersion", m_strVersion );
- url.addQueryItem( "package", d->appcombo->currentText() );
- url.addQueryItem( "kbugreport", "1" );
+ KURL url ( "http://bugs.pearsoncomputing.net/enter_bug.cgi" );
+ url.addQueryItem( "product", "KDE 3.5" );
+ url.addQueryItem( "op_sys", d->os );
+ url.addQueryItem( "cf_kde_compiler", KDE_COMPILER_VERSION );
+ url.addQueryItem( "cf_kde_version", d->kde_version );
+ url.addQueryItem( "cf_kde_appversion", m_strVersion );
+ url.addQueryItem( "cf_kde_package", d->appcombo->currentText() );
+ url.addQueryItem( "cf_kde_kbugreport", "1" );
d->url = url;
}
@@ -408,7 +410,7 @@ void KBugReport::slotOk( void )
{
QString msg = i18n("Unable to send the bug report.\n"
"Please submit a bug report manually...\n"
- "See http://bugs.kde.org/ for instructions.");
+ "See http://bugs.pearsoncomputing.net/ for instructions.");
KMessageBox::error(this, msg + "\n\n" + d->lastError);
return;
}
@@ -476,7 +478,7 @@ bool KBugReport::sendBugReport()
{
QString recipient ( m_aboutData ?
m_aboutData->bugAddress() :
- QString::fromLatin1("submit@bugs.kde.org") );
+ QString::fromLatin1("submit@bugs.pearsoncomputing.net") );
QString command;
command = locate("exe", "ksendbugmail");
diff --git a/kdeui/kbugreport.h b/kdeui/kbugreport.h
index b5f541603..3220903e0 100644
--- a/kdeui/kbugreport.h
+++ b/kdeui/kbugreport.h
@@ -66,7 +66,7 @@ protected slots:
*/
virtual void slotSetFrom();
/**
- * The URL-Label "http://bugs.kde.org/" was clicked.
+ * The URL-Label "http://bugs.pearsoncomputing.net/" was clicked.
* @deprecated remove in KDE4.0
*/
virtual void slotUrlClicked(const QString &);
diff --git a/kdeui/kdetrayproxy/Makefile.am b/kdeui/kdetrayproxy/Makefile.am
index 49d823d31..a1e803af0 100644
--- a/kdeui/kdetrayproxy/Makefile.am
+++ b/kdeui/kdetrayproxy/Makefile.am
@@ -3,7 +3,7 @@ kde_module_LTLIBRARIES = kded_kdetrayproxy.la
INCLUDES= -I$(top_srcdir)/kded $(all_includes)
kded_kdetrayproxy_la_SOURCES = kdetrayproxy.cpp module.cpp module.skel
kded_kdetrayproxy_la_LDFLAGS = $(all_libraries) -module -avoid-version
-kded_kdetrayproxy_la_LIBADD = $(LIB_KDECORE) $(LIB_KDED)
+kded_kdetrayproxy_la_LIBADD = $(LIB_KDECORE) $(LIB_KDED) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_X11) $(top_builddir)/kded/libkdeinit_kded.la
METASOURCES = AUTO
diff --git a/kdeui/khelpmenu.cpp b/kdeui/khelpmenu.cpp
index d5e8eca58..15ee9f58e 100644
--- a/kdeui/khelpmenu.cpp
+++ b/kdeui/khelpmenu.cpp
@@ -173,7 +173,7 @@ KPopupMenu* KHelpMenu::menu()
if (kapp->authorizeKAction("help_about_kde"))
{
- mMenu->insertItem( SmallIcon("about_kde"), i18n( "About &KDE" ), menuAboutKDE );
+ mMenu->insertItem( SmallIcon("about_kde"), i18n( "About &Trinity" ), menuAboutKDE );
mMenu->connectItem( menuAboutKDE, this, SLOT( aboutKDE() ) );
}
}
diff --git a/kdeui/kiconview.cpp b/kdeui/kiconview.cpp
index 4d220c331..77756030b 100644
--- a/kdeui/kiconview.cpp
+++ b/kdeui/kiconview.cpp
@@ -548,7 +548,7 @@ void KIconViewItem::calcRect( const QString& text_ )
r = m_wordWrap->boundingRect();
int realWidth = QMAX( QMIN( r.width() + 4, tw ), fm->width( "X" ) );
- itemTextRect.setWidth( realWidth );
+ itemTextRect.setWidth( realWidth + 2);
itemTextRect.setHeight( r.height() );
int w = 0; int h = 0; int y = 0;
@@ -699,11 +699,13 @@ void KIconViewItem::paintPixmap( QPainter *p, const QColorGroup &cg )
void KIconViewItem::paintText( QPainter *p, const QColorGroup &cg )
{
- int textX = textRect( false ).x() + 2;
+ int textX = textRect( false ).x() + 4;
int textY = textRect( false ).y();
if ( isSelected() ) {
- p->fillRect( textRect( false ), cg.highlight() );
+ p->setBrush(QBrush(cg.highlight()));
+ p->setPen(QPen(cg.highlight()));
+ p->drawRoundRect( textRect( false ) ,1000/textRect(false).width(),1000/textRect(false).height() );
p->setPen( QPen( cg.highlightedText() ) );
} else {
if ( iconView()->itemTextBackground() != NoBrush )
diff --git a/kdeui/kstdaction_p.h b/kdeui/kstdaction_p.h
index e41002508..f8f91868d 100644
--- a/kdeui/kstdaction_p.h
+++ b/kdeui/kstdaction_p.h
@@ -111,7 +111,7 @@ static const KStdActionInfo g_rgActionInfo[] =
{ ReportBug, KStdAccel::AccelNone, "help_report_bug", I18N_NOOP("&Report Bug..."), 0, 0 },
{ SwitchApplicationLanguage, KStdAccel::AccelNone, "switch_application_language", I18N_NOOP("Switch application &language..."), 0, 0 },
{ AboutApp, KStdAccel::AccelNone, "help_about_app", I18N_NOOP("&About %1"), 0, 0 },
- { AboutKDE, KStdAccel::AccelNone, "help_about_kde", I18N_NOOP("About &KDE"), 0,"about_kde" },
+ { AboutKDE, KStdAccel::AccelNone, "help_about_kde", I18N_NOOP("About &Trinity"), 0,"about_kde" },
{ ActionNone, KStdAccel::AccelNone, 0, 0, 0, 0 }
};
diff --git a/kdeui/ktabwidget.cpp b/kdeui/ktabwidget.cpp
index 42e00c96a..a012ea96e 100644
--- a/kdeui/ktabwidget.cpp
+++ b/kdeui/ktabwidget.cpp
@@ -56,6 +56,8 @@ KTabWidget::KTabWidget( QWidget *parent, const char *name, WFlags f )
setTabBar( new KTabBar(this, "tabbar") );
setAcceptDrops( true );
+ setHoverCloseButtonDelayed(false);
+
connect(tabBar(), SIGNAL(contextMenu( int, const QPoint & )), SLOT(contextMenu( int, const QPoint & )));
connect(tabBar(), SIGNAL(mouseDoubleClick( int )), SLOT(mouseDoubleClick( int )));
connect(tabBar(), SIGNAL(mouseMiddleClick( int )), SLOT(mouseMiddleClick( int )));
diff --git a/kdewidgets/Makefile.am b/kdewidgets/Makefile.am
index ee1fd209b..39cc94304 100644
--- a/kdewidgets/Makefile.am
+++ b/kdewidgets/Makefile.am
@@ -30,7 +30,7 @@ makekdewidgets_LDADD = $(LIB_QT) ../kdecore/libkdecore.la
kde_widget_LTLIBRARIES = kdewidgets.la
kdewidgets_la_LDFLAGS = $(KDE_PLUGIN) -module $(all_libraries)
-kdewidgets_la_LIBADD = $(LIB_KIO) $(LIB_KABC)
+kdewidgets_la_LIBADD = $(LIB_KIO) $(LIB_KABC) $(LIB_QT) $(LIB_KDEUI) $(LIB_KDECORE)
kdewidgets_la_SOURCES = classpreviews.cpp kdewidgets.cpp
kdewidgets.cpp: $(srcdir)/kde.widgets makekdewidgets
diff --git a/kdoctools/Makefile.am b/kdoctools/Makefile.am
index 08498bbf4..608f95b6b 100644
--- a/kdoctools/Makefile.am
+++ b/kdoctools/Makefile.am
@@ -5,18 +5,17 @@ AM_LDFLAGS = $(KDE_RPATH) $(LIBXML_RPATH) $(LIBXSLT_RPATH) $(all_libraries)
noinst_LTLIBRARIES = libkbzipfilter_dummy.la
libkbzipfilter_dummy_la_SOURCES = kbzip2filter.cpp
-libkbzipfilter_dummy_la_LIBADD = $(LIB_KIO) $(LIBBZ2)
####### Files
kde_module_LTLIBRARIES = kio_help.la kio_ghelp.la
kio_help_la_SOURCES = kio_help.cpp main.cpp xslt.cpp
-kio_help_la_LIBADD = $(LIBXSLT_LIBS) $(LIBXML_LIBS) libkbzipfilter_dummy.la
+kio_help_la_LIBADD = $(LIBXSLT_LIBS) $(LIBXML_LIBS) libkbzipfilter_dummy.la $(LIB_KIO) $(LIBBZ2) $(LIB_QT) $(LIB_KDECORE)
kio_help_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
kio_ghelp_la_SOURCES = kio_help.cpp main_ghelp.cpp xslt.cpp
-kio_ghelp_la_LIBADD = $(LIBXSLT_LIBS) $(LIBXML_LIBS) libkbzipfilter_dummy.la
+kio_ghelp_la_LIBADD = $(LIBXSLT_LIBS) $(LIBXML_LIBS) libkbzipfilter_dummy.la $(LIB_KIO) $(LIBBZ2) $(LIB_QT) $(LIB_KDECORE)
kio_ghelp_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
noinst_HEADERS = kio_help.h
@@ -25,7 +24,7 @@ kdelnk_DATA = help.protocol ghelp.protocol
kdelnkdir = $(kde_servicesdir)
bin_PROGRAMS = meinproc
-meinproc_LDADD = xslt_pure.o libkbzipfilter_dummy.la $(LIBXSLT_LIBS) $(LIBXML_LIBS)
+meinproc_LDADD = xslt_pure.o libkbzipfilter_dummy.la $(LIBXSLT_LIBS) $(LIBXML_LIBS) $(LIB_KIO) $(LIBBZ2) $(LIB_KDECORE)
meinproc_SOURCES = meinproc.cpp
xslt_pure.o: xslt.cpp
diff --git a/kdoctools/meinproc.cpp b/kdoctools/meinproc.cpp
index f6796194d..c48706451 100644
--- a/kdoctools/meinproc.cpp
+++ b/kdoctools/meinproc.cpp
@@ -136,9 +136,18 @@ int main(int argc, char **argv) {
}
if ( args->isSet( "check" ) ) {
+#if !defined(PATH_MAX) && defined(__GLIBC__)
+ char *pwd_buffer;
+#else
char pwd_buffer[PATH_MAX];
+#endif
QFileInfo file( QFile::decodeName(args->arg( 0 )) );
- if ( !getcwd( pwd_buffer, sizeof(pwd_buffer) - 1 ) ) {
+#if !defined(PATH_MAX) && defined(__GLIBC__)
+ if ( !(pwd_buffer = getcwd( NULL, 0 ) ) )
+#else
+ if ( !getcwd( pwd_buffer, sizeof(pwd_buffer) - 1 ) )
+#endif
+ {
kdError() << "getcwd failed." << endl;
return 2;
}
@@ -175,11 +184,18 @@ int main(int argc, char **argv) {
}
pclose( xmllint );
chdir( pwd_buffer );
- if ( !noout )
+ if ( !noout ) {
+#if !defined(PATH_MAX) && defined(__GLIBC__)
+ free( pwd_buffer );
+#endif
return 1;
+ }
} else {
kdWarning() << "couldn't find xmllint" << endl;
}
+#if !defined(PATH_MAX) && defined(__GLIBC__)
+ free( pwd_buffer );
+#endif
}
xmlSubstituteEntitiesDefault(1);
diff --git a/khtml/Makefile.am b/khtml/Makefile.am
index c917c2897..82eca8120 100644
--- a/khtml/Makefile.am
+++ b/khtml/Makefile.am
@@ -57,7 +57,7 @@ libkhtml_la_LIBADD = ./xml/libkhtmlxml.la ./html/libkhtmlhtml.la \
$(LIBTHAI) \
$(top_builddir)/kdeprint/libkdeprint.la \
$(top_builddir)/kutils/libkutils.la \
- $(top_builddir)/kwallet/client/libkwalletclient.la
+ $(top_builddir)/kwallet/client/libkwalletclient.la $(top_builddir)/kjs/libkjs.la $(LIB_KDEUI) $(LIB_QT) $(LIB_KDECORE) $(LIB_KFILE) $(top_builddir)/dcop/libDCOP.la $(LIBJPEG) $(LIB_X11)
# init_libkhtml is in libkhtml.so; init_libkhtmlpart needs to be in the part
dummy.cpp: $(srcdir)/Makefile.am
diff --git a/khtml/html/html_elementimpl.cpp b/khtml/html/html_elementimpl.cpp
index 9c0e58335..cd47ea728 100644
--- a/khtml/html/html_elementimpl.cpp
+++ b/khtml/html/html_elementimpl.cpp
@@ -565,6 +565,13 @@ DocumentFragment HTMLElementImpl::createContextualFragment( const DOMString &htm
void HTMLElementImpl::setInnerHTML( const DOMString &html, int &exceptioncode )
{
+ // Works line innerText in Gecko
+ // ### test if needed for ID_SCRIPT as well.
+ if ( id() == ID_STYLE ) {
+ setInnerText(html, exceptioncode);
+ return;
+ }
+
DocumentFragment fragment = createContextualFragment( html );
if ( fragment.isNull() ) {
exceptioncode = DOMException::NO_MODIFICATION_ALLOWED_ERR;
diff --git a/khtml/html/html_formimpl.cpp b/khtml/html/html_formimpl.cpp
index e59098499..1abaa606a 100644
--- a/khtml/html/html_formimpl.cpp
+++ b/khtml/html/html_formimpl.cpp
@@ -614,17 +614,7 @@ void HTMLFormElementImpl::submit( )
bool checkboxResult = false;
const int savePassword = KMessageBox::createKMessageBox(dialog, QMessageBox::Information,
- formUrl.host().isEmpty() ? // e.g. local file
- i18n("Konqueror has the ability to store the password "
- "in an encrypted wallet. When the wallet is unlocked, it "
- "can then automatically restore the login information "
- "next time you submit this form. Do you want to store "
- "the information now?") :
- i18n("Konqueror has the ability to store the password "
- "in an encrypted wallet. When the wallet is unlocked, it "
- "can then automatically restore the login information "
- "next time you visit %1. Do you want to store "
- "the information now?").arg(formUrl.host()),
+ i18n("Store passwords on this page?"),
QStringList(), QString::null, &checkboxResult, KMessageBox::Notify);
if ( savePassword == KDialogBase::Yes ) {
diff --git a/khtml/java/Makefile.am b/khtml/java/Makefile.am
index b29e2349c..590d33325 100644
--- a/khtml/java/Makefile.am
+++ b/khtml/java/Makefile.am
@@ -32,6 +32,6 @@ kjavaappletviewer_la_SOURCES= kjavaapplet.cpp kjavaappletcontext.cpp \
kjavadownloader.cpp kjavaappletviewer.cpp
kjavaappletviewer_la_LDFLAGS= $(all_libraries) -module $(KDE_PLUGIN)
-kjavaappletviewer_la_LIBADD= $(LIB_KPARTS)
+kjavaappletviewer_la_LIBADD= $(LIB_KPARTS) $(LIB_QT) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_KFILE) $(top_builddir)/dcop/libDCOP.la
kde_services_DATA= kjavaappletviewer.desktop
diff --git a/khtml/kmultipart/Makefile.am b/khtml/kmultipart/Makefile.am
index bd79f89a5..b6d6af0df 100644
--- a/khtml/kmultipart/Makefile.am
+++ b/khtml/kmultipart/Makefile.am
@@ -5,7 +5,7 @@ INCLUDES = -I$(top_srcdir)/khtml -I$(top_srcdir)/kio/httpfilter -I$(top_srcdir)/
kde_module_LTLIBRARIES = libkmultipart.la
libkmultipart_la_SOURCES = kmultipart.cpp
-libkmultipart_la_LIBADD = $(LIB_KPARTS) $(top_builddir)/kio/httpfilter/libhttpfilter.la
+libkmultipart_la_LIBADD = $(LIB_KPARTS) $(top_builddir)/kio/httpfilter/libhttpfilter.la $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KFILE) $(LIBZ)
libkmultipart_la_DEPENDENCIES = $(LIB_KPARTS)
libkmultipart_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
diff --git a/khtml/misc/Makefile.am b/khtml/misc/Makefile.am
index b874f9039..a64706e73 100644
--- a/khtml/misc/Makefile.am
+++ b/khtml/misc/Makefile.am
@@ -22,14 +22,14 @@ KDE_CXXFLAGS = $(WOVERLOADED_VIRTUAL)
noinst_LTLIBRARIES = libkhtmlmisc.la
libkhtmlmisc_la_SOURCES = \
decoder.cpp loader.cpp loader_jpeg.cpp guess_ja.cpp\
- htmlhashes.cpp helper.cpp arena.cpp stringit.cpp
+ htmlhashes.cpp helper.cpp arena.cpp stringit.cpp knsplugininstaller.cpp
libkhtmlmisc_la_LIBADD = $(LIBJPEG)
libkhtmlmisc_la_LDFLAGS = $(USER_LDFLAGS)
libkhtmlmisc_la_METASOURCES = AUTO
noinst_HEADERS = \
decoder.h khtmllayout.h loader_jpeg.h loader.h guess_ja.h\
- stringit.h htmlhashes.h helper.h shared.h arena.h
+ stringit.h htmlhashes.h helper.h shared.h arena.h knsplugininstaller.h
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/dcop -I$(top_srcdir)/kio -I$(top_srcdir)/libltdl \
-I$(top_srcdir)/khtml -I$(top_srcdir)/kutils $(all_includes)
diff --git a/khtml/misc/knsplugininstaller.cpp b/khtml/misc/knsplugininstaller.cpp
new file mode 100644
index 000000000..4cfbf3339
--- /dev/null
+++ b/khtml/misc/knsplugininstaller.cpp
@@ -0,0 +1,672 @@
+/*
+ * This file is part of the KDE project.
+ *
+ * Copyright (C) 2005 Benoit Canet <bcanet@dental-on-line.fr>
+ * with some advices from Aurelien Gateau <agateau@dental-on-line.fr>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+
+#include "knsplugininstaller.moc"
+
+#include <kdebug.h>
+#include <kdiroperator.h>
+#include <klistview.h>
+#include <klocale.h>
+#include <kstddirs.h>
+#include <ktempfile.h>
+#include <netaccess.h>
+
+#include <qbuttongroup.h>
+#include <qdir.h>
+#include <qiodevice.h>
+#include <qfile.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qmap.h>
+#include <qstringlist.h>
+#include <qtextstream.h>
+
+#include <sys/utsname.h>
+
+// Use 6031 for debugging (render_frame)
+#define DEBUG_NUMBER 6031
+
+/*
+ * Utility class to associate a list item with a pluginInfo object
+ */
+class PluginListItem : public QListViewItem
+{
+
+public:
+ PluginListItem(KNSPluginInfo pluginInfo, QListView *parent)
+ : QListViewItem(parent, pluginInfo.pluginName())
+ , m_pluginInfo(pluginInfo) {}
+ KNSPluginInfo pluginInfo() const { return m_pluginInfo; }
+
+private:
+ KNSPluginInfo m_pluginInfo;
+
+};
+
+
+// public methods
+
+KNSPluginInstallEngine::KNSPluginInstallEngine(KMimeType::Ptr mime) : QObject()
+{
+ m_mime = mime;
+
+ // Fill the architecture map
+ m_archMap["i386"] = "ia32";
+ m_archMap["i486"] = "ia32";
+ m_archMap["i586"] = "ia32";
+ m_archMap["i686"] = "ia32";
+}
+
+KNSPluginInstallEngine::~KNSPluginInstallEngine()
+{
+}
+
+bool KNSPluginInstallEngine::pluginAvailable()
+{
+
+ if(m_pluginList.count())
+ return true;
+
+ // check if pluginsListFile is present in kde config
+ if(!loadConfig())
+ return false;
+
+ // load the xml configuration file
+ if(!loadXmlConfig())
+ return false;
+
+ return findPlugin();
+}
+
+bool KNSPluginInstallEngine::isActive()
+{
+ // check if we have a configuration key in the kde registry
+ QString pluginsListFile;
+ KConfig cfg("kcmnspluginrc", true);
+ cfg.setGroup("Misc");
+ pluginsListFile = cfg.readPathEntry("PluginsListFile");
+ return !pluginsListFile.isEmpty();
+}
+
+const QValueList<KNSPluginInfo>& KNSPluginInstallEngine::pluginList() const
+{
+ return m_pluginList;
+}
+
+// private methods
+bool KNSPluginInstallEngine::loadConfig()
+{
+ QString pluginsListFile;
+ KConfig cfg("kcmnspluginrc", true);
+ cfg.setGroup("Misc");
+ pluginsListFile = cfg.readPathEntry("PluginsListFile");
+ if(!pluginsListFile.isEmpty())
+ {
+ m_pluginsListFileURL = KURL(pluginsListFile);
+ kdDebug(DEBUG_NUMBER) << "config loaded "<<endl;
+ return true;
+ }
+ return false;
+}
+
+bool KNSPluginInstallEngine::loadXmlConfig()
+{
+
+ // load the Xml configuration file
+ if(m_pluginsXmlConfig.isEmpty())
+ {
+ QString tmpFile;
+ if(KIO::NetAccess::download(m_pluginsListFileURL, tmpFile, NULL)) {
+ QFile f(tmpFile);
+ if(!f.open(IO_ReadOnly))
+ return false;
+ QTextStream stream(&f);
+ stream.setEncoding(QTextStream::UnicodeUTF8);
+ m_pluginsXmlConfig = stream.read();
+ f.close();
+ KIO::NetAccess::removeTempFile(tmpFile);
+ } else
+ return false;
+ }
+ kdDebug(DEBUG_NUMBER) << "xml config loaded :" << endl;
+ return true;
+}
+
+bool KNSPluginInstallEngine::findPlugin()
+{
+
+ // get system infos
+ // TODO/FIX : correct this to work with x86-64 machines
+ utsname sysinfo;
+ if(uname(&sysinfo))
+ return false;
+ QString sysname(sysinfo.sysname);
+ QString machine(sysinfo.machine);
+ QString arch = m_archMap[machine];
+
+ // Parse the document
+ QDomDocument doc("xmlConfig");
+ doc.setContent(m_pluginsXmlConfig);
+ QDomNodeList archList = doc.elementsByTagName(QString("arch"));
+ QDomNode archNode, osNode , pluginNode, node;
+ QDomElement e;
+
+ // look for the correct architecture
+ bool found = false;
+ unsigned int i;
+ for(i=0; i < archList.count() ; i++) {
+ archNode = archList.item(i);
+ e = archNode.toElement();
+ if( e.attribute("architecture") == arch) {
+ kdDebug(DEBUG_NUMBER) << "found correct architecture :" << arch << endl;
+ found = true;
+ break;
+ }
+ }
+
+ if(!found)
+ return false;
+
+ // look for the correct os
+ found = false;
+ osNode = archNode.firstChild();
+ while(!osNode.isNull()) {
+ e = osNode.toElement();
+ if( e.tagName() == "os" && e.attribute("name") == sysname) {
+ kdDebug(DEBUG_NUMBER) << "found correct os :" << sysname << endl;
+ found = true;
+ break;
+ }
+ osNode=osNode.nextSibling();
+ }
+
+ if(!found)
+ return false;
+
+ // Look for a plugin with the given mimetype
+ pluginNode = osNode.firstChild();
+ while(!pluginNode.isNull()) {
+ e = pluginNode.toElement();
+ if( e.tagName() == "plugin" && m_mime->is(e.attribute("mimetype")) ) {
+ kdDebug(DEBUG_NUMBER) << "found correct plugin :" << e.attribute("mimetype") << endl;
+ KNSPluginInfo pluginInfo(pluginNode);
+ if(pluginInfo.isValid())
+ m_pluginList.append(pluginInfo);
+ }
+ pluginNode=pluginNode.nextSibling();
+ }
+
+ if(m_pluginList.count())
+ return true;
+ else
+ return false;
+}
+
+
+void KNSPluginInstallEngine::startInstall(KNSPluginInfo info)
+{
+ m_toInstallPluginInfo = info;
+ // create a temporary dowload file
+ KTempFile tempFile(locateLocal("tmp", "plugin") , QString(".tar.gz"));
+ m_tmpPluginFileName = tempFile.name();
+ tempFile.unlink();
+ tempFile.close();
+ // start the download job
+ m_downloadJob = KIO::copy(info.pluginURL(), "file://"+m_tmpPluginFileName, false );
+ // connect signals
+ connect(m_downloadJob, SIGNAL(percent (KIO::Job *, unsigned long)), this , SLOT(slotDownLoadProgress(KIO::Job *, unsigned long)));
+ connect(m_downloadJob, SIGNAL(result(KIO::Job *)), this, SLOT(slotDownloadResult(KIO::Job *)) );
+ kdDebug(DEBUG_NUMBER) << "download plugin " << m_tmpPluginFileName << endl;
+}
+
+void KNSPluginInstallEngine::slotDownLoadProgress(KIO::Job *, unsigned long percent)
+{
+ // propagate the download progression
+ emit installProgress( ((int)percent)/3 );
+}
+
+void KNSPluginInstallEngine::slotDownloadResult(KIO::Job *job)
+{
+ // test if the download job suceed
+ if(job->error()) {
+ kdDebug(DEBUG_NUMBER) << "download error" << m_tmpPluginFileName << endl;
+ emit installFailed();
+ }
+ else {
+ kdDebug(DEBUG_NUMBER) << "download completed" << m_tmpPluginFileName << endl;
+ // the download succeed copy the plugins files
+
+ // test the existance of the homedir
+ QDir dir(QDir::homeDirPath());
+ if(!dir.exists()) {
+ emit installFailed();
+ return;
+ }
+
+ // test and create firefox plugins directory
+ if(!dir.exists(".mozilla"))
+ dir.mkdir(".mozilla");
+ if(!dir.exists(".mozilla/plugins"))
+ dir.mkdir(".mozilla/plugins");
+ // destination kurl
+ KURL destURL("file://"+QDir::homeDirPath()+"/.mozilla/plugins");
+
+ // construct the source kurlList
+ KURL::List urlList;
+ QStringList pluginFileList = m_toInstallPluginInfo.pluginFileList();
+
+ QStringList::iterator it;
+ for( it = pluginFileList.begin(); it != pluginFileList.end(); ++it ) {
+ urlList.append( KURL("tar://"+m_tmpPluginFileName+"/"+(*it)) );
+ }
+ m_installFileJob = KIO::copy(urlList , destURL, false );
+ connect(m_installFileJob, SIGNAL(percent (KIO::Job *, unsigned long)), this , SLOT(slotCopyProgress(KIO::Job *, unsigned long)));
+ connect(m_installFileJob, SIGNAL(result(KIO::Job *)), this, SLOT(slotCopyResult(KIO::Job *)) );
+ }
+ kdDebug(DEBUG_NUMBER) << "COPY FILE " << m_tmpPluginFileName << endl;
+
+ // zero the download job pointer
+ m_downloadJob = NULL;
+}
+
+void KNSPluginInstallEngine::slotCopyProgress(KIO::Job *, unsigned long percent)
+{
+ // propagate the download progression
+ emit installProgress( ((int)percent)/3 + 33 );
+}
+
+void KNSPluginInstallEngine::slotCopyResult(KIO::Job *job)
+{
+ // test if the download job suceed
+ if(job->error()) {
+ kdDebug(DEBUG_NUMBER) << "download error" << m_tmpPluginFileName << endl;
+ emit installFailed();
+ }
+ else {
+ // start the plugins scan
+ m_scanProc = new QProcess( this );
+ m_scanProc->addArgument( "nspluginscan" );
+ m_scanProc->addArgument( "--verbose" );
+
+ connect( m_scanProc, SIGNAL(readyReadStdout()),
+ this, SLOT(readScanProcFromStdout()) );
+ connect( m_scanProc, SIGNAL(processExited()),
+ this, SLOT(endScanProc()) );
+ if ( !m_scanProc->start() ) {
+ emit installFailed();
+ }
+ }
+}
+
+void KNSPluginInstallEngine::readScanProcFromStdout()
+{
+ // Monitor the scan progress
+ QString progress = m_scanProc->readLineStdout();
+ int percent;
+ bool ok;
+ percent = progress.toInt(&ok);
+ if(!ok)
+ emit installFailed();
+ emit installProgress( (percent)/3 + 66 );
+}
+
+
+void KNSPluginInstallEngine::endScanProc()
+{
+ // end of scan
+ if(m_scanProc->normalExit()) {
+ emit installProgress( 100 );
+ emit installCompleted();
+ } else
+ emit installFailed();
+}
+
+KNSPluginWizard::KNSPluginWizard(QWidget *parent, const char *name, KMimeType::Ptr mime)
+: KWizard(parent, name, true)
+, m_installEngine(mime)
+{
+ setCaption(i18n("KDE plugin wizard"));
+ setModal(true);
+
+ // read the plugin installer configuration
+ m_installEngine.pluginAvailable();
+
+ // init the wizzard Pages
+ initConfirmationPage();
+ initLicencePage();
+ initInstallationProgressPage();
+ initFinishPage();
+ initPagesButtonStates();
+
+ // connect signals and slots
+ connectSignals();
+
+ //set correct default installation status
+ m_installationComplete = false;
+
+};
+
+
+KNSPluginWizard::~KNSPluginWizard()
+{
+};
+
+void KNSPluginWizard::initConfirmationPage()
+{
+
+ m_confirmationVBox = new QVBox(this);
+ new QLabel(i18n("The following plugins are available."), m_confirmationVBox);
+ m_pluginListView = new KListView(m_confirmationVBox);
+ m_pluginListView->addColumn(i18n("Name"));
+ m_pluginListView->setSelectionMode(QListView::Single);
+ new QLabel(i18n("Click on next to install the selected plugin."), m_confirmationVBox);
+ addPage (m_confirmationVBox, i18n("Plugin installation confirmation"));
+
+ bool selected = false;
+
+ // Fill the plugin list
+ QValueList<KNSPluginInfo>::iterator it;
+ QValueList<KNSPluginInfo> pluginList = m_installEngine.pluginList();
+ for( it = pluginList.begin(); it != pluginList.end(); ++it ) {
+ PluginListItem *item = new PluginListItem((*it) , m_pluginListView);
+ if(!selected) {
+ selected = true;
+ m_pluginListView->setSelected(item, true);
+ }
+ kdDebug(DEBUG_NUMBER) << "New Plugin List item"<< endl;
+ setNextEnabled(m_confirmationVBox, true);
+ }
+}
+
+void KNSPluginWizard::initLicencePage()
+{
+ m_licenceVBox = new QVBox(this);
+ m_licencePageLabel = new QLabel(m_licenceVBox);
+ m_licencePageText = new KTextEdit(m_licenceVBox);
+ m_licencePageText->setReadOnly(true);
+
+ // invisible buttonGroup
+ QButtonGroup *buttonGroup = new QButtonGroup(this);
+ m_agreementButtonGroup = buttonGroup;
+ buttonGroup->hide();
+ buttonGroup->setExclusive(true);
+
+ m_licencePageAgree = new QRadioButton ( i18n("I agree."), m_licenceVBox);
+
+ m_licencePageDisagree = new QRadioButton ( i18n("I do not agree (plugin will not be installed)."), m_licenceVBox);
+
+ buttonGroup->insert(m_licencePageAgree);
+ buttonGroup->insert(m_licencePageDisagree);
+ m_licencePageDisagree->setChecked(true);
+
+ addPage (m_licenceVBox, i18n("Plugin licence"));
+
+
+ connect(buttonGroup, SIGNAL(clicked(int)), this, SLOT(slotAgreementClicked(int)));
+}
+
+void KNSPluginWizard::initInstallationProgressPage() {
+
+ m_installationProgressWidget = new QWidget(this);
+ QVBoxLayout *layout = new QVBoxLayout(m_installationProgressWidget);
+ layout->addWidget(new QLabel(i18n("Installation in progress."), m_installationProgressWidget));
+ layout->addItem(new QSpacerItem(40,20,QSizePolicy::Expanding,QSizePolicy::Expanding ));
+ m_installationProgressBar = new KProgress(m_installationProgressWidget);
+ m_installationProgressBar->setTotalSteps(100);
+ layout->addWidget(m_installationProgressBar);
+
+ addPage( m_installationProgressWidget, i18n("Plugin installation"));
+
+}
+
+void KNSPluginWizard::initFinishPage()
+{
+ m_finishWidget = new QWidget(this);
+ QVBoxLayout *layout = new QVBoxLayout(m_finishWidget);
+ layout->addItem(new QSpacerItem(40,20,QSizePolicy::Expanding,QSizePolicy::Expanding ));
+ m_finishLabel = new QLabel(m_finishWidget);
+ layout->addWidget(m_finishLabel);
+ layout->addItem(new QSpacerItem(40,20,QSizePolicy::Expanding,QSizePolicy::Expanding ));
+
+ addPage(m_finishWidget, i18n("Installation status"));
+
+}
+
+
+void KNSPluginWizard::initPagesButtonStates()
+{
+ // set buttons states for the confirmation page
+ setNextEnabled(m_confirmationVBox, true);
+ setFinishEnabled(m_confirmationVBox, false);
+ setHelpEnabled(m_confirmationVBox, false);
+
+ // set buttons states for the licence page
+ setNextEnabled(m_licenceVBox , false);
+ setBackEnabled(m_licenceVBox , false);
+ setFinishEnabled(m_licenceVBox , false);
+ setHelpEnabled(m_licenceVBox , false);
+
+ // for the installation page
+ setNextEnabled(m_installationProgressWidget , false);
+ setBackEnabled(m_installationProgressWidget , false);
+ setFinishEnabled(m_installationProgressWidget , false);
+ setHelpEnabled(m_installationProgressWidget , false);
+
+ // for the finish page
+ setNextEnabled(m_finishWidget , false);
+ setBackEnabled(m_finishWidget , false);
+ setFinishEnabled(m_finishWidget , true);
+ setHelpEnabled(m_finishWidget , false);
+}
+
+
+
+void KNSPluginWizard::connectSignals() {
+ connect(&m_installEngine, SIGNAL(installProgress(int)), m_installationProgressBar, SLOT(setProgress(int)) );
+ connect(&m_installEngine, SIGNAL(installCompleted()), this, SLOT(slotInstallationCompleted()) );
+ connect(&m_installEngine, SIGNAL(installFailed()), this, SLOT(slotInstallationFailed()) );
+
+
+}
+
+void KNSPluginWizard::showPage(QWidget *page)
+{
+
+ // if the licence page is shown set the label and the licence content
+ if(page == m_licenceVBox && m_licencePageLabel->text().isEmpty()) {
+ KNSPluginInfo info = static_cast<PluginListItem *>(m_pluginListView->selectedItem())->pluginInfo();
+ m_licencePageLabel->setText(i18n("To install ")+info.pluginName()+i18n(" you need to agree to the following"));
+ QString licence;
+ licence = info.licence();
+ QString tmpFile;
+ if(info.licenceURL().isValid())
+ // retrieve the licence if we have an url
+ if(KIO::NetAccess::download(info.licenceURL(), tmpFile, NULL)) {
+ QFile f(tmpFile);
+ if(f.open(IO_ReadOnly)) {
+ QTextStream stream(&f);
+ stream.setEncoding(QTextStream::UnicodeUTF8);
+ licence = stream.read();
+ f.close();
+ KIO::NetAccess::removeTempFile(tmpFile);
+ }
+ }
+ // else display the licence found in the xml config
+ m_licencePageText->setText(licence);
+
+ }
+
+ // if the installation page is shown start the download
+ if(page == m_installationProgressWidget) {
+ KNSPluginInfo info = static_cast<PluginListItem *>(m_pluginListView->selectedItem())->pluginInfo();
+ m_installEngine.startInstall(info);
+
+ }
+
+ // If we must display the finish page
+ if(page == m_finishWidget) {
+ if(m_installationComplete) {
+ m_finishLabel->setText(i18n("Installation completed. Reload the page."));
+
+ } else
+ m_finishLabel->setText(i18n("Installation failed"));
+
+ }
+
+
+ KWizard::showPage(page);
+}
+
+int KNSPluginWizard::exec()
+{
+ if(!m_installEngine.pluginList().count())
+ return QDialog::Rejected;
+
+ return KWizard::exec();
+}
+
+
+bool KNSPluginWizard::pluginAvailable()
+{
+ return m_installEngine.pluginAvailable();
+}
+
+void KNSPluginWizard::slotAgreementClicked(int id)
+{
+ if( id == m_agreementButtonGroup->id(m_licencePageAgree) ) {
+ setNextEnabled(m_licenceVBox, true);
+
+ } else {
+ setNextEnabled(m_licenceVBox, false);
+ }
+
+}
+
+void KNSPluginWizard::slotInstallationCompleted()
+{
+ m_installationComplete = true;
+ // enable next button
+ setNextEnabled(m_installationProgressWidget, true);
+ next();
+}
+void KNSPluginWizard::slotInstallationFailed()
+{
+ m_installationComplete = false;
+ showPage(m_finishWidget);
+}
+
+
+// KNSPlugin info copy constructor
+
+KNSPluginInfo::KNSPluginInfo()
+{
+
+}
+
+// KNSPlugin info constructor par an xml dom fragment
+KNSPluginInfo::KNSPluginInfo(QDomNode pluginNode)
+{
+ QDomElement e;
+ QDomNode node;
+
+ // Read plugin informations
+ node = pluginNode.firstChild();
+ while(!node.isNull()) {
+ e = node.toElement();
+ if( e.tagName() == "pluginname") {
+ kdDebug(DEBUG_NUMBER) << "found name " << e.text() << endl;
+ m_pluginName = e.text();
+ }
+
+ if( e.tagName() == "pluginurl") {
+ kdDebug(DEBUG_NUMBER) << "found plugin url " << e.text() << endl;
+ m_pluginURL = KURL(e.text());
+ }
+
+ if( e.tagName() == "licence") {
+ kdDebug(DEBUG_NUMBER) << "found licence " << e.text() << endl;
+ m_licence = e.text();
+ }
+
+ if( e.tagName() == "licenceurl") {
+ kdDebug(DEBUG_NUMBER) << "found licenceurl " << e.text() << endl;
+ m_licenceURL = KURL(e.text());
+ }
+
+ if( e.tagName() == "pluginfile") {
+ kdDebug(DEBUG_NUMBER) << "found pluginfile " << e.text() << endl;
+ m_pluginFileList.append(e.text());
+ }
+ node = node.nextSibling();
+ }
+}
+
+
+KNSPluginInfo::~KNSPluginInfo()
+{
+
+}
+
+
+bool KNSPluginInfo::isValid() const
+{
+ // tell if the pluginInfo is a valid One
+ if( m_pluginName.isEmpty() || ( m_licence.isEmpty() && !m_licenceURL.isValid() ) || !m_pluginURL.isValid() || m_pluginFileList.empty() ) {
+ kdDebug(DEBUG_NUMBER) << "invalid plugin info" << endl;
+ return false;
+
+ }
+
+ else {
+
+ kdDebug(DEBUG_NUMBER) << "valid plugin info" << endl;
+ return true;
+ }
+}
+
+// Accesors
+QString KNSPluginInfo::pluginName() const
+{
+ return m_pluginName;
+}
+
+QString KNSPluginInfo::licence() const
+{
+ return m_licence;
+}
+
+KURL KNSPluginInfo::licenceURL() const
+{
+ return m_licenceURL;
+}
+
+KURL KNSPluginInfo::pluginURL() const
+{
+ return m_pluginURL;
+}
+
+const QStringList& KNSPluginInfo::pluginFileList() const
+{
+ return m_pluginFileList;
+}
diff --git a/khtml/misc/knsplugininstaller.h b/khtml/misc/knsplugininstaller.h
new file mode 100644
index 000000000..d49a79f78
--- /dev/null
+++ b/khtml/misc/knsplugininstaller.h
@@ -0,0 +1,269 @@
+/*
+ * This file is part of the KDE project.
+ *
+ * Copyright (C) 2005 Benoit Canet <bcanet@dental-on-line.fr>
+ * with some advices from Aurelien Gateau <agateau@dental-on-line.fr>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef KNSPLUGININSTALLER_H
+#define KNSPLUGININSTALLER_H
+
+#include <job.h>
+#include <ktextedit.h>
+#include <kmimetype.h>
+#include <kprogress.h>
+#include <kurl.h>
+#include <kwizard.h>
+
+#include <qbuttongroup.h>
+#include <qdom.h>
+#include <qlabel.h>
+#include <qobject.h>
+#include <qprocess.h>
+#include <qradiobutton.h>
+#include <qvaluelist.h>
+#include <qvbox.h>
+#include <qwidget.h>
+
+class QStringList;
+
+/*
+ * This class contains all the infos needed to install a given plugin
+ * Takes and parse a QDomNode in its constructor
+ */
+class KNSPluginInfo
+{
+
+public:
+
+ /*
+ * Construct the plugin info object
+ */
+ KNSPluginInfo();
+ KNSPluginInfo(QDomNode pluginNode);
+ ~KNSPluginInfo();
+
+ /*
+ * Check the validity of the plugin info object
+ */
+ bool isValid() const;
+
+ //Accessor methods
+ QString pluginName() const;
+ QString licence() const;
+ KURL licenceURL() const;
+ KURL pluginURL() const;
+ const QStringList& pluginFileList() const;
+
+private:
+
+ // plugin info
+ QString m_pluginName;
+ QString m_licence;
+ KURL m_licenceURL;
+ KURL m_pluginURL;
+ QStringList m_pluginFileList;
+
+
+};
+
+
+/*
+ * This class contain all the the methods used to perform a plugin installation
+ *
+ */
+class KNSPluginInstallEngine : public QObject
+{
+ Q_OBJECT
+public:
+
+ /*
+ * Construct the class
+ */
+ KNSPluginInstallEngine(KMimeType::Ptr mime);
+ ~KNSPluginInstallEngine();
+
+ /*
+ * Check if the installer engine and wizzard is activated
+ */
+ static bool isActive();
+ /**
+ * Check the availability of a plugin
+ */
+ bool pluginAvailable();
+ /*
+ * Return the list of plugins Available
+ */
+ const QValueList<KNSPluginInfo>& pluginList() const;
+ void startInstall(KNSPluginInfo info);
+
+
+
+private:
+
+ // methods used to check the kde config and detect if an adequate plugin is available
+
+ /*
+ * load kde KNSPluginInstaller config
+ */
+ bool loadConfig();
+ /*
+ * retrieve the xml configuration file
+ */
+ bool loadXmlConfig();
+ /*
+ * parse the xml configuration file
+ */
+ bool findPlugin();
+
+
+ QMap<QString, QString> m_archMap;
+ QString m_pluginsXmlConfig;
+ QValueList<KNSPluginInfo> m_pluginList;
+ KMimeType::Ptr m_mime;
+ KURL m_pluginsListFileURL;
+ QString m_tmpPluginFileName;
+ KIO::CopyJob *m_downloadJob;
+ KIO::CopyJob *m_installFileJob;
+ KNSPluginInfo m_toInstallPluginInfo;
+ QProcess *m_scanProc;
+
+signals:
+ // Signals used to communicate with the wizzard
+ void installProgress(int percent);
+ void installCompleted();
+ void installFailed();
+
+private slots:
+ // Used to monitor the plugin downloading
+ void slotDownLoadProgress(KIO::Job *job, unsigned long percent);
+ void slotDownloadResult(KIO::Job *job);
+
+ // Used to monitor the plugin installation
+ void slotCopyProgress(KIO::Job *job, unsigned long percent);
+ void slotCopyResult(KIO::Job *job);
+
+ // Used to monitor the plugins scan
+ void readScanProcFromStdout();
+ void endScanProc();
+
+
+
+};
+
+/*
+ * This class is a wizzard used to install a plugin
+ */
+class KNSPluginWizard : public KWizard
+{
+ Q_OBJECT
+public:
+
+ /**
+ * Construct a KNSpluginInstaller
+ */
+ KNSPluginWizard(QWidget *parent, const char *name, KMimeType::Ptr mime);
+ ~KNSPluginWizard();
+
+
+ /**
+ * Lauch the wizzard
+ */
+ int exec();
+ /*
+ * Check the availability of a plugin
+ */
+ bool pluginAvailable();
+
+
+private:
+ // methods used in the constructor to init the wizzard pages
+ void initConfirmationPage();
+ void initLicencePage();
+ void initInstallationProgressPage();
+ void initFinishPage();
+
+ // in this method we disable or enable the wizzard pages buttons
+ void initPagesButtonStates();
+
+ /*
+ * Connect signals
+ */
+ void connectSignals();
+
+ /*
+ * Overiden method called when a page is shown
+ */
+ void showPage(QWidget *page);
+
+
+ // Plugin installation engine
+ KNSPluginInstallEngine m_installEngine;
+
+ // pages widgets
+ QVBox *m_confirmationVBox;
+ QVBox *m_licenceVBox;
+ QWidget *m_installationProgressWidget;
+ QWidget *m_finishWidget;
+
+ // plugin list
+ KListView *m_pluginListView;
+
+ // licence stuff
+ QLabel *m_licencePageLabel;
+ KTextEdit *m_licencePageText;
+ QRadioButton *m_licencePageAgree;
+ QRadioButton *m_licencePageDisagree;
+ QButtonGroup *m_agreementButtonGroup;
+
+ // installation progress bar
+ KProgress *m_installationProgressBar;
+
+ // Finish Label
+ QLabel *m_finishLabel;
+
+ // installation status
+ bool m_installationComplete;
+
+private slots:
+ /*
+ * Check if the user Agree or disagree with the licence
+ */
+ void slotAgreementClicked(int id);
+ /*
+ * Called when the installation is completed
+ */
+ void slotInstallationCompleted();
+ /*
+ * Called when the installation has failed
+ */
+ void slotInstallationFailed();
+
+signals:
+ /*
+ * Emited when the installation has complete - TODO connect this signal to reload the page
+ */
+ void pluginInstallCompleted();
+};
+
+
+
+
+
+#endif
diff --git a/khtml/rendering/render_frames.cpp b/khtml/rendering/render_frames.cpp
index 7ee69b239..4ee0f96bf 100644
--- a/khtml/rendering/render_frames.cpp
+++ b/khtml/rendering/render_frames.cpp
@@ -36,6 +36,7 @@
#include "misc/htmltags.h"
#include "khtmlview.h"
#include "khtml_part.h"
+#include "misc/knsplugininstaller.h"
#include <kapplication.h>
#include <kmessagebox.h>
@@ -937,17 +938,30 @@ void RenderPartObject::slotPartLoadingErrorNotify()
if (!mimeName.isEmpty() && part->docImpl() && !part->pluginPageQuestionAsked( serviceType ) )
{
part->setPluginPageQuestionAsked( serviceType );
- // Prepare the URL to show in the question (host only if http, to make it short)
- KURL pluginPageURL( embed->pluginPage );
- QString shortURL = pluginPageURL.protocol() == "http" ? pluginPageURL.host() : pluginPageURL.prettyURL();
- int res = KMessageBox::questionYesNo( m_view,
- i18n("No plugin found for '%1'.\nDo you want to download one from %2?").arg(mimeName).arg(shortURL),
- i18n("Missing Plugin"), i18n("Download"), i18n("Do Not Download"), QString("plugin-")+serviceType);
- if ( res == KMessageBox::Yes )
+ bool pluginAvailable;
+ pluginAvailable = false;
+ // check if a pluginList file is in the config
+ if(KNSPluginInstallEngine::isActive())
{
- // Display vendor download page
- ext->createNewWindow( pluginPageURL );
- return;
+ KNSPluginWizard pluginWizard(m_view, "pluginInstaller", mime);
+ if(pluginWizard.pluginAvailable()) {
+ pluginAvailable = true;
+ pluginWizard.exec();
+ }
+ }
+ if(!pluginAvailable) {
+ // Prepare the URL to show in the question (host only if http, to make it short)
+ KURL pluginPageURL( embed->pluginPage );
+ QString shortURL = pluginPageURL.protocol() == "http" ? pluginPageURL.host() : pluginPageURL.prettyURL();
+ int res = KMessageBox::questionYesNo( m_view,
+ i18n("No plugin found for '%1'.\nDo you want to download one from %2?").arg(mimeName).arg(shortURL),
+ i18n("Missing Plugin"), i18n("Download"), i18n("Do Not Download"), QString("plugin-")+serviceType);
+ if ( res == KMessageBox::Yes )
+ {
+ // Display vendor download page
+ ext->createNewWindow( pluginPageURL );
+ return;
+ }
}
}
}
@@ -1007,4 +1021,5 @@ void RenderPartObject::slotViewCleared()
}
}
+
#include "render_frames.moc"
diff --git a/kimgio/Makefile.am b/kimgio/Makefile.am
index 3a28d9eeb..ae52d6597 100644
--- a/kimgio/Makefile.am
+++ b/kimgio/Makefile.am
@@ -37,7 +37,7 @@ kimg_xview_la_LIBADD = $(LIB_QT)
kimg_eps_la_SOURCES = eps.cpp
kimg_eps_la_LDFLAGS = -module $(KIMGIO_PLUGIN) -no-undefined $(all_libraries)
-kimg_eps_la_LIBADD = $(LIB_KDECORE)
+kimg_eps_la_LIBADD = $(LIB_KDECORE) $(LIB_QT)
kimg_ico_la_SOURCES = ico.cpp
kimg_ico_la_LDFLAGS = -module $(KIMGIO_PLUGIN) -no-undefined $(all_libraries)
@@ -49,35 +49,35 @@ kimg_jp2_la_LIBADD = $(LIB_QT) $(LIB_JASPER) ../kdecore/libkdecore.la
kimg_pcx_la_SOURCES = pcx.cpp
kimg_pcx_la_LDFLAGS = -module $(KIMGIO_PLUGIN) -no-undefined $(all_libraries)
-kimg_pcx_la_LIBADD = $(LIB_QT) $(LIB_KDECORE)
+kimg_pcx_la_LIBADD = $(LIB_QT)
kimg_tga_la_SOURCES = tga.cpp
kimg_tga_la_LDFLAGS = -module $(KIMGIO_PLUGIN) -no-undefined $(all_libraries)
-kimg_tga_la_LIBADD = $(LIB_QT) $(LIB_KDECORE)
+kimg_tga_la_LIBADD = $(LIB_QT)
kimg_rgb_la_SOURCES = rgb.cpp
kimg_rgb_la_LDFLAGS = -module $(KIMGIO_PLUGIN) -no-undefined $(all_libraries)
-kimg_rgb_la_LIBADD = $(LIB_QT) $(LIB_KDECORE)
+kimg_rgb_la_LIBADD = $(LIB_QT)
kimg_xcf_la_SOURCES = xcf.cpp
kimg_xcf_la_LDFLAGS = -module $(KIMGIO_PLUGIN) -no-undefined $(all_libraries)
-kimg_xcf_la_LIBADD = $(LIB_QT) $(LIB_KDECORE)
+kimg_xcf_la_LIBADD = $(LIB_QT)
kimg_exr_la_SOURCES = exr.cpp
kimg_exr_la_LDFLAGS = -module $(KIMGIO_PLUGIN) -no-undefined $(all_libraries)
-kimg_exr_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_EXR)
+kimg_exr_la_LIBADD = $(LIB_QT) $(LIB_EXR)
kimg_dds_la_SOURCES = dds.cpp
kimg_dds_la_LDFLAGS = -module $(KIMGIO_PLUGIN) -no-undefined $(all_libraries)
-kimg_dds_la_LIBADD = $(LIB_QT) $(LIB_KDECORE)
+kimg_dds_la_LIBADD = $(LIB_QT)
kimg_psd_la_SOURCES = psd.cpp
kimg_psd_la_LDFLAGS = -module $(KIMGIO_PLUGIN) -no-undefined $(all_libraries)
-kimg_psd_la_LIBADD = $(LIB_QT) $(LIB_KDECORE)
+kimg_psd_la_LIBADD = $(LIB_QT)
kimg_hdr_la_SOURCES = hdr.cpp
kimg_hdr_la_LDFLAGS = -module $(KIMGIO_PLUGIN) -no-undefined $(all_libraries)
-kimg_hdr_la_LIBADD = $(LIB_QT) $(LIB_KDECORE)
+kimg_hdr_la_LIBADD = $(LIB_QT)
noinst_HEADERS= xview.h eps.h tiffr.h g3r.h ico.h jp2.h pcx.h tga.h rgb.h xcf.h gimp.h exr.h dds.h psd.h hdr.h
diff --git a/kinit/Makefile.am b/kinit/Makefile.am
index 1bbb44991..4328af871 100644
--- a/kinit/Makefile.am
+++ b/kinit/Makefile.am
@@ -56,7 +56,7 @@ kwrapper_SOURCES = kwrapper.c
kwrapper_LDADD = $(LIBSOCKET)
klauncher_la_LDFLAGS = $(all_libraries) -module -avoid-version
-klauncher_la_LIBADD = $(LIB_KIO)
+klauncher_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_KDECORE) $(top_builddir)/dcop/libDCOP.la $(LIB_X11)
klauncher_la_SOURCES = klauncher.cpp klauncher_main.cpp autostart.cpp
kstartupconfig_SOURCES = kstartupconfig.cpp
diff --git a/kinit/autostart.cpp b/kinit/autostart.cpp
index 0b39a3275..7780f793c 100644
--- a/kinit/autostart.cpp
+++ b/kinit/autostart.cpp
@@ -48,6 +48,14 @@ AutoStart::AutoStart( bool new_startup )
m_startList = new AutoStartList;
m_startList->setAutoDelete(true);
KGlobal::dirs()->addResourceType("autostart", "share/autostart");
+ QString xdgdirs = getenv("XDG_CONFIG_DIRS");
+ if (xdgdirs.isEmpty())
+ xdgdirs = "/etc/xdg";
+
+ QStringList xdgdirslist = QStringList::split( ':', xdgdirs );
+ for ( QStringList::Iterator itr = xdgdirslist.begin(); itr != xdgdirslist.end(); ++itr ) {
+ KGlobal::dirs()->addResourceDir("autostart", (*itr) +"/autostart");
+ }
}
AutoStart::~AutoStart()
diff --git a/kinit/kinit.cpp b/kinit/kinit.cpp
index 8b654b038..77608b94b 100644
--- a/kinit/kinit.cpp
+++ b/kinit/kinit.cpp
@@ -60,7 +60,7 @@
#include <kapplication.h>
#include <klocale.h>
-#ifdef Q_OS_LINUX
+#ifdef HAVE_SYS_PRCTL_H
#include <sys/prctl.h>
#ifndef PR_SET_NAME
#define PR_SET_NAME 15
@@ -256,18 +256,18 @@ static void setup_tty( const char* tty )
int fd = open( tty, O_WRONLY );
if( fd < 0 )
{
- perror( "kdeinit: couldn't open() tty" );
+ fprintf(stderr, "kdeinit: couldn't open() %s: %s\n", tty, strerror (errno) );
return;
}
if( dup2( fd, STDOUT_FILENO ) < 0 )
{
- perror( "kdeinit: couldn't dup2() tty" );
+ fprintf(stderr, "kdeinit: couldn't dup2() %s: %s\n", tty, strerror (errno) );
close( fd );
return;
}
if( dup2( fd, STDERR_FILENO ) < 0 )
{
- perror( "kdeinit: couldn't dup2() tty" );
+ fprintf(stderr, "kdeinit: couldn't dup2() %s: %s\n", tty, strerror (errno) );
close( fd );
return;
}
@@ -571,7 +571,7 @@ static pid_t launch(int argc, const char *_name, const char *args,
d.argv[argc] = 0;
/** Give the process a new name **/
-#ifdef Q_OS_LINUX
+#ifdef HAVE_SYS_PRCTL_H
/* set the process name, so that killall works like intended */
r = prctl(PR_SET_NAME, (unsigned long) name.data(), 0, 0, 0);
if ( r == 0 )
diff --git a/kinit/kstartupconfig.cpp b/kinit/kstartupconfig.cpp
index 8bb60c127..0700f22fc 100644
--- a/kinit/kstartupconfig.cpp
+++ b/kinit/kstartupconfig.cpp
@@ -81,7 +81,7 @@ int main()
else if( getenv( "HOME" ))
{
strlcpy( kdehome, getenv( "HOME" ), 1024 );
- strlcat( kdehome, "/.kde", 1024 );
+ strlcat( kdehome, "/.kde3", 1024 );
}
else
return 1;
diff --git a/kinit/lnusertemp.c b/kinit/lnusertemp.c
index 70457f74f..867f1fb95 100644
--- a/kinit/lnusertemp.c
+++ b/kinit/lnusertemp.c
@@ -89,6 +89,9 @@ int create_link(const char *file, const char *tmp_dir)
}
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
int build_link(const char *tmp_prefix, const char *kde_prefix)
{
struct passwd *pw_ent;
@@ -116,7 +119,7 @@ int build_link(const char *tmp_prefix, const char *kde_prefix)
if (!kde_home || !kde_home[0])
{
- kde_home = "~/.kde/";
+ kde_home = "~/.kde3/";
}
if (kde_home[0] == '~')
diff --git a/kinit/wrapper.c b/kinit/wrapper.c
index 0248e4789..d1d754b7b 100644
--- a/kinit/wrapper.c
+++ b/kinit/wrapper.c
@@ -139,7 +139,7 @@ static int openSocket()
if (!kde_home || !kde_home[0])
{
- kde_home = "~/.kde/";
+ kde_home = "~/.kde3/";
}
if (kde_home[0] == '~')
diff --git a/kio/Makefile.am b/kio/Makefile.am
index cfe25006e..d1fe7c6b2 100644
--- a/kio/Makefile.am
+++ b/kio/Makefile.am
@@ -20,7 +20,8 @@ AM_CPPFLAGS = -D_LARGEFILE64_SOURCE
INCLUDES= -I$(srcdir)/.. $(all_includes) $(SSL_INCLUDES)
-SUBDIRS = kssl kio bookmarks kfile . kpasswdserver misc pics tests kioexec httpfilter
+SUBDIRS = kssl kio bookmarks kfile . pics tests kioexec httpfilter
+DIST_SUBDIRS = kpasswdserver misc
lib_LTLIBRARIES = libkio.la
@@ -32,7 +33,7 @@ libkio_la_LIBADD = kssl/libkssl.la kio/libkiocore.la \
kio/libksycoca.la bookmarks/libkbookmarks.la kfile/libkfile.la \
../kdeui/libkdeui.la ../kdesu/libkdesu.la \
../kwallet/client/libkwalletclient.la \
- $(LIBZ) $(LIBFAM) $(LIBVOLMGT) $(ACL_LIBS)
+ $(LIBZ) $(LIBFAM) $(LIBVOLMGT) $(ACL_LIBS) $(LIB_QT) $(LIB_KDECORE) $(top_builddir)/dcop/libDCOP.la $(LIB_X11)
kde_mime_DATA = magic
kde_servicetypes_DATA = application.desktop kurifilterplugin.desktop \
diff --git a/kio/kfile/kfilespeedbar.cpp b/kio/kfile/kfilespeedbar.cpp
index 86ee85f52..350423d35 100644
--- a/kio/kfile/kfilespeedbar.cpp
+++ b/kio/kfile/kfilespeedbar.cpp
@@ -20,6 +20,9 @@
#include "config-kfile.h"
#include <qdir.h>
+#include <qfile.h>
+#include <qtextcodec.h>
+#include <qtextstream.h>
#include <kconfig.h>
#include <kglobal.h>
@@ -50,7 +53,7 @@ KFileSpeedBar::KFileSpeedBar( QWidget *parent, const char *name )
QDir(KGlobalSettings::documentPath()).exists())
{
u.setPath( KGlobalSettings::documentPath() );
- insertItem( u, i18n("Documents"), false, "document" );
+ insertItem( u, i18n("Documents"), false, "folder_txt" );
}
u.setPath( QDir::homeDirPath() );
@@ -62,6 +65,51 @@ KFileSpeedBar::KFileSpeedBar( QWidget *parent, const char *name )
insertItem( u, i18n("Storage Media"), false,
KProtocolInfo::icon( "media" ) );
+ if ( QFile::exists( QDir::homeDirPath()+"/.config/user-dirs.dirs" ) )
+ {
+ QString download, music, pictures, videos, templates, publicShares;
+
+ QFile f( QDir::homeDirPath()+"/.config/user-dirs.dirs" );
+ if (!f.open(IO_ReadOnly))
+ return;
+
+ QTextStream s( &f );
+ s.setCodec( QTextCodec::codecForLocale() );
+
+ // read the xdg user dirs
+ QString line = s.readLine();
+ while (!line.isNull())
+ {
+ if (line.startsWith("XDG_DOWNLOAD_DIR="))
+ download = line.remove("XDG_DOWNLOAD_DIR=").remove("\"").replace("$HOME", QDir::homeDirPath());
+ else if (line.startsWith("XDG_MUSIC_DIR="))
+ music = line.remove("XDG_MUSIC_DIR=").remove("\"").replace("$HOME", QDir::homeDirPath());
+ else if (line.startsWith("XDG_PICTURES_DIR="))
+ pictures = line.remove("XDG_PICTURES_DIR=").remove("\"").replace("$HOME", QDir::homeDirPath());
+ else if (line.startsWith("XDG_VIDEOS_DIR="))
+ videos = line.remove("XDG_VIDEOS_DIR=").remove("\"").replace("$HOME", QDir::homeDirPath());
+ else if (line.startsWith("XDG_TEMPLATES_DIR="))
+ templates = line.remove("XDG_TEMPLATES_DIR=").remove("\"").replace("$HOME", QDir::homeDirPath());
+ else if (line.startsWith("XDG_PUBLICSHARES_DIR="))
+ publicShares = line.remove("XDG_PUBLICSHARES_DIR=").remove("\"").replace("$HOME", QDir::homeDirPath());
+
+ line = s.readLine();
+ }
+ // now add in the speedbar
+ if (!download.isEmpty())
+ insertItem( download, i18n( "Download" ), false, "folder_html" );
+ if (!music.isEmpty())
+ insertItem( music, i18n( "Music" ), false, "folder_sound" );
+ if (!pictures.isEmpty())
+ insertItem( pictures, i18n( "Pictures" ), false, "folder_image" );
+ if (!videos.isEmpty())
+ insertItem( videos, i18n( "Videos" ), false, "folder_video" );
+ if (!templates.isEmpty())
+ insertItem( templates, i18n( "Templates" ), false, "folder_video" );
+ if (!publicShares.isEmpty())
+ insertItem( publicShares, i18n( "Public" ), false, "folder_video" );
+ }
+
u = "remote:/";
if ( KProtocolInfo::isKnownProtocol( u ) )
insertItem( u, i18n("Network Folders"), false,
diff --git a/kio/kfile/kpropertiesdialog.cpp b/kio/kfile/kpropertiesdialog.cpp
index fd08d906d..f02e80eaf 100644
--- a/kio/kfile/kpropertiesdialog.cpp
+++ b/kio/kfile/kpropertiesdialog.cpp
@@ -1881,7 +1881,14 @@ static bool fileSystemSupportsACL( const QCString& pathCString )
fileSystemSupportsACLs = ( statfs( pathCString.data(), &buf ) == 0 ) && ( buf.f_flags & MNT_ACLS );
#else
fileSystemSupportsACLs =
- getxattr( pathCString.data(), "system.posix_acl_access", NULL, 0 ) >= 0 || errno == ENODATA;
+ getxattr( pathCString.data(), "system.posix_acl_access", NULL, 0 ) >= 0
+#ifdef ENODATA
+ || (errno == ENODATA)
+#endif
+#ifdef ENOATTR
+ || (errno == ENOATTR)
+#endif
+ ;
#endif
return fileSystemSupportsACLs;
}
diff --git a/kio/kio/kdirwatch.cpp b/kio/kio/kdirwatch.cpp
index b80a23473..aaa807ed6 100644
--- a/kio/kio/kdirwatch.cpp
+++ b/kio/kio/kdirwatch.cpp
@@ -64,36 +64,17 @@
// debug
#include <sys/ioctl.h>
-#ifdef HAVE_SYS_INOTIFY
-#include <sys/inotify.h>
-#include <fcntl.h>
-#elif HAVE_INOTIFY
+#ifdef HAVE_INOTIFY
#include <unistd.h>
#include <fcntl.h>
#include <sys/syscall.h>
+#include <linux/types.h>
// Linux kernel headers are documented to not compile
#define _S390_BITOPS_H
-#include <linux/inotify.h>
-
-static inline int inotify_init (void)
-{
- return syscall (__NR_inotify_init);
-}
-
-static inline int inotify_add_watch (int fd, const char *name, __u32 mask)
-{
- return syscall (__NR_inotify_add_watch, fd, name, mask);
-}
-
-static inline int inotify_rm_watch (int fd, __u32 wd)
-{
- return syscall (__NR_inotify_rm_watch, fd, wd);
-}
-#endif
+#include <sys/inotify.h>
-#ifdef HAVE_INOTIFY
#ifndef IN_ONLYDIR
-#define IN_ONLYDIR 0x01000000
+#define IN_ONLYDIR 0x01000000
#endif
#ifndef IN_DONT_FOLLOW
@@ -103,6 +84,7 @@ static inline int inotify_rm_watch (int fd, __u32 wd)
#ifndef IN_MOVE_SELF
#define IN_MOVE_SELF 0x00000800
#endif
+
#endif
#include <sys/utsname.h>
diff --git a/kio/kio/kdirwatch.cpp.orig b/kio/kio/kdirwatch.cpp.orig
new file mode 100644
index 000000000..b80a23473
--- /dev/null
+++ b/kio/kio/kdirwatch.cpp.orig
@@ -0,0 +1,1770 @@
+// -*- c-basic-offset: 2 -*-
+/* This file is part of the KDE libraries
+ Copyright (C) 1998 Sven Radej <sven@lisa.exp.univie.ac.at>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+
+// CHANGES:
+// Oct 4, 2005 - Inotify support (Dirk Mueller)
+// Februar 2002 - Add file watching and remote mount check for STAT
+// Mar 30, 2001 - Native support for Linux dir change notification.
+// Jan 28, 2000 - Usage of FAM service on IRIX (Josef.Weidendorfer@in.tum.de)
+// May 24. 1998 - List of times introduced, and some bugs are fixed. (sven)
+// May 23. 1998 - Removed static pointer - you can have more instances.
+// It was Needed for KRegistry. KDirWatch now emits signals and doesn't
+// call (or need) KFM. No more URL's - just plain paths. (sven)
+// Mar 29. 1998 - added docs, stop/restart for particular Dirs and
+// deep copies for list of dirs. (sven)
+// Mar 28. 1998 - Created. (sven)
+
+
+#include <config.h>
+#include <errno.h>
+
+#ifdef HAVE_DNOTIFY
+#include <unistd.h>
+#include <time.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <errno.h>
+#endif
+
+
+#include <sys/stat.h>
+#include <assert.h>
+#include <qdir.h>
+#include <qfile.h>
+#include <qintdict.h>
+#include <qptrlist.h>
+#include <qsocketnotifier.h>
+#include <qstringlist.h>
+#include <qtimer.h>
+
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kconfig.h>
+#include <kglobal.h>
+#include <kstaticdeleter.h>
+#include <kde_file.h>
+
+// debug
+#include <sys/ioctl.h>
+
+#ifdef HAVE_SYS_INOTIFY
+#include <sys/inotify.h>
+#include <fcntl.h>
+#elif HAVE_INOTIFY
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/syscall.h>
+// Linux kernel headers are documented to not compile
+#define _S390_BITOPS_H
+#include <linux/inotify.h>
+
+static inline int inotify_init (void)
+{
+ return syscall (__NR_inotify_init);
+}
+
+static inline int inotify_add_watch (int fd, const char *name, __u32 mask)
+{
+ return syscall (__NR_inotify_add_watch, fd, name, mask);
+}
+
+static inline int inotify_rm_watch (int fd, __u32 wd)
+{
+ return syscall (__NR_inotify_rm_watch, fd, wd);
+}
+#endif
+
+#ifdef HAVE_INOTIFY
+#ifndef IN_ONLYDIR
+#define IN_ONLYDIR 0x01000000
+#endif
+
+#ifndef IN_DONT_FOLLOW
+#define IN_DONT_FOLLOW 0x02000000
+#endif
+
+#ifndef IN_MOVE_SELF
+#define IN_MOVE_SELF 0x00000800
+#endif
+#endif
+
+#include <sys/utsname.h>
+
+#include "kdirwatch.h"
+#include "kdirwatch_p.h"
+#include "global.h" // KIO::probably_slow_mounted
+
+#define NO_NOTIFY (time_t) 0
+
+static KDirWatchPrivate* dwp_self = 0;
+
+#ifdef HAVE_DNOTIFY
+
+static int dnotify_signal = 0;
+
+/* DNOTIFY signal handler
+ *
+ * As this is called asynchronously, only a flag is set and
+ * a rescan is requested.
+ * This is done by writing into a pipe to trigger a QSocketNotifier
+ * watching on this pipe: a timer is started and after a timeout,
+ * the rescan is done.
+ */
+void KDirWatchPrivate::dnotify_handler(int, siginfo_t *si, void *)
+{
+ if (!dwp_self) return;
+
+ // write might change errno, we have to save it and restore it
+ // (Richard Stevens, Advanced programming in the Unix Environment)
+ int saved_errno = errno;
+
+ Entry* e = dwp_self->fd_Entry.find(si->si_fd);
+
+// kdDebug(7001) << "DNOTIFY Handler: fd " << si->si_fd << " path "
+// << QString(e ? e->path:"unknown") << endl;
+
+ if(e && e->dn_fd == si->si_fd)
+ e->dirty = true;
+
+ char c = 0;
+ write(dwp_self->mPipe[1], &c, 1);
+ errno = saved_errno;
+}
+
+static struct sigaction old_sigio_act;
+/* DNOTIFY SIGIO signal handler
+ *
+ * When the kernel queue for the dnotify_signal overflows, a SIGIO is send.
+ */
+void KDirWatchPrivate::dnotify_sigio_handler(int sig, siginfo_t *si, void *p)
+{
+ if (dwp_self)
+ {
+ // write might change errno, we have to save it and restore it
+ // (Richard Stevens, Advanced programming in the Unix Environment)
+ int saved_errno = errno;
+
+ dwp_self->rescan_all = true;
+ char c = 0;
+ write(dwp_self->mPipe[1], &c, 1);
+
+ errno = saved_errno;
+ }
+
+ // Call previous signal handler
+ if (old_sigio_act.sa_flags & SA_SIGINFO)
+ {
+ if (old_sigio_act.sa_sigaction)
+ (*old_sigio_act.sa_sigaction)(sig, si, p);
+ }
+ else
+ {
+ if ((old_sigio_act.sa_handler != SIG_DFL) &&
+ (old_sigio_act.sa_handler != SIG_IGN))
+ (*old_sigio_act.sa_handler)(sig);
+ }
+}
+#endif
+
+
+//
+// Class KDirWatchPrivate (singleton)
+//
+
+/* All entries (files/directories) to be watched in the
+ * application (coming from multiple KDirWatch instances)
+ * are registered in a single KDirWatchPrivate instance.
+ *
+ * At the moment, the following methods for file watching
+ * are supported:
+ * - Polling: All files to be watched are polled regularly
+ * using stat (more precise: QFileInfo.lastModified()).
+ * The polling frequency is determined from global kconfig
+ * settings, defaulting to 500 ms for local directories
+ * and 5000 ms for remote mounts
+ * - FAM (File Alternation Monitor): first used on IRIX, SGI
+ * has ported this method to LINUX. It uses a kernel part
+ * (IMON, sending change events to /dev/imon) and a user
+ * level damon (fam), to which applications connect for
+ * notification of file changes. For NFS, the fam damon
+ * on the NFS server machine is used; if IMON is not built
+ * into the kernel, fam uses polling for local files.
+ * - DNOTIFY: In late LINUX 2.3.x, directory notification was
+ * introduced. By opening a directory, you can request for
+ * UNIX signals to be sent to the process when a directory
+ * is changed.
+ * - INOTIFY: In LINUX 2.6.13, inode change notification was
+ * introduced. You're now able to watch arbitrary inode's
+ * for changes, and even get notification when they're
+ * unmounted.
+ */
+
+KDirWatchPrivate::KDirWatchPrivate()
+ : rescan_timer(0, "KDirWatchPrivate::rescan_timer")
+{
+ timer = new QTimer(this, "KDirWatchPrivate::timer");
+ connect (timer, SIGNAL(timeout()), this, SLOT(slotRescan()));
+ freq = 3600000; // 1 hour as upper bound
+ statEntries = 0;
+ delayRemove = false;
+ m_ref = 0;
+
+ KConfigGroup config(KGlobal::config(), QCString("DirWatch"));
+ m_nfsPollInterval = config.readNumEntry("NFSPollInterval", 5000);
+ m_PollInterval = config.readNumEntry("PollInterval", 500);
+
+ QString available("Stat");
+
+ // used for FAM and DNOTIFY
+ rescan_all = false;
+ connect(&rescan_timer, SIGNAL(timeout()), this, SLOT(slotRescan()));
+
+#ifdef HAVE_FAM
+ // It's possible that FAM server can't be started
+ if (FAMOpen(&fc) ==0) {
+ available += ", FAM";
+ use_fam=true;
+ sn = new QSocketNotifier( FAMCONNECTION_GETFD(&fc),
+ QSocketNotifier::Read, this);
+ connect( sn, SIGNAL(activated(int)),
+ this, SLOT(famEventReceived()) );
+ }
+ else {
+ kdDebug(7001) << "Can't use FAM (fam daemon not running?)" << endl;
+ use_fam=false;
+ }
+#endif
+
+#ifdef HAVE_INOTIFY
+ supports_inotify = true;
+
+ m_inotify_fd = inotify_init();
+
+ if ( m_inotify_fd <= 0 ) {
+ kdDebug(7001) << "Can't use Inotify, kernel doesn't support it" << endl;
+ supports_inotify = false;
+ }
+
+ {
+ struct utsname uts;
+ int major, minor, patch;
+ if (uname(&uts) < 0)
+ supports_inotify = false; // *shrug*
+ else if (sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch) != 3)
+ supports_inotify = false; // *shrug*
+ else if( major * 1000000 + minor * 1000 + patch < 2006014 ) { // <2.6.14
+ kdDebug(7001) << "Can't use INotify, Linux kernel too old" << endl;
+ supports_inotify = false;
+ }
+ }
+
+ if ( supports_inotify ) {
+ available += ", Inotify";
+ fcntl(m_inotify_fd, F_SETFD, FD_CLOEXEC);
+
+ mSn = new QSocketNotifier( m_inotify_fd, QSocketNotifier::Read, this );
+ connect( mSn, SIGNAL(activated( int )), this, SLOT( slotActivated() ) );
+ }
+#endif
+
+#ifdef HAVE_DNOTIFY
+
+ // if we have inotify, disable dnotify.
+#ifdef HAVE_INOTIFY
+ supports_dnotify = !supports_inotify;
+#else
+ // otherwise, not guilty until proven guilty.
+ supports_dnotify = true;
+#endif
+
+ struct utsname uts;
+ int major, minor, patch;
+ if (uname(&uts) < 0)
+ supports_dnotify = false; // *shrug*
+ else if (sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch) != 3)
+ supports_dnotify = false; // *shrug*
+ else if( major * 1000000 + minor * 1000 + patch < 2004019 ) { // <2.4.19
+ kdDebug(7001) << "Can't use DNotify, Linux kernel too old" << endl;
+ supports_dnotify = false;
+ }
+
+ if( supports_dnotify ) {
+ available += ", DNotify";
+
+ pipe(mPipe);
+ fcntl(mPipe[0], F_SETFD, FD_CLOEXEC);
+ fcntl(mPipe[1], F_SETFD, FD_CLOEXEC);
+ fcntl(mPipe[0], F_SETFL, O_NONBLOCK | fcntl(mPipe[0], F_GETFL));
+ fcntl(mPipe[1], F_SETFL, O_NONBLOCK | fcntl(mPipe[1], F_GETFL));
+ mSn = new QSocketNotifier( mPipe[0], QSocketNotifier::Read, this);
+ connect(mSn, SIGNAL(activated(int)), this, SLOT(slotActivated()));
+ // Install the signal handler only once
+ if ( dnotify_signal == 0 )
+ {
+ dnotify_signal = SIGRTMIN + 8;
+
+ struct sigaction act;
+ act.sa_sigaction = KDirWatchPrivate::dnotify_handler;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = SA_SIGINFO;
+#ifdef SA_RESTART
+ act.sa_flags |= SA_RESTART;
+#endif
+ sigaction(dnotify_signal, &act, NULL);
+
+ act.sa_sigaction = KDirWatchPrivate::dnotify_sigio_handler;
+ sigaction(SIGIO, &act, &old_sigio_act);
+ }
+ }
+ else
+ {
+ mPipe[0] = -1;
+ mPipe[1] = -1;
+ }
+#endif
+
+ kdDebug(7001) << "Available methods: " << available << endl;
+}
+
+/* This is called on app exit (KStaticDeleter) */
+KDirWatchPrivate::~KDirWatchPrivate()
+{
+ timer->stop();
+
+ /* remove all entries being watched */
+ removeEntries(0);
+
+#ifdef HAVE_FAM
+ if (use_fam) {
+ FAMClose(&fc);
+ kdDebug(7001) << "KDirWatch deleted (FAM closed)" << endl;
+ }
+#endif
+#ifdef HAVE_INOTIFY
+ if ( supports_inotify )
+ ::close( m_inotify_fd );
+#endif
+#ifdef HAVE_DNOTIFY
+ close(mPipe[0]);
+ close(mPipe[1]);
+#endif
+}
+
+#include <stdlib.h>
+
+void KDirWatchPrivate::slotActivated()
+{
+#ifdef HAVE_DNOTIFY
+ if ( supports_dnotify )
+ {
+ char dummy_buf[4096];
+ read(mPipe[0], &dummy_buf, 4096);
+
+ if (!rescan_timer.isActive())
+ rescan_timer.start(m_PollInterval, true /* singleshot */);
+
+ return;
+ }
+#endif
+
+#ifdef HAVE_INOTIFY
+ if ( !supports_inotify )
+ return;
+
+ int pending = -1;
+ int offset = 0;
+ char buf[4096];
+ assert( m_inotify_fd > -1 );
+ ioctl( m_inotify_fd, FIONREAD, &pending );
+
+ while ( pending > 0 ) {
+
+ if ( pending > (int)sizeof( buf ) )
+ pending = sizeof( buf );
+
+ pending = read( m_inotify_fd, buf, pending);
+
+ while ( pending > 0 ) {
+ struct inotify_event *event = (struct inotify_event *) &buf[offset];
+ pending -= sizeof( struct inotify_event ) + event->len;
+ offset += sizeof( struct inotify_event ) + event->len;
+
+ QString path;
+ if ( event->len )
+ path = QFile::decodeName( QCString( event->name, event->len ) );
+
+ if ( path.length() && isNoisyFile( path.latin1() ) )
+ continue;
+
+ kdDebug(7001) << "ev wd: " << event->wd << " mask " << event->mask << " path: " << path << endl;
+
+ // now we're in deep trouble of finding the
+ // associated entries
+ // for now, we suck and iterate
+ for ( EntryMap::Iterator it = m_mapEntries.begin();
+ it != m_mapEntries.end(); ++it ) {
+ Entry* e = &( *it );
+ if ( e->wd == event->wd ) {
+ e->dirty = true;
+
+ if ( 1 || e->isDir) {
+ if( event->mask & IN_DELETE_SELF) {
+ kdDebug(7001) << "-->got deleteself signal for " << e->path << endl;
+ e->m_status = NonExistent;
+ if (e->isDir)
+ addEntry(0, QDir::cleanDirPath(e->path+"/.."), e, true);
+ else
+ addEntry(0, QFileInfo(e->path).dirPath(true), e, true);
+ }
+ if ( event->mask & IN_IGNORED ) {
+ e->wd = 0;
+ }
+ if ( event->mask & (IN_CREATE|IN_MOVED_TO) ) {
+ Entry *sub_entry = e->m_entries.first();
+ for(;sub_entry; sub_entry = e->m_entries.next())
+ if (sub_entry->path == e->path + "/" + path) break;
+
+ if (sub_entry /*&& sub_entry->isDir*/) {
+ removeEntry(0,e->path, sub_entry);
+ KDE_struct_stat stat_buf;
+ QCString tpath = QFile::encodeName(path);
+ KDE_stat(tpath, &stat_buf);
+
+ //sub_entry->isDir = S_ISDIR(stat_buf.st_mode);
+ //sub_entry->m_ctime = stat_buf.st_ctime;
+ //sub_entry->m_status = Normal;
+ //sub_entry->m_nlink = stat_buf.st_nlink;
+
+ if(!useINotify(sub_entry))
+ useStat(sub_entry);
+ sub_entry->dirty = true;
+ }
+ }
+ }
+
+ if (!rescan_timer.isActive())
+ rescan_timer.start(m_PollInterval, true /* singleshot */);
+
+ break; // there really should be only one matching wd
+ }
+ }
+
+ }
+ }
+#endif
+}
+
+/* In DNOTIFY/FAM mode, only entries which are marked dirty are scanned.
+ * We first need to mark all yet nonexistent, but possible created
+ * entries as dirty...
+ */
+void KDirWatchPrivate::Entry::propagate_dirty()
+{
+ for (QPtrListIterator<Entry> sub_entry (m_entries);
+ sub_entry.current(); ++sub_entry)
+ {
+ if (!sub_entry.current()->dirty)
+ {
+ sub_entry.current()->dirty = true;
+ sub_entry.current()->propagate_dirty();
+ }
+ }
+}
+
+
+/* A KDirWatch instance is interested in getting events for
+ * this file/Dir entry.
+ */
+void KDirWatchPrivate::Entry::addClient(KDirWatch* instance)
+{
+ Client* client = m_clients.first();
+ for(;client; client = m_clients.next())
+ if (client->instance == instance) break;
+
+ if (client) {
+ client->count++;
+ return;
+ }
+
+ client = new Client;
+ client->instance = instance;
+ client->count = 1;
+ client->watchingStopped = instance->isStopped();
+ client->pending = NoChange;
+
+ m_clients.append(client);
+}
+
+void KDirWatchPrivate::Entry::removeClient(KDirWatch* instance)
+{
+ Client* client = m_clients.first();
+ for(;client; client = m_clients.next())
+ if (client->instance == instance) break;
+
+ if (client) {
+ client->count--;
+ if (client->count == 0) {
+ m_clients.removeRef(client);
+ delete client;
+ }
+ }
+}
+
+/* get number of clients */
+int KDirWatchPrivate::Entry::clients()
+{
+ int clients = 0;
+ Client* client = m_clients.first();
+ for(;client; client = m_clients.next())
+ clients += client->count;
+
+ return clients;
+}
+
+
+KDirWatchPrivate::Entry* KDirWatchPrivate::entry(const QString& _path)
+{
+// we only support absolute paths
+ if (QDir::isRelativePath(_path)) {
+ return 0;
+ }
+
+ QString path = _path;
+
+ if ( path.length() > 1 && path.right(1) == "/" )
+ path.truncate( path.length() - 1 );
+
+ EntryMap::Iterator it = m_mapEntries.find( path );
+ if ( it == m_mapEntries.end() )
+ return 0;
+ else
+ return &(*it);
+}
+
+// set polling frequency for a entry and adjust global freq if needed
+void KDirWatchPrivate::useFreq(Entry* e, int newFreq)
+{
+ e->freq = newFreq;
+
+ // a reasonable frequency for the global polling timer
+ if (e->freq < freq) {
+ freq = e->freq;
+ if (timer->isActive()) timer->changeInterval(freq);
+ kdDebug(7001) << "Global Poll Freq is now " << freq << " msec" << endl;
+ }
+}
+
+
+#ifdef HAVE_FAM
+// setup FAM notification, returns false if not possible
+bool KDirWatchPrivate::useFAM(Entry* e)
+{
+ if (!use_fam) return false;
+
+ // handle FAM events to avoid deadlock
+ // (FAM sends back all files in a directory when monitoring)
+ famEventReceived();
+
+ e->m_mode = FAMMode;
+ e->dirty = false;
+
+ if (e->isDir) {
+ if (e->m_status == NonExistent) {
+ // If the directory does not exist we watch the parent directory
+ addEntry(0, QDir::cleanDirPath(e->path+"/.."), e, true);
+ }
+ else {
+ int res =FAMMonitorDirectory(&fc, QFile::encodeName(e->path),
+ &(e->fr), e);
+ if (res<0) {
+ e->m_mode = UnknownMode;
+ use_fam=false;
+ return false;
+ }
+ kdDebug(7001) << " Setup FAM (Req "
+ << FAMREQUEST_GETREQNUM(&(e->fr))
+ << ") for " << e->path << endl;
+ }
+ }
+ else {
+ if (e->m_status == NonExistent) {
+ // If the file does not exist we watch the directory
+ addEntry(0, QFileInfo(e->path).dirPath(true), e, true);
+ }
+ else {
+ int res = FAMMonitorFile(&fc, QFile::encodeName(e->path),
+ &(e->fr), e);
+ if (res<0) {
+ e->m_mode = UnknownMode;
+ use_fam=false;
+ return false;
+ }
+
+ kdDebug(7001) << " Setup FAM (Req "
+ << FAMREQUEST_GETREQNUM(&(e->fr))
+ << ") for " << e->path << endl;
+ }
+ }
+
+ // handle FAM events to avoid deadlock
+ // (FAM sends back all files in a directory when monitoring)
+ famEventReceived();
+
+ return true;
+}
+#endif
+
+
+#ifdef HAVE_DNOTIFY
+// setup DNotify notification, returns false if not possible
+bool KDirWatchPrivate::useDNotify(Entry* e)
+{
+ e->dn_fd = 0;
+ e->dirty = false;
+ if (!supports_dnotify) return false;
+
+ e->m_mode = DNotifyMode;
+
+ if (e->isDir) {
+ if (e->m_status == Normal) {
+ int fd = KDE_open(QFile::encodeName(e->path).data(), O_RDONLY);
+ // Migrate fd to somewhere above 128. Some libraries have
+ // constructs like:
+ // fd = socket(...)
+ // if (fd > ARBITRARY_LIMIT)
+ // return error;
+ //
+ // Since programs might end up using a lot of KDirWatch objects
+ // for a rather long time the above braindamage could get
+ // triggered.
+ //
+ // By moving the kdirwatch fd's to > 128, calls like socket() will keep
+ // returning fd's < ARBITRARY_LIMIT for a bit longer.
+ int fd2 = fcntl(fd, F_DUPFD, 128);
+ if (fd2 >= 0)
+ {
+ close(fd);
+ fd = fd2;
+ }
+ if (fd<0) {
+ e->m_mode = UnknownMode;
+ return false;
+ }
+
+ int mask = DN_DELETE|DN_CREATE|DN_RENAME|DN_MULTISHOT;
+ // if dependant is a file watch, we check for MODIFY & ATTRIB too
+ for(Entry* dep=e->m_entries.first();dep;dep=e->m_entries.next())
+ if (!dep->isDir) { mask |= DN_MODIFY|DN_ATTRIB; break; }
+
+ if(fcntl(fd, F_SETSIG, dnotify_signal) < 0 ||
+ fcntl(fd, F_NOTIFY, mask) < 0) {
+
+ kdDebug(7001) << "Not using Linux Directory Notifications."
+ << endl;
+ supports_dnotify = false;
+ ::close(fd);
+ e->m_mode = UnknownMode;
+ return false;
+ }
+
+ fd_Entry.replace(fd, e);
+ e->dn_fd = fd;
+
+ kdDebug(7001) << " Setup DNotify (fd " << fd
+ << ") for " << e->path << endl;
+ }
+ else { // NotExisting
+ addEntry(0, QDir::cleanDirPath(e->path+"/.."), e, true);
+ }
+ }
+ else { // File
+ // we always watch the directory (DNOTIFY can't watch files alone)
+ // this notifies us about changes of files therein
+ addEntry(0, QFileInfo(e->path).dirPath(true), e, true);
+ }
+
+ return true;
+}
+#endif
+
+#ifdef HAVE_INOTIFY
+// setup INotify notification, returns false if not possible
+bool KDirWatchPrivate::useINotify( Entry* e )
+{
+ e->wd = 0;
+ e->dirty = false;
+ if (!supports_inotify) return false;
+
+ e->m_mode = INotifyMode;
+
+ int mask = IN_DELETE|IN_DELETE_SELF|IN_CREATE|IN_MOVE|IN_MOVE_SELF|IN_DONT_FOLLOW;
+ if(!e->isDir)
+ mask |= IN_MODIFY|IN_ATTRIB;
+ else
+ mask |= IN_ONLYDIR;
+
+ // if dependant is a file watch, we check for MODIFY & ATTRIB too
+ for(Entry* dep=e->m_entries.first();dep;dep=e->m_entries.next()) {
+ if (!dep->isDir) { mask |= IN_MODIFY|IN_ATTRIB; break; }
+ }
+
+ if ( ( e->wd = inotify_add_watch( m_inotify_fd,
+ QFile::encodeName( e->path ), mask) ) > 0 )
+ return true;
+
+ if ( e->m_status == NonExistent ) {
+ if (e->isDir)
+ addEntry(0, QDir::cleanDirPath(e->path+"/.."), e, true);
+ else
+ addEntry(0, QFileInfo(e->path).dirPath(true), e, true);
+ return true;
+ }
+
+ return false;
+}
+#endif
+
+bool KDirWatchPrivate::useStat(Entry* e)
+{
+ if (KIO::probably_slow_mounted(e->path))
+ useFreq(e, m_nfsPollInterval);
+ else
+ useFreq(e, m_PollInterval);
+
+ if (e->m_mode != StatMode) {
+ e->m_mode = StatMode;
+ statEntries++;
+
+ if ( statEntries == 1 ) {
+ // if this was first STAT entry (=timer was stopped)
+ timer->start(freq); // then start the timer
+ kdDebug(7001) << " Started Polling Timer, freq " << freq << endl;
+ }
+ }
+
+ kdDebug(7001) << " Setup Stat (freq " << e->freq
+ << ") for " << e->path << endl;
+
+ return true;
+}
+
+
+/* If <instance> !=0, this KDirWatch instance wants to watch at <_path>,
+ * providing in <isDir> the type of the entry to be watched.
+ * Sometimes, entries are dependant on each other: if <sub_entry> !=0,
+ * this entry needs another entry to watch himself (when notExistent).
+ */
+void KDirWatchPrivate::addEntry(KDirWatch* instance, const QString& _path,
+ Entry* sub_entry, bool isDir)
+{
+ QString path = _path;
+ if (path.startsWith("/dev/") || (path == "/dev"))
+ return; // Don't even go there.
+
+ if ( path.length() > 1 && path.right(1) == "/" )
+ path.truncate( path.length() - 1 );
+
+ EntryMap::Iterator it = m_mapEntries.find( path );
+ if ( it != m_mapEntries.end() )
+ {
+ if (sub_entry) {
+ (*it).m_entries.append(sub_entry);
+ kdDebug(7001) << "Added already watched Entry " << path
+ << " (for " << sub_entry->path << ")" << endl;
+
+#ifdef HAVE_DNOTIFY
+ {
+ Entry* e = &(*it);
+ if( (e->m_mode == DNotifyMode) && (e->dn_fd > 0) ) {
+ int mask = DN_DELETE|DN_CREATE|DN_RENAME|DN_MULTISHOT;
+ // if dependant is a file watch, we check for MODIFY & ATTRIB too
+ for(Entry* dep=e->m_entries.first();dep;dep=e->m_entries.next())
+ if (!dep->isDir) { mask |= DN_MODIFY|DN_ATTRIB; break; }
+ if( fcntl(e->dn_fd, F_NOTIFY, mask) < 0) { // shouldn't happen
+ ::close(e->dn_fd);
+ e->m_mode = UnknownMode;
+ fd_Entry.remove(e->dn_fd);
+ e->dn_fd = 0;
+ useStat( e );
+ }
+ }
+ }
+#endif
+
+#ifdef HAVE_INOTIFY
+ {
+ Entry* e = &(*it);
+ if( (e->m_mode == INotifyMode) && (e->wd > 0) ) {
+ int mask = IN_DELETE|IN_DELETE_SELF|IN_CREATE|IN_MOVE|IN_MOVE_SELF|IN_DONT_FOLLOW;
+ if(!e->isDir)
+ mask |= IN_MODIFY|IN_ATTRIB;
+ else
+ mask |= IN_ONLYDIR;
+
+ inotify_rm_watch (m_inotify_fd, e->wd);
+ e->wd = inotify_add_watch( m_inotify_fd, QFile::encodeName( e->path ), mask);
+ }
+ }
+#endif
+
+ }
+ else {
+ (*it).addClient(instance);
+ kdDebug(7001) << "Added already watched Entry " << path
+ << " (now " << (*it).clients() << " clients)"
+ << QString(" [%1]").arg(instance->name()) << endl;
+ }
+ return;
+ }
+
+ // we have a new path to watch
+
+ KDE_struct_stat stat_buf;
+ QCString tpath = QFile::encodeName(path);
+ bool exists = (KDE_stat(tpath, &stat_buf) == 0);
+
+ Entry newEntry;
+ m_mapEntries.insert( path, newEntry );
+ // the insert does a copy, so we have to use <e> now
+ Entry* e = &(m_mapEntries[path]);
+
+ if (exists) {
+ e->isDir = S_ISDIR(stat_buf.st_mode);
+
+ if (e->isDir && !isDir)
+ kdWarning() << "KDirWatch: " << path << " is a directory. Use addDir!" << endl;
+ else if (!e->isDir && isDir)
+ kdWarning() << "KDirWatch: " << path << " is a file. Use addFile!" << endl;
+
+ e->m_ctime = stat_buf.st_ctime;
+ e->m_status = Normal;
+ e->m_nlink = stat_buf.st_nlink;
+ }
+ else {
+ e->isDir = isDir;
+ e->m_ctime = invalid_ctime;
+ e->m_status = NonExistent;
+ e->m_nlink = 0;
+ }
+
+ e->path = path;
+ if (sub_entry)
+ e->m_entries.append(sub_entry);
+ else
+ e->addClient(instance);
+
+ kdDebug(7001) << "Added " << (e->isDir ? "Dir ":"File ") << path
+ << (e->m_status == NonExistent ? " NotExisting" : "")
+ << (sub_entry ? QString(" for %1").arg(sub_entry->path) : QString(""))
+ << (instance ? QString(" [%1]").arg(instance->name()) : QString(""))
+ << endl;
+
+
+ // now setup the notification method
+ e->m_mode = UnknownMode;
+ e->msecLeft = 0;
+
+ if ( isNoisyFile( tpath ) )
+ return;
+
+#ifdef HAVE_FAM
+ if (useFAM(e)) return;
+#endif
+
+#ifdef HAVE_INOTIFY
+ if (useINotify(e)) return;
+#endif
+
+#ifdef HAVE_DNOTIFY
+ if (useDNotify(e)) return;
+#endif
+
+ useStat(e);
+}
+
+
+void KDirWatchPrivate::removeEntry( KDirWatch* instance,
+ const QString& _path, Entry* sub_entry )
+{
+ kdDebug(7001) << "KDirWatchPrivate::removeEntry for '" << _path << "' sub_entry: " << sub_entry << endl;
+ Entry* e = entry(_path);
+ if (!e) {
+ kdDebug(7001) << "KDirWatchPrivate::removeEntry can't handle '" << _path << "'" << endl;
+ return;
+ }
+
+ if (sub_entry)
+ e->m_entries.removeRef(sub_entry);
+ else
+ e->removeClient(instance);
+
+ if (e->m_clients.count() || e->m_entries.count()) {
+ kdDebug(7001) << "removeEntry: unwatched " << e->path << " " << _path << endl;
+ return;
+ }
+
+ if (delayRemove) {
+ // removeList is allowed to contain any entry at most once
+ if (removeList.findRef(e)==-1)
+ removeList.append(e);
+ // now e->isValid() is false
+ return;
+ }
+
+#ifdef HAVE_FAM
+ if (e->m_mode == FAMMode) {
+ if ( e->m_status == Normal) {
+ FAMCancelMonitor(&fc, &(e->fr) );
+ kdDebug(7001) << "Cancelled FAM (Req "
+ << FAMREQUEST_GETREQNUM(&(e->fr))
+ << ") for " << e->path << endl;
+ }
+ else {
+ if (e->isDir)
+ removeEntry(0, QDir::cleanDirPath(e->path+"/.."), e);
+ else
+ removeEntry(0, QFileInfo(e->path).dirPath(true), e);
+ }
+ }
+#endif
+
+#ifdef HAVE_INOTIFY
+ kdDebug(7001) << "inotify remove " << ( e->m_mode == INotifyMode ) << " " << ( e->m_status == Normal ) << endl;
+ if (e->m_mode == INotifyMode) {
+ if ( e->m_status == Normal ) {
+ (void) inotify_rm_watch( m_inotify_fd, e->wd );
+ kdDebug(7001) << "Cancelled INotify (fd " <<
+ m_inotify_fd << ", " << e->wd <<
+ ") for " << e->path << endl;
+ }
+ else {
+ if (e->isDir)
+ removeEntry(0, QDir::cleanDirPath(e->path+"/.."), e);
+ else
+ removeEntry(0, QFileInfo(e->path).dirPath(true), e);
+ }
+ }
+#endif
+
+#ifdef HAVE_DNOTIFY
+ if (e->m_mode == DNotifyMode) {
+ if (!e->isDir) {
+ removeEntry(0, QFileInfo(e->path).dirPath(true), e);
+ }
+ else { // isDir
+ // must close the FD.
+ if ( e->m_status == Normal) {
+ if (e->dn_fd) {
+ ::close(e->dn_fd);
+ fd_Entry.remove(e->dn_fd);
+
+ kdDebug(7001) << "Cancelled DNotify (fd " << e->dn_fd
+ << ") for " << e->path << endl;
+ e->dn_fd = 0;
+
+ }
+ }
+ else {
+ removeEntry(0, QDir::cleanDirPath(e->path+"/.."), e);
+ }
+ }
+ }
+#endif
+
+ if (e->m_mode == StatMode) {
+ statEntries--;
+ if ( statEntries == 0 ) {
+ timer->stop(); // stop timer if lists are empty
+ kdDebug(7001) << " Stopped Polling Timer" << endl;
+ }
+ }
+
+ kdDebug(7001) << "Removed " << (e->isDir ? "Dir ":"File ") << e->path
+ << (sub_entry ? QString(" for %1").arg(sub_entry->path) : QString(""))
+ << (instance ? QString(" [%1]").arg(instance->name()) : QString(""))
+ << endl;
+ m_mapEntries.remove( e->path ); // <e> not valid any more
+}
+
+
+/* Called from KDirWatch destructor:
+ * remove <instance> as client from all entries
+ */
+void KDirWatchPrivate::removeEntries( KDirWatch* instance )
+{
+ QPtrList<Entry> list;
+ int minfreq = 3600000;
+
+ // put all entries where instance is a client in list
+ EntryMap::Iterator it = m_mapEntries.begin();
+ for( ; it != m_mapEntries.end(); ++it ) {
+ Client* c = (*it).m_clients.first();
+ for(;c;c=(*it).m_clients.next())
+ if (c->instance == instance) break;
+ if (c) {
+ c->count = 1; // forces deletion of instance as client
+ list.append(&(*it));
+ }
+ else if ( (*it).m_mode == StatMode && (*it).freq < minfreq )
+ minfreq = (*it).freq;
+ }
+
+ for(Entry* e=list.first();e;e=list.next())
+ removeEntry(instance, e->path, 0);
+
+ if (minfreq > freq) {
+ // we can decrease the global polling frequency
+ freq = minfreq;
+ if (timer->isActive()) timer->changeInterval(freq);
+ kdDebug(7001) << "Poll Freq now " << freq << " msec" << endl;
+ }
+}
+
+// instance ==0: stop scanning for all instances
+bool KDirWatchPrivate::stopEntryScan( KDirWatch* instance, Entry* e)
+{
+ int stillWatching = 0;
+ Client* c = e->m_clients.first();
+ for(;c;c=e->m_clients.next()) {
+ if (!instance || instance == c->instance)
+ c->watchingStopped = true;
+ else if (!c->watchingStopped)
+ stillWatching += c->count;
+ }
+
+ kdDebug(7001) << instance->name() << " stopped scanning " << e->path
+ << " (now " << stillWatching << " watchers)" << endl;
+
+ if (stillWatching == 0) {
+ // if nobody is interested, we don't watch
+ e->m_ctime = invalid_ctime; // invalid
+ e->m_status = NonExistent;
+ // e->m_status = Normal;
+ }
+ return true;
+}
+
+// instance ==0: start scanning for all instances
+bool KDirWatchPrivate::restartEntryScan( KDirWatch* instance, Entry* e,
+ bool notify)
+{
+ int wasWatching = 0, newWatching = 0;
+ Client* c = e->m_clients.first();
+ for(;c;c=e->m_clients.next()) {
+ if (!c->watchingStopped)
+ wasWatching += c->count;
+ else if (!instance || instance == c->instance) {
+ c->watchingStopped = false;
+ newWatching += c->count;
+ }
+ }
+ if (newWatching == 0)
+ return false;
+
+ kdDebug(7001) << (instance ? instance->name() : "all") << " restarted scanning " << e->path
+ << " (now " << wasWatching+newWatching << " watchers)" << endl;
+
+ // restart watching and emit pending events
+
+ int ev = NoChange;
+ if (wasWatching == 0) {
+ if (!notify) {
+ KDE_struct_stat stat_buf;
+ bool exists = (KDE_stat(QFile::encodeName(e->path), &stat_buf) == 0);
+ if (exists) {
+ e->m_ctime = stat_buf.st_ctime;
+ e->m_status = Normal;
+ e->m_nlink = stat_buf.st_nlink;
+ }
+ else {
+ e->m_ctime = invalid_ctime;
+ e->m_status = NonExistent;
+ e->m_nlink = 0;
+ }
+ }
+ e->msecLeft = 0;
+ ev = scanEntry(e);
+ }
+ emitEvent(e,ev);
+
+ return true;
+}
+
+// instance ==0: stop scanning for all instances
+void KDirWatchPrivate::stopScan(KDirWatch* instance)
+{
+ EntryMap::Iterator it = m_mapEntries.begin();
+ for( ; it != m_mapEntries.end(); ++it )
+ stopEntryScan(instance, &(*it));
+}
+
+
+void KDirWatchPrivate::startScan(KDirWatch* instance,
+ bool notify, bool skippedToo )
+{
+ if (!notify)
+ resetList(instance,skippedToo);
+
+ EntryMap::Iterator it = m_mapEntries.begin();
+ for( ; it != m_mapEntries.end(); ++it )
+ restartEntryScan(instance, &(*it), notify);
+
+ // timer should still be running when in polling mode
+}
+
+
+// clear all pending events, also from stopped
+void KDirWatchPrivate::resetList( KDirWatch* /*instance*/,
+ bool skippedToo )
+{
+ EntryMap::Iterator it = m_mapEntries.begin();
+ for( ; it != m_mapEntries.end(); ++it ) {
+
+ Client* c = (*it).m_clients.first();
+ for(;c;c=(*it).m_clients.next())
+ if (!c->watchingStopped || skippedToo)
+ c->pending = NoChange;
+ }
+}
+
+// Return event happened on <e>
+//
+int KDirWatchPrivate::scanEntry(Entry* e)
+{
+#ifdef HAVE_FAM
+ if (e->m_mode == FAMMode) {
+ // we know nothing has changed, no need to stat
+ if(!e->dirty) return NoChange;
+ e->dirty = false;
+ }
+#endif
+
+ // Shouldn't happen: Ignore "unknown" notification method
+ if (e->m_mode == UnknownMode) return NoChange;
+
+#if defined ( HAVE_DNOTIFY ) || defined( HAVE_INOTIFY )
+ if (e->m_mode == DNotifyMode || e->m_mode == INotifyMode ) {
+ // we know nothing has changed, no need to stat
+ if(!e->dirty) return NoChange;
+ kdDebug(7001) << "scanning " << e->path << " " << e->m_status << " " << e->m_ctime << endl;
+ e->dirty = false;
+ }
+#endif
+
+ if (e->m_mode == StatMode) {
+ // only scan if timeout on entry timer happens;
+ // e.g. when using 500msec global timer, a entry
+ // with freq=5000 is only watched every 10th time
+
+ e->msecLeft -= freq;
+ if (e->msecLeft>0) return NoChange;
+ e->msecLeft += e->freq;
+ }
+
+ KDE_struct_stat stat_buf;
+ bool exists = (KDE_stat(QFile::encodeName(e->path), &stat_buf) == 0);
+ if (exists) {
+
+ if (e->m_status == NonExistent) {
+ e->m_ctime = stat_buf.st_ctime;
+ e->m_status = Normal;
+ e->m_nlink = stat_buf.st_nlink;
+ return Created;
+ }
+
+ if ( (e->m_ctime != invalid_ctime) &&
+ ((stat_buf.st_ctime != e->m_ctime) ||
+ (stat_buf.st_nlink != (nlink_t) e->m_nlink)) ) {
+ e->m_ctime = stat_buf.st_ctime;
+ e->m_nlink = stat_buf.st_nlink;
+ return Changed;
+ }
+
+ return NoChange;
+ }
+
+ // dir/file doesn't exist
+
+ if (e->m_ctime == invalid_ctime && e->m_status == NonExistent) {
+ e->m_nlink = 0;
+ e->m_status = NonExistent;
+ return NoChange;
+ }
+
+ e->m_ctime = invalid_ctime;
+ e->m_nlink = 0;
+ e->m_status = NonExistent;
+
+ return Deleted;
+}
+
+/* Notify all interested KDirWatch instances about a given event on an entry
+ * and stored pending events. When watching is stopped, the event is
+ * added to the pending events.
+ */
+void KDirWatchPrivate::emitEvent(Entry* e, int event, const QString &fileName)
+{
+ QString path = e->path;
+ if (!fileName.isEmpty()) {
+ if (!QDir::isRelativePath(fileName))
+ path = fileName;
+ else
+#ifdef Q_OS_UNIX
+ path += "/" + fileName;
+#elif defined(Q_WS_WIN)
+ //current drive is passed instead of /
+ path += QDir::currentDirPath().left(2) + "/" + fileName;
+#endif
+ }
+
+ QPtrListIterator<Client> cit( e->m_clients );
+ for ( ; cit.current(); ++cit )
+ {
+ Client* c = cit.current();
+
+ if (c->instance==0 || c->count==0) continue;
+
+ if (c->watchingStopped) {
+ // add event to pending...
+ if (event == Changed)
+ c->pending |= event;
+ else if (event == Created || event == Deleted)
+ c->pending = event;
+ continue;
+ }
+ // not stopped
+ if (event == NoChange || event == Changed)
+ event |= c->pending;
+ c->pending = NoChange;
+ if (event == NoChange) continue;
+
+ if (event & Deleted) {
+ c->instance->setDeleted(path);
+ // emit only Deleted event...
+ continue;
+ }
+
+ if (event & Created) {
+ c->instance->setCreated(path);
+ // possible emit Change event after creation
+ }
+
+ if (event & Changed)
+ c->instance->setDirty(path);
+ }
+}
+
+// Remove entries which were marked to be removed
+void KDirWatchPrivate::slotRemoveDelayed()
+{
+ Entry* e;
+ delayRemove = false;
+ for(e=removeList.first();e;e=removeList.next())
+ removeEntry(0, e->path, 0);
+ removeList.clear();
+}
+
+/* Scan all entries to be watched for changes. This is done regularly
+ * when polling and once after a DNOTIFY signal. This is NOT used by FAM.
+ */
+void KDirWatchPrivate::slotRescan()
+{
+ EntryMap::Iterator it;
+
+ // People can do very long things in the slot connected to dirty(),
+ // like showing a message box. We don't want to keep polling during
+ // that time, otherwise the value of 'delayRemove' will be reset.
+ bool timerRunning = timer->isActive();
+ if ( timerRunning )
+ timer->stop();
+
+ // We delay deletions of entries this way.
+ // removeDir(), when called in slotDirty(), can cause a crash otherwise
+ delayRemove = true;
+
+#if defined(HAVE_DNOTIFY) || defined(HAVE_INOTIFY)
+ QPtrList<Entry> dList, cList;
+#endif
+
+ if (rescan_all)
+ {
+ // mark all as dirty
+ it = m_mapEntries.begin();
+ for( ; it != m_mapEntries.end(); ++it )
+ (*it).dirty = true;
+ rescan_all = false;
+ }
+ else
+ {
+ // progate dirty flag to dependant entries (e.g. file watches)
+ it = m_mapEntries.begin();
+ for( ; it != m_mapEntries.end(); ++it )
+ if (((*it).m_mode == INotifyMode || (*it).m_mode == DNotifyMode) && (*it).dirty )
+ (*it).propagate_dirty();
+ }
+
+ it = m_mapEntries.begin();
+ for( ; it != m_mapEntries.end(); ++it ) {
+ // we don't check invalid entries (i.e. remove delayed)
+ if (!(*it).isValid()) continue;
+
+ int ev = scanEntry( &(*it) );
+
+
+#ifdef HAVE_INOTIFY
+ if ((*it).m_mode == INotifyMode && ev == Created && (*it).wd == 0) {
+ cList.append( &(*it) );
+ if (! useINotify( &(*it) )) {
+ useStat( &(*it) );
+ }
+ }
+#endif
+
+#ifdef HAVE_DNOTIFY
+ if ((*it).m_mode == DNotifyMode) {
+ if ((*it).isDir && (ev == Deleted)) {
+ dList.append( &(*it) );
+
+ // must close the FD.
+ if ((*it).dn_fd) {
+ ::close((*it).dn_fd);
+ fd_Entry.remove((*it).dn_fd);
+ (*it).dn_fd = 0;
+ }
+ }
+
+ else if ((*it).isDir && (ev == Created)) {
+ // For created, but yet without DNOTIFYing ...
+ if ( (*it).dn_fd == 0) {
+ cList.append( &(*it) );
+ if (! useDNotify( &(*it) )) {
+ // if DNotify setup fails...
+ useStat( &(*it) );
+ }
+ }
+ }
+ }
+#endif
+
+ if ( ev != NoChange )
+ emitEvent( &(*it), ev);
+ }
+
+
+#if defined(HAVE_DNOTIFY) || defined(HAVE_INOTIFY)
+ // Scan parent of deleted directories for new creation
+ Entry* e;
+ for(e=dList.first();e;e=dList.next())
+ addEntry(0, QDir::cleanDirPath( e->path+"/.."), e, true);
+
+ // Remove watch of parent of new created directories
+ for(e=cList.first();e;e=cList.next())
+ removeEntry(0, QDir::cleanDirPath( e->path+"/.."), e);
+#endif
+
+ if ( timerRunning )
+ timer->start(freq);
+
+ QTimer::singleShot(0, this, SLOT(slotRemoveDelayed()));
+}
+
+bool KDirWatchPrivate::isNoisyFile( const char * filename )
+{
+ // $HOME/.X.err grows with debug output, so don't notify change
+ if ( *filename == '.') {
+ if (strncmp(filename, ".X.err", 6) == 0) return true;
+ if (strncmp(filename, ".xsession-errors", 16) == 0) return true;
+ // fontconfig updates the cache on every KDE app start
+ // (inclusive kio_thumbnail slaves)
+ if (strncmp(filename, ".fonts.cache", 12) == 0) return true;
+ }
+
+ return false;
+}
+
+#ifdef HAVE_FAM
+void KDirWatchPrivate::famEventReceived()
+{
+ static FAMEvent fe;
+
+ delayRemove = true;
+
+ while(use_fam && FAMPending(&fc)) {
+ if (FAMNextEvent(&fc, &fe) == -1) {
+ kdWarning(7001) << "FAM connection problem, switching to polling."
+ << endl;
+ use_fam = false;
+ delete sn; sn = 0;
+
+ // Replace all FAMMode entries with DNotify/Stat
+ EntryMap::Iterator it;
+ it = m_mapEntries.begin();
+ for( ; it != m_mapEntries.end(); ++it )
+ if ((*it).m_mode == FAMMode && (*it).m_clients.count()>0) {
+#ifdef HAVE_INOTIFY
+ if (useINotify( &(*it) )) continue;
+#endif
+#ifdef HAVE_DNOTIFY
+ if (useDNotify( &(*it) )) continue;
+#endif
+ useStat( &(*it) );
+ }
+ }
+ else
+ checkFAMEvent(&fe);
+ }
+
+ QTimer::singleShot(0, this, SLOT(slotRemoveDelayed()));
+}
+
+void KDirWatchPrivate::checkFAMEvent(FAMEvent* fe)
+{
+ // Don't be too verbose ;-)
+ if ((fe->code == FAMExists) ||
+ (fe->code == FAMEndExist) ||
+ (fe->code == FAMAcknowledge)) return;
+
+ if ( isNoisyFile( fe->filename ) )
+ return;
+
+ Entry* e = 0;
+ EntryMap::Iterator it = m_mapEntries.begin();
+ for( ; it != m_mapEntries.end(); ++it )
+ if (FAMREQUEST_GETREQNUM(&( (*it).fr )) ==
+ FAMREQUEST_GETREQNUM(&(fe->fr)) ) {
+ e = &(*it);
+ break;
+ }
+
+ // Entry* e = static_cast<Entry*>(fe->userdata);
+
+#if 0 // #88538
+ kdDebug(7001) << "Processing FAM event ("
+ << ((fe->code == FAMChanged) ? "FAMChanged" :
+ (fe->code == FAMDeleted) ? "FAMDeleted" :
+ (fe->code == FAMStartExecuting) ? "FAMStartExecuting" :
+ (fe->code == FAMStopExecuting) ? "FAMStopExecuting" :
+ (fe->code == FAMCreated) ? "FAMCreated" :
+ (fe->code == FAMMoved) ? "FAMMoved" :
+ (fe->code == FAMAcknowledge) ? "FAMAcknowledge" :
+ (fe->code == FAMExists) ? "FAMExists" :
+ (fe->code == FAMEndExist) ? "FAMEndExist" : "Unknown Code")
+ << ", " << fe->filename
+ << ", Req " << FAMREQUEST_GETREQNUM(&(fe->fr))
+ << ")" << endl;
+#endif
+
+ if (!e) {
+ // this happens e.g. for FAMAcknowledge after deleting a dir...
+ // kdDebug(7001) << "No entry for FAM event ?!" << endl;
+ return;
+ }
+
+ if (e->m_status == NonExistent) {
+ kdDebug(7001) << "FAM event for nonExistent entry " << e->path << endl;
+ return;
+ }
+
+ // Delayed handling. This rechecks changes with own stat calls.
+ e->dirty = true;
+ if (!rescan_timer.isActive())
+ rescan_timer.start(m_PollInterval, true);
+
+ // needed FAM control actions on FAM events
+ if (e->isDir)
+ switch (fe->code)
+ {
+ case FAMDeleted:
+ // file absolute: watched dir
+ if (!QDir::isRelativePath(fe->filename))
+ {
+ // a watched directory was deleted
+
+ e->m_status = NonExistent;
+ FAMCancelMonitor(&fc, &(e->fr) ); // needed ?
+ kdDebug(7001) << "Cancelled FAMReq "
+ << FAMREQUEST_GETREQNUM(&(e->fr))
+ << " for " << e->path << endl;
+ // Scan parent for a new creation
+ addEntry(0, QDir::cleanDirPath( e->path+"/.."), e, true);
+ }
+ break;
+
+ case FAMCreated: {
+ // check for creation of a directory we have to watch
+ Entry *sub_entry = e->m_entries.first();
+ for(;sub_entry; sub_entry = e->m_entries.next())
+ if (sub_entry->path == e->path + "/" + fe->filename) break;
+ if (sub_entry && sub_entry->isDir) {
+ QString path = e->path;
+ removeEntry(0,e->path,sub_entry); // <e> can be invalid here!!
+ sub_entry->m_status = Normal;
+ if (!useFAM(sub_entry))
+#ifdef HAVE_INOTIFY
+ if (!useINotify(sub_entry ))
+#endif
+ useStat(sub_entry);
+ }
+ break;
+ }
+
+ default:
+ break;
+ }
+}
+#else
+void KDirWatchPrivate::famEventReceived() {}
+#endif
+
+
+void KDirWatchPrivate::statistics()
+{
+ EntryMap::Iterator it;
+
+ kdDebug(7001) << "Entries watched:" << endl;
+ if (m_mapEntries.count()==0) {
+ kdDebug(7001) << " None." << endl;
+ }
+ else {
+ it = m_mapEntries.begin();
+ for( ; it != m_mapEntries.end(); ++it ) {
+ Entry* e = &(*it);
+ kdDebug(7001) << " " << e->path << " ("
+ << ((e->m_status==Normal)?"":"Nonexistent ")
+ << (e->isDir ? "Dir":"File") << ", using "
+ << ((e->m_mode == FAMMode) ? "FAM" :
+ (e->m_mode == INotifyMode) ? "INotify" :
+ (e->m_mode == DNotifyMode) ? "DNotify" :
+ (e->m_mode == StatMode) ? "Stat" : "Unknown Method")
+ << ")" << endl;
+
+ Client* c = e->m_clients.first();
+ for(;c; c = e->m_clients.next()) {
+ QString pending;
+ if (c->watchingStopped) {
+ if (c->pending & Deleted) pending += "deleted ";
+ if (c->pending & Created) pending += "created ";
+ if (c->pending & Changed) pending += "changed ";
+ if (!pending.isEmpty()) pending = " (pending: " + pending + ")";
+ pending = ", stopped" + pending;
+ }
+ kdDebug(7001) << " by " << c->instance->name()
+ << " (" << c->count << " times)"
+ << pending << endl;
+ }
+ if (e->m_entries.count()>0) {
+ kdDebug(7001) << " dependent entries:" << endl;
+ Entry* d = e->m_entries.first();
+ for(;d; d = e->m_entries.next()) {
+ kdDebug(7001) << " " << d << endl;
+ kdDebug(7001) << " " << d->path << " (" << d << ") " << endl;
+ }
+ }
+ }
+ }
+}
+
+
+//
+// Class KDirWatch
+//
+
+static KStaticDeleter<KDirWatch> sd_dw;
+KDirWatch* KDirWatch::s_pSelf = 0L;
+
+KDirWatch* KDirWatch::self()
+{
+ if ( !s_pSelf ) {
+ sd_dw.setObject( s_pSelf, new KDirWatch );
+ }
+
+ return s_pSelf;
+}
+
+bool KDirWatch::exists()
+{
+ return s_pSelf != 0;
+}
+
+KDirWatch::KDirWatch (QObject* parent, const char* name)
+ : QObject(parent,name)
+{
+ if (!name) {
+ static int nameCounter = 0;
+
+ nameCounter++;
+ setName(QString("KDirWatch-%1").arg(nameCounter).ascii());
+ }
+
+ if (!dwp_self)
+ dwp_self = new KDirWatchPrivate;
+ d = dwp_self;
+ d->ref();
+
+ _isStopped = false;
+}
+
+KDirWatch::~KDirWatch()
+{
+ d->removeEntries(this);
+ if ( d->deref() )
+ {
+ // delete it if it's the last one
+ delete d;
+ dwp_self = 0L;
+ }
+}
+
+
+// TODO: add watchFiles/recursive support
+void KDirWatch::addDir( const QString& _path,
+ bool watchFiles, bool recursive)
+{
+ if (watchFiles || recursive) {
+ kdDebug(7001) << "addDir - recursive/watchFiles not supported yet in KDE 3.x" << endl;
+ }
+ if (d) d->addEntry(this, _path, 0, true);
+}
+
+void KDirWatch::addFile( const QString& _path )
+{
+ if (d) d->addEntry(this, _path, 0, false);
+}
+
+QDateTime KDirWatch::ctime( const QString &_path )
+{
+ KDirWatchPrivate::Entry* e = d->entry(_path);
+
+ if (!e)
+ return QDateTime();
+
+ QDateTime result;
+ result.setTime_t(e->m_ctime);
+ return result;
+}
+
+void KDirWatch::removeDir( const QString& _path )
+{
+ if (d) d->removeEntry(this, _path, 0);
+}
+
+void KDirWatch::removeFile( const QString& _path )
+{
+ if (d) d->removeEntry(this, _path, 0);
+}
+
+bool KDirWatch::stopDirScan( const QString& _path )
+{
+ if (d) {
+ KDirWatchPrivate::Entry *e = d->entry(_path);
+ if (e && e->isDir) return d->stopEntryScan(this, e);
+ }
+ return false;
+}
+
+bool KDirWatch::restartDirScan( const QString& _path )
+{
+ if (d) {
+ KDirWatchPrivate::Entry *e = d->entry(_path);
+ if (e && e->isDir)
+ // restart without notifying pending events
+ return d->restartEntryScan(this, e, false);
+ }
+ return false;
+}
+
+void KDirWatch::stopScan()
+{
+ if (d) d->stopScan(this);
+ _isStopped = true;
+}
+
+void KDirWatch::startScan( bool notify, bool skippedToo )
+{
+ _isStopped = false;
+ if (d) d->startScan(this, notify, skippedToo);
+}
+
+
+bool KDirWatch::contains( const QString& _path ) const
+{
+ KDirWatchPrivate::Entry* e = d->entry(_path);
+ if (!e)
+ return false;
+
+ KDirWatchPrivate::Client* c = e->m_clients.first();
+ for(;c;c=e->m_clients.next())
+ if (c->instance == this) return true;
+
+ return false;
+}
+
+void KDirWatch::statistics()
+{
+ if (!dwp_self) {
+ kdDebug(7001) << "KDirWatch not used" << endl;
+ return;
+ }
+ dwp_self->statistics();
+}
+
+
+void KDirWatch::setCreated( const QString & _file )
+{
+ kdDebug(7001) << name() << " emitting created " << _file << endl;
+ emit created( _file );
+}
+
+void KDirWatch::setDirty( const QString & _file )
+{
+ kdDebug(7001) << name() << " emitting dirty " << _file << endl;
+ emit dirty( _file );
+}
+
+void KDirWatch::setDeleted( const QString & _file )
+{
+ kdDebug(7001) << name() << " emitting deleted " << _file << endl;
+ emit deleted( _file );
+}
+
+KDirWatch::Method KDirWatch::internalMethod()
+{
+#ifdef HAVE_FAM
+ if (d->use_fam)
+ return KDirWatch::FAM;
+#endif
+#ifdef HAVE_INOTIFY
+ if (d->supports_inotify)
+ return KDirWatch::INotify;
+#endif
+#ifdef HAVE_DNOTIFY
+ if (d->supports_dnotify)
+ return KDirWatch::DNotify;
+#endif
+ return KDirWatch::Stat;
+}
+
+
+#include "kdirwatch.moc"
+#include "kdirwatch_p.moc"
+
+//sven
+
+// vim: sw=2 ts=8 et
diff --git a/kio/kio/krun.cpp b/kio/kio/krun.cpp
index b90f603f0..6acfb3b74 100644
--- a/kio/kio/krun.cpp
+++ b/kio/kio/krun.cpp
@@ -77,6 +77,7 @@ public:
QString m_localPath;
QString m_suggestedFileName;
QGuardedPtr <QWidget> m_window;
+ QCString m_asn;
};
pid_t KRun::runURL( const KURL& u, const QString& _mimetype )
@@ -109,14 +110,20 @@ bool KRun::isExecutableFile( const KURL& url, const QString &mimetype )
return false;
}
-// This is called by foundMimeType, since it knows the mimetype of the URL
pid_t KRun::runURL( const KURL& u, const QString& _mimetype, bool tempFile, bool runExecutables, const QString& suggestedFileName )
{
+ return runURL( u, _mimetype, NULL, "", tempFile, runExecutables, suggestedFileName );
+}
+
+// This is called by foundMimeType, since it knows the mimetype of the URL
+pid_t KRun::runURL( const KURL& u, const QString& _mimetype, QWidget* window, const QCString& asn,
+ bool tempFile, bool runExecutables, const QString& suggestedFileName )
+{
bool noRun = false;
bool noAuth = false;
if ( _mimetype == "inode/directory-locked" )
{
- KMessageBoxWrapper::error( 0L,
+ KMessageBoxWrapper::error( window,
i18n("<qt>Unable to enter <b>%1</b>.\nYou do not have access rights to this location.</qt>").arg(u.htmlURL()) );
return 0;
}
@@ -133,7 +140,7 @@ pid_t KRun::runURL( const KURL& u, const QString& _mimetype, bool tempFile, bool
{
QString path = u.path();
shellQuote( path );
- return (KRun::runCommand(path)); // just execute the url as a command
+ return (KRun::runCommand(path, QString::null, QString::null, window, asn)); // just execute the url as a command
// ## TODO implement deleting the file if tempFile==true
}
else
@@ -155,14 +162,14 @@ pid_t KRun::runURL( const KURL& u, const QString& _mimetype, bool tempFile, bool
if ( noRun )
{
- KMessageBox::sorry( 0L,
+ KMessageBox::sorry( window,
i18n("<qt>The file <b>%1</b> is an executable program. "
"For safety it will not be started.</qt>").arg(u.htmlURL()));
return 0;
}
if ( noAuth )
{
- KMessageBoxWrapper::error( 0L,
+ KMessageBoxWrapper::error( window,
i18n("<qt>You do not have permission to run <b>%1</b>.</qt>").arg(u.htmlURL()) );
return 0;
}
@@ -182,7 +189,7 @@ pid_t KRun::runURL( const KURL& u, const QString& _mimetype, bool tempFile, bool
return displayOpenWithDialog( lst, tempFile, suggestedFileName );
}
- return KRun::run( *offer, lst, 0 /*window*/, tempFile, suggestedFileName );
+ return KRun::run( *offer, lst, window, asn, tempFile, suggestedFileName );
}
bool KRun::displayOpenWithDialog( const KURL::List& lst )
@@ -536,13 +543,13 @@ QString KRun::binaryName( const QString & execLine, bool removePath )
}
static pid_t runCommandInternal( KProcess* proc, const KService* service, const QString& binName,
- const QString &execName, const QString & iconName )
+ const QString &execName, const QString & iconName, QWidget* window, QCString asn )
{
if (service && !service->desktopEntryPath().isEmpty()
&& !KDesktopFile::isAuthorizedDesktopFile( service->desktopEntryPath() ))
{
kdWarning() << "No authorization to execute " << service->desktopEntryPath() << endl;
- KMessageBox::sorry(0, i18n("You are not authorized to execute this file."));
+ KMessageBox::sorry(window, i18n("You are not authorized to execute this file."));
return 0;
}
QString bin = KRun::binaryName( binName, true );
@@ -550,10 +557,10 @@ static pid_t runCommandInternal( KProcess* proc, const KService* service, const
bool silent;
QCString wmclass;
KStartupInfoId id;
- bool startup_notify = KRun::checkStartupNotify( binName, service, &silent, &wmclass );
+ bool startup_notify = ( asn != "0" && KRun::checkStartupNotify( binName, service, &silent, &wmclass ));
if( startup_notify )
{
- id.initId();
+ id.initId( asn );
id.setupStartupEnv();
KStartupInfoData data;
data.setHostname();
@@ -572,6 +579,8 @@ static pid_t runCommandInternal( KProcess* proc, const KService* service, const
if( silent )
data.setSilent( KStartupInfoData::Yes );
data.setDesktop( KWin::currentDesktop());
+ if( window )
+ data.setLaunchedBy( window->winId());
KStartupInfo::sendStartup( id, data );
}
pid_t pid = KProcessRunner::run( proc, binName, id );
@@ -635,7 +644,8 @@ bool KRun::checkStartupNotify( const QString& /*binName*/, const KService* servi
return true;
}
-static pid_t runTempService( const KService& _service, const KURL::List& _urls, bool tempFiles, const QString& suggestedFileName )
+static pid_t runTempService( const KService& _service, const KURL::List& _urls, QWidget* window,
+ const QCString& asn, bool tempFiles, const QString& suggestedFileName )
{
if (!_urls.isEmpty()) {
kdDebug(7010) << "runTempService: first url " << _urls.first().url() << endl;
@@ -654,7 +664,7 @@ static pid_t runTempService( const KService& _service, const KURL::List& _urls,
{
KURL::List singleUrl;
singleUrl.append(*it);
- runTempService( _service, singleUrl, tempFiles, suggestedFileName );
+ runTempService( _service, singleUrl, window, "", tempFiles, suggestedFileName );
}
KURL::List singleUrl;
singleUrl.append(_urls.first());
@@ -673,7 +683,7 @@ static pid_t runTempService( const KService& _service, const KURL::List& _urls,
proc->setWorkingDirectory(_service.path());
return runCommandInternal( proc, &_service, KRun::binaryName( _service.exec(), false ),
- _service.name(), _service.icon() );
+ _service.name(), _service.icon(), window, asn );
}
// WARNING: don't call this from processDesktopExec, since klauncher uses that too...
@@ -734,11 +744,22 @@ pid_t KRun::run( const KService& _service, const KURL::List& _urls, bool tempFil
pid_t KRun::run( const KService& _service, const KURL::List& _urls, QWidget* window, bool tempFiles )
{
- return run( _service, _urls, window, tempFiles, QString::null );
+ return run( _service, _urls, window, "", tempFiles, QString::null );
+}
+
+pid_t KRun::run( const KService& _service, const KURL::List& _urls, QWidget* window, const QCString& asn, bool tempFiles )
+{
+ return run( _service, _urls, window, asn, tempFiles, QString::null );
}
pid_t KRun::run( const KService& _service, const KURL::List& _urls, QWidget* window, bool tempFiles, const QString& suggestedFileName )
{
+ return run( _service, _urls, window, "", tempFiles, suggestedFileName );
+}
+
+pid_t KRun::run( const KService& _service, const KURL::List& _urls, QWidget* window, const QCString& asn,
+ bool tempFiles, const QString& suggestedFileName )
+{
if (!_service.desktopEntryPath().isEmpty() &&
!KDesktopFile::isAuthorizedDesktopFile( _service.desktopEntryPath()))
{
@@ -759,7 +780,7 @@ pid_t KRun::run( const KService& _service, const KURL::List& _urls, QWidget* win
if ( tempFiles || _service.desktopEntryPath().isEmpty() || !suggestedFileName.isEmpty() )
{
- return runTempService(_service, _urls, tempFiles, suggestedFileName);
+ return runTempService(_service, _urls, window, asn, tempFiles, suggestedFileName);
}
kdDebug(7010) << "KRun::run " << _service.desktopEntryPath() << endl;
@@ -773,9 +794,25 @@ pid_t KRun::run( const KService& _service, const KURL::List& _urls, QWidget* win
QString error;
int pid = 0;
-
+
+ QCString myasn = asn;
+ // startServiceByDesktopPath() doesn't take QWidget*, add it to the startup info now
+ if( window != NULL )
+ {
+ if( myasn.isEmpty())
+ myasn = KStartupInfo::createNewStartupId();
+ if( myasn != "0" )
+ {
+ KStartupInfoId id;
+ id.initId( myasn );
+ KStartupInfoData data;
+ data.setLaunchedBy( window->winId());
+ KStartupInfo::sendChange( id, data );
+ }
+ }
+
int i = KApplication::startServiceByDesktopPath(
- _service.desktopEntryPath(), urls.toStringList(), &error, 0L, &pid
+ _service.desktopEntryPath(), urls.toStringList(), &error, 0L, &pid, myasn
);
if (i != 0)
@@ -800,33 +837,47 @@ pid_t KRun::run( const QString& _exec, const KURL::List& _urls, const QString& _
pid_t KRun::runCommand( QString cmd )
{
- return KRun::runCommand( cmd, QString::null, QString::null );
+ return KRun::runCommand( cmd, QString::null, QString::null, NULL, "" );
}
pid_t KRun::runCommand( const QString& cmd, const QString &execName, const QString & iconName )
{
+ return KRun::runCommand( cmd, execName, iconName, NULL, "" );
+}
+
+pid_t KRun::runCommand( const QString& cmd, const QString &execName, const QString & iconName,
+ QWidget* window, const QCString& asn )
+{
kdDebug(7010) << "runCommand " << cmd << "," << execName << endl;
KProcess * proc = new KProcess;
proc->setUseShell(true);
*proc << cmd;
KService::Ptr service = KService::serviceByDesktopName( binaryName( execName, true ) );
- return runCommandInternal( proc, service.data(), binaryName( execName, false ), execName, iconName );
+ return runCommandInternal( proc, service.data(), binaryName( execName, false ), execName, iconName,
+ window, asn );
}
KRun::KRun( const KURL& url, mode_t mode, bool isLocalFile, bool showProgressInfo )
:m_timer(0,"KRun::timer")
{
- init (url, 0, mode, isLocalFile, showProgressInfo);
+ init (url, 0, "", mode, isLocalFile, showProgressInfo);
}
KRun::KRun( const KURL& url, QWidget* window, mode_t mode, bool isLocalFile,
bool showProgressInfo )
:m_timer(0,"KRun::timer")
{
- init (url, window, mode, isLocalFile, showProgressInfo);
+ init (url, window, "", mode, isLocalFile, showProgressInfo);
+}
+
+KRun::KRun( const KURL& url, QWidget* window, const QCString& asn, mode_t mode, bool isLocalFile,
+ bool showProgressInfo )
+ :m_timer(0,"KRun::timer")
+{
+ init (url, window, asn, mode, isLocalFile, showProgressInfo);
}
-void KRun::init ( const KURL& url, QWidget* window, mode_t mode, bool isLocalFile,
+void KRun::init ( const KURL& url, QWidget* window, const QCString& asn, mode_t mode, bool isLocalFile,
bool showProgressInfo )
{
m_bFault = false;
@@ -842,6 +893,7 @@ void KRun::init ( const KURL& url, QWidget* window, mode_t mode, bool isLocalFil
d = new KRunPrivate;
d->m_runExecutables = true;
d->m_window = window;
+ d->m_asn = asn;
setEnableExternalBrowser(true);
// Start the timer. This means we will return to the event
@@ -942,7 +994,7 @@ void KRun::init()
KService::Ptr service = KService::serviceByStorageId( exec );
if (service)
{
- run( *service, urls );
+ run( *service, urls, d->m_window, d->m_asn );
ok = true;
}
}
@@ -1235,7 +1287,7 @@ void KRun::foundMimeType( const QString& type )
{
KURL::List lst;
lst.append( m_strURL );
- m_bFinished = KRun::run( *serv, lst );
+ m_bFinished = KRun::run( *serv, lst, d->m_window, d->m_asn );
/// Note: the line above means that if that service failed, we'll
/// go to runURL to maybe find another service, even though a dialog
/// box was displayed. That's good if runURL tries another service,
@@ -1250,7 +1302,7 @@ void KRun::foundMimeType( const QString& type )
m_strURL.setPath( d->m_localPath );
}
- if (!m_bFinished && KRun::runURL( m_strURL, type, false, d->m_runExecutables, d->m_suggestedFileName )){
+ if (!m_bFinished && KRun::runURL( m_strURL, type, d->m_window, d->m_asn, false, d->m_runExecutables, d->m_suggestedFileName )){
m_bFinished = true;
}
else{
diff --git a/kio/kio/krun.h b/kio/kio/krun.h
index c4f9bee0e..385b227af 100644
--- a/kio/kio/krun.h
+++ b/kio/kio/krun.h
@@ -111,6 +111,8 @@ public:
*/
KRun( const KURL& url, QWidget* window, mode_t mode = 0,
bool isLocalFile = false, bool showProgressInfo = true );
+ KRun( const KURL& url, QWidget* window, const QCString& asn, mode_t mode = 0,
+ bool isLocalFile = false, bool showProgressInfo = true );
/**
* Destructor. Don't call it yourself, since a KRun object auto-deletes
@@ -210,6 +212,8 @@ public:
* @since 3.5.2
*/
static pid_t run( const KService& _service, const KURL::List& _urls, QWidget* window, bool tempFiles = false );
+ static pid_t run( const KService& _service, const KURL::List& _urls, QWidget* window,
+ const QCString& asn, bool tempFiles = false );
/**
* Open a list of URLs with a certain service (application).
*
@@ -226,6 +230,8 @@ public:
/// @since 3.5.3
/// @internal
static pid_t run( const KService& _service, const KURL::List& _urls, QWidget* window, bool tempFiles, const QString& suggestedFileName );
+ static pid_t run( const KService& _service, const KURL::List& _urls, QWidget* window,
+ const QCString& asn, bool tempFiles, const QString& suggestedFileName );
/**
* Open a list of URLs with.
@@ -269,6 +275,7 @@ public:
static pid_t runURL( const KURL& _url, const QString& _mimetype );
/// @since 3.5.3
/// @internal
+ static pid_t runURL( const KURL& _url, const QString& _mimetype, QWidget* window, const QCString& asn, bool tempFile, bool runExecutables, const QString& suggestedFileName );
static pid_t runURL( const KURL& _url, const QString& _mimetype, bool tempFile, bool runExecutables, const QString& suggestedFileName );
/**
@@ -299,6 +306,8 @@ public:
* of running command) if command was unsafe for map notification.
*/
static pid_t runCommand( const QString& cmd, const QString & execName, const QString & icon );
+ static pid_t runCommand( const QString& cmd, const QString & execName, const QString & icon,
+ QWidget* window, const QCString& asn );
/**
* Display the Open-With dialog for those URLs, and run the chosen application.
@@ -438,7 +447,7 @@ protected:
virtual void virtual_hook( int id, void* data );
private:
- void init (const KURL& url, QWidget* window, mode_t mode,
+ void init (const KURL& url, QWidget* window, const QCString& asn, mode_t mode,
bool isLocalFile, bool showProgressInfo);
private:
class KRunPrivate;
diff --git a/kio/kio/kservice.cpp b/kio/kio/kservice.cpp
index bfb5ba2e7..d33e33530 100644
--- a/kio/kio/kservice.cpp
+++ b/kio/kio/kservice.cpp
@@ -97,6 +97,7 @@ KService::init( KDesktopFile *config )
m_bValid = true;
bool absPath = !QDir::isRelativePath(entryPath());
+ bool kde4application = config->fileName().startsWith("/usr/share/applications/kde4/");
config->setDesktopGroup();
@@ -196,9 +197,28 @@ KService::init( KDesktopFile *config )
name = name.left(pos);
m_strExec = config->readPathEntry( "Exec" );
+ if (kde4application && !m_strExec.startsWith("/")) {
+ m_strExec = "KDEHOME=$HOME/.kde XDG_DATA_DIRS=/usr/share KDEDIRS=/usr/ XDG_CONFIG_DIRS=/etc/xdg/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:$PATH "+m_strExec;
+ } else if (config->readBoolEntry("X-KDE-SubstituteUID")) {
+ int space = m_strExec.find(" ");
+ if (space==-1)
+ m_strExec = KStandardDirs::findExe(m_strExec);
+ else {
+ const QString command = m_strExec.left(space);
+ m_strExec.replace(command,KStandardDirs::findExe(command));
+ }
+ }
+
entryMap.remove("Exec");
m_strIcon = config->readEntry( "Icon", "unknown" );
+ if (kde4application) {
+ if (QFile::exists("/usr/share/icons/oxygen/22x22/apps/" + m_strIcon + ".png")) {
+ m_strIcon = "/usr/share/icons/oxygen/22x22/apps/" + m_strIcon + ".png";
+ } else if (QFile::exists("/usr/share/icons/hicolor/22x22/apps/" + m_strIcon + ".png")) {
+ m_strIcon = "/usr/share/icons/hicolor/22x22/apps/" + m_strIcon + ".png";
+ }
+ }
entryMap.remove("Icon");
m_bTerminal = (config->readBoolEntry( "Terminal" )); // should be a property IMHO
entryMap.remove("Terminal");
@@ -209,6 +229,9 @@ KService::init( KDesktopFile *config )
m_strComment = config->readEntry( "Comment" );
entryMap.remove("Comment");
m_strGenName = config->readEntry( "GenericName" );
+ if (kde4application) {
+ m_strGenName += " [KDE4]";
+ }
entryMap.remove("GenericName");
QString untranslatedGenericName = config->readEntryUntranslated( "GenericName" );
if (!untranslatedGenericName.isEmpty())
@@ -226,7 +249,8 @@ KService::init( KDesktopFile *config )
m_lstServiceTypes = config->readListEntry( "ServiceTypes" );
entryMap.remove("ServiceTypes");
// For compatibility with KDE 1.x
- m_lstServiceTypes += config->readListEntry( "MimeType", ';' );
+ if (!kde4application)
+ m_lstServiceTypes += config->readListEntry( "MimeType", ';' );
entryMap.remove("MimeType");
if ( m_strType == "Application" && !m_lstServiceTypes.contains("Application") )
@@ -245,6 +269,8 @@ KService::init( KDesktopFile *config )
m_DCOPServiceType = DCOP_None;
m_strDesktopEntryName = name.lower();
+ if (kde4application)
+ m_strDesktopEntryName = "kde4-" + m_strDesktopEntryName;
m_bAllowAsDefault = config->readBoolEntry( "AllowDefault", true );
entryMap.remove("AllowDefault");
@@ -260,7 +286,10 @@ KService::init( KDesktopFile *config )
for( ; it != entryMap.end();++it)
{
//qDebug(" Key = %s Data = %s", it.key().latin1(), it.data().latin1());
- m_mapProps.insert( it.key(), QVariant( it.data()));
+ QString key = it.key();
+ if (kde4application && key=="OnlyShowIn" && it.data()=="KDE;")
+ key = "NotShowIn";
+ m_mapProps.insert( key, QVariant( it.data()));
}
}
diff --git a/kio/kio/kurlcompletion.cpp b/kio/kio/kurlcompletion.cpp
index 72a41d9a3..cddd9fa79 100644
--- a/kio/kio/kurlcompletion.cpp
+++ b/kio/kio/kurlcompletion.cpp
@@ -231,6 +231,9 @@ void DirectoryListThread::run()
while ( !terminationRequested() &&
(dirEntry = ::readdir( dir)))
#else
+#if !defined(MAXPATHLEN) && defined(__GNU__)
+#define MAXPATHLEN UCHAR_MAX
+#endif
struct dirent *dirPosition = (struct dirent *) malloc( sizeof( struct dirent ) + MAXPATHLEN + 1 );
struct dirent *dirEntry = 0;
while ( !terminationRequested() &&
diff --git a/kio/kpasswdserver/Makefile.am b/kio/kpasswdserver/Makefile.am
index fcc3e2b1b..4ddb85be4 100644
--- a/kio/kpasswdserver/Makefile.am
+++ b/kio/kpasswdserver/Makefile.am
@@ -10,6 +10,6 @@ kde_module_LTLIBRARIES = kded_kpasswdserver.la
kded_kpasswdserver_la_SOURCES = kpasswdserver.cpp kpasswdserver.skel
kded_kpasswdserver_la_METASOURCES = AUTO
kded_kpasswdserver_la_LDFLAGS = $(all_libraries) -module -avoid-version
-kded_kpasswdserver_la_LIBADD = $(top_builddir)/kwallet/client/libkwalletclient.la $(LIB_KIO) $(LIB_KDED)
+kded_kpasswdserver_la_LIBADD = $(top_builddir)/kwallet/client/libkwalletclient.la $(LIB_KIO) $(LIB_KDED) $(LIB_QT) $(LIB_KDEUI) $(LIB_KDECORE) $(top_builddir)/dcop/libDCOP.la $(LIB_X11) $(top_builddir)/kded/libkdeinit_kded.la
include $(top_srcdir)/admin/Doxyfile.am
diff --git a/kio/misc/Makefile.am b/kio/misc/Makefile.am
index 5dab3a23e..6dc6bcd60 100644
--- a/kio/misc/Makefile.am
+++ b/kio/misc/Makefile.am
@@ -29,7 +29,7 @@ bin_PROGRAMS = kmailservice ktelnetservice
observer_DIR = $(top_srcdir)/kio/kio
kio_uiserver_la_SOURCES = uiserver.cpp uiserver.skel observer.stub
-kio_uiserver_la_LIBADD = $(LIB_KIO)
+kio_uiserver_la_LIBADD = $(LIB_KIO) $(LIB_KDEUI) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_KDECORE)
kio_uiserver_la_LDFLAGS = $(all_libraries) -module -avoid-version
METASOURCES = AUTO
diff --git a/kio/misc/fileshareset b/kio/misc/fileshareset
index f73e5f008..4c921ba38 100755
--- a/kio/misc/fileshareset
+++ b/kio/misc/fileshareset
@@ -285,7 +285,12 @@ sub update_server {
system('PATH=/bin:/sbin pidof nfsd >/dev/null') != 0) {
# trying to start the server...
system('/etc/init.d/portmap start') if system('/etc/init.d/portmap status') != 0;
- system('/etc/init.d/nfs', $_) foreach 'stop', 'start';
+ if ( -f '/etc/init.d/nfs' ) {
+ system('/etc/init.d/nfs', $_) foreach 'stop', 'start';
+ }
+ elsif ( -f '/etc/init.d/nfs-kernel-server' ) {
+ system('/etc/init.d/nfs-kernel-server', $_) foreach 'stop', 'start';
+ }
}
exit 0;
}
diff --git a/kio/misc/kdesasl/Makefile.am b/kio/misc/kdesasl/Makefile.am
index 854757d37..4020a966c 100644
--- a/kio/misc/kdesasl/Makefile.am
+++ b/kio/misc/kdesasl/Makefile.am
@@ -8,5 +8,5 @@ kdesaslinclude_HEADERS = kdesasl.h
libkdesasl_la_SOURCES = kdesasl.cpp
libkdesasl_la_LDFLAGS = $(all_libraries) -version-info 3:0:2 -no-undefined
-libkdesasl_la_LIBADD = $(LIB_KDECORE)
+libkdesasl_la_LIBADD = $(LIB_KDECORE) $(LIB_QT)
diff --git a/kio/misc/kntlm/Makefile.am b/kio/misc/kntlm/Makefile.am
index 192ddc0af..7136310d9 100644
--- a/kio/misc/kntlm/Makefile.am
+++ b/kio/misc/kntlm/Makefile.am
@@ -8,5 +8,5 @@ kntlminclude_HEADERS = kntlm.h
libkntlm_la_SOURCES = kntlm.cpp des.cpp
libkntlm_la_LDFLAGS = $(all_libraries) -version-info 0:0:0 -no-undefined
-libkntlm_la_LIBADD = $(LIB_KDECORE)
+libkntlm_la_LIBADD = $(LIB_KDECORE) $(LIB_QT)
diff --git a/kio/misc/kpac/Makefile.am b/kio/misc/kpac/Makefile.am
index 173071318..33d7d0196 100644
--- a/kio/misc/kpac/Makefile.am
+++ b/kio/misc/kpac/Makefile.am
@@ -10,7 +10,9 @@ KDE_CXXFLAGS = $(USE_EXCEPTIONS)
kded_proxyscout_la_SOURCES = proxyscout.skel proxyscout.cpp script.cpp \
downloader.cpp discovery.cpp
kded_proxyscout_la_LDFLAGS = $(all_libraries) -module -avoid-version
-kded_proxyscout_la_LIBADD = $(LIB_KIO) $(top_builddir)/kjs/libkjs.la $(LIB_KDED)
+kded_proxyscout_la_LIBADD = $(LIB_KIO) $(top_builddir)/kjs/libkjs.la $(LIB_KDED) $(LIB_QT) \
+ $(top_builddir)/dcop/libDCOP.la $(top_builddir)/kded/libkdeinit_kded.la \
+ $(LIB_KDECORE) $(LIBRESOLV)
kpac_dhcp_helper_SOURCES = kpac_dhcp_helper.c
kpac_dhcp_helper_CFLAGS = $(KDE_USE_FPIE)
diff --git a/kio/misc/kssld/Makefile.am b/kio/misc/kssld/Makefile.am
index 63252f46c..24faf2e28 100644
--- a/kio/misc/kssld/Makefile.am
+++ b/kio/misc/kssld/Makefile.am
@@ -21,7 +21,7 @@ INCLUDES= -I$(srcdir)/.. -I$(top_srcdir) $(SSL_INCLUDES) -I$(top_srcdir)/kio/kss
kde_module_LTLIBRARIES = kded_kssld.la
kded_kssld_la_LDFLAGS = $(all_libraries) -module -avoid-version
-kded_kssld_la_LIBADD = $(LIB_KIO) $(LIB_KDED)
+kded_kssld_la_LIBADD = $(LIB_KIO) $(LIB_KDED) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(top_builddir)/kded/libkdeinit_kded.la $(LIB_KDECORE)
kded_kssld_la_SOURCES = kssld.cpp kssld.skel
METASOURCES = AUTO
diff --git a/kio/misc/kwalletd/Makefile.am b/kio/misc/kwalletd/Makefile.am
index f57f2c692..1c198c46e 100644
--- a/kio/misc/kwalletd/Makefile.am
+++ b/kio/misc/kwalletd/Makefile.am
@@ -21,7 +21,7 @@ INCLUDES= -I$(srcdir)/.. -I$(top_srcdir) -I$(top_srcdir)/kwallet/backend -I$(top
kde_module_LTLIBRARIES = kded_kwalletd.la
kded_kwalletd_la_LDFLAGS = $(all_libraries) -module -avoid-version
-kded_kwalletd_la_LIBADD = $(LIB_KIO) ../../../kwallet/backend/libkwalletbackend.la ../../../kwallet/client/libkwalletclient.la $(LIB_KDED)
+kded_kwalletd_la_LIBADD = $(LIB_KIO) ../../../kwallet/backend/libkwalletbackend.la ../../../kwallet/client/libkwalletclient.la $(LIB_KDED) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_KDECORE) $(LIB_KDEUI) $(top_builddir)/kded/libkdeinit_kded.la
kded_kwalletd_la_SOURCES = kwalletd.cpp kwalletd.skel ktimeout.cpp kwalletwizard.ui kbetterthankdialogbase.ui
METASOURCES = AUTO
diff --git a/kio/misc/kwalletd/kwalletd.cpp b/kio/misc/kwalletd/kwalletd.cpp
index 686a99d6f..3fa32ff71 100644
--- a/kio/misc/kwalletd/kwalletd.cpp
+++ b/kio/misc/kwalletd/kwalletd.cpp
@@ -829,6 +829,12 @@ bool KWalletD::removeFolder(int handle, const QString& f) {
if ((b = getWallet(friendlyDCOPPeerName(), handle))) {
bool rc = b->removeFolder(f);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
QByteArray data;
QDataStream ds(data, IO_WriteOnly);
ds << b->walletName();
@@ -845,6 +851,12 @@ bool KWalletD::createFolder(int handle, const QString& f) {
if ((b = getWallet(friendlyDCOPPeerName(), handle))) {
bool rc = b->createFolder(f);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
QByteArray data;
QDataStream ds(data, IO_WriteOnly);
ds << b->walletName();
@@ -987,6 +999,12 @@ int KWalletD::writeMap(int handle, const QString& folder, const QString& key, co
e.setValue(value);
e.setType(KWallet::Wallet::Map);
b->writeEntry(&e);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
emitFolderUpdated(b->walletName(), folder);
return 0;
}
@@ -1005,6 +1023,12 @@ int KWalletD::writeEntry(int handle, const QString& folder, const QString& key,
e.setValue(value);
e.setType(KWallet::Wallet::EntryType(entryType));
b->writeEntry(&e);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
emitFolderUpdated(b->walletName(), folder);
return 0;
}
@@ -1023,6 +1047,12 @@ int KWalletD::writeEntry(int handle, const QString& folder, const QString& key,
e.setValue(value);
e.setType(KWallet::Wallet::Stream);
b->writeEntry(&e);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
emitFolderUpdated(b->walletName(), folder);
return 0;
}
@@ -1041,6 +1071,12 @@ int KWalletD::writePassword(int handle, const QString& folder, const QString& ke
e.setValue(value);
e.setType(KWallet::Wallet::Password);
b->writeEntry(&e);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
emitFolderUpdated(b->walletName(), folder);
return 0;
}
@@ -1090,6 +1126,12 @@ int KWalletD::removeEntry(int handle, const QString& folder, const QString& key)
}
b->setFolder(folder);
bool rc = b->removeEntry(key);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
emitFolderUpdated(b->walletName(), folder);
return rc ? 0 : -3;
}
@@ -1183,6 +1225,12 @@ int KWalletD::renameEntry(int handle, const QString& folder, const QString& oldN
if ((b = getWallet(friendlyDCOPPeerName(), handle))) {
b->setFolder(folder);
int rc = b->renameEntry(oldName, newName);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
emitFolderUpdated(b->walletName(), folder);
return rc;
}
diff --git a/kioslave/bzip2/Makefile.am b/kioslave/bzip2/Makefile.am
index bb5ca3dc5..9efd77a4c 100644
--- a/kioslave/bzip2/Makefile.am
+++ b/kioslave/bzip2/Makefile.am
@@ -4,7 +4,7 @@ METASOURCES = AUTO
kde_module_LTLIBRARIES = kbzip2filter.la
kbzip2filter_la_SOURCES = kbzip2filter.cpp
-kbzip2filter_la_LIBADD = $(LIB_KIO) $(LIBBZ2)
+kbzip2filter_la_LIBADD = $(LIB_KIO) $(LIBBZ2) $(LIB_QT) $(LIB_KDECORE)
kbzip2filter_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
kde_services_DATA = kbzip2filter.desktop
diff --git a/kioslave/file/Makefile.am b/kioslave/file/Makefile.am
index 0dd7a760f..7cafcb339 100644
--- a/kioslave/file/Makefile.am
+++ b/kioslave/file/Makefile.am
@@ -9,7 +9,7 @@ INCLUDES = $(all_includes)
kde_module_LTLIBRARIES = kio_file.la
kio_file_la_SOURCES = file.cc
-kio_file_la_LIBADD = $(LIB_KIO)
+kio_file_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_KDECORE) $(ACL_LIBS)
kio_file_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
noinst_HEADERS = file.h
diff --git a/kioslave/file/file.cc b/kioslave/file/file.cc
index 718d42125..c24413cc7 100644
--- a/kioslave/file/file.cc
+++ b/kioslave/file/file.cc
@@ -1234,8 +1234,13 @@ void FileProtocol::listDir( const KURL& url)
directories we keep as active directory. And
as the slave runs in the background, it's hard
to see for the user what the problem would be */
+#if !defined(PATH_MAX) && defined(__GLIBC__)
+ char *path_buffer;
+ path_buffer = getcwd(NULL, 0);
+#else
char path_buffer[PATH_MAX];
(void) getcwd(path_buffer, PATH_MAX - 1);
+#endif
if ( chdir( _path.data() ) ) {
if (errno == EACCES)
error(ERR_ACCESS_DENIED, _path);
@@ -1261,6 +1266,9 @@ void FileProtocol::listDir( const KURL& url)
kdDebug(7101) << "============= COMPLETED LIST ============" << endl;
chdir(path_buffer);
+#if !defined(PATH_MAX) && defined(__GLIBC__)
+ free(path_buffer);
+#endif
finished();
}
diff --git a/kioslave/ftp/Makefile.am b/kioslave/ftp/Makefile.am
index cfa3de6ad..eeb5f061c 100644
--- a/kioslave/ftp/Makefile.am
+++ b/kioslave/ftp/Makefile.am
@@ -5,7 +5,7 @@ INCLUDES= $(all_includes)
kde_module_LTLIBRARIES = kio_ftp.la
kio_ftp_la_SOURCES = ftp.cc
-kio_ftp_la_LIBADD = $(LIB_KIO)
+kio_ftp_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_KDECORE)
kio_ftp_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
noinst_HEADERS = ftp.h
diff --git a/kioslave/gzip/Makefile.am b/kioslave/gzip/Makefile.am
index 2b290c206..193b8beb0 100644
--- a/kioslave/gzip/Makefile.am
+++ b/kioslave/gzip/Makefile.am
@@ -5,7 +5,7 @@ METASOURCES = AUTO
kde_module_LTLIBRARIES = kgzipfilter.la
kgzipfilter_la_SOURCES = kgzipfilter.cpp
-kgzipfilter_la_LIBADD = $(LIB_KIO) $(LIBZ)
+kgzipfilter_la_LIBADD = $(LIB_KIO) $(LIBZ) $(LIB_QT) $(LIB_KDECORE)
kgzipfilter_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
kde_services_DATA = kgzipfilter.desktop
diff --git a/kioslave/http/Makefile.am b/kioslave/http/Makefile.am
index a29e06e9e..2e4f027dc 100644
--- a/kioslave/http/Makefile.am
+++ b/kioslave/http/Makefile.am
@@ -15,11 +15,11 @@ kde_module_LTLIBRARIES = kio_http.la
kio_http_la_SOURCES = http.cc
kio_http_la_METASOURCES = AUTO
-kio_http_la_LIBADD = $(LIB_KIO) $(top_builddir)/kio/httpfilter/libhttpfilter.la $(top_builddir)/kio/misc/kntlm/libkntlm.la
-kio_http_la_LDFLAGS = $(all_libraries) $(GSSAPI_RPATH) -module $(KDE_PLUGIN) $(GSSAPI_LIBS)
+kio_http_la_LIBADD = $(LIB_KIO) $(top_builddir)/kio/httpfilter/libhttpfilter.la $(top_builddir)/kio/misc/kntlm/libkntlm.la $(LIB_QT) $(LIB_KDECORE) $(LIBZ) $(top_builddir)/dcop/libDCOP.la
+kio_http_la_LDFLAGS = $(all_libraries) $(GSSAPI_RPATH) -module $(KDE_PLUGIN) -lgssapi_krb5
kio_http_cache_cleaner_la_SOURCES = http_cache_cleaner.cpp
-kio_http_cache_cleaner_la_LIBADD = $(LIB_KIO)
+kio_http_cache_cleaner_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_KDECORE) $(top_builddir)/dcop/libDCOP.la
kio_http_cache_cleaner_la_LDFLAGS = -module -avoid-version
noinst_HEADERS = http.h
diff --git a/kioslave/http/kcookiejar/Makefile.am b/kioslave/http/kcookiejar/Makefile.am
index 933de5e13..c1c586b94 100644
--- a/kioslave/http/kcookiejar/Makefile.am
+++ b/kioslave/http/kcookiejar/Makefile.am
@@ -13,12 +13,12 @@ kde_module_LTLIBRARIES = kded_kcookiejar.la
kcookiejar_la_SOURCES = main.cpp
METASOURCES = AUTO
kcookiejar_la_LDFLAGS = $(all_libraries) -module -avoid-version
-kcookiejar_la_LIBADD = $(LIB_KDECORE)
+kcookiejar_la_LIBADD = $(LIB_KDECORE) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la
kded_kcookiejar_la_SOURCES = kcookiejar.cpp kcookieserver.cpp \
kcookieserver.skel kcookiewin.cpp
kded_kcookiejar_la_LDFLAGS = $(all_libraries) -module -avoid-version
-kded_kcookiejar_la_LIBADD = $(LIB_KIO) $(LIB_KDED)
+kded_kcookiejar_la_LIBADD = $(LIB_KDED) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_KDECORE) $(LIB_X11) $(LIB_KDEUI) $(top_builddir)/kded/libkdeinit_kded.la
kded_DATA = kcookiejar.desktop
kdeddir = $(kde_servicesdir)/kded
diff --git a/kioslave/metainfo/Makefile.am b/kioslave/metainfo/Makefile.am
index 6807019f4..e1c0b3382 100644
--- a/kioslave/metainfo/Makefile.am
+++ b/kioslave/metainfo/Makefile.am
@@ -8,7 +8,7 @@ METASOURCES = AUTO
kde_module_LTLIBRARIES = kio_metainfo.la
kio_metainfo_la_SOURCES = metainfo.cpp
-kio_metainfo_la_LIBADD = $(LIB_KIO)
+kio_metainfo_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_KDECORE)
kio_metainfo_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
noinst_HEADERS = metainfo.h
diff --git a/kjs/configure.in.in b/kjs/configure.in.in
index 1ffa6cedd..fd23612e0 100644
--- a/kjs/configure.in.in
+++ b/kjs/configure.in.in
@@ -52,10 +52,10 @@ AC_DEFUN([AC_CHECK_PCREPOSIX],
KDE_FIND_PATH(pcre-config, PCRE_CONFIG, [${exec_prefix}/bin ${prefix}/bin], [PCRE_CONFIG="" ])
if test -n "$PCRE_CONFIG" && $PCRE_CONFIG --libs >/dev/null 2>&1; then
- LIBPCRE=`$PCRE_CONFIG --libs-posix | sed -e "s,-L/usr/lib ,,"`
+ LIBPCRE=`$PCRE_CONFIG --libs-posix | sed -e "s,-L/usr/lib ,," -e "s,[\b-].\+pcreposix[^[:space:]]*\b,,"`
PCRECFLAGS=`$PCRE_CONFIG --cflags`
else
- LIBPCRE="-lpcre -lpcreposix"
+ LIBPCRE="-lpcre"
PCRECFLAGS=
fi
AC_CACHE_VAL(ac_cv_have_pcreposix, [
diff --git a/kjs/dtoa.cpp b/kjs/dtoa.cpp
index a941c1d8a..054450f12 100644
--- a/kjs/dtoa.cpp
+++ b/kjs/dtoa.cpp
@@ -169,22 +169,17 @@
* the result overflows to +-Infinity or underflows to 0.
*/
-// Put this before anything else that may import a definition of CONST. CONST from grammar.cpp conflicts with this.
-#ifdef KDE_USE_FINAL
-#undef CONST
-#endif
-
+#include "dtoa.h"
#include <config.h>
-#include "stdlib.h"
+#include "global.h"
-#ifdef WORDS_BIGENDIAN
-#define IEEE_MC68k
-#else
+// #if PLATFORM(BIG_ENDIAN)
+// #define IEEE_MC68k
+// #else
#define IEEE_8087
-#endif
+// #endif
#define INFNAN_CHECK
-#include "dtoa.h"
@@ -196,22 +191,19 @@ typedef unsigned Long ULong;
#endif
#ifdef DEBUG
-#include "stdio.h"
+#include <stdio.h>
#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);}
#endif
-#include "string.h"
+#include <stdlib.h>
+#include <string.h>
#ifdef USE_LOCALE
-#include "locale.h"
+#include <locale.h>
#endif
#ifdef MALLOC
-#ifdef KR_headers
-extern char *MALLOC();
-#else
extern void *MALLOC(size_t);
-#endif
#else
#define MALLOC malloc
#endif
@@ -233,7 +225,7 @@ static double private_mem[PRIVATE_mem], *pmem_next = private_mem;
#define IEEE_Arith
#endif
-#include "errno.h"
+#include <errno.h>
#ifdef Bad_float_h
@@ -260,25 +252,29 @@ static double private_mem[PRIVATE_mem], *pmem_next = private_mem;
#define DBL_MAX 1.7014118346046923e+38
#endif
+#ifndef LONG_MAX
+#define LONG_MAX 2147483647
+#endif
+
#else /* ifndef Bad_float_h */
-#include "float.h"
+#include <float.h>
#endif /* Bad_float_h */
#ifndef __MATH_H__
-#include "math.h"
+#include <math.h>
#endif
+#define strtod kjs_strtod
+#define dtoa kjs_dtoa
+#define freedtoa kjs_freedtoa
+
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef CONST
-#ifdef KR_headers
-#define CONST /* blank */
-#else
+// #ifndef CONST
#define CONST const
-#endif
-#endif
+// #endif
#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1
Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined.
@@ -286,37 +282,19 @@ Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined.
typedef union { double d; ULong L[2]; } U;
-#ifdef YES_ALIAS
-#define dval(x) x
+#define dval(x) (x).d
#ifdef IEEE_8087
-#define word0(x) ((ULong *)&x)[1]
-#define word1(x) ((ULong *)&x)[0]
+#define word0(x) (x).L[1]
+#define word1(x) (x).L[0]
#else
-#define word0(x) ((ULong *)&x)[0]
-#define word1(x) ((ULong *)&x)[1]
-#endif
-#else
-#ifdef IEEE_8087
-#define word0(x) ((U*)&x)->L[1]
-#define word1(x) ((U*)&x)->L[0]
-#else
-#define word0(x) ((U*)&x)->L[0]
-#define word1(x) ((U*)&x)->L[1]
-#endif
-#define dval(x) ((U*)&x)->d
+#define word0(x) (x).L[0]
+#define word1(x) (x).L[1]
#endif
/* The following definition of Storeinc is appropriate for MIPS processors.
* An alternative that might be better on some machines is
- * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff)
*/
-#if defined(IEEE_8087) + defined(VAX)
-#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \
-((unsigned short *)a)[0] = (unsigned short)c, a++)
-#else
-#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \
-((unsigned short *)a)[1] = (unsigned short)c, a++)
-#endif
+#define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff)
/* #define P DBL_MANT_DIG */
/* Ten_pmax = floor(P*log(2)/log(5)) */
@@ -440,11 +418,7 @@ typedef union { double d; ULong L[2]; } U;
#ifdef RND_PRODQUOT
#define rounded_product(a,b) a = rnd_prod(a, b)
#define rounded_quotient(a,b) a = rnd_quot(a, b)
-#ifdef KR_headers
-extern double rnd_prod(), rnd_quot();
-#else
extern double rnd_prod(double, double), rnd_quot(double, double);
-#endif
#else
#define rounded_product(a,b) a *= b
#define rounded_quotient(a,b) a /= b
@@ -457,11 +431,7 @@ extern double rnd_prod(double, double), rnd_quot(double, double);
#define Pack_32
#endif
-#ifdef KR_headers
-#define FFFFFFFF ((((unsigned long)0xffff)<<16)|(unsigned long)0xffff)
-#else
#define FFFFFFFF 0xffffffffUL
-#endif
#ifdef NO_LONG_LONG
#undef ULLong
@@ -502,11 +472,7 @@ Bigint {
static Bigint *
Balloc
-#ifdef KR_headers
- (k) int k;
-#else
(int k)
-#endif
{
int x;
Bigint *rv;
@@ -525,7 +491,7 @@ Balloc
#else
len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1)
/sizeof(double);
- if (pmem_next - private_mem + len <= PRIVATE_mem) {
+ if (pmem_next - private_mem + len <= (unsigned)PRIVATE_mem) {
rv = (Bigint*)pmem_next;
pmem_next += len;
}
@@ -542,11 +508,7 @@ Balloc
static void
Bfree
-#ifdef KR_headers
- (v) Bigint *v;
-#else
(Bigint *v)
-#endif
{
if (v) {
ACQUIRE_DTOA_LOCK(0);
@@ -561,11 +523,7 @@ y->wds*sizeof(Long) + 2*sizeof(int))
static Bigint *
multadd
-#ifdef KR_headers
- (b, m, a) Bigint *b; int m, a;
-#else
(Bigint *b, int m, int a) /* multiply by m and add a */
-#endif
{
int i, wds;
#ifdef ULLong
@@ -587,7 +545,7 @@ multadd
#ifdef ULLong
y = *x * (ULLong)m + carry;
carry = y >> 32;
- *x++ = y & FFFFFFFF;
+ *x++ = (ULong)y & FFFFFFFF;
#else
#ifdef Pack_32
xi = *x;
@@ -610,7 +568,7 @@ multadd
Bfree(b);
b = b1;
}
- b->x[wds++] = carry;
+ b->x[wds++] = (ULong)carry;
b->wds = wds;
}
return b;
@@ -618,11 +576,7 @@ multadd
static Bigint *
s2b
-#ifdef KR_headers
- (s, nd0, nd, y9) CONST char *s; int nd0, nd; ULong y9;
-#else
(CONST char *s, int nd0, int nd, ULong y9)
-#endif
{
Bigint *b;
int i, k;
@@ -656,11 +610,7 @@ s2b
static int
hi0bits
-#ifdef KR_headers
- (x) register ULong x;
-#else
(register ULong x)
-#endif
{
register int k = 0;
@@ -690,11 +640,7 @@ hi0bits
static int
lo0bits
-#ifdef KR_headers
- (y) ULong *y;
-#else
(ULong *y)
-#endif
{
register int k;
register ULong x = *y;
@@ -738,11 +684,7 @@ lo0bits
static Bigint *
i2b
-#ifdef KR_headers
- (i) int i;
-#else
(int i)
-#endif
{
Bigint *b;
@@ -754,11 +696,7 @@ i2b
static Bigint *
mult
-#ifdef KR_headers
- (a, b) Bigint *a, *b;
-#else
(Bigint *a, Bigint *b)
-#endif
{
Bigint *c;
int k, wa, wb, wc;
@@ -801,10 +739,10 @@ mult
do {
z = *x++ * (ULLong)y + *xc + carry;
carry = z >> 32;
- *xc++ = z & FFFFFFFF;
+ *xc++ = (ULong)z & FFFFFFFF;
}
while(x < xae);
- *xc = carry;
+ *xc = (ULong)carry;
}
}
#else
@@ -866,11 +804,7 @@ mult
static Bigint *
pow5mult
-#ifdef KR_headers
- (b, k) Bigint *b; int k;
-#else
(Bigint *b, int k)
-#endif
{
Bigint *b1, *p5, *p51;
int i;
@@ -923,11 +857,7 @@ pow5mult
static Bigint *
lshift
-#ifdef KR_headers
- (b, k) Bigint *b; int k;
-#else
(Bigint *b, int k)
-#endif
{
int i, k1, n, n1;
Bigint *b1;
@@ -983,11 +913,7 @@ lshift
static int
cmp
-#ifdef KR_headers
- (a, b) Bigint *a, *b;
-#else
(Bigint *a, Bigint *b)
-#endif
{
ULong *xa, *xa0, *xb, *xb0;
int i, j;
@@ -1017,11 +943,7 @@ cmp
static Bigint *
diff
-#ifdef KR_headers
- (a, b) Bigint *a, *b;
-#else
(Bigint *a, Bigint *b)
-#endif
{
Bigint *c;
int i, wa, wb;
@@ -1064,13 +986,13 @@ diff
do {
y = (ULLong)*xa++ - *xb++ - borrow;
borrow = y >> 32 & (ULong)1;
- *xc++ = y & FFFFFFFF;
+ *xc++ = (ULong)y & FFFFFFFF;
}
while(xb < xbe);
while(xa < xae) {
y = *xa++ - borrow;
borrow = y >> 32 & (ULong)1;
- *xc++ = y & FFFFFFFF;
+ *xc++ = (ULong)y & FFFFFFFF;
}
#else
#ifdef Pack_32
@@ -1111,15 +1033,12 @@ diff
static double
ulp
-#ifdef KR_headers
- (x) double x;
-#else
- (double x)
-#endif
+ (double dx)
{
register Long L;
- double a;
+ U x, a;
+ dval(x) = dx;
L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1;
#ifndef Avoid_Underflow
#ifndef Sudden_Underflow
@@ -1153,15 +1072,11 @@ ulp
static double
b2d
-#ifdef KR_headers
- (a, e) Bigint *a; int *e;
-#else
(Bigint *a, int *e)
-#endif
{
ULong *xa, *xa0, w, y, z;
int k;
- double d;
+ U d;
#ifdef VAX
ULong d0, d1;
#else
@@ -1223,12 +1138,9 @@ b2d
static Bigint *
d2b
-#ifdef KR_headers
- (d, e, bits) double d; int *e, *bits;
-#else
- (double d, int *e, int *bits)
-#endif
+ (double dd, int *e, int *bits)
{
+ U d;
Bigint *b;
int de, k;
ULong *x, y, z;
@@ -1237,6 +1149,9 @@ d2b
#endif
#ifdef VAX
ULong d0, d1;
+#endif
+ dval(d) = dd;
+#ifdef VAX
d0 = word0(d) >> 16 | word0(d) << 16;
d1 = word1(d) >> 16 | word1(d) << 16;
#else
@@ -1361,13 +1276,9 @@ d2b
static double
ratio
-#ifdef KR_headers
- (a, b) Bigint *a, *b;
-#else
(Bigint *a, Bigint *b)
-#endif
{
- double da, db;
+ U da, db;
int k, ka, kb;
dval(da) = b2d(a, &ka);
@@ -1453,11 +1364,7 @@ static CONST double tinytens[] = { 1e-16, 1e-32 };
static int
match
-#ifdef KR_headers
- (sp, t) char **sp, *t;
-#else
(CONST char **sp, CONST char *t)
-#endif
{
int c, d;
CONST char *s = *sp;
@@ -1475,11 +1382,7 @@ match
#ifndef No_Hex_NaN
static void
hexnan
-#ifdef KR_headers
- (rvp, sp) double *rvp; CONST char **sp;
-#else
- (double *rvp, CONST char **sp)
-#endif
+ (U *rvp, CONST char **sp)
{
ULong c, x[2];
CONST char *s;
@@ -1528,12 +1431,8 @@ hexnan
#endif /* INFNAN_CHECK */
double
-kjs_strtod
-#ifdef KR_headers
- (s00, se) CONST char *s00; char **se;
-#else
+strtod
(CONST char *s00, char **se)
-#endif
{
#ifdef Avoid_Underflow
int scale;
@@ -1541,7 +1440,8 @@ kjs_strtod
int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign,
e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
CONST char *s, *s0, *s1;
- double aadj, aadj1, adj, rv, rv0;
+ double aadj, aadj1, adj;
+ U aadj2, rv, rv0;
Long L;
ULong y, z;
Bigint *bb = NULL, *bb1 = NULL, *bd = NULL, *bd0 = NULL, *bs = NULL, *delta = NULL;
@@ -2302,7 +2202,9 @@ kjs_strtod
aadj = z;
aadj1 = dsign ? aadj : -aadj;
}
- word0(aadj1) += (2*P+1)*Exp_msk1 - y;
+ dval(aadj2) = aadj1;
+ word0(aadj2) += (2*P+1)*Exp_msk1 - y;
+ aadj1 = dval(aadj2);
}
adj = aadj1 * ulp(dval(rv));
dval(rv) += adj;
@@ -2419,11 +2321,7 @@ kjs_strtod
static int
quorem
-#ifdef KR_headers
- (b, S) Bigint *b, *S;
-#else
(Bigint *b, Bigint *S)
-#endif
{
int n;
ULong *bx, *bxe, q, *sx, *sxe;
@@ -2461,7 +2359,7 @@ quorem
carry = ys >> 32;
y = *bx - (ys & FFFFFFFF) - borrow;
borrow = y >> 32 & (ULong)1;
- *bx++ = y & FFFFFFFF;
+ *bx++ = (ULong)y & FFFFFFFF;
#else
#ifdef Pack_32
si = *sx++;
@@ -2502,7 +2400,7 @@ quorem
carry = ys >> 32;
y = *bx - (ys & FFFFFFFF) - borrow;
borrow = y >> 32 & (ULong)1;
- *bx++ = y & FFFFFFFF;
+ *bx++ = (ULong)y & FFFFFFFF;
#else
#ifdef Pack_32
si = *sx++;
@@ -2540,11 +2438,7 @@ quorem
#endif
static char *
-#ifdef KR_headers
-rv_alloc(i) int i;
-#else
rv_alloc(int i)
-#endif
{
int j, k, *r;
@@ -2563,11 +2457,7 @@ rv_alloc(int i)
}
static char *
-#ifdef KR_headers
-nrv_alloc(s, rve, n) char *s, **rve; int n;
-#else
nrv_alloc(CONST char *s, char **rve, int n)
-#endif
{
char *rv, *t;
@@ -2585,11 +2475,7 @@ nrv_alloc(CONST char *s, char **rve, int n)
*/
void
-#ifdef KR_headers
-kjs_freedtoa(s) char *s;
-#else
-kjs_freedtoa(char *s)
-#endif
+freedtoa(char *s)
{
Bigint *b = (Bigint *)((int *)s - 1);
b->maxwds = 1 << (b->k = *(int*)b);
@@ -2635,13 +2521,8 @@ kjs_freedtoa(char *s)
*/
char *
-kjs_dtoa
-#ifdef KR_headers
- (d, mode, ndigits, decpt, sign, rve)
- double d; int mode, ndigits, *decpt, *sign; char **rve;
-#else
- (double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
-#endif
+dtoa
+ (double dd, int mode, int ndigits, int *decpt, int *sign, char **rve)
{
/* Arguments ndigits, decpt, sign are similar to those
of ecvt and fcvt; trailing zeros are suppressed from
@@ -2686,7 +2567,8 @@ kjs_dtoa
ULong x;
#endif
Bigint *b, *b1, *delta, *mlo = NULL, *mhi, *S;
- double d2, ds, eps;
+ U d, d2, eps;
+ double ds;
char *s, *s0;
#ifdef Honor_FLT_ROUNDS
int rounding;
@@ -2697,11 +2579,12 @@ kjs_dtoa
#ifndef MULTIPLE_THREADS
if (dtoa_result) {
- kjs_freedtoa(dtoa_result);
+ freedtoa(dtoa_result);
dtoa_result = 0;
}
#endif
+ dval(d) = dd;
if (word0(d) & Sign_bit) {
/* set sign for everything, including 0's and NaNs */
*sign = 1;
@@ -2966,7 +2849,8 @@ kjs_dtoa
if (dval(d) > 0.5 + dval(eps))
goto bump_up;
else if (dval(d) < 0.5 - dval(eps)) {
- while(*--s == '0');
+ while(*--s == '0')
+ ;
s++;
goto ret1;
}
@@ -3285,7 +3169,8 @@ kjs_dtoa
#ifdef Honor_FLT_ROUNDS
trimzeros:
#endif
- while(*--s == '0');
+ while(*--s == '0')
+ ;
s++;
}
ret:
diff --git a/kmdi/Makefile.am b/kmdi/Makefile.am
index 9eb6d8e71..4bad40aaf 100644
--- a/kmdi/Makefile.am
+++ b/kmdi/Makefile.am
@@ -4,7 +4,7 @@ INCLUDES = -I$(top_srcdir)/kmdi/res -I$(top_srcdir)/kutils -I$(top_srcdir) -I$(t
lib_LTLIBRARIES = libkmdi.la
libkmdi_la_LDFLAGS = $(all_libraries) -version-info 1:0
-libkmdi_la_LIBADD = $(LIB_KPARTS) $(top_builddir)/kutils/libkutils.la
+libkmdi_la_LIBADD = $(LIB_KPARTS) $(top_builddir)/kutils/libkutils.la $(LIB_KDEUI) $(LIB_QT) $(LIB_KDECORE) $(LIB_X11)
libkmdi_la_SOURCES = kmdichildarea.cpp kmdichildfrm.cpp kmdichildfrmcaption.cpp \
kmdichildview.cpp kmdimainfrm.cpp kmditaskbar.cpp kmdidockcontainer.cpp \
diff --git a/kmdi/kmdi/Makefile.am b/kmdi/kmdi/Makefile.am
index 494d5866a..7ca3c5a89 100644
--- a/kmdi/kmdi/Makefile.am
+++ b/kmdi/kmdi/Makefile.am
@@ -2,7 +2,7 @@ INCLUDES = -I$(top_srcdir)/kutils -I$(top_srcdir) -I$(top_srcdir)/kmdi $(all_inc
lib_LTLIBRARIES = libkmdi2.la
libkmdi2_la_LDFLAGS = $(all_libraries) -version-info 1:0
-libkmdi2_la_LIBADD = $(LIB_KPARTS) $(top_builddir)/kutils/libkutils.la
+libkmdi2_la_LIBADD = $(LIB_KPARTS) $(top_builddir)/kutils/libkutils.la $(LIB_KDEUI) $(LIB_QT) $(LIB_KDECORE)
libkmdi2_la_SOURCES = mainwindow.cpp dockcontainer.cpp toolviewaccessor.cpp guiclient.cpp tabwidget.cpp
diff --git a/knewstuff/Makefile.am b/knewstuff/Makefile.am
index c3d4605f7..0de5aff1a 100644
--- a/knewstuff/Makefile.am
+++ b/knewstuff/Makefile.am
@@ -5,7 +5,7 @@ METASOURCES = AUTO
lib_LTLIBRARIES = libknewstuff.la
libknewstuff_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -version-info 1:0
-libknewstuff_la_LIBADD = $(LIB_KIO)
+libknewstuff_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI)
libknewstuff_la_SOURCES = engine.cpp entry.cpp downloaddialog.cpp \
uploaddialog.cpp providerdialog.cpp provider.cpp knewstuff.cpp \
knewstuffgeneric.cpp knewstuffbutton.cpp knewstuffsecure.cpp security.cpp
diff --git a/kparts/Makefile.am b/kparts/Makefile.am
index 35c2bc913..2acbcbcd1 100644
--- a/kparts/Makefile.am
+++ b/kparts/Makefile.am
@@ -5,7 +5,7 @@ AM_LDFLAGS = $(LDFLAGS_AS_NEEDED)
INCLUDES= -I$(srcdir)/../ -I$(top_srcdir)/kio/ -I$(top_srcdir)/libltdl \
-I$(top_srcdir)/kfile $(all_includes)
libkparts_la_LDFLAGS = $(KDE_MT_LDFLAGS) -version-info 3:0:1 -no-undefined
-libkparts_la_LIBADD = $(LIB_KIO)
+libkparts_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_KDEUI) $(LIB_KDECORE) $(top_builddir)/dcop/libDCOP.la
check-local:
(cd tests && $(MAKE) check )
diff --git a/kresources/Makefile.am b/kresources/Makefile.am
index c30d108a7..147dd972e 100644
--- a/kresources/Makefile.am
+++ b/kresources/Makefile.am
@@ -15,7 +15,7 @@ libkresources_la_SOURCES = resource.cpp \
configpage.cpp
libkresources_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 3:0:2
-libkresources_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO)
+libkresources_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_KDECORE)
kresincludedir = $(includedir)/kresources
kresinclude_HEADERS = resource.h \
@@ -32,7 +32,7 @@ kde_module_LTLIBRARIES = kcm_kresources.la
kcm_kresources_la_SOURCES = kcmkresources.cpp
kcm_kresources_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
-kcm_kresources_la_LIBADD = libkresources.la
+kcm_kresources_la_LIBADD = libkresources.la $(LIB_QT) $(LIB_KDEUI) $(LIB_KDECORE)
check_PROGRAMS = testresources
diff --git a/kspell2/Makefile.am b/kspell2/Makefile.am
index 18b03daed..a3ef1b807 100644
--- a/kspell2/Makefile.am
+++ b/kspell2/Makefile.am
@@ -17,7 +17,6 @@ libkspell2base_la_SOURCES = settings.cpp broker.cpp \
defaultdictionary.cpp
libkspell2base_la_LDFLAGS = -no-undefined $(all_libraries)
-libkspell2base_la_LIBADD = $(LIB_KPARTS) ../kutils/libkutils.la
servicetype_DATA = kspellclient.desktop
servicetypedir = $(kde_servicetypesdir)
diff --git a/kspell2/plugins/aspell/Makefile.am b/kspell2/plugins/aspell/Makefile.am
index 69f560ec1..dca63b51d 100644
--- a/kspell2/plugins/aspell/Makefile.am
+++ b/kspell2/plugins/aspell/Makefile.am
@@ -11,7 +11,7 @@ kde_module_LTLIBRARIES = kspell_aspell.la
kspell_aspell_la_SOURCES = kspell_aspellclient.cpp kspell_aspelldict.cpp
kspell_aspell_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN)
-kspell_aspell_la_LIBADD = ../../ui/libkspell2.la -laspell
+kspell_aspell_la_LIBADD = ../../ui/libkspell2.la -laspell $(LIB_QT) $(LIB_KDECORE)
service_DATA = kspell_aspell.desktop
servicedir = $(kde_servicesdir)
diff --git a/kspell2/plugins/hspell/Makefile.am b/kspell2/plugins/hspell/Makefile.am
index 8f9b4e982..e45ae1aae 100644
--- a/kspell2/plugins/hspell/Makefile.am
+++ b/kspell2/plugins/hspell/Makefile.am
@@ -11,7 +11,7 @@ kde_module_LTLIBRARIES = kspell_hspell.la
kspell_hspell_la_SOURCES = kspell_hspellclient.cpp kspell_hspelldict.cpp
kspell_hspell_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN)
-kspell_hspell_la_LIBADD = ../../ui/libkspell2.la -lhspell -lz
+kspell_hspell_la_LIBADD = ../../ui/libkspell2.la -lhspell -lz $(LIB_QT) $(LIB_KDECORE)
service_DATA = kspell_hspell.desktop
servicedir = $(kde_servicesdir)
diff --git a/kspell2/plugins/ispell/Makefile.am b/kspell2/plugins/ispell/Makefile.am
index b74f48753..6bbaab94a 100644
--- a/kspell2/plugins/ispell/Makefile.am
+++ b/kspell2/plugins/ispell/Makefile.am
@@ -18,7 +18,7 @@ kspell_ispell_la_SOURCES = kspell_ispellclient.cpp kspell_ispelldict.cpp \
ispell_checker.cpp
kspell_ispell_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN)
-kspell_ispell_la_LIBADD = ../../ui/libkspell2.la
+kspell_ispell_la_LIBADD = ../../ui/libkspell2.la $(LIB_QT) $(LIB_KDECORE)
service_DATA = kspell_ispell.desktop
servicedir = $(kde_servicesdir)
diff --git a/kspell2/tests/Makefile.am b/kspell2/tests/Makefile.am
index 88a0d03b6..7ab5943d3 100644
--- a/kspell2/tests/Makefile.am
+++ b/kspell2/tests/Makefile.am
@@ -18,7 +18,7 @@ test_dialog_SOURCES = test_dialog.cpp
test_dialog_LDADD = ../ui/libkspell2.la $(LIB_KDECORE)
test_highlighter_SOURCES = test_highlighter.cpp
-test_highlighter_LDADD = ../ui/libkspell2_noinst.la ../libkspell2base.la $(LIB_KDECORE)
+test_highlighter_LDADD = ../ui/libkspell2_noinst.la ../libkspell2base.la $(LIB_KDECORE) $(LIB_KPARTS) ../../kutils/libkutils.la
test_configdialog_SOURCES = test_configdialog.cpp
-test_configdialog_LDADD = ../ui/libkspell2_noinst.la ../libkspell2base.la $(LIB_KDECORE)
+test_configdialog_LDADD = ../ui/libkspell2_noinst.la ../libkspell2base.la $(LIB_KDECORE) $(LIB_KPARTS) ../../kutils/libkutils.la
diff --git a/kspell2/ui/Makefile.am b/kspell2/ui/Makefile.am
index e5995a0aa..4fa9a4cf3 100644
--- a/kspell2/ui/Makefile.am
+++ b/kspell2/ui/Makefile.am
@@ -18,4 +18,4 @@ dialog.lo: kspell2ui.h
libkspell2_la_SOURCES = dialog.cpp
libkspell2_la_LDFLAGS = -no-undefined -version-info 1:0:0 $(all_libraries)
-libkspell2_la_LIBADD = libkspell2_noinst.la ../libkspell2base.la
+libkspell2_la_LIBADD = libkspell2_noinst.la ../libkspell2base.la ../../kutils/libkutils.la $(LIB_QT) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_KFILE)
diff --git a/kstyles/highcolor/Makefile.am b/kstyles/highcolor/Makefile.am
index a86199cce..76146112e 100644
--- a/kstyles/highcolor/Makefile.am
+++ b/kstyles/highcolor/Makefile.am
@@ -24,6 +24,6 @@ INCLUDES = -I$(top_srcdir)/kdefx $(all_includes)
noinst_HEADERS = highcolor.h bitmaps.h
kde_style_LTLIBRARIES = highcolor.la
highcolor_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
-highcolor_la_LIBADD = ../../kdefx/libkdefx.la
+highcolor_la_LIBADD = ../../kdefx/libkdefx.la $(LIB_QT)
highcolor_la_SOURCES = highcolor.cpp
highcolor_la_METASOURCES = AUTO
diff --git a/kstyles/highcontrast/Makefile.am b/kstyles/highcontrast/Makefile.am
index 9157e3488..af54fd949 100644
--- a/kstyles/highcontrast/Makefile.am
+++ b/kstyles/highcontrast/Makefile.am
@@ -35,7 +35,7 @@ noinst_HEADERS = highcontrast.h
kde_style_LTLIBRARIES = highcontrast.la
highcontrast_la_SOURCES = highcontrast.cpp
highcontrast_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
-highcontrast_la_LIBADD = ../../kdefx/libkdefx.la
+highcontrast_la_LIBADD = ../../kdefx/libkdefx.la $(LIB_QT)
highcontrast_la_METASOURCES = AUTO
DISTCLEANFILES = $(highcontrast_la_METASOURCES)
diff --git a/kstyles/highcontrast/config/Makefile.am b/kstyles/highcontrast/config/Makefile.am
index 23f9c6a81..e94d5a46c 100644
--- a/kstyles/highcontrast/config/Makefile.am
+++ b/kstyles/highcontrast/config/Makefile.am
@@ -3,7 +3,7 @@ INCLUDES = $(all_includes)
noinst_HEADERS = highcontrastconfig.h
kde_module_LTLIBRARIES = kstyle_highcontrast_config.la
kstyle_highcontrast_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
-kstyle_highcontrast_config_la_LIBADD = $(LIB_KDEUI)
+kstyle_highcontrast_config_la_LIBADD = $(LIB_QT) $(LIB_KDECORE)
kstyle_highcontrast_config_la_SOURCES = highcontrastconfig.cpp
kstyle_highcontrast_config_la_METASOURCES = AUTO
diff --git a/kstyles/keramik/Makefile.am b/kstyles/keramik/Makefile.am
index a649c4eb7..39482a8e0 100644
--- a/kstyles/keramik/Makefile.am
+++ b/kstyles/keramik/Makefile.am
@@ -6,7 +6,7 @@ KDE_CXXFLAGS = -UQT_NO_ASCII_CAST
noinst_HEADERS = keramik.h pixmaploader.h keramikimage.h bitmaps.h gradients.h colorutil.h
kde_style_LTLIBRARIES = keramik.la
keramik_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
-keramik_la_LIBADD = ../../kdefx/libkdefx.la
+keramik_la_LIBADD = ../../kdefx/libkdefx.la $(LIB_QT) $(LIB_XEXT)
keramik_la_SOURCES = keramik.cpp pixmaploader.cpp gradients.cpp colorutil.cpp
keramik_la_COMPILE_FIRST = keramikrc.h
keramik_la_METASOURCES = AUTO
diff --git a/kstyles/kthemestyle/Makefile.am b/kstyles/kthemestyle/Makefile.am
index 0edb271b4..ccf9ad336 100644
--- a/kstyles/kthemestyle/Makefile.am
+++ b/kstyles/kthemestyle/Makefile.am
@@ -24,6 +24,6 @@ INCLUDES = -I$(top_srcdir)/kdefx $(all_includes)
noinst_HEADERS = kthemestyle.h kthemebase.h kstyledirs.h
kde_style_LTLIBRARIES = kthemestyle.la
kthemestyle_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
-kthemestyle_la_LIBADD = ../../kdefx/libkdefx.la ../../kdecore/libkdecore.la
+kthemestyle_la_LIBADD = ../../kdefx/libkdefx.la ../../kdecore/libkdecore.la -ldl $(LIB_QT)
kthemestyle_la_SOURCES = kthemebase.cpp kthemestyle.cpp kstyledirs.cpp
kthemestyle_la_METASOURCES = AUTO
diff --git a/kstyles/plastik/Makefile.am b/kstyles/plastik/Makefile.am
index 5b57c7681..e74be711d 100644
--- a/kstyles/plastik/Makefile.am
+++ b/kstyles/plastik/Makefile.am
@@ -16,7 +16,7 @@ noinst_HEADERS = plastik.h misc.h
kde_style_LTLIBRARIES = plastik.la
plastik_la_SOURCES = plastik.cpp misc.cpp
plastik_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
-plastik_la_LIBADD = ../../kdefx/libkdefx.la
+plastik_la_LIBADD = ../../kdefx/libkdefx.la $(LIB_QT)
plastik_la_METASOURCES = AUTO
DISTCLEANFILES = $(plastik_la_METASOURCES)
diff --git a/kstyles/plastik/config/Makefile.am b/kstyles/plastik/config/Makefile.am
index a3b081ead..aeae1c5e5 100644
--- a/kstyles/plastik/config/Makefile.am
+++ b/kstyles/plastik/config/Makefile.am
@@ -3,7 +3,7 @@ INCLUDES = $(all_includes)
noinst_HEADERS = plastikconf.h
kde_module_LTLIBRARIES = kstyle_plastik_config.la
kstyle_plastik_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
-kstyle_plastik_config_la_LIBADD = $(LIB_KDEUI)
+kstyle_plastik_config_la_LIBADD = $(LIB_KDEUI) $(LIB_QT) $(LIB_KDECORE)
kstyle_plastik_config_la_SOURCES = plastikconf.cpp
kstyle_plastik_config_la_METASOURCES = AUTO
diff --git a/kstyles/utils/installtheme/Makefile.am b/kstyles/utils/installtheme/Makefile.am
index ff222bad0..a07905013 100644
--- a/kstyles/utils/installtheme/Makefile.am
+++ b/kstyles/utils/installtheme/Makefile.am
@@ -14,5 +14,5 @@ kinstalltheme_LDFLAGS = $(all_libraries) $(KDE_RPATH)
# the libraries to link against. Be aware of the order. First the libraries,
# that depend on the following ones.
-kinstalltheme_LDADD = $(LIB_KDEUI)
+kinstalltheme_LDADD = $(LIB_QT) $(LIB_KDECORE)
diff --git a/kunittest/Makefile.am b/kunittest/Makefile.am
index 4f8ebebc1..09ab8cb90 100644
--- a/kunittest/Makefile.am
+++ b/kunittest/Makefile.am
@@ -4,7 +4,7 @@ METASOURCES = AUTO
lib_LTLIBRARIES = libkunittest.la
libkunittest_la_SOURCES = runner.cpp tester.cpp
libkunittest_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -version-info 1:0:0
-libkunittest_la_LIBADD = $(LIB_KDECORE)
+libkunittest_la_LIBADD = $(LIB_KDECORE) $(LIB_QT)
libkunittestinclude_HEADERS = runner.h tester.h module.h
libkunittestincludedir = $(includedir)/kunittest
diff --git a/kutils/Makefile.am b/kutils/Makefile.am
index 2206d798f..4ddda0d83 100644
--- a/kutils/Makefile.am
+++ b/kutils/Makefile.am
@@ -4,7 +4,7 @@ INCLUDES = -I$(top_srcdir)/interfaces/kregexpeditor $(all_includes)
lib_LTLIBRARIES = libkutils.la
libkutils_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 3:0:2
# Needs KTrader
-libkutils_la_LIBADD = ../kio/libkio.la ksettings/libksettings.la
+libkutils_la_LIBADD = ../kio/libkio.la ksettings/libksettings.la $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_X11)
libkutils_la_SOURCES = kfind.cpp kfinddialog.cpp kreplace.cpp \
kreplacedialog.cpp kcmoduleinfo.cpp kcmoduleloader.cpp \
diff --git a/kutils/kcmoduleinfo.cpp b/kutils/kcmoduleinfo.cpp
index ababaadba..2de4142d4 100644
--- a/kutils/kcmoduleinfo.cpp
+++ b/kutils/kcmoduleinfo.cpp
@@ -53,7 +53,9 @@ KCModuleInfo::KCModuleInfo()
KCModuleInfo::KCModuleInfo(const QString& desktopFile)
{
- init( KService::serviceByStorageId(desktopFile) );
+ KService::Ptr service = KService::serviceByStorageId(desktopFile);
+ if(!service) setName(desktopFile);
+ init(service);
}
KCModuleInfo::KCModuleInfo( KService::Ptr moduleInfo )
diff --git a/kutils/kcmoduleloader.cpp b/kutils/kcmoduleloader.cpp
index 24a5fa8b3..0cc06d25f 100644
--- a/kutils/kcmoduleloader.cpp
+++ b/kutils/kcmoduleloader.cpp
@@ -128,9 +128,23 @@ KCModule* KCModuleLoader::loadModule(const KCModuleInfo &mod, ErrorReporting rep
if ( !mod.service() )
{
- return reportError( report,
- i18n("The module %1 could not be found.")
- .arg( mod.moduleName() ), i18n("<qt><p>The diagnostics is:<br>The desktop file %1 could not be found.</qt>").arg(mod.fileName()), parent );
+ if ( mod.moduleName() == "kcmlisa" || mod.moduleName() == "kcmkiolan" )
+ {
+ return reportError( report,
+ i18n("The module %1 could not be found.")
+ .arg( mod.moduleName() ),
+ i18n("<qt><p>The Lisa and lan:/ ioslave modules "
+ "are not installed by default in Kubuntu, because they are obsolete "
+ "and replaced by zeroconf.<br> If you still wish to use them, you "
+ "should install the lisa package from the Universe repository.</p></qt>"),
+ parent );
+ } else {
+ return reportError( report,
+ i18n("The module %1 could not be found.")
+ .arg( mod.moduleName() ),
+ i18n("<qt><p>The diagnostics is:<br>The desktop file %1 could not be found.</p></qt>").arg(mod.fileName()),
+ parent );
+ }
}
if (!mod.library().isEmpty())
diff --git a/kwallet/client/Makefile.am b/kwallet/client/Makefile.am
index 7158aae31..2aba4cb8d 100644
--- a/kwallet/client/Makefile.am
+++ b/kwallet/client/Makefile.am
@@ -4,7 +4,7 @@ INCLUDES= -I$(srcdir) $(all_includes)
lib_LTLIBRARIES = libkwalletclient.la
libkwalletclient_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:1 -no-undefined
-libkwalletclient_la_LIBADD = $(LIB_KDECORE)
+libkwalletclient_la_LIBADD = $(LIB_KDECORE) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la
libkwalletclient_la_SOURCES = kwallet.skel \
kwallet.cc
diff --git a/libkmid/Makefile.am b/libkmid/Makefile.am
index 5d64b0fcf..8db9d5369 100644
--- a/libkmid/Makefile.am
+++ b/libkmid/Makefile.am
@@ -18,7 +18,7 @@ libkmid_la_SOURCES = midiout.cc player.cc track.cc midimapper.cc \
libkmid.cc
libkmid_la_LDFLAGS = $(KDE_MT_LDFLAGS) -version-info 0:95 -no-undefined
-libkmid_la_LIBADD = $(LIBASOUND) ../kdecore/libkdecore.la
+libkmid_la_LIBADD = $(LIBASOUND) ../kdecore/libkdecore.la $(LIB_QT)
DOXYGEN_REFERENCES = kdecore
include ../admin/Doxyfile.am
diff --git a/libkmid/fmout.cc b/libkmid/fmout.cc
index c4af93dcd..bce421f81 100644
--- a/libkmid/fmout.cc
+++ b/libkmid/fmout.cc
@@ -127,8 +127,8 @@ void FMOut::initDev (void)
void FMOut::loadFMPatches(void)
{
#ifdef HAVE_OSS_SUPPORT
- char patchesfile[PATH_MAX];
- char drumsfile[PATH_MAX];
+ char patchesfile[strlen(FMPatchesDirectory)+7+1];
+ char drumsfile[strlen(FMPatchesDirectory)+9+1];
int size;
struct sbi_instrument instr;
char tmp[60];
@@ -141,12 +141,12 @@ void FMOut::loadFMPatches(void)
if (opl==3)
{
- snprintf(patchesfile, PATH_MAX, "%s/std.o3",FMPatchesDirectory);
+ snprintf(patchesfile, sizeof(patchesfile), "%s/std.o3",FMPatchesDirectory);
size=60;
}
else
{
- snprintf(patchesfile, PATH_MAX, "%s/std.sb",FMPatchesDirectory);
+ snprintf(patchesfile, sizeof(patchesfile), "%s/std.sb",FMPatchesDirectory);
size=52;
}
fh=fopen(patchesfile,"rb");
@@ -171,11 +171,11 @@ void FMOut::loadFMPatches(void)
if (opl==3)
{
- snprintf(drumsfile, PATH_MAX, "%s/drums.o3",FMPatchesDirectory);
+ snprintf(drumsfile, sizeof(drumsfile), "%s/drums.o3",FMPatchesDirectory);
}
else
{
- snprintf(drumsfile, PATH_MAX, "%s/drums.sb",FMPatchesDirectory);
+ snprintf(drumsfile, sizeof(drumsfile), "%s/drums.sb",FMPatchesDirectory);
}
fh=fopen(drumsfile,"rb");
diff --git a/libkscreensaver/Makefile.am b/libkscreensaver/Makefile.am
index b0cff55ab..b3b314748 100644
--- a/libkscreensaver/Makefile.am
+++ b/libkscreensaver/Makefile.am
@@ -1,6 +1,6 @@
lib_LTLIBRARIES = libkscreensaver.la
libkscreensaver_la_SOURCES = main.cpp kscreensaver.cpp
-libkscreensaver_la_LIBADD = $(LIB_KIO)
+libkscreensaver_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_X11)
if undefined_symbols_allowed
libkscreensaver_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -version-info 6:0:2
else
diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c
index a1a09180c..d3577a709 100644
--- a/libltdl/ltdl.c
+++ b/libltdl/ltdl.c
@@ -184,6 +184,7 @@ struct lt_dlhandle_struct {
#define LT_DLSTRERROR(name) lt_dlerror_strings[LT_CONC(LT_ERROR_,name)]
static const char objdir[] = LTDL_OBJDIR;
+#define LTDL_SHLIB_EXT ".so"
#ifdef LTDL_SHLIB_EXT
static const char shlib_ext[] = LTDL_SHLIB_EXT;
#endif
diff --git a/mimetypes/application/Makefile.am b/mimetypes/application/Makefile.am
index 08e10ed79..543394b01 100644
--- a/mimetypes/application/Makefile.am
+++ b/mimetypes/application/Makefile.am
@@ -67,7 +67,25 @@ mimetypeapplicationdata_DATA = x-dvi.desktop x-gzdvi.desktop x-bz2dvi.desktop \
x-java-jnlp-file.desktop xml-dtd.desktop fits.desktop \
x-rar-compressed.desktop \
x-sqlite2.desktop x-sqlite3.desktop chm.desktop \
- x-mplayer2.desktop
+ x-mplayer2.desktop \
+ x-nzb.desktop \
+ vnd.openxmlformats-officedocument.wordprocessingml.document.desktop \
+ vnd.openxmlformats-officedocument.wordprocessingml.template.desktop \
+ vnd.ms-word.document.macroEnabled.12.desktop \
+ vnd.ms-word.template.macroEnabled.12.desktop \
+ vnd.openxmlformats-officedocument.spreadsheetml.sheet.desktop \
+ vnd.openxmlformats-officedocument.spreadsheetml.template.desktop \
+ vnd.ms-excel.sheet.macroEnabled.12.desktop \
+ vnd.ms-excel.template.macroEnabled.12.desktop \
+ vnd.ms-excel.addin.macroEnabled.12.desktop \
+ vnd.ms-excel.sheet.binary.macroEnabled.12.desktop \
+ vnd.openxmlformats-officedocument.presentationml.presentation.desktop \
+ vnd.openxmlformats-officedocument.presentationml.template.desktop \
+ vnd.openxmlformats-officedocument.presentationml.slideshow.desktop \
+ vnd.ms-powerpoint.addin.macroEnabled.12.desktop \
+ vnd.ms-powerpoint.presentation.macroEnabled.12.desktop \
+ vnd.ms-powerpoint.template.macroEnabled.12.desktop \
+ vnd.ms-powerpoint.slideshow.macroEnabled.12.desktop
mimetypeapplicationdatadir = $(kde_mimedir)/application
diff --git a/mimetypes/application/vnd.ms-access.desktop b/mimetypes/application/vnd.ms-access.desktop
new file mode 100644
index 000000000..bf0ad78cb
--- /dev/null
+++ b/mimetypes/application/vnd.ms-access.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.ms-access
+Icon=database
+Comment=Microsoft Access Database
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.mdb
+
diff --git a/mimetypes/application/vnd.ms-excel.addin.macroEnabled.12.desktop b/mimetypes/application/vnd.ms-excel.addin.macroEnabled.12.desktop
new file mode 100644
index 000000000..90b88228b
--- /dev/null
+++ b/mimetypes/application/vnd.ms-excel.addin.macroEnabled.12.desktop
@@ -0,0 +1,89 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.ms-excel.addin.macroEnabled.12
+Patterns=*.xlam;*.XLAM
+Icon=spreadsheet
+Comment=Microsoft Excel Spreadsheet Add-In Macro Enabled
+Comment[af]=Microsoft Excel Spreiblad
+Comment[ar]=ورقة عمل مايكروسوفت اكسل
+Comment[az]=Microsoft Excel Sənədi
+Comment[be]=Разліковы аркуш Microsoft Excel
+Comment[bg]=Документ на Microsoft Excel
+Comment[bn]=মাইক্রোসফট এক্সসেল নথী
+Comment[br]=Loger Microsoft Excel
+Comment[bs]=Microsoft Excel proračunska tablica
+Comment[ca]=Full de càlcul de Microsoft Excel
+Comment[cs]=Tabulka programu Microsoft Excel
+Comment[csb]=Bòga Microsoft Excela
+Comment[cy]=Taenlen Microsoft Excel
+Comment[da]=Microsoft Excel-regneark
+Comment[de]=MS-Excel-Arbeitsblatt
+Comment[el]=Φύλλο εργασίας Microsoft Excel
+Comment[eo]=Mikrosoft-Excel-dokumento
+Comment[es]=Hoja de cálculo de Microsoft Excel
+Comment[et]=Microsoft Exceli tabel
+Comment[eu]=Microsoft Excel kalkulu-orria
+Comment[fa]=صفحۀ گستردۀ میکروسافت اکسل
+Comment[fi]=Microsoft Excel -taulukko
+Comment[fr]=Feuille de calcul Microsoft Excel
+Comment[fy]=Microsoft Excel-Rekkenboerd
+Comment[ga]=Scarbhileog Microsoft Excel
+Comment[gl]=Folla de cálculo Microsoft Excel
+Comment[he]=גיליון אלקטרוני של Microsoft Excel
+Comment[hi]=माइक्रोसॉफ्ट एक्सेल स्प्रेडशीट
+Comment[hr]=Microsoft Excel proračunska tablica
+Comment[hu]=Microsoft Excel dokumentum
+Comment[id]=Lembar Kerja Microsoft Excel
+Comment[is]=Microsoft Excel tafla
+Comment[it]=Foglio di calcolo Microsoft Excel
+Comment[ja]=Microsoft Excel スプレッドシート
+Comment[ka]=Microsoft Excel–ის ცხრილი
+Comment[kk]=Microsoft Excel эл.кестесі
+Comment[km]=សៀវភៅ​បញ្ជី Microsoft Excel
+Comment[ko]=마이크로소프트 엑셀 스프레드시트
+Comment[lb]=Microsoft-Excel-Tabellëblat
+Comment[lt]=Microsoft Excel elektroninė lentelė
+Comment[lv]=Microsoft Excel izklājlapa
+Comment[mk]=Microsoft Excel-табеларна пресметка
+Comment[mn]=MS-Excel-Хүснэгт
+Comment[ms]=Hamparan helaian Microsoft Excel
+Comment[mt]=Spreadsheet Microsoft Excel
+Comment[nb]=Microsoft Excel-regneark
+Comment[nds]="Microsoft Excel"-Arbeitblatt
+Comment[ne]=माइक्रोसफ्ट एक्सेल स्प्रेडसिट
+Comment[nl]=Microsoft Excel-spreadsheet
+Comment[nn]=Microsoft Excel-rekneark
+Comment[nso]=Letlakala la Phatlalatso la Bokgoni bja Microsoft
+Comment[pa]=Microsoft Excel ਸਾਰਣੀਕਾਰ
+Comment[pl]=Arkusz Microsoft Excela
+Comment[pt]=Folha de cálculo do Microsoft Excel
+Comment[pt_BR]=Planilha do Microsoft Excel
+Comment[ro]=Foaie de calcul tabelar Microsoft Excel
+Comment[ru]=Таблица Microsoft Excel
+Comment[rw]=Urupapurorusesuye Microsoft Excel
+Comment[se]=Microsoft Excel-tabealla
+Comment[sk]=Dokument Microsoft Excel
+Comment[sl]=Preglednica za Microsoft Excel
+Comment[sq]=Tabak nga Microsoft Excel
+Comment[sr]=Унакрсна табела Microsoft-овог Excel-а
+Comment[sr@Latn]=Unakrsna tabela Microsoft-ovog Excel-a
+Comment[sv]=Microsoft Excel-kalkylark
+Comment[ta]=மைக்ரோசாப்ட் எக்செல் விரிதாள்
+Comment[te]=మైక్రొసాఫ్ట్ ఎక్సెల్ స్ప్రెడ్ షీట్
+Comment[tg]=Ҷадвалҳои электронӣ Microsoft Excel
+Comment[th]=ตารางคำนวณไมโครซอฟต์เอ็กเซล
+Comment[tr]=Microsoft Excel Hesap Çizelgesi
+Comment[tt]=Microsoft Excel İsäpcäymäse
+Comment[uk]=Таблиця MS Excel
+Comment[uz]=Microsoft Excel elektron jadvali
+Comment[uz@cyrillic]=Microsoft Excel электрон жадвали
+Comment[ven]=Bammbiri lo navhaho la microsoft Excel
+Comment[vi]=Bảng tính Excel của Microsoft™.
+Comment[wa]=Fitchî tåvleu Microsoft Excel
+Comment[zh_CN]=Microsoft Excel 电子表格
+Comment[zh_HK]=微軟 Excel 表格
+Comment[zh_TW]=微軟 Excel 表格
+Comment[zu]= Ipheshana lesitayela le-Microsoft Excel
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.xls
diff --git a/mimetypes/application/vnd.ms-excel.desktop b/mimetypes/application/vnd.ms-excel.desktop
index 572d64d5c..d3ff696d9 100644
--- a/mimetypes/application/vnd.ms-excel.desktop
+++ b/mimetypes/application/vnd.ms-excel.desktop
@@ -1,6 +1,7 @@
[Desktop Entry]
Type=MimeType
MimeType=application/vnd.ms-excel
+Patterns=*.xls;*.XLS
Icon=spreadsheet
Comment=Microsoft Excel Spreadsheet
Comment[af]=Microsoft Excel Spreiblad
diff --git a/mimetypes/application/vnd.ms-excel.sheet.binary.macroEnabled.12.desktop b/mimetypes/application/vnd.ms-excel.sheet.binary.macroEnabled.12.desktop
new file mode 100644
index 000000000..e65650240
--- /dev/null
+++ b/mimetypes/application/vnd.ms-excel.sheet.binary.macroEnabled.12.desktop
@@ -0,0 +1,89 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.ms-excel.sheet.binary.macroEnabled.12
+Patterns=*.xlsb;*.XLSB
+Icon=spreadsheet
+Comment=Microsoft Excel Spreadsheet Macro Enabled
+Comment[af]=Microsoft Excel Spreiblad
+Comment[ar]=ورقة عمل مايكروسوفت اكسل
+Comment[az]=Microsoft Excel Sənədi
+Comment[be]=Разліковы аркуш Microsoft Excel
+Comment[bg]=Документ на Microsoft Excel
+Comment[bn]=মাইক্রোসফট এক্সসেল নথী
+Comment[br]=Loger Microsoft Excel
+Comment[bs]=Microsoft Excel proračunska tablica
+Comment[ca]=Full de càlcul de Microsoft Excel
+Comment[cs]=Tabulka programu Microsoft Excel
+Comment[csb]=Bòga Microsoft Excela
+Comment[cy]=Taenlen Microsoft Excel
+Comment[da]=Microsoft Excel-regneark
+Comment[de]=MS-Excel-Arbeitsblatt
+Comment[el]=Φύλλο εργασίας Microsoft Excel
+Comment[eo]=Mikrosoft-Excel-dokumento
+Comment[es]=Hoja de cálculo de Microsoft Excel
+Comment[et]=Microsoft Exceli tabel
+Comment[eu]=Microsoft Excel kalkulu-orria
+Comment[fa]=صفحۀ گستردۀ میکروسافت اکسل
+Comment[fi]=Microsoft Excel -taulukko
+Comment[fr]=Feuille de calcul Microsoft Excel
+Comment[fy]=Microsoft Excel-Rekkenboerd
+Comment[ga]=Scarbhileog Microsoft Excel
+Comment[gl]=Folla de cálculo Microsoft Excel
+Comment[he]=גיליון אלקטרוני של Microsoft Excel
+Comment[hi]=माइक्रोसॉफ्ट एक्सेल स्प्रेडशीट
+Comment[hr]=Microsoft Excel proračunska tablica
+Comment[hu]=Microsoft Excel dokumentum
+Comment[id]=Lembar Kerja Microsoft Excel
+Comment[is]=Microsoft Excel tafla
+Comment[it]=Foglio di calcolo Microsoft Excel
+Comment[ja]=Microsoft Excel スプレッドシート
+Comment[ka]=Microsoft Excel–ის ცხრილი
+Comment[kk]=Microsoft Excel эл.кестесі
+Comment[km]=សៀវភៅ​បញ្ជី Microsoft Excel
+Comment[ko]=마이크로소프트 엑셀 스프레드시트
+Comment[lb]=Microsoft-Excel-Tabellëblat
+Comment[lt]=Microsoft Excel elektroninė lentelė
+Comment[lv]=Microsoft Excel izklājlapa
+Comment[mk]=Microsoft Excel-табеларна пресметка
+Comment[mn]=MS-Excel-Хүснэгт
+Comment[ms]=Hamparan helaian Microsoft Excel
+Comment[mt]=Spreadsheet Microsoft Excel
+Comment[nb]=Microsoft Excel-regneark
+Comment[nds]="Microsoft Excel"-Arbeitblatt
+Comment[ne]=माइक्रोसफ्ट एक्सेल स्प्रेडसिट
+Comment[nl]=Microsoft Excel-spreadsheet
+Comment[nn]=Microsoft Excel-rekneark
+Comment[nso]=Letlakala la Phatlalatso la Bokgoni bja Microsoft
+Comment[pa]=Microsoft Excel ਸਾਰਣੀਕਾਰ
+Comment[pl]=Arkusz Microsoft Excela
+Comment[pt]=Folha de cálculo do Microsoft Excel
+Comment[pt_BR]=Planilha do Microsoft Excel
+Comment[ro]=Foaie de calcul tabelar Microsoft Excel
+Comment[ru]=Таблица Microsoft Excel
+Comment[rw]=Urupapurorusesuye Microsoft Excel
+Comment[se]=Microsoft Excel-tabealla
+Comment[sk]=Dokument Microsoft Excel
+Comment[sl]=Preglednica za Microsoft Excel
+Comment[sq]=Tabak nga Microsoft Excel
+Comment[sr]=Унакрсна табела Microsoft-овог Excel-а
+Comment[sr@Latn]=Unakrsna tabela Microsoft-ovog Excel-a
+Comment[sv]=Microsoft Excel-kalkylark
+Comment[ta]=மைக்ரோசாப்ட் எக்செல் விரிதாள்
+Comment[te]=మైక్రొసాఫ్ట్ ఎక్సెల్ స్ప్రెడ్ షీట్
+Comment[tg]=Ҷадвалҳои электронӣ Microsoft Excel
+Comment[th]=ตารางคำนวณไมโครซอฟต์เอ็กเซล
+Comment[tr]=Microsoft Excel Hesap Çizelgesi
+Comment[tt]=Microsoft Excel İsäpcäymäse
+Comment[uk]=Таблиця MS Excel
+Comment[uz]=Microsoft Excel elektron jadvali
+Comment[uz@cyrillic]=Microsoft Excel электрон жадвали
+Comment[ven]=Bammbiri lo navhaho la microsoft Excel
+Comment[vi]=Bảng tính Excel của Microsoft™.
+Comment[wa]=Fitchî tåvleu Microsoft Excel
+Comment[zh_CN]=Microsoft Excel 电子表格
+Comment[zh_HK]=微軟 Excel 表格
+Comment[zh_TW]=微軟 Excel 表格
+Comment[zu]= Ipheshana lesitayela le-Microsoft Excel
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.xls
diff --git a/mimetypes/application/vnd.ms-excel.sheet.macroEnabled.12.desktop b/mimetypes/application/vnd.ms-excel.sheet.macroEnabled.12.desktop
new file mode 100644
index 000000000..8ed830335
--- /dev/null
+++ b/mimetypes/application/vnd.ms-excel.sheet.macroEnabled.12.desktop
@@ -0,0 +1,89 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.ms-excel.sheet.macroEnabled.12
+Patterns=*.xlsm;*.XLSM
+Icon=spreadsheet
+Comment=Microsoft Excel Spreadsheet Macro Enabled
+Comment[af]=Microsoft Excel Spreiblad
+Comment[ar]=ورقة عمل مايكروسوفت اكسل
+Comment[az]=Microsoft Excel Sənədi
+Comment[be]=Разліковы аркуш Microsoft Excel
+Comment[bg]=Документ на Microsoft Excel
+Comment[bn]=মাইক্রোসফট এক্সসেল নথী
+Comment[br]=Loger Microsoft Excel
+Comment[bs]=Microsoft Excel proračunska tablica
+Comment[ca]=Full de càlcul de Microsoft Excel
+Comment[cs]=Tabulka programu Microsoft Excel
+Comment[csb]=Bòga Microsoft Excela
+Comment[cy]=Taenlen Microsoft Excel
+Comment[da]=Microsoft Excel-regneark
+Comment[de]=MS-Excel-Arbeitsblatt
+Comment[el]=Φύλλο εργασίας Microsoft Excel
+Comment[eo]=Mikrosoft-Excel-dokumento
+Comment[es]=Hoja de cálculo de Microsoft Excel
+Comment[et]=Microsoft Exceli tabel
+Comment[eu]=Microsoft Excel kalkulu-orria
+Comment[fa]=صفحۀ گستردۀ میکروسافت اکسل
+Comment[fi]=Microsoft Excel -taulukko
+Comment[fr]=Feuille de calcul Microsoft Excel
+Comment[fy]=Microsoft Excel-Rekkenboerd
+Comment[ga]=Scarbhileog Microsoft Excel
+Comment[gl]=Folla de cálculo Microsoft Excel
+Comment[he]=גיליון אלקטרוני של Microsoft Excel
+Comment[hi]=माइक्रोसॉफ्ट एक्सेल स्प्रेडशीट
+Comment[hr]=Microsoft Excel proračunska tablica
+Comment[hu]=Microsoft Excel dokumentum
+Comment[id]=Lembar Kerja Microsoft Excel
+Comment[is]=Microsoft Excel tafla
+Comment[it]=Foglio di calcolo Microsoft Excel
+Comment[ja]=Microsoft Excel スプレッドシート
+Comment[ka]=Microsoft Excel–ის ცხრილი
+Comment[kk]=Microsoft Excel эл.кестесі
+Comment[km]=សៀវភៅ​បញ្ជី Microsoft Excel
+Comment[ko]=마이크로소프트 엑셀 스프레드시트
+Comment[lb]=Microsoft-Excel-Tabellëblat
+Comment[lt]=Microsoft Excel elektroninė lentelė
+Comment[lv]=Microsoft Excel izklājlapa
+Comment[mk]=Microsoft Excel-табеларна пресметка
+Comment[mn]=MS-Excel-Хүснэгт
+Comment[ms]=Hamparan helaian Microsoft Excel
+Comment[mt]=Spreadsheet Microsoft Excel
+Comment[nb]=Microsoft Excel-regneark
+Comment[nds]="Microsoft Excel"-Arbeitblatt
+Comment[ne]=माइक्रोसफ्ट एक्सेल स्प्रेडसिट
+Comment[nl]=Microsoft Excel-spreadsheet
+Comment[nn]=Microsoft Excel-rekneark
+Comment[nso]=Letlakala la Phatlalatso la Bokgoni bja Microsoft
+Comment[pa]=Microsoft Excel ਸਾਰਣੀਕਾਰ
+Comment[pl]=Arkusz Microsoft Excela
+Comment[pt]=Folha de cálculo do Microsoft Excel
+Comment[pt_BR]=Planilha do Microsoft Excel
+Comment[ro]=Foaie de calcul tabelar Microsoft Excel
+Comment[ru]=Таблица Microsoft Excel
+Comment[rw]=Urupapurorusesuye Microsoft Excel
+Comment[se]=Microsoft Excel-tabealla
+Comment[sk]=Dokument Microsoft Excel
+Comment[sl]=Preglednica za Microsoft Excel
+Comment[sq]=Tabak nga Microsoft Excel
+Comment[sr]=Унакрсна табела Microsoft-овог Excel-а
+Comment[sr@Latn]=Unakrsna tabela Microsoft-ovog Excel-a
+Comment[sv]=Microsoft Excel-kalkylark
+Comment[ta]=மைக்ரோசாப்ட் எக்செல் விரிதாள்
+Comment[te]=మైక్రొసాఫ్ట్ ఎక్సెల్ స్ప్రెడ్ షీట్
+Comment[tg]=Ҷадвалҳои электронӣ Microsoft Excel
+Comment[th]=ตารางคำนวณไมโครซอฟต์เอ็กเซล
+Comment[tr]=Microsoft Excel Hesap Çizelgesi
+Comment[tt]=Microsoft Excel İsäpcäymäse
+Comment[uk]=Таблиця MS Excel
+Comment[uz]=Microsoft Excel elektron jadvali
+Comment[uz@cyrillic]=Microsoft Excel электрон жадвали
+Comment[ven]=Bammbiri lo navhaho la microsoft Excel
+Comment[vi]=Bảng tính Excel của Microsoft™.
+Comment[wa]=Fitchî tåvleu Microsoft Excel
+Comment[zh_CN]=Microsoft Excel 电子表格
+Comment[zh_HK]=微軟 Excel 表格
+Comment[zh_TW]=微軟 Excel 表格
+Comment[zu]= Ipheshana lesitayela le-Microsoft Excel
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.xls
diff --git a/mimetypes/application/vnd.ms-excel.template.macroEnabled.12.desktop b/mimetypes/application/vnd.ms-excel.template.macroEnabled.12.desktop
new file mode 100644
index 000000000..b53891706
--- /dev/null
+++ b/mimetypes/application/vnd.ms-excel.template.macroEnabled.12.desktop
@@ -0,0 +1,89 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.ms-excel.template.macroEnabled.12
+Patterns=*.xltm;*.XLTM
+Icon=spreadsheet
+Comment=Microsoft Excel Spreadsheet Template Macro Enabled
+Comment[af]=Microsoft Excel Spreiblad
+Comment[ar]=ورقة عمل مايكروسوفت اكسل
+Comment[az]=Microsoft Excel Sənədi
+Comment[be]=Разліковы аркуш Microsoft Excel
+Comment[bg]=Документ на Microsoft Excel
+Comment[bn]=মাইক্রোসফট এক্সসেল নথী
+Comment[br]=Loger Microsoft Excel
+Comment[bs]=Microsoft Excel proračunska tablica
+Comment[ca]=Full de càlcul de Microsoft Excel
+Comment[cs]=Tabulka programu Microsoft Excel
+Comment[csb]=Bòga Microsoft Excela
+Comment[cy]=Taenlen Microsoft Excel
+Comment[da]=Microsoft Excel-regneark
+Comment[de]=MS-Excel-Arbeitsblatt
+Comment[el]=Φύλλο εργασίας Microsoft Excel
+Comment[eo]=Mikrosoft-Excel-dokumento
+Comment[es]=Hoja de cálculo de Microsoft Excel
+Comment[et]=Microsoft Exceli tabel
+Comment[eu]=Microsoft Excel kalkulu-orria
+Comment[fa]=صفحۀ گستردۀ میکروسافت اکسل
+Comment[fi]=Microsoft Excel -taulukko
+Comment[fr]=Feuille de calcul Microsoft Excel
+Comment[fy]=Microsoft Excel-Rekkenboerd
+Comment[ga]=Scarbhileog Microsoft Excel
+Comment[gl]=Folla de cálculo Microsoft Excel
+Comment[he]=גיליון אלקטרוני של Microsoft Excel
+Comment[hi]=माइक्रोसॉफ्ट एक्सेल स्प्रेडशीट
+Comment[hr]=Microsoft Excel proračunska tablica
+Comment[hu]=Microsoft Excel dokumentum
+Comment[id]=Lembar Kerja Microsoft Excel
+Comment[is]=Microsoft Excel tafla
+Comment[it]=Foglio di calcolo Microsoft Excel
+Comment[ja]=Microsoft Excel スプレッドシート
+Comment[ka]=Microsoft Excel–ის ცხრილი
+Comment[kk]=Microsoft Excel эл.кестесі
+Comment[km]=សៀវភៅ​បញ្ជី Microsoft Excel
+Comment[ko]=마이크로소프트 엑셀 스프레드시트
+Comment[lb]=Microsoft-Excel-Tabellëblat
+Comment[lt]=Microsoft Excel elektroninė lentelė
+Comment[lv]=Microsoft Excel izklājlapa
+Comment[mk]=Microsoft Excel-табеларна пресметка
+Comment[mn]=MS-Excel-Хүснэгт
+Comment[ms]=Hamparan helaian Microsoft Excel
+Comment[mt]=Spreadsheet Microsoft Excel
+Comment[nb]=Microsoft Excel-regneark
+Comment[nds]="Microsoft Excel"-Arbeitblatt
+Comment[ne]=माइक्रोसफ्ट एक्सेल स्प्रेडसिट
+Comment[nl]=Microsoft Excel-spreadsheet
+Comment[nn]=Microsoft Excel-rekneark
+Comment[nso]=Letlakala la Phatlalatso la Bokgoni bja Microsoft
+Comment[pa]=Microsoft Excel ਸਾਰਣੀਕਾਰ
+Comment[pl]=Arkusz Microsoft Excela
+Comment[pt]=Folha de cálculo do Microsoft Excel
+Comment[pt_BR]=Planilha do Microsoft Excel
+Comment[ro]=Foaie de calcul tabelar Microsoft Excel
+Comment[ru]=Таблица Microsoft Excel
+Comment[rw]=Urupapurorusesuye Microsoft Excel
+Comment[se]=Microsoft Excel-tabealla
+Comment[sk]=Dokument Microsoft Excel
+Comment[sl]=Preglednica za Microsoft Excel
+Comment[sq]=Tabak nga Microsoft Excel
+Comment[sr]=Унакрсна табела Microsoft-овог Excel-а
+Comment[sr@Latn]=Unakrsna tabela Microsoft-ovog Excel-a
+Comment[sv]=Microsoft Excel-kalkylark
+Comment[ta]=மைக்ரோசாப்ட் எக்செல் விரிதாள்
+Comment[te]=మైక్రొసాఫ్ట్ ఎక్సెల్ స్ప్రెడ్ షీట్
+Comment[tg]=Ҷадвалҳои электронӣ Microsoft Excel
+Comment[th]=ตารางคำนวณไมโครซอฟต์เอ็กเซล
+Comment[tr]=Microsoft Excel Hesap Çizelgesi
+Comment[tt]=Microsoft Excel İsäpcäymäse
+Comment[uk]=Таблиця MS Excel
+Comment[uz]=Microsoft Excel elektron jadvali
+Comment[uz@cyrillic]=Microsoft Excel электрон жадвали
+Comment[ven]=Bammbiri lo navhaho la microsoft Excel
+Comment[vi]=Bảng tính Excel của Microsoft™.
+Comment[wa]=Fitchî tåvleu Microsoft Excel
+Comment[zh_CN]=Microsoft Excel 电子表格
+Comment[zh_HK]=微軟 Excel 表格
+Comment[zh_TW]=微軟 Excel 表格
+Comment[zu]= Ipheshana lesitayela le-Microsoft Excel
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.xls
diff --git a/mimetypes/application/vnd.ms-powerpoint.addin.macroEnabled.12.desktop b/mimetypes/application/vnd.ms-powerpoint.addin.macroEnabled.12.desktop
new file mode 100644
index 000000000..315de52ab
--- /dev/null
+++ b/mimetypes/application/vnd.ms-powerpoint.addin.macroEnabled.12.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.ms-powerpoint.addin.macroEnabled.12.desktop
+Patterns=*.ppam
+Icon=presentation
+Comment=Microsoft PowerPoint Presentation Add-In Macro Enabled
+Comment[af]=Microsoft Powerpoint Voorlegging
+Comment[ar]=مستند مايكروسوفت باوربوينت
+Comment[az]=Microsoft PowerPoint Sənədi
+Comment[be]=Прэзентацыя Microsoft PowerPoint
+Comment[bg]=Документ на Microsoft PowerPoint
+Comment[bn]=মাইক্রোসফট পাওয়ার-পয়েন্ট নথী
+Comment[br]=Emginnig Microsoft PowerPoint
+Comment[bs]=Microsoft PowerPoint prezentacija
+Comment[ca]=Presentació de Microsoft PowerPoint
+Comment[cs]=Prezentace Microsoft Powerpoint
+Comment[csb]=Prezentacëjô Microsoft PowerPointa
+Comment[cy]=Cyflwyniad Microsoft PowerPoint
+Comment[da]=Microsoft PowerPoint-præsentation
+Comment[de]=MS-PowerPoint-Präsentation
+Comment[el]=Παρουσίαση Microsoft PowerPoint
+Comment[eo]=Mikrosoft-PowerPoint-dokumento
+Comment[es]=Presentación de Microsoft PowerPoint
+Comment[et]=Microsoft PowerPointi esitlus
+Comment[eu]=Microsoft PowerPoint aurkezpena
+Comment[fa]=میکروسافت پاورپوینت
+Comment[fi]=Microsoft PowerPoint -esitys
+Comment[fr]=Présentation Microsoft PowerPoint
+Comment[fy]=Microsoft PowerPoint Presintaasje
+Comment[ga]=Cáipéis Microsoft PowerPoint
+Comment[gl]=Apresentación de Microsoft PowerPoint
+Comment[he]=מצגת Microsoft PowerPoint
+Comment[hi]=माइक्रोसाफ्ट पावरपाइंट प्रेजेंटेशन
+Comment[hr]=Microsoft PowerPointa prezentacija
+Comment[hu]=Microsoft PowerPoint dokumentum
+Comment[id]=Presentasi Microsoft PowerPoint
+Comment[is]=Microsoft PowerPoint kynning
+Comment[it]=Presentazione Microsoft PowerPoint
+Comment[ja]=Microsoft PowerPoint プレゼンテーション
+Comment[ka]=Microsoft PowerPoint–ის დოკუმენტი
+Comment[kk]=Microsoft PowerPoint презентациясы
+Comment[km]=ការ​បង្ហាញ Microsoft PowerPoint
+Comment[ko]=마이크로소프트 파워포인트 프리젠테이션
+Comment[lb]=Microsoft-PowerPoint-Präsentatioun
+Comment[lt]=Microsoft PowerPoint pristatymas
+Comment[lv]=Microsoft PowerPoint prezentācija
+Comment[mk]=Microsoft PowerPoint-презентација
+Comment[mn]=MS-PowerPoint-Үзүүлэн
+Comment[ms]=Persembahan Microsoft PowerPoint
+Comment[nb]=Microsoft PowerPoint-dokument
+Comment[nds]="Microsoft PowerPoint"-Presentatschoon
+Comment[ne]=माइक्रोसफ्ट पावरप्वाइन्ट प्रस्तुतिकरण
+Comment[nl]=Microsoft PowerPoint-presentatie
+Comment[nn]=Microsoft PowerPoint-presentasjon
+Comment[pa]=Microsoft PowerPoint ਪੇਸ਼ਕਾਰੀ
+Comment[pl]=Prezentacja Microsoft PowerPointa
+Comment[pt]=Apresentação do Microsoft PowerPoint
+Comment[pt_BR]=Documento do Microsoft PowerPoint
+Comment[ro]=Prezentare Microsoft PowerPoint
+Comment[ru]=Презентация Microsoft PowerPoint
+Comment[rw]=Iyerekana Microsoft PowerPoint
+Comment[se]=Microsoft PowerPoint-dokumeanta
+Comment[sk]=Prezentácia Microsoft PowerPoint
+Comment[sl]=Predstavitev za Microsoft PowerPoint
+Comment[sq]=Prezentim nga Microsoft PowerPoint
+Comment[sr]=Microsoft PowerPoint-ова презентација
+Comment[sr@Latn]=Microsoft PowerPoint-ova prezentacija
+Comment[sv]=Microsoft PowerPoint-presentation
+Comment[ta]=மைக்ரோசாப்ட் பவர்பாயின்ட் வழங்கல்
+Comment[te]=మైక్రొసాఫ్ట్ పవర్ పాయింట్ పత్రం
+Comment[tg]=Презинтатсия Microsoft PowerPoint
+Comment[th]=เอกสารนำเสนอไมโครซอฟต์เพาเวอร์พอยนต์
+Comment[tr]=Microsoft PowerPoint Sunumu
+Comment[tt]=Microsoft PowerPoint Täqbire
+Comment[uk]=Презентація MS PowerPoint
+Comment[uz]=Microsoft PowerPoint namunasi
+Comment[uz@cyrillic]=Microsoft PowerPoint намунаси
+Comment[vi]=Trình diễn PowerPoint của Microsoft™.
+Comment[wa]=Prezintaedje Microsoft PowerPoint
+Comment[zh_CN]=Microsoft PowerPoint 演示文稿
+Comment[zh_HK]=微軟 PowerPoint 文件
+Comment[zh_TW]=微軟 PowerPoint 文件
+
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.ppt
diff --git a/mimetypes/application/vnd.ms-powerpoint.desktop b/mimetypes/application/vnd.ms-powerpoint.desktop
index ef0e1ea81..eeb48632b 100644
--- a/mimetypes/application/vnd.ms-powerpoint.desktop
+++ b/mimetypes/application/vnd.ms-powerpoint.desktop
@@ -1,6 +1,7 @@
[Desktop Entry]
Type=MimeType
MimeType=application/vnd.ms-powerpoint
+Patterns=*.ppt;*.PPT
Icon=presentation
Comment=Microsoft PowerPoint Presentation
Comment[af]=Microsoft Powerpoint Voorlegging
diff --git a/mimetypes/application/vnd.ms-powerpoint.presentation.macroEnabled.12.desktop b/mimetypes/application/vnd.ms-powerpoint.presentation.macroEnabled.12.desktop
new file mode 100644
index 000000000..53c95dcca
--- /dev/null
+++ b/mimetypes/application/vnd.ms-powerpoint.presentation.macroEnabled.12.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.ms-powerpoint.presentation.macroEnabled.12
+Patterns=*.pptm;*.PPTM
+Icon=presentation
+Comment=Microsoft PowerPoint Presentation Macro Enabled
+Comment[af]=Microsoft Powerpoint Voorlegging
+Comment[ar]=مستند مايكروسوفت باوربوينت
+Comment[az]=Microsoft PowerPoint Sənədi
+Comment[be]=Прэзентацыя Microsoft PowerPoint
+Comment[bg]=Документ на Microsoft PowerPoint
+Comment[bn]=মাইক্রোসফট পাওয়ার-পয়েন্ট নথী
+Comment[br]=Emginnig Microsoft PowerPoint
+Comment[bs]=Microsoft PowerPoint prezentacija
+Comment[ca]=Presentació de Microsoft PowerPoint
+Comment[cs]=Prezentace Microsoft Powerpoint
+Comment[csb]=Prezentacëjô Microsoft PowerPointa
+Comment[cy]=Cyflwyniad Microsoft PowerPoint
+Comment[da]=Microsoft PowerPoint-præsentation
+Comment[de]=MS-PowerPoint-Präsentation
+Comment[el]=Παρουσίαση Microsoft PowerPoint
+Comment[eo]=Mikrosoft-PowerPoint-dokumento
+Comment[es]=Presentación de Microsoft PowerPoint
+Comment[et]=Microsoft PowerPointi esitlus
+Comment[eu]=Microsoft PowerPoint aurkezpena
+Comment[fa]=میکروسافت پاورپوینت
+Comment[fi]=Microsoft PowerPoint -esitys
+Comment[fr]=Présentation Microsoft PowerPoint
+Comment[fy]=Microsoft PowerPoint Presintaasje
+Comment[ga]=Cáipéis Microsoft PowerPoint
+Comment[gl]=Apresentación de Microsoft PowerPoint
+Comment[he]=מצגת Microsoft PowerPoint
+Comment[hi]=माइक्रोसाफ्ट पावरपाइंट प्रेजेंटेशन
+Comment[hr]=Microsoft PowerPointa prezentacija
+Comment[hu]=Microsoft PowerPoint dokumentum
+Comment[id]=Presentasi Microsoft PowerPoint
+Comment[is]=Microsoft PowerPoint kynning
+Comment[it]=Presentazione Microsoft PowerPoint
+Comment[ja]=Microsoft PowerPoint プレゼンテーション
+Comment[ka]=Microsoft PowerPoint–ის დოკუმენტი
+Comment[kk]=Microsoft PowerPoint презентациясы
+Comment[km]=ការ​បង្ហាញ Microsoft PowerPoint
+Comment[ko]=마이크로소프트 파워포인트 프리젠테이션
+Comment[lb]=Microsoft-PowerPoint-Präsentatioun
+Comment[lt]=Microsoft PowerPoint pristatymas
+Comment[lv]=Microsoft PowerPoint prezentācija
+Comment[mk]=Microsoft PowerPoint-презентација
+Comment[mn]=MS-PowerPoint-Үзүүлэн
+Comment[ms]=Persembahan Microsoft PowerPoint
+Comment[nb]=Microsoft PowerPoint-dokument
+Comment[nds]="Microsoft PowerPoint"-Presentatschoon
+Comment[ne]=माइक्रोसफ्ट पावरप्वाइन्ट प्रस्तुतिकरण
+Comment[nl]=Microsoft PowerPoint-presentatie
+Comment[nn]=Microsoft PowerPoint-presentasjon
+Comment[pa]=Microsoft PowerPoint ਪੇਸ਼ਕਾਰੀ
+Comment[pl]=Prezentacja Microsoft PowerPointa
+Comment[pt]=Apresentação do Microsoft PowerPoint
+Comment[pt_BR]=Documento do Microsoft PowerPoint
+Comment[ro]=Prezentare Microsoft PowerPoint
+Comment[ru]=Презентация Microsoft PowerPoint
+Comment[rw]=Iyerekana Microsoft PowerPoint
+Comment[se]=Microsoft PowerPoint-dokumeanta
+Comment[sk]=Prezentácia Microsoft PowerPoint
+Comment[sl]=Predstavitev za Microsoft PowerPoint
+Comment[sq]=Prezentim nga Microsoft PowerPoint
+Comment[sr]=Microsoft PowerPoint-ова презентација
+Comment[sr@Latn]=Microsoft PowerPoint-ova prezentacija
+Comment[sv]=Microsoft PowerPoint-presentation
+Comment[ta]=மைக்ரோசாப்ட் பவர்பாயின்ட் வழங்கல்
+Comment[te]=మైక్రొసాఫ్ట్ పవర్ పాయింట్ పత్రం
+Comment[tg]=Презинтатсия Microsoft PowerPoint
+Comment[th]=เอกสารนำเสนอไมโครซอฟต์เพาเวอร์พอยนต์
+Comment[tr]=Microsoft PowerPoint Sunumu
+Comment[tt]=Microsoft PowerPoint Täqbire
+Comment[uk]=Презентація MS PowerPoint
+Comment[uz]=Microsoft PowerPoint namunasi
+Comment[uz@cyrillic]=Microsoft PowerPoint намунаси
+Comment[vi]=Trình diễn PowerPoint của Microsoft™.
+Comment[wa]=Prezintaedje Microsoft PowerPoint
+Comment[zh_CN]=Microsoft PowerPoint 演示文稿
+Comment[zh_HK]=微軟 PowerPoint 文件
+Comment[zh_TW]=微軟 PowerPoint 文件
+
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.ppt
diff --git a/mimetypes/application/vnd.ms-powerpoint.slideshow.macroEnabled.12.desktop b/mimetypes/application/vnd.ms-powerpoint.slideshow.macroEnabled.12.desktop
new file mode 100644
index 000000000..b0482d86e
--- /dev/null
+++ b/mimetypes/application/vnd.ms-powerpoint.slideshow.macroEnabled.12.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.ms-powerpoint.slideshow.macroEnabled.12
+Patterns=*.ppsm;*.PPSM
+Icon=presentation
+Comment=Microsoft PowerPoint Presentation SlideShow Macro Enabled
+Comment[af]=Microsoft Powerpoint Voorlegging
+Comment[ar]=مستند مايكروسوفت باوربوينت
+Comment[az]=Microsoft PowerPoint Sənədi
+Comment[be]=Прэзентацыя Microsoft PowerPoint
+Comment[bg]=Документ на Microsoft PowerPoint
+Comment[bn]=মাইক্রোসফট পাওয়ার-পয়েন্ট নথী
+Comment[br]=Emginnig Microsoft PowerPoint
+Comment[bs]=Microsoft PowerPoint prezentacija
+Comment[ca]=Presentació de Microsoft PowerPoint
+Comment[cs]=Prezentace Microsoft Powerpoint
+Comment[csb]=Prezentacëjô Microsoft PowerPointa
+Comment[cy]=Cyflwyniad Microsoft PowerPoint
+Comment[da]=Microsoft PowerPoint-præsentation
+Comment[de]=MS-PowerPoint-Präsentation
+Comment[el]=Παρουσίαση Microsoft PowerPoint
+Comment[eo]=Mikrosoft-PowerPoint-dokumento
+Comment[es]=Presentación de Microsoft PowerPoint
+Comment[et]=Microsoft PowerPointi esitlus
+Comment[eu]=Microsoft PowerPoint aurkezpena
+Comment[fa]=میکروسافت پاورپوینت
+Comment[fi]=Microsoft PowerPoint -esitys
+Comment[fr]=Présentation Microsoft PowerPoint
+Comment[fy]=Microsoft PowerPoint Presintaasje
+Comment[ga]=Cáipéis Microsoft PowerPoint
+Comment[gl]=Apresentación de Microsoft PowerPoint
+Comment[he]=מצגת Microsoft PowerPoint
+Comment[hi]=माइक्रोसाफ्ट पावरपाइंट प्रेजेंटेशन
+Comment[hr]=Microsoft PowerPointa prezentacija
+Comment[hu]=Microsoft PowerPoint dokumentum
+Comment[id]=Presentasi Microsoft PowerPoint
+Comment[is]=Microsoft PowerPoint kynning
+Comment[it]=Presentazione Microsoft PowerPoint
+Comment[ja]=Microsoft PowerPoint プレゼンテーション
+Comment[ka]=Microsoft PowerPoint–ის დოკუმენტი
+Comment[kk]=Microsoft PowerPoint презентациясы
+Comment[km]=ការ​បង្ហាញ Microsoft PowerPoint
+Comment[ko]=마이크로소프트 파워포인트 프리젠테이션
+Comment[lb]=Microsoft-PowerPoint-Präsentatioun
+Comment[lt]=Microsoft PowerPoint pristatymas
+Comment[lv]=Microsoft PowerPoint prezentācija
+Comment[mk]=Microsoft PowerPoint-презентација
+Comment[mn]=MS-PowerPoint-Үзүүлэн
+Comment[ms]=Persembahan Microsoft PowerPoint
+Comment[nb]=Microsoft PowerPoint-dokument
+Comment[nds]="Microsoft PowerPoint"-Presentatschoon
+Comment[ne]=माइक्रोसफ्ट पावरप्वाइन्ट प्रस्तुतिकरण
+Comment[nl]=Microsoft PowerPoint-presentatie
+Comment[nn]=Microsoft PowerPoint-presentasjon
+Comment[pa]=Microsoft PowerPoint ਪੇਸ਼ਕਾਰੀ
+Comment[pl]=Prezentacja Microsoft PowerPointa
+Comment[pt]=Apresentação do Microsoft PowerPoint
+Comment[pt_BR]=Documento do Microsoft PowerPoint
+Comment[ro]=Prezentare Microsoft PowerPoint
+Comment[ru]=Презентация Microsoft PowerPoint
+Comment[rw]=Iyerekana Microsoft PowerPoint
+Comment[se]=Microsoft PowerPoint-dokumeanta
+Comment[sk]=Prezentácia Microsoft PowerPoint
+Comment[sl]=Predstavitev za Microsoft PowerPoint
+Comment[sq]=Prezentim nga Microsoft PowerPoint
+Comment[sr]=Microsoft PowerPoint-ова презентација
+Comment[sr@Latn]=Microsoft PowerPoint-ova prezentacija
+Comment[sv]=Microsoft PowerPoint-presentation
+Comment[ta]=மைக்ரோசாப்ட் பவர்பாயின்ட் வழங்கல்
+Comment[te]=మైక్రొసాఫ్ట్ పవర్ పాయింట్ పత్రం
+Comment[tg]=Презинтатсия Microsoft PowerPoint
+Comment[th]=เอกสารนำเสนอไมโครซอฟต์เพาเวอร์พอยนต์
+Comment[tr]=Microsoft PowerPoint Sunumu
+Comment[tt]=Microsoft PowerPoint Täqbire
+Comment[uk]=Презентація MS PowerPoint
+Comment[uz]=Microsoft PowerPoint namunasi
+Comment[uz@cyrillic]=Microsoft PowerPoint намунаси
+Comment[vi]=Trình diễn PowerPoint của Microsoft™.
+Comment[wa]=Prezintaedje Microsoft PowerPoint
+Comment[zh_CN]=Microsoft PowerPoint 演示文稿
+Comment[zh_HK]=微軟 PowerPoint 文件
+Comment[zh_TW]=微軟 PowerPoint 文件
+
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.ppt
diff --git a/mimetypes/application/vnd.ms-powerpoint.template.macroEnabled.12.desktop b/mimetypes/application/vnd.ms-powerpoint.template.macroEnabled.12.desktop
new file mode 100644
index 000000000..8f95b4f6f
--- /dev/null
+++ b/mimetypes/application/vnd.ms-powerpoint.template.macroEnabled.12.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.ms-powerpoint.template.macroEnabled.12
+Patterns=*.potm;*.POTM
+Icon=presentation
+Comment=Microsoft PowerPoint Presentation Template Macro Enabled
+Comment[af]=Microsoft Powerpoint Voorlegging
+Comment[ar]=مستند مايكروسوفت باوربوينت
+Comment[az]=Microsoft PowerPoint Sənədi
+Comment[be]=Прэзентацыя Microsoft PowerPoint
+Comment[bg]=Документ на Microsoft PowerPoint
+Comment[bn]=মাইক্রোসফট পাওয়ার-পয়েন্ট নথী
+Comment[br]=Emginnig Microsoft PowerPoint
+Comment[bs]=Microsoft PowerPoint prezentacija
+Comment[ca]=Presentació de Microsoft PowerPoint
+Comment[cs]=Prezentace Microsoft Powerpoint
+Comment[csb]=Prezentacëjô Microsoft PowerPointa
+Comment[cy]=Cyflwyniad Microsoft PowerPoint
+Comment[da]=Microsoft PowerPoint-præsentation
+Comment[de]=MS-PowerPoint-Präsentation
+Comment[el]=Παρουσίαση Microsoft PowerPoint
+Comment[eo]=Mikrosoft-PowerPoint-dokumento
+Comment[es]=Presentación de Microsoft PowerPoint
+Comment[et]=Microsoft PowerPointi esitlus
+Comment[eu]=Microsoft PowerPoint aurkezpena
+Comment[fa]=میکروسافت پاورپوینت
+Comment[fi]=Microsoft PowerPoint -esitys
+Comment[fr]=Présentation Microsoft PowerPoint
+Comment[fy]=Microsoft PowerPoint Presintaasje
+Comment[ga]=Cáipéis Microsoft PowerPoint
+Comment[gl]=Apresentación de Microsoft PowerPoint
+Comment[he]=מצגת Microsoft PowerPoint
+Comment[hi]=माइक्रोसाफ्ट पावरपाइंट प्रेजेंटेशन
+Comment[hr]=Microsoft PowerPointa prezentacija
+Comment[hu]=Microsoft PowerPoint dokumentum
+Comment[id]=Presentasi Microsoft PowerPoint
+Comment[is]=Microsoft PowerPoint kynning
+Comment[it]=Presentazione Microsoft PowerPoint
+Comment[ja]=Microsoft PowerPoint プレゼンテーション
+Comment[ka]=Microsoft PowerPoint–ის დოკუმენტი
+Comment[kk]=Microsoft PowerPoint презентациясы
+Comment[km]=ការ​បង្ហាញ Microsoft PowerPoint
+Comment[ko]=마이크로소프트 파워포인트 프리젠테이션
+Comment[lb]=Microsoft-PowerPoint-Präsentatioun
+Comment[lt]=Microsoft PowerPoint pristatymas
+Comment[lv]=Microsoft PowerPoint prezentācija
+Comment[mk]=Microsoft PowerPoint-презентација
+Comment[mn]=MS-PowerPoint-Үзүүлэн
+Comment[ms]=Persembahan Microsoft PowerPoint
+Comment[nb]=Microsoft PowerPoint-dokument
+Comment[nds]="Microsoft PowerPoint"-Presentatschoon
+Comment[ne]=माइक्रोसफ्ट पावरप्वाइन्ट प्रस्तुतिकरण
+Comment[nl]=Microsoft PowerPoint-presentatie
+Comment[nn]=Microsoft PowerPoint-presentasjon
+Comment[pa]=Microsoft PowerPoint ਪੇਸ਼ਕਾਰੀ
+Comment[pl]=Prezentacja Microsoft PowerPointa
+Comment[pt]=Apresentação do Microsoft PowerPoint
+Comment[pt_BR]=Documento do Microsoft PowerPoint
+Comment[ro]=Prezentare Microsoft PowerPoint
+Comment[ru]=Презентация Microsoft PowerPoint
+Comment[rw]=Iyerekana Microsoft PowerPoint
+Comment[se]=Microsoft PowerPoint-dokumeanta
+Comment[sk]=Prezentácia Microsoft PowerPoint
+Comment[sl]=Predstavitev za Microsoft PowerPoint
+Comment[sq]=Prezentim nga Microsoft PowerPoint
+Comment[sr]=Microsoft PowerPoint-ова презентација
+Comment[sr@Latn]=Microsoft PowerPoint-ova prezentacija
+Comment[sv]=Microsoft PowerPoint-presentation
+Comment[ta]=மைக்ரோசாப்ட் பவர்பாயின்ட் வழங்கல்
+Comment[te]=మైక్రొసాఫ్ట్ పవర్ పాయింట్ పత్రం
+Comment[tg]=Презинтатсия Microsoft PowerPoint
+Comment[th]=เอกสารนำเสนอไมโครซอฟต์เพาเวอร์พอยนต์
+Comment[tr]=Microsoft PowerPoint Sunumu
+Comment[tt]=Microsoft PowerPoint Täqbire
+Comment[uk]=Презентація MS PowerPoint
+Comment[uz]=Microsoft PowerPoint namunasi
+Comment[uz@cyrillic]=Microsoft PowerPoint намунаси
+Comment[vi]=Trình diễn PowerPoint của Microsoft™.
+Comment[wa]=Prezintaedje Microsoft PowerPoint
+Comment[zh_CN]=Microsoft PowerPoint 演示文稿
+Comment[zh_HK]=微軟 PowerPoint 文件
+Comment[zh_TW]=微軟 PowerPoint 文件
+
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.ppt
diff --git a/mimetypes/application/vnd.ms-word.desktop b/mimetypes/application/vnd.ms-word.desktop
index 82660334f..b77b4b58f 100644
--- a/mimetypes/application/vnd.ms-word.desktop
+++ b/mimetypes/application/vnd.ms-word.desktop
@@ -1,6 +1,7 @@
[Desktop Entry]
Type=MimeType
MimeType=application/vnd.ms-word
+Patterns=*.doc;*.DOC
Icon=wordprocessing
Comment=Microsoft Word Document
Comment[af]=Microsoft Woord Dokument
diff --git a/mimetypes/application/vnd.ms-word.document.macroEnabled.12.desktop b/mimetypes/application/vnd.ms-word.document.macroEnabled.12.desktop
new file mode 100644
index 000000000..b80762c3a
--- /dev/null
+++ b/mimetypes/application/vnd.ms-word.document.macroEnabled.12.desktop
@@ -0,0 +1,91 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.ms-word.document.macroEnabled.12
+Patterns=*.docm;*.DOCM
+Icon=wordprocessing
+Comment=Microsoft Word Document Macro Enabled
+Comment[af]=Microsoft Woord Dokument
+Comment[ar]=مستند مايكروسوفت وورد
+Comment[az]=Microsoft Word Sənədi
+Comment[be]=Дакумент Microsoft Word
+Comment[bg]=Документ на Microsoft Word
+Comment[bn]=মাইক্রোসফট ওয়ার্ড নথী
+Comment[br]=Teul Microsoft Word
+Comment[bs]=Microsoft Word dokument
+Comment[ca]=Document de Microsoft Word
+Comment[cs]=Dokument programu Microsoft Word
+Comment[csb]=Dokùment Microsoft Worda
+Comment[cy]=Dogfen Microsoft Word
+Comment[da]=Microsoft Word-dokument
+Comment[de]=MS-Word-Dokument
+Comment[el]=Έγγραφο Microsoft Word
+Comment[eo]=Mikrosoft-Word-dokumento
+Comment[es]=Documento de Microsoft Word
+Comment[et]=Microsoft Wordi dokument
+Comment[eu]=Microsoft Word dokumentua
+Comment[fa]=سند میکروسافت ورد
+Comment[fi]=Microsoft Word -asiakirja
+Comment[fr]=Document Microsoft Word
+Comment[fy]=Microsoft Word-dokumint
+Comment[ga]=Cáipéis Microsoft Word
+Comment[gl]=Documento de Microsoft Word
+Comment[he]=מסמך Microsoft Word
+Comment[hi]=माइक्रोसॉफ्ट वर्ड दस्तावेज़
+Comment[hr]=Microsoft Word dokument
+Comment[hu]=Microsoft Word dokumentum
+Comment[id]=Dokumen Microsoft Word
+Comment[is]=Microsoft Word skjal
+Comment[it]=Documento Microsoft Word
+Comment[ja]=Microsoft Word ドキュメント
+Comment[ka]=Microsoft Word–ის დოკუმენტი
+Comment[kk]=Microsoft Word құжаты
+Comment[km]=ឯកសារ Microsoft Word
+Comment[ko]=마이크로소프트 글틀 문서
+Comment[lb]=Microsoft-Word-Dokument
+Comment[lt]=Microsoft Word dokumentas
+Comment[lv]=Microsoft Word dokuments
+Comment[mk]=Microsoft Word-документ
+Comment[mn]=MS-Word-Баримт
+Comment[ms]=Dokumen Microsoft Word
+Comment[mt]=Dokument Microsoft Word
+Comment[nb]=Microsoft Word-dokument
+Comment[nds]="Microsoft Word"-Dokment
+Comment[ne]=माइक्रोसफ्ट वर्ड कागजात
+Comment[nl]=Microsoft Word-document
+Comment[nn]=Microsoft Word-dokument
+Comment[nso]=Tokomane ya Lentsu la Microsoft
+Comment[pa]=Microsoft Word ਦਸਤਾਵੇਜ਼
+Comment[pl]=Dokument Microsoft Worda
+Comment[pt]=Documento do Microsoft Word
+Comment[pt_BR]=Documento do Microsoft Word
+Comment[ro]=Document Microsoft Word
+Comment[ru]=Документ Microsoft Word
+Comment[rw]=Microsoft Word Inyandiko
+Comment[se]=Microsoft Word-dokumeanta
+Comment[sk]=Dokument Microsoft Word
+Comment[sl]=Dokument za Microsoft Word
+Comment[sq]=Dokument nga Microsoft Word
+Comment[sr]=Microsoft Word-ов документ
+Comment[sr@Latn]=Microsoft Word-ov dokument
+Comment[sv]=Microsoft Word-dokument
+Comment[ta]=மைக்ரோசாப்ட் வேர்டு ஆவணம்
+Comment[te]=మైక్రొసాఫ్ట్ పదం పత్రం
+Comment[tg]=Ҳуҷҷати Microsoft Word
+Comment[th]=เอกสารไมโครซอฟต์เวิร์ด
+Comment[tr]=Microsoft Word Belgesi
+Comment[tt]=Microsoft Word İstälege
+Comment[uk]=Документ MS Word
+Comment[uz]=Microsoft Word hujjati
+Comment[uz@cyrillic]=Microsoft Word ҳужжати
+Comment[ven]=Manwalwa a Microsoft Word
+Comment[vi]=Tài liệu Word của Microsoft™.
+Comment[wa]=Documint Microsoft Word
+Comment[xh]=Uxwebhhu LweMicrosoft Word
+Comment[zh_CN]=Microsoft Word 文档
+Comment[zh_HK]=微軟 Word 文件
+Comment[zh_TW]=微軟 Word 文件
+Comment[zu]=Uhlu Lwamafayela lwe-Microsoft Word
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.doc
+
diff --git a/mimetypes/application/vnd.ms-word.template.macroEnabled.12.desktop b/mimetypes/application/vnd.ms-word.template.macroEnabled.12.desktop
new file mode 100644
index 000000000..cf4422b77
--- /dev/null
+++ b/mimetypes/application/vnd.ms-word.template.macroEnabled.12.desktop
@@ -0,0 +1,91 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.ms-word.template.macroEnabled.12
+Patterns=*.dotm;*.DOTM
+Icon=wordprocessing
+Comment=Microsoft Word Document Template Macro Enabled
+Comment[af]=Microsoft Woord Dokument
+Comment[ar]=مستند مايكروسوفت وورد
+Comment[az]=Microsoft Word Sənədi
+Comment[be]=Дакумент Microsoft Word
+Comment[bg]=Документ на Microsoft Word
+Comment[bn]=মাইক্রোসফট ওয়ার্ড নথী
+Comment[br]=Teul Microsoft Word
+Comment[bs]=Microsoft Word dokument
+Comment[ca]=Document de Microsoft Word
+Comment[cs]=Dokument programu Microsoft Word
+Comment[csb]=Dokùment Microsoft Worda
+Comment[cy]=Dogfen Microsoft Word
+Comment[da]=Microsoft Word-dokument
+Comment[de]=MS-Word-Dokument
+Comment[el]=Έγγραφο Microsoft Word
+Comment[eo]=Mikrosoft-Word-dokumento
+Comment[es]=Documento de Microsoft Word
+Comment[et]=Microsoft Wordi dokument
+Comment[eu]=Microsoft Word dokumentua
+Comment[fa]=سند میکروسافت ورد
+Comment[fi]=Microsoft Word -asiakirja
+Comment[fr]=Document Microsoft Word
+Comment[fy]=Microsoft Word-dokumint
+Comment[ga]=Cáipéis Microsoft Word
+Comment[gl]=Documento de Microsoft Word
+Comment[he]=מסמך Microsoft Word
+Comment[hi]=माइक्रोसॉफ्ट वर्ड दस्तावेज़
+Comment[hr]=Microsoft Word dokument
+Comment[hu]=Microsoft Word dokumentum
+Comment[id]=Dokumen Microsoft Word
+Comment[is]=Microsoft Word skjal
+Comment[it]=Documento Microsoft Word
+Comment[ja]=Microsoft Word ドキュメント
+Comment[ka]=Microsoft Word–ის დოკუმენტი
+Comment[kk]=Microsoft Word құжаты
+Comment[km]=ឯកសារ Microsoft Word
+Comment[ko]=마이크로소프트 글틀 문서
+Comment[lb]=Microsoft-Word-Dokument
+Comment[lt]=Microsoft Word dokumentas
+Comment[lv]=Microsoft Word dokuments
+Comment[mk]=Microsoft Word-документ
+Comment[mn]=MS-Word-Баримт
+Comment[ms]=Dokumen Microsoft Word
+Comment[mt]=Dokument Microsoft Word
+Comment[nb]=Microsoft Word-dokument
+Comment[nds]="Microsoft Word"-Dokment
+Comment[ne]=माइक्रोसफ्ट वर्ड कागजात
+Comment[nl]=Microsoft Word-document
+Comment[nn]=Microsoft Word-dokument
+Comment[nso]=Tokomane ya Lentsu la Microsoft
+Comment[pa]=Microsoft Word ਦਸਤਾਵੇਜ਼
+Comment[pl]=Dokument Microsoft Worda
+Comment[pt]=Documento do Microsoft Word
+Comment[pt_BR]=Documento do Microsoft Word
+Comment[ro]=Document Microsoft Word
+Comment[ru]=Документ Microsoft Word
+Comment[rw]=Microsoft Word Inyandiko
+Comment[se]=Microsoft Word-dokumeanta
+Comment[sk]=Dokument Microsoft Word
+Comment[sl]=Dokument za Microsoft Word
+Comment[sq]=Dokument nga Microsoft Word
+Comment[sr]=Microsoft Word-ов документ
+Comment[sr@Latn]=Microsoft Word-ov dokument
+Comment[sv]=Microsoft Word-dokument
+Comment[ta]=மைக்ரோசாப்ட் வேர்டு ஆவணம்
+Comment[te]=మైక్రొసాఫ్ట్ పదం పత్రం
+Comment[tg]=Ҳуҷҷати Microsoft Word
+Comment[th]=เอกสารไมโครซอฟต์เวิร์ด
+Comment[tr]=Microsoft Word Belgesi
+Comment[tt]=Microsoft Word İstälege
+Comment[uk]=Документ MS Word
+Comment[uz]=Microsoft Word hujjati
+Comment[uz@cyrillic]=Microsoft Word ҳужжати
+Comment[ven]=Manwalwa a Microsoft Word
+Comment[vi]=Tài liệu Word của Microsoft™.
+Comment[wa]=Documint Microsoft Word
+Comment[xh]=Uxwebhhu LweMicrosoft Word
+Comment[zh_CN]=Microsoft Word 文档
+Comment[zh_HK]=微軟 Word 文件
+Comment[zh_TW]=微軟 Word 文件
+Comment[zu]=Uhlu Lwamafayela lwe-Microsoft Word
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.doc
+
diff --git a/mimetypes/application/vnd.oasis.opendocument.database.desktop b/mimetypes/application/vnd.oasis.opendocument.database.desktop
new file mode 100644
index 000000000..5fc2b214b
--- /dev/null
+++ b/mimetypes/application/vnd.oasis.opendocument.database.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.oasis.opendocument.database
+Patterns=*.odb;*.ODB
+Icon=database
+Comment=OASIS OpenDocument Database
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.odb
diff --git a/mimetypes/application/vnd.openxmlformats-officedocument.presentationml.presentation.desktop b/mimetypes/application/vnd.openxmlformats-officedocument.presentationml.presentation.desktop
new file mode 100644
index 000000000..fb0f8d695
--- /dev/null
+++ b/mimetypes/application/vnd.openxmlformats-officedocument.presentationml.presentation.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.openxmlformats-officedocument.presentationml.presentation
+Patterns=*.pptx;*.PPTX
+Icon=presentation
+Comment=Microsoft PowerPoint Presentation
+Comment[af]=Microsoft Powerpoint Voorlegging
+Comment[ar]=مستند مايكروسوفت باوربوينت
+Comment[az]=Microsoft PowerPoint Sənədi
+Comment[be]=Прэзентацыя Microsoft PowerPoint
+Comment[bg]=Документ на Microsoft PowerPoint
+Comment[bn]=মাইক্রোসফট পাওয়ার-পয়েন্ট নথী
+Comment[br]=Emginnig Microsoft PowerPoint
+Comment[bs]=Microsoft PowerPoint prezentacija
+Comment[ca]=Presentació de Microsoft PowerPoint
+Comment[cs]=Prezentace Microsoft Powerpoint
+Comment[csb]=Prezentacëjô Microsoft PowerPointa
+Comment[cy]=Cyflwyniad Microsoft PowerPoint
+Comment[da]=Microsoft PowerPoint-præsentation
+Comment[de]=MS-PowerPoint-Präsentation
+Comment[el]=Παρουσίαση Microsoft PowerPoint
+Comment[eo]=Mikrosoft-PowerPoint-dokumento
+Comment[es]=Presentación de Microsoft PowerPoint
+Comment[et]=Microsoft PowerPointi esitlus
+Comment[eu]=Microsoft PowerPoint aurkezpena
+Comment[fa]=میکروسافت پاورپوینت
+Comment[fi]=Microsoft PowerPoint -esitys
+Comment[fr]=Présentation Microsoft PowerPoint
+Comment[fy]=Microsoft PowerPoint Presintaasje
+Comment[ga]=Cáipéis Microsoft PowerPoint
+Comment[gl]=Apresentación de Microsoft PowerPoint
+Comment[he]=מצגת Microsoft PowerPoint
+Comment[hi]=माइक्रोसाफ्ट पावरपाइंट प्रेजेंटेशन
+Comment[hr]=Microsoft PowerPointa prezentacija
+Comment[hu]=Microsoft PowerPoint dokumentum
+Comment[id]=Presentasi Microsoft PowerPoint
+Comment[is]=Microsoft PowerPoint kynning
+Comment[it]=Presentazione Microsoft PowerPoint
+Comment[ja]=Microsoft PowerPoint プレゼンテーション
+Comment[ka]=Microsoft PowerPoint–ის დოკუმენტი
+Comment[kk]=Microsoft PowerPoint презентациясы
+Comment[km]=ការ​បង្ហាញ Microsoft PowerPoint
+Comment[ko]=마이크로소프트 파워포인트 프리젠테이션
+Comment[lb]=Microsoft-PowerPoint-Präsentatioun
+Comment[lt]=Microsoft PowerPoint pristatymas
+Comment[lv]=Microsoft PowerPoint prezentācija
+Comment[mk]=Microsoft PowerPoint-презентација
+Comment[mn]=MS-PowerPoint-Үзүүлэн
+Comment[ms]=Persembahan Microsoft PowerPoint
+Comment[nb]=Microsoft PowerPoint-dokument
+Comment[nds]="Microsoft PowerPoint"-Presentatschoon
+Comment[ne]=माइक्रोसफ्ट पावरप्वाइन्ट प्रस्तुतिकरण
+Comment[nl]=Microsoft PowerPoint-presentatie
+Comment[nn]=Microsoft PowerPoint-presentasjon
+Comment[pa]=Microsoft PowerPoint ਪੇਸ਼ਕਾਰੀ
+Comment[pl]=Prezentacja Microsoft PowerPointa
+Comment[pt]=Apresentação do Microsoft PowerPoint
+Comment[pt_BR]=Documento do Microsoft PowerPoint
+Comment[ro]=Prezentare Microsoft PowerPoint
+Comment[ru]=Презентация Microsoft PowerPoint
+Comment[rw]=Iyerekana Microsoft PowerPoint
+Comment[se]=Microsoft PowerPoint-dokumeanta
+Comment[sk]=Prezentácia Microsoft PowerPoint
+Comment[sl]=Predstavitev za Microsoft PowerPoint
+Comment[sq]=Prezentim nga Microsoft PowerPoint
+Comment[sr]=Microsoft PowerPoint-ова презентација
+Comment[sr@Latn]=Microsoft PowerPoint-ova prezentacija
+Comment[sv]=Microsoft PowerPoint-presentation
+Comment[ta]=மைக்ரோசாப்ட் பவர்பாயின்ட் வழங்கல்
+Comment[te]=మైక్రొసాఫ్ట్ పవర్ పాయింట్ పత్రం
+Comment[tg]=Презинтатсия Microsoft PowerPoint
+Comment[th]=เอกสารนำเสนอไมโครซอฟต์เพาเวอร์พอยนต์
+Comment[tr]=Microsoft PowerPoint Sunumu
+Comment[tt]=Microsoft PowerPoint Täqbire
+Comment[uk]=Презентація MS PowerPoint
+Comment[uz]=Microsoft PowerPoint namunasi
+Comment[uz@cyrillic]=Microsoft PowerPoint намунаси
+Comment[vi]=Trình diễn PowerPoint của Microsoft™.
+Comment[wa]=Prezintaedje Microsoft PowerPoint
+Comment[zh_CN]=Microsoft PowerPoint 演示文稿
+Comment[zh_HK]=微軟 PowerPoint 文件
+Comment[zh_TW]=微軟 PowerPoint 文件
+
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.ppt
diff --git a/mimetypes/application/vnd.openxmlformats-officedocument.presentationml.slideshow.desktop b/mimetypes/application/vnd.openxmlformats-officedocument.presentationml.slideshow.desktop
new file mode 100644
index 000000000..37288baca
--- /dev/null
+++ b/mimetypes/application/vnd.openxmlformats-officedocument.presentationml.slideshow.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.openxmlformats-officedocument.presentationml.slideshow
+Patterns=*.ppsx;*.PPSX
+Icon=presentation
+Comment=Microsoft PowerPoint Presentation SlideShow
+Comment[af]=Microsoft Powerpoint Voorlegging
+Comment[ar]=مستند مايكروسوفت باوربوينت
+Comment[az]=Microsoft PowerPoint Sənədi
+Comment[be]=Прэзентацыя Microsoft PowerPoint
+Comment[bg]=Документ на Microsoft PowerPoint
+Comment[bn]=মাইক্রোসফট পাওয়ার-পয়েন্ট নথী
+Comment[br]=Emginnig Microsoft PowerPoint
+Comment[bs]=Microsoft PowerPoint prezentacija
+Comment[ca]=Presentació de Microsoft PowerPoint
+Comment[cs]=Prezentace Microsoft Powerpoint
+Comment[csb]=Prezentacëjô Microsoft PowerPointa
+Comment[cy]=Cyflwyniad Microsoft PowerPoint
+Comment[da]=Microsoft PowerPoint-præsentation
+Comment[de]=MS-PowerPoint-Präsentation
+Comment[el]=Παρουσίαση Microsoft PowerPoint
+Comment[eo]=Mikrosoft-PowerPoint-dokumento
+Comment[es]=Presentación de Microsoft PowerPoint
+Comment[et]=Microsoft PowerPointi esitlus
+Comment[eu]=Microsoft PowerPoint aurkezpena
+Comment[fa]=میکروسافت پاورپوینت
+Comment[fi]=Microsoft PowerPoint -esitys
+Comment[fr]=Présentation Microsoft PowerPoint
+Comment[fy]=Microsoft PowerPoint Presintaasje
+Comment[ga]=Cáipéis Microsoft PowerPoint
+Comment[gl]=Apresentación de Microsoft PowerPoint
+Comment[he]=מצגת Microsoft PowerPoint
+Comment[hi]=माइक्रोसाफ्ट पावरपाइंट प्रेजेंटेशन
+Comment[hr]=Microsoft PowerPointa prezentacija
+Comment[hu]=Microsoft PowerPoint dokumentum
+Comment[id]=Presentasi Microsoft PowerPoint
+Comment[is]=Microsoft PowerPoint kynning
+Comment[it]=Presentazione Microsoft PowerPoint
+Comment[ja]=Microsoft PowerPoint プレゼンテーション
+Comment[ka]=Microsoft PowerPoint–ის დოკუმენტი
+Comment[kk]=Microsoft PowerPoint презентациясы
+Comment[km]=ការ​បង្ហាញ Microsoft PowerPoint
+Comment[ko]=마이크로소프트 파워포인트 프리젠테이션
+Comment[lb]=Microsoft-PowerPoint-Präsentatioun
+Comment[lt]=Microsoft PowerPoint pristatymas
+Comment[lv]=Microsoft PowerPoint prezentācija
+Comment[mk]=Microsoft PowerPoint-презентација
+Comment[mn]=MS-PowerPoint-Үзүүлэн
+Comment[ms]=Persembahan Microsoft PowerPoint
+Comment[nb]=Microsoft PowerPoint-dokument
+Comment[nds]="Microsoft PowerPoint"-Presentatschoon
+Comment[ne]=माइक्रोसफ्ट पावरप्वाइन्ट प्रस्तुतिकरण
+Comment[nl]=Microsoft PowerPoint-presentatie
+Comment[nn]=Microsoft PowerPoint-presentasjon
+Comment[pa]=Microsoft PowerPoint ਪੇਸ਼ਕਾਰੀ
+Comment[pl]=Prezentacja Microsoft PowerPointa
+Comment[pt]=Apresentação do Microsoft PowerPoint
+Comment[pt_BR]=Documento do Microsoft PowerPoint
+Comment[ro]=Prezentare Microsoft PowerPoint
+Comment[ru]=Презентация Microsoft PowerPoint
+Comment[rw]=Iyerekana Microsoft PowerPoint
+Comment[se]=Microsoft PowerPoint-dokumeanta
+Comment[sk]=Prezentácia Microsoft PowerPoint
+Comment[sl]=Predstavitev za Microsoft PowerPoint
+Comment[sq]=Prezentim nga Microsoft PowerPoint
+Comment[sr]=Microsoft PowerPoint-ова презентација
+Comment[sr@Latn]=Microsoft PowerPoint-ova prezentacija
+Comment[sv]=Microsoft PowerPoint-presentation
+Comment[ta]=மைக்ரோசாப்ட் பவர்பாயின்ட் வழங்கல்
+Comment[te]=మైక్రొసాఫ్ట్ పవర్ పాయింట్ పత్రం
+Comment[tg]=Презинтатсия Microsoft PowerPoint
+Comment[th]=เอกสารนำเสนอไมโครซอฟต์เพาเวอร์พอยนต์
+Comment[tr]=Microsoft PowerPoint Sunumu
+Comment[tt]=Microsoft PowerPoint Täqbire
+Comment[uk]=Презентація MS PowerPoint
+Comment[uz]=Microsoft PowerPoint namunasi
+Comment[uz@cyrillic]=Microsoft PowerPoint намунаси
+Comment[vi]=Trình diễn PowerPoint của Microsoft™.
+Comment[wa]=Prezintaedje Microsoft PowerPoint
+Comment[zh_CN]=Microsoft PowerPoint 演示文稿
+Comment[zh_HK]=微軟 PowerPoint 文件
+Comment[zh_TW]=微軟 PowerPoint 文件
+
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.ppt
diff --git a/mimetypes/application/vnd.openxmlformats-officedocument.presentationml.template.desktop b/mimetypes/application/vnd.openxmlformats-officedocument.presentationml.template.desktop
new file mode 100644
index 000000000..d2e0cc45b
--- /dev/null
+++ b/mimetypes/application/vnd.openxmlformats-officedocument.presentationml.template.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.openxmlformats-officedocument.presentationml.template
+Patterns=*.potx;*.POTX
+Icon=presentation
+Comment=Microsoft PowerPoint Presentation Template
+Comment[af]=Microsoft Powerpoint Voorlegging
+Comment[ar]=مستند مايكروسوفت باوربوينت
+Comment[az]=Microsoft PowerPoint Sənədi
+Comment[be]=Прэзентацыя Microsoft PowerPoint
+Comment[bg]=Документ на Microsoft PowerPoint
+Comment[bn]=মাইক্রোসফট পাওয়ার-পয়েন্ট নথী
+Comment[br]=Emginnig Microsoft PowerPoint
+Comment[bs]=Microsoft PowerPoint prezentacija
+Comment[ca]=Presentació de Microsoft PowerPoint
+Comment[cs]=Prezentace Microsoft Powerpoint
+Comment[csb]=Prezentacëjô Microsoft PowerPointa
+Comment[cy]=Cyflwyniad Microsoft PowerPoint
+Comment[da]=Microsoft PowerPoint-præsentation
+Comment[de]=MS-PowerPoint-Präsentation
+Comment[el]=Παρουσίαση Microsoft PowerPoint
+Comment[eo]=Mikrosoft-PowerPoint-dokumento
+Comment[es]=Presentación de Microsoft PowerPoint
+Comment[et]=Microsoft PowerPointi esitlus
+Comment[eu]=Microsoft PowerPoint aurkezpena
+Comment[fa]=میکروسافت پاورپوینت
+Comment[fi]=Microsoft PowerPoint -esitys
+Comment[fr]=Présentation Microsoft PowerPoint
+Comment[fy]=Microsoft PowerPoint Presintaasje
+Comment[ga]=Cáipéis Microsoft PowerPoint
+Comment[gl]=Apresentación de Microsoft PowerPoint
+Comment[he]=מצגת Microsoft PowerPoint
+Comment[hi]=माइक्रोसाफ्ट पावरपाइंट प्रेजेंटेशन
+Comment[hr]=Microsoft PowerPointa prezentacija
+Comment[hu]=Microsoft PowerPoint dokumentum
+Comment[id]=Presentasi Microsoft PowerPoint
+Comment[is]=Microsoft PowerPoint kynning
+Comment[it]=Presentazione Microsoft PowerPoint
+Comment[ja]=Microsoft PowerPoint プレゼンテーション
+Comment[ka]=Microsoft PowerPoint–ის დოკუმენტი
+Comment[kk]=Microsoft PowerPoint презентациясы
+Comment[km]=ការ​បង្ហាញ Microsoft PowerPoint
+Comment[ko]=마이크로소프트 파워포인트 프리젠테이션
+Comment[lb]=Microsoft-PowerPoint-Präsentatioun
+Comment[lt]=Microsoft PowerPoint pristatymas
+Comment[lv]=Microsoft PowerPoint prezentācija
+Comment[mk]=Microsoft PowerPoint-презентација
+Comment[mn]=MS-PowerPoint-Үзүүлэн
+Comment[ms]=Persembahan Microsoft PowerPoint
+Comment[nb]=Microsoft PowerPoint-dokument
+Comment[nds]="Microsoft PowerPoint"-Presentatschoon
+Comment[ne]=माइक्रोसफ्ट पावरप्वाइन्ट प्रस्तुतिकरण
+Comment[nl]=Microsoft PowerPoint-presentatie
+Comment[nn]=Microsoft PowerPoint-presentasjon
+Comment[pa]=Microsoft PowerPoint ਪੇਸ਼ਕਾਰੀ
+Comment[pl]=Prezentacja Microsoft PowerPointa
+Comment[pt]=Apresentação do Microsoft PowerPoint
+Comment[pt_BR]=Documento do Microsoft PowerPoint
+Comment[ro]=Prezentare Microsoft PowerPoint
+Comment[ru]=Презентация Microsoft PowerPoint
+Comment[rw]=Iyerekana Microsoft PowerPoint
+Comment[se]=Microsoft PowerPoint-dokumeanta
+Comment[sk]=Prezentácia Microsoft PowerPoint
+Comment[sl]=Predstavitev za Microsoft PowerPoint
+Comment[sq]=Prezentim nga Microsoft PowerPoint
+Comment[sr]=Microsoft PowerPoint-ова презентација
+Comment[sr@Latn]=Microsoft PowerPoint-ova prezentacija
+Comment[sv]=Microsoft PowerPoint-presentation
+Comment[ta]=மைக்ரோசாப்ட் பவர்பாயின்ட் வழங்கல்
+Comment[te]=మైక్రొసాఫ్ట్ పవర్ పాయింట్ పత్రం
+Comment[tg]=Презинтатсия Microsoft PowerPoint
+Comment[th]=เอกสารนำเสนอไมโครซอฟต์เพาเวอร์พอยนต์
+Comment[tr]=Microsoft PowerPoint Sunumu
+Comment[tt]=Microsoft PowerPoint Täqbire
+Comment[uk]=Презентація MS PowerPoint
+Comment[uz]=Microsoft PowerPoint namunasi
+Comment[uz@cyrillic]=Microsoft PowerPoint намунаси
+Comment[vi]=Trình diễn PowerPoint của Microsoft™.
+Comment[wa]=Prezintaedje Microsoft PowerPoint
+Comment[zh_CN]=Microsoft PowerPoint 演示文稿
+Comment[zh_HK]=微軟 PowerPoint 文件
+Comment[zh_TW]=微軟 PowerPoint 文件
+
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.ppt
diff --git a/mimetypes/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.desktop b/mimetypes/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.desktop
new file mode 100644
index 000000000..99b483ece
--- /dev/null
+++ b/mimetypes/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.desktop
@@ -0,0 +1,89 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+Patterns=*.xlsx;*.XLSX
+Icon=spreadsheet
+Comment=Microsoft Excel Spreadsheet
+Comment[af]=Microsoft Excel Spreiblad
+Comment[ar]=ورقة عمل مايكروسوفت اكسل
+Comment[az]=Microsoft Excel Sənədi
+Comment[be]=Разліковы аркуш Microsoft Excel
+Comment[bg]=Документ на Microsoft Excel
+Comment[bn]=মাইক্রোসফট এক্সসেল নথী
+Comment[br]=Loger Microsoft Excel
+Comment[bs]=Microsoft Excel proračunska tablica
+Comment[ca]=Full de càlcul de Microsoft Excel
+Comment[cs]=Tabulka programu Microsoft Excel
+Comment[csb]=Bòga Microsoft Excela
+Comment[cy]=Taenlen Microsoft Excel
+Comment[da]=Microsoft Excel-regneark
+Comment[de]=MS-Excel-Arbeitsblatt
+Comment[el]=Φύλλο εργασίας Microsoft Excel
+Comment[eo]=Mikrosoft-Excel-dokumento
+Comment[es]=Hoja de cálculo de Microsoft Excel
+Comment[et]=Microsoft Exceli tabel
+Comment[eu]=Microsoft Excel kalkulu-orria
+Comment[fa]=صفحۀ گستردۀ میکروسافت اکسل
+Comment[fi]=Microsoft Excel -taulukko
+Comment[fr]=Feuille de calcul Microsoft Excel
+Comment[fy]=Microsoft Excel-Rekkenboerd
+Comment[ga]=Scarbhileog Microsoft Excel
+Comment[gl]=Folla de cálculo Microsoft Excel
+Comment[he]=גיליון אלקטרוני של Microsoft Excel
+Comment[hi]=माइक्रोसॉफ्ट एक्सेल स्प्रेडशीट
+Comment[hr]=Microsoft Excel proračunska tablica
+Comment[hu]=Microsoft Excel dokumentum
+Comment[id]=Lembar Kerja Microsoft Excel
+Comment[is]=Microsoft Excel tafla
+Comment[it]=Foglio di calcolo Microsoft Excel
+Comment[ja]=Microsoft Excel スプレッドシート
+Comment[ka]=Microsoft Excel–ის ცხრილი
+Comment[kk]=Microsoft Excel эл.кестесі
+Comment[km]=សៀវភៅ​បញ្ជី Microsoft Excel
+Comment[ko]=마이크로소프트 엑셀 스프레드시트
+Comment[lb]=Microsoft-Excel-Tabellëblat
+Comment[lt]=Microsoft Excel elektroninė lentelė
+Comment[lv]=Microsoft Excel izklājlapa
+Comment[mk]=Microsoft Excel-табеларна пресметка
+Comment[mn]=MS-Excel-Хүснэгт
+Comment[ms]=Hamparan helaian Microsoft Excel
+Comment[mt]=Spreadsheet Microsoft Excel
+Comment[nb]=Microsoft Excel-regneark
+Comment[nds]="Microsoft Excel"-Arbeitblatt
+Comment[ne]=माइक्रोसफ्ट एक्सेल स्प्रेडसिट
+Comment[nl]=Microsoft Excel-spreadsheet
+Comment[nn]=Microsoft Excel-rekneark
+Comment[nso]=Letlakala la Phatlalatso la Bokgoni bja Microsoft
+Comment[pa]=Microsoft Excel ਸਾਰਣੀਕਾਰ
+Comment[pl]=Arkusz Microsoft Excela
+Comment[pt]=Folha de cálculo do Microsoft Excel
+Comment[pt_BR]=Planilha do Microsoft Excel
+Comment[ro]=Foaie de calcul tabelar Microsoft Excel
+Comment[ru]=Таблица Microsoft Excel
+Comment[rw]=Urupapurorusesuye Microsoft Excel
+Comment[se]=Microsoft Excel-tabealla
+Comment[sk]=Dokument Microsoft Excel
+Comment[sl]=Preglednica za Microsoft Excel
+Comment[sq]=Tabak nga Microsoft Excel
+Comment[sr]=Унакрсна табела Microsoft-овог Excel-а
+Comment[sr@Latn]=Unakrsna tabela Microsoft-ovog Excel-a
+Comment[sv]=Microsoft Excel-kalkylark
+Comment[ta]=மைக்ரோசாப்ட் எக்செல் விரிதாள்
+Comment[te]=మైక్రొసాఫ్ట్ ఎక్సెల్ స్ప్రెడ్ షీట్
+Comment[tg]=Ҷадвалҳои электронӣ Microsoft Excel
+Comment[th]=ตารางคำนวณไมโครซอฟต์เอ็กเซล
+Comment[tr]=Microsoft Excel Hesap Çizelgesi
+Comment[tt]=Microsoft Excel İsäpcäymäse
+Comment[uk]=Таблиця MS Excel
+Comment[uz]=Microsoft Excel elektron jadvali
+Comment[uz@cyrillic]=Microsoft Excel электрон жадвали
+Comment[ven]=Bammbiri lo navhaho la microsoft Excel
+Comment[vi]=Bảng tính Excel của Microsoft™.
+Comment[wa]=Fitchî tåvleu Microsoft Excel
+Comment[zh_CN]=Microsoft Excel 电子表格
+Comment[zh_HK]=微軟 Excel 表格
+Comment[zh_TW]=微軟 Excel 表格
+Comment[zu]= Ipheshana lesitayela le-Microsoft Excel
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.xls
diff --git a/mimetypes/application/vnd.openxmlformats-officedocument.spreadsheetml.template.desktop b/mimetypes/application/vnd.openxmlformats-officedocument.spreadsheetml.template.desktop
new file mode 100644
index 000000000..4adc151ba
--- /dev/null
+++ b/mimetypes/application/vnd.openxmlformats-officedocument.spreadsheetml.template.desktop
@@ -0,0 +1,89 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.openxmlformats-officedocument.spreadsheetml.template
+Patterns=*.xltx;*.XLTX
+Icon=spreadsheet
+Comment=Microsoft Excel Spreadsheet Template
+Comment[af]=Microsoft Excel Spreiblad
+Comment[ar]=ورقة عمل مايكروسوفت اكسل
+Comment[az]=Microsoft Excel Sənədi
+Comment[be]=Разліковы аркуш Microsoft Excel
+Comment[bg]=Документ на Microsoft Excel
+Comment[bn]=মাইক্রোসফট এক্সসেল নথী
+Comment[br]=Loger Microsoft Excel
+Comment[bs]=Microsoft Excel proračunska tablica
+Comment[ca]=Full de càlcul de Microsoft Excel
+Comment[cs]=Tabulka programu Microsoft Excel
+Comment[csb]=Bòga Microsoft Excela
+Comment[cy]=Taenlen Microsoft Excel
+Comment[da]=Microsoft Excel-regneark
+Comment[de]=MS-Excel-Arbeitsblatt
+Comment[el]=Φύλλο εργασίας Microsoft Excel
+Comment[eo]=Mikrosoft-Excel-dokumento
+Comment[es]=Hoja de cálculo de Microsoft Excel
+Comment[et]=Microsoft Exceli tabel
+Comment[eu]=Microsoft Excel kalkulu-orria
+Comment[fa]=صفحۀ گستردۀ میکروسافت اکسل
+Comment[fi]=Microsoft Excel -taulukko
+Comment[fr]=Feuille de calcul Microsoft Excel
+Comment[fy]=Microsoft Excel-Rekkenboerd
+Comment[ga]=Scarbhileog Microsoft Excel
+Comment[gl]=Folla de cálculo Microsoft Excel
+Comment[he]=גיליון אלקטרוני של Microsoft Excel
+Comment[hi]=माइक्रोसॉफ्ट एक्सेल स्प्रेडशीट
+Comment[hr]=Microsoft Excel proračunska tablica
+Comment[hu]=Microsoft Excel dokumentum
+Comment[id]=Lembar Kerja Microsoft Excel
+Comment[is]=Microsoft Excel tafla
+Comment[it]=Foglio di calcolo Microsoft Excel
+Comment[ja]=Microsoft Excel スプレッドシート
+Comment[ka]=Microsoft Excel–ის ცხრილი
+Comment[kk]=Microsoft Excel эл.кестесі
+Comment[km]=សៀវភៅ​បញ្ជី Microsoft Excel
+Comment[ko]=마이크로소프트 엑셀 스프레드시트
+Comment[lb]=Microsoft-Excel-Tabellëblat
+Comment[lt]=Microsoft Excel elektroninė lentelė
+Comment[lv]=Microsoft Excel izklājlapa
+Comment[mk]=Microsoft Excel-табеларна пресметка
+Comment[mn]=MS-Excel-Хүснэгт
+Comment[ms]=Hamparan helaian Microsoft Excel
+Comment[mt]=Spreadsheet Microsoft Excel
+Comment[nb]=Microsoft Excel-regneark
+Comment[nds]="Microsoft Excel"-Arbeitblatt
+Comment[ne]=माइक्रोसफ्ट एक्सेल स्प्रेडसिट
+Comment[nl]=Microsoft Excel-spreadsheet
+Comment[nn]=Microsoft Excel-rekneark
+Comment[nso]=Letlakala la Phatlalatso la Bokgoni bja Microsoft
+Comment[pa]=Microsoft Excel ਸਾਰਣੀਕਾਰ
+Comment[pl]=Arkusz Microsoft Excela
+Comment[pt]=Folha de cálculo do Microsoft Excel
+Comment[pt_BR]=Planilha do Microsoft Excel
+Comment[ro]=Foaie de calcul tabelar Microsoft Excel
+Comment[ru]=Таблица Microsoft Excel
+Comment[rw]=Urupapurorusesuye Microsoft Excel
+Comment[se]=Microsoft Excel-tabealla
+Comment[sk]=Dokument Microsoft Excel
+Comment[sl]=Preglednica za Microsoft Excel
+Comment[sq]=Tabak nga Microsoft Excel
+Comment[sr]=Унакрсна табела Microsoft-овог Excel-а
+Comment[sr@Latn]=Unakrsna tabela Microsoft-ovog Excel-a
+Comment[sv]=Microsoft Excel-kalkylark
+Comment[ta]=மைக்ரோசாப்ட் எக்செல் விரிதாள்
+Comment[te]=మైక్రొసాఫ్ట్ ఎక్సెల్ స్ప్రెడ్ షీట్
+Comment[tg]=Ҷадвалҳои электронӣ Microsoft Excel
+Comment[th]=ตารางคำนวณไมโครซอฟต์เอ็กเซล
+Comment[tr]=Microsoft Excel Hesap Çizelgesi
+Comment[tt]=Microsoft Excel İsäpcäymäse
+Comment[uk]=Таблиця MS Excel
+Comment[uz]=Microsoft Excel elektron jadvali
+Comment[uz@cyrillic]=Microsoft Excel электрон жадвали
+Comment[ven]=Bammbiri lo navhaho la microsoft Excel
+Comment[vi]=Bảng tính Excel của Microsoft™.
+Comment[wa]=Fitchî tåvleu Microsoft Excel
+Comment[zh_CN]=Microsoft Excel 电子表格
+Comment[zh_HK]=微軟 Excel 表格
+Comment[zh_TW]=微軟 Excel 表格
+Comment[zu]= Ipheshana lesitayela le-Microsoft Excel
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.xls
diff --git a/mimetypes/application/vnd.openxmlformats-officedocument.wordprocessingml.document.desktop b/mimetypes/application/vnd.openxmlformats-officedocument.wordprocessingml.document.desktop
new file mode 100644
index 000000000..5f45f6dba
--- /dev/null
+++ b/mimetypes/application/vnd.openxmlformats-officedocument.wordprocessingml.document.desktop
@@ -0,0 +1,91 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.openxmlformats-officedocument.wordprocessingml.document
+Patterns=*.docx;*.DOCX
+Icon=wordprocessing
+Comment=Microsoft Word Document
+Comment[af]=Microsoft Woord Dokument
+Comment[ar]=مستند مايكروسوفت وورد
+Comment[az]=Microsoft Word Sənədi
+Comment[be]=Дакумент Microsoft Word
+Comment[bg]=Документ на Microsoft Word
+Comment[bn]=মাইক্রোসফট ওয়ার্ড নথী
+Comment[br]=Teul Microsoft Word
+Comment[bs]=Microsoft Word dokument
+Comment[ca]=Document de Microsoft Word
+Comment[cs]=Dokument programu Microsoft Word
+Comment[csb]=Dokùment Microsoft Worda
+Comment[cy]=Dogfen Microsoft Word
+Comment[da]=Microsoft Word-dokument
+Comment[de]=MS-Word-Dokument
+Comment[el]=Έγγραφο Microsoft Word
+Comment[eo]=Mikrosoft-Word-dokumento
+Comment[es]=Documento de Microsoft Word
+Comment[et]=Microsoft Wordi dokument
+Comment[eu]=Microsoft Word dokumentua
+Comment[fa]=سند میکروسافت ورد
+Comment[fi]=Microsoft Word -asiakirja
+Comment[fr]=Document Microsoft Word
+Comment[fy]=Microsoft Word-dokumint
+Comment[ga]=Cáipéis Microsoft Word
+Comment[gl]=Documento de Microsoft Word
+Comment[he]=מסמך Microsoft Word
+Comment[hi]=माइक्रोसॉफ्ट वर्ड दस्तावेज़
+Comment[hr]=Microsoft Word dokument
+Comment[hu]=Microsoft Word dokumentum
+Comment[id]=Dokumen Microsoft Word
+Comment[is]=Microsoft Word skjal
+Comment[it]=Documento Microsoft Word
+Comment[ja]=Microsoft Word ドキュメント
+Comment[ka]=Microsoft Word–ის დოკუმენტი
+Comment[kk]=Microsoft Word құжаты
+Comment[km]=ឯកសារ Microsoft Word
+Comment[ko]=마이크로소프트 글틀 문서
+Comment[lb]=Microsoft-Word-Dokument
+Comment[lt]=Microsoft Word dokumentas
+Comment[lv]=Microsoft Word dokuments
+Comment[mk]=Microsoft Word-документ
+Comment[mn]=MS-Word-Баримт
+Comment[ms]=Dokumen Microsoft Word
+Comment[mt]=Dokument Microsoft Word
+Comment[nb]=Microsoft Word-dokument
+Comment[nds]="Microsoft Word"-Dokment
+Comment[ne]=माइक्रोसफ्ट वर्ड कागजात
+Comment[nl]=Microsoft Word-document
+Comment[nn]=Microsoft Word-dokument
+Comment[nso]=Tokomane ya Lentsu la Microsoft
+Comment[pa]=Microsoft Word ਦਸਤਾਵੇਜ਼
+Comment[pl]=Dokument Microsoft Worda
+Comment[pt]=Documento do Microsoft Word
+Comment[pt_BR]=Documento do Microsoft Word
+Comment[ro]=Document Microsoft Word
+Comment[ru]=Документ Microsoft Word
+Comment[rw]=Microsoft Word Inyandiko
+Comment[se]=Microsoft Word-dokumeanta
+Comment[sk]=Dokument Microsoft Word
+Comment[sl]=Dokument za Microsoft Word
+Comment[sq]=Dokument nga Microsoft Word
+Comment[sr]=Microsoft Word-ов документ
+Comment[sr@Latn]=Microsoft Word-ov dokument
+Comment[sv]=Microsoft Word-dokument
+Comment[ta]=மைக்ரோசாப்ட் வேர்டு ஆவணம்
+Comment[te]=మైక్రొసాఫ్ట్ పదం పత్రం
+Comment[tg]=Ҳуҷҷати Microsoft Word
+Comment[th]=เอกสารไมโครซอฟต์เวิร์ด
+Comment[tr]=Microsoft Word Belgesi
+Comment[tt]=Microsoft Word İstälege
+Comment[uk]=Документ MS Word
+Comment[uz]=Microsoft Word hujjati
+Comment[uz@cyrillic]=Microsoft Word ҳужжати
+Comment[ven]=Manwalwa a Microsoft Word
+Comment[vi]=Tài liệu Word của Microsoft™.
+Comment[wa]=Documint Microsoft Word
+Comment[xh]=Uxwebhhu LweMicrosoft Word
+Comment[zh_CN]=Microsoft Word 文档
+Comment[zh_HK]=微軟 Word 文件
+Comment[zh_TW]=微軟 Word 文件
+Comment[zu]=Uhlu Lwamafayela lwe-Microsoft Word
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.doc
+
diff --git a/mimetypes/application/vnd.openxmlformats-officedocument.wordprocessingml.template.desktop b/mimetypes/application/vnd.openxmlformats-officedocument.wordprocessingml.template.desktop
new file mode 100644
index 000000000..014cf209c
--- /dev/null
+++ b/mimetypes/application/vnd.openxmlformats-officedocument.wordprocessingml.template.desktop
@@ -0,0 +1,91 @@
+[Desktop Entry]
+Type=MimeType
+MimeType=application/vnd.openxmlformats-officedocument.wordprocessingml.template
+Patterns=*.dotx;*.DOTX
+Icon=wordprocessing
+Comment=Microsoft Word Document Template
+Comment[af]=Microsoft Woord Dokument
+Comment[ar]=مستند مايكروسوفت وورد
+Comment[az]=Microsoft Word Sənədi
+Comment[be]=Дакумент Microsoft Word
+Comment[bg]=Документ на Microsoft Word
+Comment[bn]=মাইক্রোসফট ওয়ার্ড নথী
+Comment[br]=Teul Microsoft Word
+Comment[bs]=Microsoft Word dokument
+Comment[ca]=Document de Microsoft Word
+Comment[cs]=Dokument programu Microsoft Word
+Comment[csb]=Dokùment Microsoft Worda
+Comment[cy]=Dogfen Microsoft Word
+Comment[da]=Microsoft Word-dokument
+Comment[de]=MS-Word-Dokument
+Comment[el]=Έγγραφο Microsoft Word
+Comment[eo]=Mikrosoft-Word-dokumento
+Comment[es]=Documento de Microsoft Word
+Comment[et]=Microsoft Wordi dokument
+Comment[eu]=Microsoft Word dokumentua
+Comment[fa]=سند میکروسافت ورد
+Comment[fi]=Microsoft Word -asiakirja
+Comment[fr]=Document Microsoft Word
+Comment[fy]=Microsoft Word-dokumint
+Comment[ga]=Cáipéis Microsoft Word
+Comment[gl]=Documento de Microsoft Word
+Comment[he]=מסמך Microsoft Word
+Comment[hi]=माइक्रोसॉफ्ट वर्ड दस्तावेज़
+Comment[hr]=Microsoft Word dokument
+Comment[hu]=Microsoft Word dokumentum
+Comment[id]=Dokumen Microsoft Word
+Comment[is]=Microsoft Word skjal
+Comment[it]=Documento Microsoft Word
+Comment[ja]=Microsoft Word ドキュメント
+Comment[ka]=Microsoft Word–ის დოკუმენტი
+Comment[kk]=Microsoft Word құжаты
+Comment[km]=ឯកសារ Microsoft Word
+Comment[ko]=마이크로소프트 글틀 문서
+Comment[lb]=Microsoft-Word-Dokument
+Comment[lt]=Microsoft Word dokumentas
+Comment[lv]=Microsoft Word dokuments
+Comment[mk]=Microsoft Word-документ
+Comment[mn]=MS-Word-Баримт
+Comment[ms]=Dokumen Microsoft Word
+Comment[mt]=Dokument Microsoft Word
+Comment[nb]=Microsoft Word-dokument
+Comment[nds]="Microsoft Word"-Dokment
+Comment[ne]=माइक्रोसफ्ट वर्ड कागजात
+Comment[nl]=Microsoft Word-document
+Comment[nn]=Microsoft Word-dokument
+Comment[nso]=Tokomane ya Lentsu la Microsoft
+Comment[pa]=Microsoft Word ਦਸਤਾਵੇਜ਼
+Comment[pl]=Dokument Microsoft Worda
+Comment[pt]=Documento do Microsoft Word
+Comment[pt_BR]=Documento do Microsoft Word
+Comment[ro]=Document Microsoft Word
+Comment[ru]=Документ Microsoft Word
+Comment[rw]=Microsoft Word Inyandiko
+Comment[se]=Microsoft Word-dokumeanta
+Comment[sk]=Dokument Microsoft Word
+Comment[sl]=Dokument za Microsoft Word
+Comment[sq]=Dokument nga Microsoft Word
+Comment[sr]=Microsoft Word-ов документ
+Comment[sr@Latn]=Microsoft Word-ov dokument
+Comment[sv]=Microsoft Word-dokument
+Comment[ta]=மைக்ரோசாப்ட் வேர்டு ஆவணம்
+Comment[te]=మైక్రొసాఫ్ట్ పదం పత్రం
+Comment[tg]=Ҳуҷҷати Microsoft Word
+Comment[th]=เอกสารไมโครซอฟต์เวิร์ด
+Comment[tr]=Microsoft Word Belgesi
+Comment[tt]=Microsoft Word İstälege
+Comment[uk]=Документ MS Word
+Comment[uz]=Microsoft Word hujjati
+Comment[uz@cyrillic]=Microsoft Word ҳужжати
+Comment[ven]=Manwalwa a Microsoft Word
+Comment[vi]=Tài liệu Word của Microsoft™.
+Comment[wa]=Documint Microsoft Word
+Comment[xh]=Uxwebhhu LweMicrosoft Word
+Comment[zh_CN]=Microsoft Word 文档
+Comment[zh_HK]=微軟 Word 文件
+Comment[zh_TW]=微軟 Word 文件
+Comment[zu]=Uhlu Lwamafayela lwe-Microsoft Word
+[Property::X-KDE-NativeExtension]
+Type=QString
+Value=.doc
+
diff --git a/mimetypes/application/x-nzb.desktop b/mimetypes/application/x-nzb.desktop
new file mode 100644
index 000000000..4ac9a6d5c
--- /dev/null
+++ b/mimetypes/application/x-nzb.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Comment=NewzBin Usenet Index
+Hidden=false
+MimeType=application/x-nzb
+Icon=bt
+Type=MimeType
+Patterns=*.nzb
+X-KDE-AutoEmbed=false
+X-KDE-isAlso=text/xml
+
diff --git a/pics/Makefile.am b/pics/Makefile.am
index 9112b1620..9df672d94 100644
--- a/pics/Makefile.am
+++ b/pics/Makefile.am
@@ -9,7 +9,7 @@ endif
bin_PROGRAMS = $(KSVGTOPNG)
ksvgtopng_SOURCES = ksvgtopng.cpp
-ksvgtopng_LDADD = $(LIBART_LIBS) $(LIB_KDECORE) $(top_builddir)/kdecore/svgicons/libkdesvgicons.la
+ksvgtopng_LDADD = $(LIB_KDECORE) $(top_builddir)/kdecore/svgicons/libkdesvgicons.la
ksvgtopng_LDFLAGS = $(KDE_RPATH) $(all_libraries)
install-data-local: