diff options
1558 files changed, 131155 insertions, 131155 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a1f952d..3a9f23a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,7 +81,7 @@ OPTION( WITH_AVAHI "Enable AVAHI support" ${WITH_ALL_OPTIONS} ) OPTION( WITH_ELFICON "Enable ELF embedded icon support" ${WITH_ALL_OPTIONS} ) OPTION( WITH_PCRE "Enable pcre regex support for kjs" ON ) OPTION( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_INOTIFY "Enable inotify support for kio" ON ) +OPTION( WITH_INOTIFY "Enable inotify support for tdeio" ON ) OPTION( WITH_GAMIN "Enable FAM/GAMIN support" ${WITH_ALL_OPTIONS} ) option( WITH_UPOWER "Enable UPOWER support" ${WITH_ALL_OPTIONS} ) OPTION( WITH_NETWORK_MANAGER_BACKEND "Enable network-manager support" OFF ) @@ -745,7 +745,7 @@ endif( ) # before altering the LIBR_VERSION check, # please ensure that nothing changed in the # duplicated data definitions present in -# kio/kio/kfileitem.cpp +# tdeio/tdeio/tdefileitem.cpp if( WITH_ELFICON ) pkg_search_module( LIBR libr ) @@ -886,7 +886,7 @@ configure_file( config.h.cmake config.h ) configure_file( dcop/dcop-path.h.cmake dcop/dcop-path.h ) configure_file( tdecore/kdemacros.h.cmake tdecore/kdemacros.h ) configure_file( kjs/global.h.in kjs/global.h ) -configure_file( kio/kssl/ksslconfig.h.cmake kio/kssl/ksslconfig.h ) +configure_file( tdeio/kssl/ksslconfig.h.cmake tdeio/kssl/ksslconfig.h ) configure_file( kdoctools/checkXML.cmake kdoctools/checkXML ) @@ -895,7 +895,7 @@ configure_file( kdoctools/checkXML.cmake kdoctools/checkXML ) set( KDE3_DCOPIDL_EXECUTABLE ${CMAKE_BINARY_DIR}/dcop/dcopidl/dcopidl ) set( KDE3_DCOPIDL2CPP_EXECUTABLE ${CMAKE_BINARY_DIR}/dcop/dcopidl2cpp/dcopidl2cpp ) set( KDE3_MEINPROC_EXECUTABLE ${CMAKE_BINARY_DIR}/kdoctools/meinproc ) -set( KDE3_KCFGC_EXECUTABLE ${CMAKE_BINARY_DIR}/tdecore/kconfig_compiler/kconfig_compiler ) +set( KDE3_KCFGC_EXECUTABLE ${CMAKE_BINARY_DIR}/tdecore/tdeconfig_compiler/tdeconfig_compiler ) ##### global compiler settings ################## @@ -937,7 +937,7 @@ add_subdirectory( tdeui ) add_subdirectory( tdesu ) add_subdirectory( kjs ) add_subdirectory( tdewallet ) -add_subdirectory( kio ) +add_subdirectory( tdeio ) add_subdirectory( kded ) # FIXME this directory/target doesn't exists @@ -962,11 +962,11 @@ if( XRANDR_FOUND ) add_subdirectory( tderandr ) endif( XRANDR_FOUND ) add_subdirectory( tdehtml ) -add_subdirectory( kcmshell ) -add_subdirectory( kconf_update ) +add_subdirectory( tdecmshell ) +add_subdirectory( tdeconf_update ) add_subdirectory( kdewidgets ) add_subdirectory( kimgio ) -add_subdirectory( kioslave ) +add_subdirectory( tdeioslave ) add_subdirectory( kstyles ) add_subdirectory( libtdemid ) add_subdirectory( libtdescreensaver ) @@ -977,7 +977,7 @@ add_subdirectory( licenses ) add_subdirectory( dnssd ) add_subdirectory( pics ) add_subdirectory( mimetypes ) -add_subdirectory( kfile-plugins ) +add_subdirectory( tdefile-plugins ) ##### install import cmake modules ############### diff --git a/KDE2PORTING.html b/KDE2PORTING.html index c373e83f..131c7457 100644 --- a/KDE2PORTING.html +++ b/KDE2PORTING.html @@ -205,7 +205,7 @@ must have created a TDEApplication object before the methods can be used.<P> <TD COLSPAN="2"> <PRE> #include <kglobal.h> - #include <kconfig.h> // Needed to use TDEConfig + #include <tdeconfig.h> // Needed to use TDEConfig #include <klocale.h> // Needed to use KLocale #include <kiconloader.h> // Needed to use KIconLoader </PRE> @@ -501,20 +501,20 @@ are necessary to convert your old KDND-based stuff to Qt DND.<P> <H3><A NAME="libkfm">libkfm has disappeared</A></H3> Lots of other functionalities have been taken out of kfm, some being - now in libkio, some in libkonq.<P> + now in libtdeio, some in libkonq.<P> <STRONG> Replacement table :</STRONG><P> <TABLE BORDER="1"> -<TR><TD>KFM::download </TD><TD>-> TDEIO::NetAccess::download (tdelibs/kio/netaccess.h)</TD></TR> +<TR><TD>KFM::download </TD><TD>-> TDEIO::NetAccess::download (tdelibs/tdeio/netaccess.h)</TD></TR> <TR><TD>KFM::removeTempFile </TD><TD>-> TDEIO::NetAccess::removeTempFile</TD></TR> <TR><TD COLSPAN="2" ROWSPAN="0">refreshDesktop, sortDesktop, selectRootIcons : removed; kdesktop handles it</TD></TR> <TR><TD>KFM::configure </TD><TD>-> see konqueror DCOP interface</TD></TR> -<TR><TD>KFM::openURL </TD><TD>-> "(void) new KRun (url)" (tdelibs/kio/krun.h)</TD></TR> +<TR><TD>KFM::openURL </TD><TD>-> "(void) new KRun (url)" (tdelibs/tdeio/krun.h)</TD></TR> <TR><TD>KFM::refreshDirectory </TD><TD>-> not needed anymore since konqy/kdesktop use KDirWatch</TD></TR> -<TR><TD>KFM::openProperties </TD><TD>-> "(void) new KPropertiesDialog (url)" (tdelibs/kfile/kpropsdlg.h)</TD></TR> -<TR><TD>KFM::exec </TD><TD>-> "(void) new KRun (url)" (tdelibs/kio/krun.h)</TD></TR> -<TR><TD>KFM::copy, KFM::move </TD><TD>-> TDEIO::Job (async, see kio/job.h)<BR> - or TDEIO::NetAccess (sync, see kio/netaccess.h)</TD></TR> +<TR><TD>KFM::openProperties </TD><TD>-> "(void) new KPropertiesDialog (url)" (tdelibs/tdefile/kpropsdlg.h)</TD></TR> +<TR><TD>KFM::exec </TD><TD>-> "(void) new KRun (url)" (tdelibs/tdeio/krun.h)</TD></TR> +<TR><TD>KFM::copy, KFM::move </TD><TD>-> TDEIO::Job (async, see tdeio/job.h)<BR> + or TDEIO::NetAccess (sync, see tdeio/netaccess.h)</TD></TR> <TR><TD>DlgLocation </TD><TD>-> Use KLineEditDlg (tdeui/klineeditdlg.h) instead</TD></TR> </TABLE> diff --git a/KDE3PORTING.html b/KDE3PORTING.html index 645bd761..7d6130ac 100644 --- a/KDE3PORTING.html +++ b/KDE3PORTING.html @@ -23,7 +23,7 @@ or <a href="http://doc.trolltech.com/3.0/porting.html">this page online</a>.<P> <LI><A HREF="#tdeparts">Changes in tdeparts</A></LI> <LI><A HREF="#tdespell">Changes in tdespell</A></LI> <LI><A HREF="#tdehtmlpart">API-cleanup in KHTML</A></LI> -<LI><A HREF="#kfile">Changes in kfile</A></LI> +<LI><A HREF="#tdefile">Changes in tdefile</A></LI> <LI><A HREF="#kcontrol">TDE Control Center</A></LI> <LI><A HREF="#kicker">Panel Applets and Extensions</A></LI> </UL> @@ -214,7 +214,7 @@ The preferred means of defining a shortcut, however, is to use <b>KAction</b>. <H4>KIconLoader, KIconTheme</H4> Methods now use KIcon::Group and KIcon::Context instead of int as types for group and context arguments. The change should affect only code using hardcoded numeric values instead of using the proper enum constants. -This applies to classes KIconLoader, KIconTheme and (in kio and kfile) KMimeType, KService, KIconDialog, KIconButton, +This applies to classes KIconLoader, KIconTheme and (in kio and tdefile) KMimeType, KService, KIconDialog, KIconButton, KURLBar and KURLBarItem. <H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4> @@ -416,7 +416,7 @@ TQString&) is not a slot anymore. <H4>KOpenWithHandler / KFileOpenWithHandler</H4> Those two classes are deprecated, no need to create a KFileOpenWithHandler anymore. -The merging of libkio, libtdesycoca, libkfile and libkssl into a single libkio has +The merging of libtdeio, libtdesycoca, libtdefile and libkssl into a single libtdeio has allowed to fix this dependency problem: KRun can now use the OpenWith dialog directly. <H4>KMimeType, KService</H4> @@ -520,14 +520,14 @@ disable this use a #define KDE_NO_COMPAT. </ul> <H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4> -<H3><A NAME="kfile">Changes in kfile</A></H3> -The kfile-library, as used by the KFileDialog provides classes for directory browsing widgets. +<H3><A NAME="tdefile">Changes in tdefile</A></H3> +The tdefile-library, as used by the KFileDialog provides classes for directory browsing widgets. Those classes gained some new features, some parts were merged with other existing classes -and in some cases the API was cleaned up/fixed. The library is now built as part of libkio -library (there's no need to modify Makefiles which use $LIB_KFILE instead of hardcoding -lkfile). +and in some cases the API was cleaned up/fixed. The library is now built as part of libtdeio +library (there's no need to modify Makefiles which use $LIB_KFILE instead of hardcoding -ltdefile). <p> Even if the list of changes is long, the affected code base should be relatively small, as most -parts are rarely used outside of kfile. +parts are rarely used outside of tdefile. <p> The changes are: <H4>KFileItem</H4> diff --git a/Mainpage.dox b/Mainpage.dox index ef574522..15904678 100644 --- a/Mainpage.dox +++ b/Mainpage.dox @@ -20,8 +20,8 @@ * - <a target="_top" href="kjs/html/index.html"><b>kjs</b></a> * (<a target="_top" href="kjs/html/classes.html">classes</a>)\n * <i>Javascript (aka. ECMAScript and JScript) support.</i> - * - <a target="_top" href="kio/html/index.html"><b>kio</b></a> - * (<a target="_top" href="kio/kio/html/classes.html">classes</a>)\n + * - <a target="_top" href="tdeio/html/index.html"><b>kio</b></a> + * (<a target="_top" href="tdeio/tdeio/html/classes.html">classes</a>)\n * <i>Low level access to network files. Also provides access to facilities * such as KDirWatcher which monitors directories for changes.</i> * - <a target="_top" href="tdeparts/html/index.html"><b>tdeparts</b></a> diff --git a/Makefile.am.in b/Makefile.am.in index 10e9219d..83d0901f 100644 --- a/Makefile.am.in +++ b/Makefile.am.in @@ -27,7 +27,7 @@ COMPILE_BEFORE_kabc = kab tderesources COMPILE_BEFORE_kate = interfaces tdeutils COMPILE_BEFORE_tdemdi = tdeutils COMPILE_BEFORE_tdespell2 = tdeutils -COMPILE_BEFORE_kcmshell = tdeutils +COMPILE_BEFORE_tdecmshell = tdeutils COMPILE_BEFORE_kdewidgets = kabc tdehtml COMPILE_BEFORE_interfaces = arts kabc @@ -42,7 +42,7 @@ Here is an alphabetical list: * tdecert Personal certification manager. -* kconf_update +* tdeconf_update Auto-Updater for config files. * tdecore @@ -89,7 +89,7 @@ Here is an alphabetical list: contains "tdesycoca", the system configure cache containing services, applications, servicetypes and mimetypes. -* kioslave +* tdeioslave I/O subprocesses to handle files, ftp, http, gzip and bzip2 streams. * kjs @@ -180,9 +180,9 @@ that we would like to make for the next binary incompatible release. - KWallet::Wallet::* functions - remove the default = 0 argument for mainwindow for the dialog -- Make libtdewalletclient part of libkio and get rid of libtdewalletclient. +- Make libtdewalletclient part of libtdeio and get rid of libtdewalletclient. -- Get rid of libtdesu dependency in libkio, get rid of SessionData::AuthData*, +- Get rid of libtdesu dependency in libtdeio, get rid of SessionData::AuthData*, get rid of SlaveInterface::authorizationKey and SlaveInterface::delAuthorization - Make functions in KHelpMenu virtual so they can be overridden (ex: to provide @@ -215,7 +215,7 @@ an alternative help->contents action) - Move TDEIO::findDeviceMountPoint, findPathMoundPoint, probably_slow_mounted, and testFileSystemFlag to KMountPoint, to merge that code. -- Refactor the kio/bookmarks code so we don't need to use the static d-pointer trick anymore. +- Refactor the tdeio/bookmarks code so we don't need to use the static d-pointer trick anymore. - Rename the parameters to KDEDesktopMimeType::pixmap so that they use meaningful names rather than just a, b, c, and d. Probably not something that has to wait for KDE 4, but seems like a good idea diff --git a/arts/kde/CMakeLists.txt b/arts/kde/CMakeLists.txt index 3877ddb9..3b585256 100644 --- a/arts/kde/CMakeLists.txt +++ b/arts/kde/CMakeLists.txt @@ -18,8 +18,8 @@ include_directories( ${CMAKE_BINARY_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio ) link_directories( @@ -65,6 +65,6 @@ add_custom_command( tde_add_library( ${target} SHARED AUTOMOC SOURCES ${${target}_SRCS} VERSION 1.2.0 - LINK kio-shared mcop artsflow_idl kmedia2_idl soundserver_idl artsflow qtmcop + LINK tdeio-shared mcop artsflow_idl kmedia2_idl soundserver_idl artsflow qtmcop DESTINATION ${LIB_INSTALL_DIR} ) diff --git a/arts/kde/kioinputstream_impl.cpp b/arts/kde/kioinputstream_impl.cpp index 4ff50998..bf6b3654 100644 --- a/arts/kde/kioinputstream_impl.cpp +++ b/arts/kde/kioinputstream_impl.cpp @@ -31,9 +31,9 @@ #include <kapplication.h> #include <kdebug.h> -#include <kio/job.h> -#include <kio/kmimetype.h> -#include <kio/jobclasses.h> +#include <tdeio/job.h> +#include <tdeio/kmimetype.h> +#include <tdeio/jobclasses.h> #include <tqtimer.h> #include <tqdatastream.h> #include "artsversion.h" diff --git a/arts/kde/kioinputstream_impl.h b/arts/kde/kioinputstream_impl.h index d0a87288..1d18f642 100644 --- a/arts/kde/kioinputstream_impl.h +++ b/arts/kde/kioinputstream_impl.h @@ -24,7 +24,7 @@ #include <tqobject.h> #include <tqcstring.h> -#include <kio/jobclasses.h> +#include <tdeio/jobclasses.h> #include <kurl.h> #include "artskde.h" #include "stdsynthmodule.h" diff --git a/arts/kde/kplayobjectcreator.cc b/arts/kde/kplayobjectcreator.cc index 2e8187e6..039c8a3b 100644 --- a/arts/kde/kplayobjectcreator.cc +++ b/arts/kde/kplayobjectcreator.cc @@ -19,7 +19,7 @@ */ -#include <kio/kmimetype.h> +#include <tdeio/kmimetype.h> #include "artskde.h" #include "kplayobjectcreator.h" #include "kplayobjectcreator.moc" diff --git a/arts/kde/kplayobjectfactory.cc b/arts/kde/kplayobjectfactory.cc index db411079..fa9e2c5a 100644 --- a/arts/kde/kplayobjectfactory.cc +++ b/arts/kde/kplayobjectfactory.cc @@ -19,7 +19,7 @@ */ -#include <kio/kmimetype.h> +#include <tdeio/kmimetype.h> #include "kplayobject.h" #include "artskde.h" #include "kplayobjectfactory.h" @@ -33,7 +33,7 @@ #include <kdebug.h> #include "kaudiomanagerplay.h" #include <flowsystem.h> -#include <kio/netaccess.h> +#include <tdeio/netaccess.h> using namespace std; diff --git a/arts/knotify/knotify.cpp b/arts/knotify/knotify.cpp index b8c1642f..71006c1a 100644 --- a/arts/knotify/knotify.cpp +++ b/arts/knotify/knotify.cpp @@ -50,7 +50,7 @@ #include <kartsserver.h> #endif #include <kcmdlineargs.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kdebug.h> #include <kglobal.h> #include <klocale.h> diff --git a/configure.in.in b/configure.in.in index c899ee51..00870d24 100644 --- a/configure.in.in +++ b/configure.in.in @@ -252,9 +252,9 @@ AC_SUBST(LIB_KAB, '$(top_builddir)/kab/libkab.la') AC_SUBST(LIB_KABC, '$(top_builddir)/kabc/libkabc.la') AC_SUBST(LIB_TDECORE, '$(top_builddir)/tdecore/libtdecore.la') AC_SUBST(LIB_TDEUI, '$(top_builddir)/tdeui/libtdeui.la') -AC_SUBST(LIB_KIO, '$(top_builddir)/kio/libkio.la') -AC_SUBST(LIB_KFILE, '$(top_builddir)/kio/libkio.la') -AC_SUBST(LIB_KSYCOCA, '$(top_builddir)/kio/libkio.la') +AC_SUBST(LIB_KIO, '$(top_builddir)/tdeio/libtdeio.la') +AC_SUBST(LIB_KFILE, '$(top_builddir)/tdeio/libtdeio.la') +AC_SUBST(LIB_KSYCOCA, '$(top_builddir)/tdeio/libtdeio.la') AC_SUBST(LIB_KHTML, '$(top_builddir)/tdehtml/libtdehtml.la') AC_SUBST(LIB_TDEPRINT, '$(top_builddir)/tdeprint/libtdeprint.la') AC_SUBST(LIB_KPARTS, '$(top_builddir)/tdeparts/libtdeparts.la') @@ -308,7 +308,7 @@ AC_SUBST(DCOPIDL, '$(top_builddir)/dcop/dcopidl/dcopidl') AC_SUBST(DCOPIDLNG, '$(top_srcdir)/dcop/dcopidlng/dcopidlng') AC_SUBST(DCOPIDL2CPP, '$(top_builddir)/dcop/dcopidl2cpp/dcopidl2cpp') AC_SUBST(MAKEKDEWIDGETS, '$(top_builddir)/kdewidgets/makekdewidgets') -AC_SUBST(KCONFIG_COMPILER, '$(top_builddir)/tdecore/kconfig_compiler/kconfig_compiler') +AC_SUBST(KCONFIG_COMPILER, '$(top_builddir)/tdecore/tdeconfig_compiler/tdeconfig_compiler') ac_save_LIBS="$LIBS" LIBS="$LIBS $X_LDFLAGS -lICE" diff --git a/configure.in.mid b/configure.in.mid index 669f0d13..bf0c8d02 100644 --- a/configure.in.mid +++ b/configure.in.mid @@ -1,7 +1,7 @@ dnl put here things which have to be done after all usual autoconf macros dnl have been run, but before the Makefiles are created -all_includes='-I$(top_srcdir)/dcop -I$(top_srcdir)/libltdl -I$(top_srcdir)/tdefx -I$(top_builddir)/tdecore -I$(top_srcdir)/tdecore -I$(top_srcdir)/tdecore/network -I$(top_srcdir)/tdeui -I$(top_srcdir)/kio -I$(top_srcdir)/kio/kio -I$(top_srcdir)/kio/kfile -I$(top_srcdir) $(QT_INCLUDES) $(X_INCLUDES) $(KDE_INCLUDES) $(USER_INCLUDES)' +all_includes='-I$(top_srcdir)/dcop -I$(top_srcdir)/libltdl -I$(top_srcdir)/tdefx -I$(top_builddir)/tdecore -I$(top_srcdir)/tdecore -I$(top_srcdir)/tdecore/network -I$(top_srcdir)/tdeui -I$(top_srcdir)/tdeio -I$(top_srcdir)/tdeio/tdeio -I$(top_srcdir)/tdeio/tdefile -I$(top_srcdir) $(QT_INCLUDES) $(X_INCLUDES) $(KDE_INCLUDES) $(USER_INCLUDES)' AC_SUBST(all_includes) CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS" diff --git a/dcop/client/dcopfind.cpp b/dcop/client/dcopfind.cpp index a4bcb67b..940d62fd 100644 --- a/dcop/client/dcopfind.cpp +++ b/dcop/client/dcopfind.cpp @@ -166,16 +166,16 @@ bool launchApp(TQString app) TQDataStream arg(data, IO_WriteOnly); arg << app << URLs; - if ( !dcop->call( "klauncher", "klauncher", "start_service_by_desktop_name(TQString,TQStringList)", + if ( !dcop->call( "tdelauncher", "tdelauncher", "start_service_by_desktop_name(TQString,TQStringList)", data, replyType, replyData) ) { - tqWarning( "call to klauncher failed."); + tqWarning( "call to tdelauncher failed."); return false; } TQDataStream reply(replyData, IO_ReadOnly); if ( replyType != "serviceResult" ) { - tqWarning( "unexpected result '%s' from klauncher.", replyType.data()); + tqWarning( "unexpected result '%s' from tdelauncher.", replyType.data()); return false; } int result; diff --git a/dcop/client/dcopstart.cpp b/dcop/client/dcopstart.cpp index 73718438..a3ea0472 100644 --- a/dcop/client/dcopstart.cpp +++ b/dcop/client/dcopstart.cpp @@ -49,7 +49,7 @@ void startApp(const char *_app, int argc, const char **args) TQDataStream arg(data, IO_WriteOnly); arg << app << URLs; - if ( !dcop->call( "klauncher", "klauncher", function, data, replyType, replyData) ) { + if ( !dcop->call( "tdelauncher", "tdelauncher", function, data, replyType, replyData) ) { tqWarning( "call failed"); exit(1); } else { diff --git a/dcop/dcopidlng/kalyptus b/dcop/dcopidlng/kalyptus index 41f49333..ec16d8fa 100644 --- a/dcop/dcopidlng/kalyptus +++ b/dcop/dcopidlng/kalyptus @@ -1514,7 +1514,7 @@ sub makeParamList($$$) } if (defined $defaultparam && $isEnum) { - # Remove any casts in enum values, for example this in kfileitem.h: + # Remove any casts in enum values, for example this in tdefileitem.h: # 'enum { Unknown = (mode_t) - 1 };' $defaultparam =~ s/\([^\)]+\)(.*[0-9].*)/$1/; } diff --git a/dnssd/CMakeLists.txt b/dnssd/CMakeLists.txt index 09d96161..01be9831 100644 --- a/dnssd/CMakeLists.txt +++ b/dnssd/CMakeLists.txt @@ -45,6 +45,6 @@ tde_add_library( ${target} SHARED AUTOMOC SOURCES ${${target}_SRCS} VERSION 1.0.0 LINK tdecore-shared - DEPENDENCIES kconfig_compiler + DEPENDENCIES tdeconfig_compiler DESTINATION ${LIB_INSTALL_DIR} ) diff --git a/doc/api/kfiledialog.png b/doc/api/tdefiledialog.png Binary files differindex fa54aa3b..fa54aa3b 100644 --- a/doc/api/kfiledialog.png +++ b/doc/api/tdefiledialog.png diff --git a/doc/tdelibs/man-kbuildsycoca.8.docbook b/doc/tdelibs/man-kbuildsycoca.8.docbook deleted file mode 100644 index 670c000c..00000000 --- a/doc/tdelibs/man-kbuildsycoca.8.docbook +++ /dev/null @@ -1,221 +0,0 @@ -<?xml version="1.0" ?> -<!DOCTYPE refentry PUBLIC "-//KDE//DTD DocBook XML V4.1-Based Variant V1.0//EN" "dtd/kdex.dtd" [ - <!ENTITY % English "INCLUDE"><!-- change language only here --> -]> - -<refentry> - -<refentryinfo> - -<author> -<firstname>Darian</firstname> -<surname>Lanx</surname> -<affiliation> -<address><email>content@openprojects.net</email></address> -</affiliation> -</author> - -<date>2001-04-25</date> -<releaseinfo>0.01.01</releaseinfo> - -</refentryinfo> - -<refmeta> -<refentrytitle>KBuildSycoca</refentrytitle> -<manvolnum>8</manvolnum> -</refmeta> - -<refnamediv> -<refname>Description</refname> -<refpurpose>Rebuilds the system configuration cache.</refpurpose> -</refnamediv> - -<refsynopsisdiv> -<title>Synopsis</title> - -<cmdsynopsis> -<command>kbuildsycoca</command> - -<group> -<arg choice="opt">--nosignal</arg> -<arg choice="opt">--incremental</arg> -<arg choice="opt">--help</arg> -<arg choice="opt">--help-qt</arg> -<arg choice="opt">--help-kde</arg> -<arg choice="opt">--help-all</arg> -<arg choice="opt">--author</arg> -<arg choice="opt">-v, --version</arg> -<arg choice="opt">--license</arg> -</group> -</cmdsynopsis> - -</refsynopsisdiv> - -<refsect1> -<title>Description</title> - -<para> -<command>kbuildsyscoca</command>, as part of the &tde; command line -tools ensures the proper operation of &tde; by reading in all the -<literal role="extension">.desktop</literal>, <literal -role="extension">.directory</literal>, <literal -role="extension">.kimgio</literal> and <literal -role="extension">.protocol</literal> files to constructs a binary -database. -</para> - -<para> -&tde; itself accesses this databse during operation to provide -configurational information a program needs to run. -</para> - -<para> -This tool is part of ksyscoca, which stands for &tde; System -Configuration Cache -</para> - -</refsect1> - -<refsect1> -<title>Options</title> - -<variablelist> -<varlistentry> -<term><option>--nosignal</option></term> -<listitem> -<para>Don't signal applications </para> -</listitem> -</varlistentry> - -<varlistentry> -<term><option>--incremental</option></term> -<listitem> -<para>Incremental Update</para> -</listitem> -</varlistentry> - -<!-- this entire section from here to the end of the section could be an --> -<!-- entity.. or maybe just so irrelevant as to leave it out --> - -<varlistentry> -<term><option>--help</option></term> -<listitem> -<para> -Show help about options -</para> -</listitem> -</varlistentry> - -<varlistentry> -<term><option>--help-qt</option></term> -<listitem> -<para> -Show Qt specific options -</para> -</listitem> -</varlistentry> - -<varlistentry> -<term><option>--help-kde</option></term> -<listitem> -<para> -Show KDE specific options -</para> -</listitem> -</varlistentry> - -<varlistentry> -<term><option>--help-all</option></term> -<listitem> -<para> -Show all options -</para> -</listitem> -</varlistentry> - -<varlistentry> -<term><option>--author</option></term> -<listitem> -<para> -Show author information -</para> -</listitem> -</varlistentry> - -<varlistentry> -<term><option>--version</option></term> -<listitem> -<para> -Show version information -</para> -</listitem> -</varlistentry> - -<varlistentry> -<term><option>--license</option></term> -<listitem> -<para> -Show license information -</para> -</listitem> -</varlistentry> -</variablelist> - -</refsect1> - -<refsect1> -<title>Usage</title> -<para> -A standard way to run this program is by simply specifying the following -command at the prompt -<userinput><command>kbuildsyscoca</command></userinput> -</para> - -</refsect1> - -<refsect1> -<title>Files</title> - -<variablelist> -<varlistentry> -<term><filename>/tmp/tde-$USER/ksyscoca</filename></term> -<listitem> -<para>...</para> -</listitem> -</varlistentry> -</variablelist> - -</refsect1> - -<refsect1> -<title>Environment Variables</title> -<variablelist> -<varlistentry> -<term>$<envar>TDEDIRS</envar></term> -<listitem> -<para>Specifies which directories are part of the KDE -installations</para> -</listitem> -</varlistentry> -</variablelist> - -</refsect1> - -<refsect1> -<title>See Also</title> - -<para>tdesycoca(3), kblah(4), knogga(6)</para> - -</refsect1> - -<refsect1> -<title>Bugs</title> - -<para>There are no known bugs at the time of writing.</para> - -</refsect1> - -</refentry> - - - diff --git a/doc/tdelibs/man-tdebuildsycoca.8.docbook b/doc/tdelibs/man-tdebuildsycoca.8.docbook new file mode 100644 index 00000000..243e0f9a --- /dev/null +++ b/doc/tdelibs/man-tdebuildsycoca.8.docbook @@ -0,0 +1,221 @@ +<?xml version="1.0" ?> +<!DOCTYPE refentry PUBLIC "-//KDE//DTD DocBook XML V4.1-Based Variant V1.0//EN" "dtd/kdex.dtd" [ + <!ENTITY % English "INCLUDE"><!-- change language only here --> +]> + +<refentry> + +<refentryinfo> + +<author> +<firstname>Darian</firstname> +<surname>Lanx</surname> +<affiliation> +<address><email>content@openprojects.net</email></address> +</affiliation> +</author> + +<date>2001-04-25</date> +<releaseinfo>0.01.01</releaseinfo> + +</refentryinfo> + +<refmeta> +<refentrytitle>KBuildSycoca</refentrytitle> +<manvolnum>8</manvolnum> +</refmeta> + +<refnamediv> +<refname>Description</refname> +<refpurpose>Rebuilds the system configuration cache.</refpurpose> +</refnamediv> + +<refsynopsisdiv> +<title>Synopsis</title> + +<cmdsynopsis> +<command>tdebuildsycoca</command> + +<group> +<arg choice="opt">--nosignal</arg> +<arg choice="opt">--incremental</arg> +<arg choice="opt">--help</arg> +<arg choice="opt">--help-qt</arg> +<arg choice="opt">--help-kde</arg> +<arg choice="opt">--help-all</arg> +<arg choice="opt">--author</arg> +<arg choice="opt">-v, --version</arg> +<arg choice="opt">--license</arg> +</group> +</cmdsynopsis> + +</refsynopsisdiv> + +<refsect1> +<title>Description</title> + +<para> +<command>kbuildsyscoca</command>, as part of the &tde; command line +tools ensures the proper operation of &tde; by reading in all the +<literal role="extension">.desktop</literal>, <literal +role="extension">.directory</literal>, <literal +role="extension">.kimgio</literal> and <literal +role="extension">.protocol</literal> files to constructs a binary +database. +</para> + +<para> +&tde; itself accesses this databse during operation to provide +configurational information a program needs to run. +</para> + +<para> +This tool is part of ksyscoca, which stands for &tde; System +Configuration Cache +</para> + +</refsect1> + +<refsect1> +<title>Options</title> + +<variablelist> +<varlistentry> +<term><option>--nosignal</option></term> +<listitem> +<para>Don't signal applications </para> +</listitem> +</varlistentry> + +<varlistentry> +<term><option>--incremental</option></term> +<listitem> +<para>Incremental Update</para> +</listitem> +</varlistentry> + +<!-- this entire section from here to the end of the section could be an --> +<!-- entity.. or maybe just so irrelevant as to leave it out --> + +<varlistentry> +<term><option>--help</option></term> +<listitem> +<para> +Show help about options +</para> +</listitem> +</varlistentry> + +<varlistentry> +<term><option>--help-qt</option></term> +<listitem> +<para> +Show Qt specific options +</para> +</listitem> +</varlistentry> + +<varlistentry> +<term><option>--help-kde</option></term> +<listitem> +<para> +Show KDE specific options +</para> +</listitem> +</varlistentry> + +<varlistentry> +<term><option>--help-all</option></term> +<listitem> +<para> +Show all options +</para> +</listitem> +</varlistentry> + +<varlistentry> +<term><option>--author</option></term> +<listitem> +<para> +Show author information +</para> +</listitem> +</varlistentry> + +<varlistentry> +<term><option>--version</option></term> +<listitem> +<para> +Show version information +</para> +</listitem> +</varlistentry> + +<varlistentry> +<term><option>--license</option></term> +<listitem> +<para> +Show license information +</para> +</listitem> +</varlistentry> +</variablelist> + +</refsect1> + +<refsect1> +<title>Usage</title> +<para> +A standard way to run this program is by simply specifying the following +command at the prompt +<userinput><command>kbuildsyscoca</command></userinput> +</para> + +</refsect1> + +<refsect1> +<title>Files</title> + +<variablelist> +<varlistentry> +<term><filename>/tmp/tde-$USER/ksyscoca</filename></term> +<listitem> +<para>...</para> +</listitem> +</varlistentry> +</variablelist> + +</refsect1> + +<refsect1> +<title>Environment Variables</title> +<variablelist> +<varlistentry> +<term>$<envar>TDEDIRS</envar></term> +<listitem> +<para>Specifies which directories are part of the KDE +installations</para> +</listitem> +</varlistentry> +</variablelist> + +</refsect1> + +<refsect1> +<title>See Also</title> + +<para>tdesycoca(3), kblah(4), knogga(6)</para> + +</refsect1> + +<refsect1> +<title>Bugs</title> + +<para>There are no known bugs at the time of writing.</para> + +</refsect1> + +</refentry> + + + diff --git a/interfaces/kio/CMakeLists.txt b/interfaces/kio/CMakeLists.txt index efcecf65..a8d8a218 100644 --- a/interfaces/kio/CMakeLists.txt +++ b/interfaces/kio/CMakeLists.txt @@ -13,5 +13,5 @@ install( FILES http.h - DESTINATION ${INCLUDE_INSTALL_DIR}/kio ) + DESTINATION ${INCLUDE_INSTALL_DIR}/tdeio ) diff --git a/interfaces/kio/Makefile.am b/interfaces/kio/Makefile.am index 8fad2420..daa98db0 100644 --- a/interfaces/kio/Makefile.am +++ b/interfaces/kio/Makefile.am @@ -1,3 +1,3 @@ -kioincludedir = $(includedir)/kio +kioincludedir = $(includedir)/tdeio kioinclude_HEADERS = http.h diff --git a/interfaces/kregexpeditor/Makefile.am b/interfaces/kregexpeditor/Makefile.am index 2007129d..4e8f5af2 100644 --- a/interfaces/kregexpeditor/Makefile.am +++ b/interfaces/kregexpeditor/Makefile.am @@ -1,6 +1,6 @@ # $Id$ -INCLUDES = -I$(top_srcdir)/kio -I$(top_srcdir) $(all_includes) +INCLUDES = -I$(top_srcdir)/tdeio -I$(top_srcdir) $(all_includes) include_HEADERS = kregexpeditorinterface.h diff --git a/interfaces/tdeimproxy/library/CMakeLists.txt b/interfaces/tdeimproxy/library/CMakeLists.txt index 9aa1f60e..40974d72 100644 --- a/interfaces/tdeimproxy/library/CMakeLists.txt +++ b/interfaces/tdeimproxy/library/CMakeLists.txt @@ -18,7 +18,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/dcop ${CMAKE_SOURCE_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio/kio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio ) link_directories( @@ -45,7 +45,7 @@ set( ${target}_SRCS tde_add_library( ${target} SHARED AUTOMOC SOURCES ${${target}_SRCS} VERSION 0.0.0 - LINK kio-shared + LINK tdeio-shared DESTINATION ${LIB_INSTALL_DIR} DEPENDENCIES dcopidl ) diff --git a/interfaces/tdemediaplayer/CMakeLists.txt b/interfaces/tdemediaplayer/CMakeLists.txt index 00ab7f3d..0c935556 100644 --- a/interfaces/tdemediaplayer/CMakeLists.txt +++ b/interfaces/tdemediaplayer/CMakeLists.txt @@ -10,7 +10,7 @@ ################################################# if( ARTS_FOUND ) - add_subdirectory( kfileaudiopreview ) + add_subdirectory( tdefileaudiopreview ) endif( ARTS_FOUND ) include_directories( diff --git a/interfaces/tdemediaplayer/Makefile.am b/interfaces/tdemediaplayer/Makefile.am index 0b7aded0..91ed342b 100644 --- a/interfaces/tdemediaplayer/Makefile.am +++ b/interfaces/tdemediaplayer/Makefile.am @@ -1,8 +1,8 @@ if include_ARTS -kfileaudiopreview_subdir = kfileaudiopreview +tdefileaudiopreview_subdir = tdefileaudiopreview endif -SUBDIRS = . $(kfileaudiopreview_subdir) +SUBDIRS = . $(tdefileaudiopreview_subdir) INCLUDES = -I$(srcdir)/.. $(all_includes) lib_LTLIBRARIES = libtdemediaplayer.la diff --git a/interfaces/tdemediaplayer/kfileaudiopreview/CMakeLists.txt b/interfaces/tdemediaplayer/kfileaudiopreview/CMakeLists.txt deleted file mode 100644 index 17485b65..00000000 --- a/interfaces/tdemediaplayer/kfileaudiopreview/CMakeLists.txt +++ /dev/null @@ -1,46 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${TQT_INCLUDE_DIRS} - ${ARTS_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/dcop - ${CMAKE_SOURCE_DIR}/interfaces - ${CMAKE_SOURCE_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio - ${CMAKE_SOURCE_DIR}/kio/kfile - ${CMAKE_SOURCE_DIR}/arts/kde -) - -link_directories( - ${TQT_LIBRARY_DIRS} - ${ARTS_LIBRARY_DIRS} -) - - -##### kfileaudiopreview ######################### - -set( target kfileaudiopreview ) - -set( ${target}_SRCS - kfileaudiopreview.cpp -) - -tde_add_kpart( ${target} AUTOMOC - SOURCES ${${target}_SRCS} - LINK tdemediaplayer-shared artskde-shared - DESTINATION ${PLUGIN_INSTALL_DIR} -) diff --git a/interfaces/tdemediaplayer/kfileaudiopreview/Makefile.am b/interfaces/tdemediaplayer/kfileaudiopreview/Makefile.am deleted file mode 100644 index 4f88a0c8..00000000 --- a/interfaces/tdemediaplayer/kfileaudiopreview/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -INCLUDES = -I$(top_srcdir)/interfaces/ -I$(top_srcdir)/arts/kde -I$(includedir)/arts $(all_includes) -METASOURCES = AUTO - -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/tdemediaplayer/libtdemediaplayer.la $(top_builddir)/arts/kde/libartskde.la $(LIB_KIO) $(LIB_QT) $(LIB_TDECORE) - -noinst_HEADERS = kfileaudiopreview.h - -messages: - $(XGETTEXT) $(kfileaudiopreview_la_SOURCES) -o $(podir)/kfileaudiopreview.pot diff --git a/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.cpp b/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.cpp deleted file mode 100644 index 1d83fc59..00000000 --- a/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.cpp +++ /dev/null @@ -1,146 +0,0 @@ -#include "kfileaudiopreview.h" - -#include <tqcheckbox.h> -#include <tqhbox.h> -#include <tqlayout.h> -#include <tqvgroupbox.h> - -#include <kglobal.h> -#include <kconfig.h> -#include <klibloader.h> -#include <klocale.h> -#include <tdemediaplayer/player.h> -#include <kmimetype.h> -#include <tdeparts/componentfactory.h> - -#include <kplayobjectfactory.h> - -#include <config-kfile.h> - -class KFileAudioPreviewFactory : public KLibFactory -{ -protected: - virtual TQObject *createObject( TQObject *parent, const char *name, - const char *className, const TQStringList & args) - { - Q_UNUSED(className); - Q_UNUSED(args); - return TQT_TQOBJECT(new KFileAudioPreview( dynamic_cast<TQWidget*>( parent ), name )); - } -}; - -K_EXPORT_COMPONENT_FACTORY( kfileaudiopreview, KFileAudioPreviewFactory ) - - -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// - - -class KFileAudioPreview::KFileAudioPreviewPrivate -{ -public: - KFileAudioPreviewPrivate( TQWidget *parent ) - { - player = KParts::ComponentFactory::createInstanceFromQuery<KMediaPlayer::Player>( "KMediaPlayer/Player", TQString(), TQT_TQOBJECT(parent) ); - } - - ~KFileAudioPreviewPrivate() - { - delete player; - } - - KMediaPlayer::Player *player; -}; - - -KFileAudioPreview::KFileAudioPreview( TQWidget *parent, const char *name ) - : KPreviewWidgetBase( parent, name ) -{ - TDEGlobal::locale()->insertCatalogue("kfileaudiopreview"); - - TQStringList formats = KDE::PlayObjectFactory::mimeTypes(); - // ### - TQStringList::ConstIterator it = formats.begin(); - for ( ; it != formats.end(); ++it ) - m_supportedFormats.insert( *it, (void*) 1 ); - - TQVGroupBox *box = new TQVGroupBox( i18n("Media Player"), this ); - TQVBoxLayout *layout = new TQVBoxLayout( this ); - layout->addWidget( box ); - - (void) new TQWidget( box ); // spacer - - d = new KFileAudioPreviewPrivate( 0L ); // not box -- being reparented anyway - if ( d->player ) // only if there actually is a component... - { - setSupportedMimeTypes( formats ); - KMediaPlayer::View *view = d->player->view(); - view->setEnabled( false ); - - // if we have access to the video widget, show it above the player - // So, reparent first the video widget, then the view. - if ( view->videoWidget() ) - { - TQHBox *frame = new TQHBox( box ); - frame->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - frame->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ) ); - view->videoWidget()->reparent( frame, TQPoint(0,0) ); - } - - view->reparent( box, TQPoint(0,0) ); - } - - m_autoPlay = new TQCheckBox( i18n("Play &automatically"), box ); - TDEConfigGroup config( TDEGlobal::config(), ConfigGroup ); - m_autoPlay->setChecked( config.readBoolEntry( "Autoplay sounds", true ) ); - connect( m_autoPlay, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggleAuto(bool)) ); -} - -KFileAudioPreview::~KFileAudioPreview() -{ - TDEConfigGroup config( TDEGlobal::config(), ConfigGroup ); - config.writeEntry( "Autoplay sounds", m_autoPlay->isChecked() ); - - delete d; -} - -void KFileAudioPreview::showPreview( const KURL &url ) -{ - if ( !d->player || !url.isValid() ) - return; - - KMimeType::Ptr mt = KMimeType::findByURL( url ); - bool supported = m_supportedFormats.find( mt->name() ); - d->player->view()->setEnabled( supported ); - if ( !supported ) - return; - - static_cast<KParts::ReadOnlyPart*>(d->player)->openURL( url ); - if ( m_autoPlay->isChecked() ) - d->player->play(); -} - -void KFileAudioPreview::clearPreview() -{ - if ( d->player ) - { - d->player->stop(); - d->player->closeURL(); - } -} - -void KFileAudioPreview::toggleAuto( bool on ) -{ - if ( !d->player ) - return; - - if ( on && m_currentURL.isValid() && d->player->view()->isEnabled() ) - d->player->play(); - else - d->player->stop(); -} - -void KFileAudioPreview::virtual_hook( int, void* ) -{} - -#include "kfileaudiopreview.moc" diff --git a/interfaces/tdemediaplayer/tdefileaudiopreview/CMakeLists.txt b/interfaces/tdemediaplayer/tdefileaudiopreview/CMakeLists.txt new file mode 100644 index 00000000..8e561e1f --- /dev/null +++ b/interfaces/tdemediaplayer/tdefileaudiopreview/CMakeLists.txt @@ -0,0 +1,46 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${TQT_INCLUDE_DIRS} + ${ARTS_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/interfaces + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile + ${CMAKE_SOURCE_DIR}/arts/kde +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${ARTS_LIBRARY_DIRS} +) + + +##### tdefileaudiopreview ######################### + +set( target tdefileaudiopreview ) + +set( ${target}_SRCS + tdefileaudiopreview.cpp +) + +tde_add_kpart( ${target} AUTOMOC + SOURCES ${${target}_SRCS} + LINK tdemediaplayer-shared artskde-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/interfaces/tdemediaplayer/tdefileaudiopreview/Makefile.am b/interfaces/tdemediaplayer/tdefileaudiopreview/Makefile.am new file mode 100644 index 00000000..d73cf545 --- /dev/null +++ b/interfaces/tdemediaplayer/tdefileaudiopreview/Makefile.am @@ -0,0 +1,13 @@ +INCLUDES = -I$(top_srcdir)/interfaces/ -I$(top_srcdir)/arts/kde -I$(includedir)/arts $(all_includes) +METASOURCES = AUTO + +kde_module_LTLIBRARIES = tdefileaudiopreview.la + +tdefileaudiopreview_la_SOURCES = tdefileaudiopreview.cpp +tdefileaudiopreview_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module -avoid-version -no-undefined +tdefileaudiopreview_la_LIBADD = $(top_builddir)/interfaces/tdemediaplayer/libtdemediaplayer.la $(top_builddir)/arts/kde/libartskde.la $(LIB_KIO) $(LIB_QT) $(LIB_TDECORE) + +noinst_HEADERS = tdefileaudiopreview.h + +messages: + $(XGETTEXT) $(tdefileaudiopreview_la_SOURCES) -o $(podir)/tdefileaudiopreview.pot diff --git a/interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.cpp b/interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.cpp new file mode 100644 index 00000000..7dd746c4 --- /dev/null +++ b/interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.cpp @@ -0,0 +1,146 @@ +#include "tdefileaudiopreview.h" + +#include <tqcheckbox.h> +#include <tqhbox.h> +#include <tqlayout.h> +#include <tqvgroupbox.h> + +#include <kglobal.h> +#include <tdeconfig.h> +#include <klibloader.h> +#include <klocale.h> +#include <tdemediaplayer/player.h> +#include <kmimetype.h> +#include <tdeparts/componentfactory.h> + +#include <kplayobjectfactory.h> + +#include <config-tdefile.h> + +class KFileAudioPreviewFactory : public KLibFactory +{ +protected: + virtual TQObject *createObject( TQObject *parent, const char *name, + const char *className, const TQStringList & args) + { + Q_UNUSED(className); + Q_UNUSED(args); + return TQT_TQOBJECT(new KFileAudioPreview( dynamic_cast<TQWidget*>( parent ), name )); + } +}; + +K_EXPORT_COMPONENT_FACTORY( tdefileaudiopreview, KFileAudioPreviewFactory ) + + +/////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////// + + +class KFileAudioPreview::KFileAudioPreviewPrivate +{ +public: + KFileAudioPreviewPrivate( TQWidget *parent ) + { + player = KParts::ComponentFactory::createInstanceFromQuery<KMediaPlayer::Player>( "KMediaPlayer/Player", TQString(), TQT_TQOBJECT(parent) ); + } + + ~KFileAudioPreviewPrivate() + { + delete player; + } + + KMediaPlayer::Player *player; +}; + + +KFileAudioPreview::KFileAudioPreview( TQWidget *parent, const char *name ) + : KPreviewWidgetBase( parent, name ) +{ + TDEGlobal::locale()->insertCatalogue("tdefileaudiopreview"); + + TQStringList formats = KDE::PlayObjectFactory::mimeTypes(); + // ### + TQStringList::ConstIterator it = formats.begin(); + for ( ; it != formats.end(); ++it ) + m_supportedFormats.insert( *it, (void*) 1 ); + + TQVGroupBox *box = new TQVGroupBox( i18n("Media Player"), this ); + TQVBoxLayout *layout = new TQVBoxLayout( this ); + layout->addWidget( box ); + + (void) new TQWidget( box ); // spacer + + d = new KFileAudioPreviewPrivate( 0L ); // not box -- being reparented anyway + if ( d->player ) // only if there actually is a component... + { + setSupportedMimeTypes( formats ); + KMediaPlayer::View *view = d->player->view(); + view->setEnabled( false ); + + // if we have access to the video widget, show it above the player + // So, reparent first the video widget, then the view. + if ( view->videoWidget() ) + { + TQHBox *frame = new TQHBox( box ); + frame->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); + frame->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ) ); + view->videoWidget()->reparent( frame, TQPoint(0,0) ); + } + + view->reparent( box, TQPoint(0,0) ); + } + + m_autoPlay = new TQCheckBox( i18n("Play &automatically"), box ); + TDEConfigGroup config( TDEGlobal::config(), ConfigGroup ); + m_autoPlay->setChecked( config.readBoolEntry( "Autoplay sounds", true ) ); + connect( m_autoPlay, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggleAuto(bool)) ); +} + +KFileAudioPreview::~KFileAudioPreview() +{ + TDEConfigGroup config( TDEGlobal::config(), ConfigGroup ); + config.writeEntry( "Autoplay sounds", m_autoPlay->isChecked() ); + + delete d; +} + +void KFileAudioPreview::showPreview( const KURL &url ) +{ + if ( !d->player || !url.isValid() ) + return; + + KMimeType::Ptr mt = KMimeType::findByURL( url ); + bool supported = m_supportedFormats.find( mt->name() ); + d->player->view()->setEnabled( supported ); + if ( !supported ) + return; + + static_cast<KParts::ReadOnlyPart*>(d->player)->openURL( url ); + if ( m_autoPlay->isChecked() ) + d->player->play(); +} + +void KFileAudioPreview::clearPreview() +{ + if ( d->player ) + { + d->player->stop(); + d->player->closeURL(); + } +} + +void KFileAudioPreview::toggleAuto( bool on ) +{ + if ( !d->player ) + return; + + if ( on && m_currentURL.isValid() && d->player->view()->isEnabled() ) + d->player->play(); + else + d->player->stop(); +} + +void KFileAudioPreview::virtual_hook( int, void* ) +{} + +#include "tdefileaudiopreview.moc" diff --git a/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.h b/interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.h index de48e471..de48e471 100644 --- a/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.h +++ b/interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.h diff --git a/interfaces/tdescript/CMakeLists.txt b/interfaces/tdescript/CMakeLists.txt index bcddb106..6b57cdeb 100644 --- a/interfaces/tdescript/CMakeLists.txt +++ b/interfaces/tdescript/CMakeLists.txt @@ -19,8 +19,8 @@ include_directories( ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio ) link_directories( @@ -51,6 +51,6 @@ set( ${target}_SRCS tde_add_library( ${target} SHARED AUTOMOC SOURCES ${${target}_SRCS} VERSION 0.0.0 - LINK kio-shared + LINK tdeio-shared DESTINATION ${LIB_INSTALL_DIR} ) diff --git a/interfaces/tdescript/Makefile.am b/interfaces/tdescript/Makefile.am index 55d4cac3..03c7efc8 100644 --- a/interfaces/tdescript/Makefile.am +++ b/interfaces/tdescript/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . sample -INCLUDES = -I$(top_srcdir)/kio -I$(top_srcdir) -I$(srcdir) -I$(srcdir)/.. $(all_includes) +INCLUDES = -I$(top_srcdir)/tdeio -I$(top_srcdir) -I$(srcdir) -I$(srcdir)/.. $(all_includes) #lib_LTLIBRARIES = libtdescriptloader.la libtdescript.la lib_LTLIBRARIES = libtdescript.la diff --git a/interfaces/tdescript/sample/Makefile.am b/interfaces/tdescript/sample/Makefile.am index 77d39b28..e20854c7 100644 --- a/interfaces/tdescript/sample/Makefile.am +++ b/interfaces/tdescript/sample/Makefile.am @@ -1,4 +1,4 @@ -INCLUDES = -I$(top_srcdir)/kio -I$(top_srcdir)/interfaces -I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/interfaces/tdescript $(all_includes) +INCLUDES = -I$(top_srcdir)/tdeio -I$(top_srcdir)/interfaces -I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/interfaces/tdescript $(all_includes) kde_module_LTLIBRARIES = libshellscript.la diff --git a/interfaces/tdescript/scriptloader.cpp b/interfaces/tdescript/scriptloader.cpp index 79fa2055..1ff34f98 100644 --- a/interfaces/tdescript/scriptloader.cpp +++ b/interfaces/tdescript/scriptloader.cpp @@ -23,7 +23,7 @@ #include <tdeparts/componentfactory.h> #include <kglobal.h> #include <klocale.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kdesktopfile.h> #include <kstandarsdirs.h> #include <kstdaccel.h> diff --git a/interfaces/tdetexteditor/CMakeLists.txt b/interfaces/tdetexteditor/CMakeLists.txt index a9d39edb..0808a84f 100644 --- a/interfaces/tdetexteditor/CMakeLists.txt +++ b/interfaces/tdetexteditor/CMakeLists.txt @@ -20,8 +20,8 @@ include_directories( ${CMAKE_SOURCE_DIR}/dcop ${CMAKE_SOURCE_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio ${CMAKE_SOURCE_DIR}/kabc ${CMAKE_SOURCE_DIR}/interfaces ) diff --git a/interfaces/tdetexteditor/Makefile.am b/interfaces/tdetexteditor/Makefile.am index 5663bb76..fce0ec56 100644 --- a/interfaces/tdetexteditor/Makefile.am +++ b/interfaces/tdetexteditor/Makefile.am @@ -1,4 +1,4 @@ -INCLUDES = -I$(top_srcdir)/kio -I$(top_srcdir) -I$(top_srcdir)/interfaces -I$(top_builddir)/interfaces -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) +INCLUDES = -I$(top_srcdir)/tdeio -I$(top_srcdir) -I$(top_srcdir)/interfaces -I$(top_builddir)/interfaces -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) lib_LTLIBRARIES = libtdetexteditor.la diff --git a/interfaces/tdetexteditor/configinterface.h b/interfaces/tdetexteditor/configinterface.h index ed6a80d8..10a6173a 100644 --- a/interfaces/tdetexteditor/configinterface.h +++ b/interfaces/tdetexteditor/configinterface.h @@ -57,7 +57,7 @@ class KTEXTEDITOR_EXPORT ConfigInterface virtual void writeConfig () = 0; /** - Read/Write the config of the part to a given kconfig object + Read/Write the config of the part to a given tdeconfig object to store the settings in a different place than the standard */ virtual void readConfig (TDEConfig *) = 0; diff --git a/interfaces/tdetexteditor/editorchooser.cpp b/interfaces/tdetexteditor/editorchooser.cpp index 807d342d..ce493018 100644 --- a/interfaces/tdetexteditor/editorchooser.cpp +++ b/interfaces/tdetexteditor/editorchooser.cpp @@ -3,7 +3,7 @@ #include <tqcombobox.h> #include <ktrader.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <tqstringlist.h> #include <kservice.h> #include <klocale.h> diff --git a/kabc/CMakeLists.txt b/kabc/CMakeLists.txt index 5f2619cf..57c4741f 100644 --- a/kabc/CMakeLists.txt +++ b/kabc/CMakeLists.txt @@ -29,8 +29,8 @@ include_directories( ${CMAKE_SOURCE_DIR}/dcop ${CMAKE_SOURCE_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio ${CMAKE_SOURCE_DIR}/kab ) @@ -58,7 +58,7 @@ install( FILES ##### other data ################################ -install( FILES kab2kabc.desktop DESTINATION ${AUTOSTART_INSTALL_DIR} ) +install( FILES tdeab2tdeabc.desktop DESTINATION ${AUTOSTART_INSTALL_DIR} ) install( FILES kabc_manager.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources ) install( FILES countrytransl.map DESTINATION ${DATA_INSTALL_DIR}/kabc ) @@ -102,18 +102,18 @@ set( ${target}_SRCS tde_add_library( ${target} SHARED AUTOMOC SOURCES ${${target}_SRCS} VERSION 1.2.0 - LINK vcards-static vcard-shared kio-shared tderesources-shared + LINK vcards-static vcard-shared tdeio-shared tderesources-shared DEPENDENCIES addressee.h dcopidl DESTINATION ${LIB_INSTALL_DIR} ) -##### kab2kabc ################################## +##### tdeab2tdeabc ################################## -set( target kab2kabc ) +set( target tdeab2tdeabc ) set( ${target}_SRCS - kab2kabc.cpp + tdeab2tdeabc.cpp ) tde_add_executable( ${target} diff --git a/kabc/Makefile.am b/kabc/Makefile.am index ef989662..57e72aec 100644 --- a/kabc/Makefile.am +++ b/kabc/Makefile.am @@ -50,13 +50,13 @@ kabcinclude_HEADERS = address.h addressbook.h addressee.h addresseedialog.h \ METASOURCES = AUTO -bin_PROGRAMS = kab2kabc +bin_PROGRAMS = tdeab2tdeabc -kab2kabc_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -kab2kabc_LDADD = libkabc.la ../kab/libkab.la -kab2kabc_SOURCES = kab2kabc.cpp +tdeab2tdeabc_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +tdeab2tdeabc_LDADD = libkabc.la ../kab/libkab.la +tdeab2tdeabc_SOURCES = tdeab2tdeabc.cpp -autostart_DATA = kab2kabc.desktop +autostart_DATA = tdeab2tdeabc.desktop autostartdir = $(datadir)/autostart manager_DATA = kabc_manager.desktop diff --git a/kabc/addresseehelper.cpp b/kabc/addresseehelper.cpp index 90879586..5b899885 100644 --- a/kabc/addresseehelper.cpp +++ b/kabc/addresseehelper.cpp @@ -19,7 +19,7 @@ #include <tqapplication.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <klocale.h> #include "addresseehelper.h" diff --git a/kabc/addresslineedit.cpp b/kabc/addresslineedit.cpp index 76d99f63..efb0738a 100644 --- a/kabc/addresslineedit.cpp +++ b/kabc/addresslineedit.cpp @@ -33,7 +33,7 @@ #include <tqdragobject.h> #include <kcompletionbox.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kcursor.h> #include <kstandarddirs.h> #include <kstaticdeleter.h> diff --git a/kabc/formatfactory.h b/kabc/formatfactory.h index 76a3704d..ff9da550 100644 --- a/kabc/formatfactory.h +++ b/kabc/formatfactory.h @@ -24,7 +24,7 @@ #include <tqdict.h> #include <tqstring.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <klibloader.h> #include "formatplugin.h" diff --git a/kabc/formats/CMakeLists.txt b/kabc/formats/CMakeLists.txt index 327cb1ea..60ea1c3f 100644 --- a/kabc/formats/CMakeLists.txt +++ b/kabc/formats/CMakeLists.txt @@ -18,8 +18,8 @@ include_directories( ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/dcop ${CMAKE_SOURCE_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio ) link_directories( diff --git a/kabc/kab2kabc.cpp b/kabc/kab2kabc.cpp deleted file mode 100644 index 11b80639..00000000 --- a/kabc/kab2kabc.cpp +++ /dev/null @@ -1,476 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> - - 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 Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include <tqfile.h> -#include <tqtextstream.h> - -#include <kabapi.h> -#include <kaboutdata.h> -#include <kapplication.h> -#include <kcmdlineargs.h> -#include <kconfig.h> -#include <kdebug.h> -#include <kglobal.h> -#include <klocale.h> -#include <kmessagebox.h> -#include <kstandarddirs.h> - -#include "addressbook.h" -#include "stdaddressbook.h" - -using namespace KABC; - -static const KCmdLineOptions options[] = -{ - { "disable-autostart", I18N_NOOP( "Disable automatic startup on login" ), 0 }, - { "quiet", "", 0 }, - { "o", 0, 0 }, - { "override", I18N_NOOP( "Override existing entries" ), "1" }, - KCmdLineLastOption -}; - -void readKMailEntry( const TQString &kmailEntry, KABC::AddressBook *ab ) -{ - kdDebug() << "KMAILENTRY: " << kmailEntry << endl; - - TQString entry = kmailEntry.simplifyWhiteSpace(); - if ( entry.isEmpty() ) return; - - TQString email; - TQString name; - TQString comment; - - if ( entry.at( entry.length() -1 ) == ')' ) { - int br = entry.findRev( '(' ); - if ( br >= 0 ) { - comment = entry.mid( br + 1, entry.length() - br - 2 ); - entry.truncate( br ); - if ( entry.at( entry.length() - 1 ).isSpace() ) { - entry.truncate( br - 1 ); - } - } - } - - int posSpace = entry.findRev( ' ' ); - if ( posSpace < 0 ) { - email = entry; - if ( !comment.isEmpty() ) { - name = comment; - comment = ""; - } - } else { - email = entry.mid( posSpace + 1 ); - name = entry.left( posSpace ); - } - - if ( email.at( 0 ) == '<' && email.at( email.length() - 1) == '>' ) { - email = email.mid( 1, email.length() - 2 ); - } - if ( name.at( 0 ) == '"' && name.at( name.length() - 1) == '"' ) { - name = name.mid( 1, name.length() - 2 ); - } - if ( name.at( 0 ) == '\'' && name.at( name.length() - 1) == '\'' ) { - name = name.mid( 1, name.length() - 2 ); - } - - if ( name.at( name.length() -1 ) == ')' ) { - int br = name.findRev( '(' ); - if ( br >= 0 ) { - comment = name.mid( br + 1, name.length() - br - 2 ) + " " + comment; - name.truncate( br ); - if ( name.at( name.length() - 1 ).isSpace() ) { - name.truncate( br - 1 ); - } - } - } - - kdDebug() << " EMAIL : " << email << endl; - kdDebug() << " NAME : " << name << endl; - kdDebug() << " COMMENT : " << comment << endl; - - KABC::Addressee::List al = ab->findByEmail( email ); - if ( al.isEmpty() ) { - KABC::Addressee a; - a.setNameFromString( name ); - a.insertEmail( email ); - a.setNote( comment ); - - ab->insertAddressee( a ); - - kdDebug() << "--INSERTED: " << a.realName() << endl; - } -} - -void importKMailAddressBook( KABC::AddressBook *ab ) -{ - TQString fileName = locateLocal( "data", "kmail/addressbook" ); - TQString kmailConfigName = locate( "config", "kmailrc" ); - if ( !kmailConfigName.isEmpty() ) { - TDEConfig cfg( kmailConfigName ); - cfg.setGroup( "Addressbook" ); - fileName = cfg.readPathEntry( "default", fileName ); - } - if ( !KStandardDirs::exists( fileName ) ) { - kdDebug(5700) << "Couldn't find KMail addressbook." << endl; - return; - } - - TQFile f( fileName ); - if ( !f.open(IO_ReadOnly) ) { - kdDebug(5700) << "Couldn't open file '" << fileName << "'" << endl; - return; - } - - TQStringList kmailEntries; - - TQTextStream t( &f ); - while ( !t.eof() ) { - kmailEntries.append( t.readLine() ); - } - f.close(); - - TQStringList::ConstIterator it; - for ( it = kmailEntries.begin(); it != kmailEntries.end(); ++it ) { - if ( (*it).at( 0 ) == '#' ) continue; - bool insideQuote = false; - int end = (*it).length() - 1; - for ( int i = end; i; i-- ) { - if ( (*it).at( i ) == '"' ) { - if ( insideQuote ) - insideQuote = false; - else - insideQuote = true; - } else if ( (*it).at( i ) == ',' && !insideQuote ) { - readKMailEntry( (*it).mid( i + 1, end - i ), ab ); - end = i - 1; - } - } - - readKMailEntry( (*it).mid( 0, end + 1 ), ab ); - } -} - -void readKAddressBookEntries( const TQString &dataString, Addressee &a ) -{ - // Strip "KMail:1.0" prefix and "[EOS]" suffix. - TQString str = dataString.mid( 11, dataString.length() - 24 ); - - TQStringList entries = TQStringList::split( "\n[EOR]\n ", str ); - - Address homeAddress( Address::Home ); - Address businessAddress( Address::Work ); - Address otherAddress; - - TQStringList::ConstIterator it; - for ( it = entries.begin(); it != entries.end(); ++it ) { - int pos = (*it).find( "\n" ); - TQString fieldName = (*it).left( pos ); - TQString fieldValue = (*it).mid( pos + 2 ); - - if ( fieldName == "X-HomeFax" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Home | - PhoneNumber::Fax ) ); - } else if ( fieldName == "X-OtherPhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, 0 ) ); - } else if ( fieldName == "X-PrimaryPhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Pref ) ); - } else if ( fieldName == "X-BusinessFax" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Work | - PhoneNumber::Fax ) ); - } else if ( fieldName == "X-CarPhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Car ) ); - } else if ( fieldName == "X-MobilePhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Cell ) ); - } else if ( fieldName == "X-ISDN" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Isdn ) ); - } else if ( fieldName == "X-OtherFax" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Fax ) ); - } else if ( fieldName == "X-Pager" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Pager ) ); - } else if ( fieldName == "X-BusinessPhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Work ) ); - } else if ( fieldName == "X-HomePhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Home ) ); - } else if ( fieldName == "X-HomeAddress" ) { - homeAddress.setLabel( fieldValue ); - } else if ( fieldName == "X-HomeAddressStreet" ) { - homeAddress.setStreet( fieldValue ); - } else if ( fieldName == "X-HomeAddressCity" ) { - homeAddress.setLocality( fieldValue ); - } else if ( fieldName == "X-HomeAddressPostalCode" ) { - homeAddress.setPostalCode( fieldValue ); - } else if ( fieldName == "X-HomeAddressState" ) { - homeAddress.setRegion( fieldValue ); - } else if ( fieldName == "X-HomeAddressCountry" ) { - homeAddress.setCountry( fieldValue ); - } else if ( fieldName == "X-BusinessAddress" ) { - businessAddress.setLabel( fieldValue ); - } else if ( fieldName == "X-BusinessAddressStreet" ) { - businessAddress.setStreet( fieldValue ); - } else if ( fieldName == "X-BusinessAddressCity" ) { - businessAddress.setLocality( fieldValue ); - } else if ( fieldName == "X-BusinessAddressPostalCode" ) { - businessAddress.setPostalCode( fieldValue ); - } else if ( fieldName == "X-BusinessAddressState" ) { - businessAddress.setRegion( fieldValue ); - } else if ( fieldName == "X-BusinessAddressCountry" ) { - businessAddress.setCountry( fieldValue ); - } else if ( fieldName == "X-OtherAddress" ) { - otherAddress.setLabel( fieldValue ); - } else if ( fieldName == "X-OtherAddressStreet" ) { - otherAddress.setStreet( fieldValue ); - } else if ( fieldName == "X-OtherAddressCity" ) { - otherAddress.setLocality( fieldValue ); - } else if ( fieldName == "X-OtherAddressPostalCode" ) { - otherAddress.setPostalCode( fieldValue ); - } else if ( fieldName == "X-OtherAddressState" ) { - otherAddress.setRegion( fieldValue ); - } else if ( fieldName == "X-OtherAddressCountry" ) { - otherAddress.setCountry( fieldValue ); - } else if ( fieldName == "NICKNAME" ) { - a.setNickName( fieldValue ); - } else if ( fieldName == "ORG" ) { - a.setOrganization( fieldValue ); - } else if ( fieldName == "ROLE" ) { - a.setRole( fieldValue ); - } else if ( fieldName == "BDAY" ) { - a.setBirthday( TDEGlobal::locale()->readDate( fieldValue ) ); - } else if ( fieldName == "WEBPAGE" ) { - a.setUrl( KURL( fieldValue ) ); - } else if ( fieldName == "N" ) { - } else if ( fieldName == "X-FirstName" ) { - } else if ( fieldName == "X-MiddleName" ) { - } else if ( fieldName == "X-LastName" ) { - } else if ( fieldName == "X-Title" ) { - } else if ( fieldName == "X-Suffix" ) { - } else if ( fieldName == "X-FileAs" ) { - } else if ( fieldName == "EMAIL" ) { - a.insertEmail( fieldValue, true ); - } else if ( fieldName == "X-E-mail2" ) { - a.insertEmail( fieldValue ); - } else if ( fieldName == "X-E-mail3" ) { - a.insertEmail( fieldValue ); - } else if ( fieldName == "X-Notes" ) { - } else { - a.insertCustom( "KADDRESSBOOK", fieldName, fieldValue ); - } - } - - if ( !homeAddress.isEmpty() ) a.insertAddress( homeAddress ); - if ( !businessAddress.isEmpty() ) a.insertAddress( businessAddress ); - if ( !otherAddress.isEmpty() ) a.insertAddress( otherAddress ); -} - -void importKab( KABC::AddressBook *ab, bool override, bool quiet ) -{ - TQString fileName = TDEGlobal::dirs()->saveLocation( "data", "kab/" ); - fileName += "addressbook.kab"; - if ( !TQFile::exists( fileName ) ) { - if ( !quiet ) { - KMessageBox::error( 0, "<qt>" + i18n( "Address book file <b>%1</b> not found! Make sure the old address book is located there and you have read permission for this file." ) - .arg( fileName ) + "</qt>" ); - } - kdDebug(5700) << "No KDE 2 addressbook found." << endl; - return; - } - - kdDebug(5700) << "Converting old-style kab addressbook to " - "new-style kabc addressbook." << endl; - - KabAPI kab( 0 ); - if ( kab.init() != ::AddressBook::NoError ) { - kdDebug(5700) << "Error initing kab" << endl; - exit( 1 ); - } - - KabKey key; - ::AddressBook::Entry entry; - - int num = kab.addressbook()->noOfEntries(); - - kdDebug(5700) << "kab Addressbook has " << num << " entries." << endl; - - for ( int i = 0; i < num; ++i ) { - if ( ::AddressBook::NoError != kab.addressbook()->getKey( i, key ) ) { - kdDebug(5700) << "Error getting key for index " << i << " from kab." << endl; - continue; - } - if ( ::AddressBook::NoError != kab.addressbook()->getEntry( key, entry ) ) { - kdDebug(5700) << "Error getting entry for index " << i << " from kab." << endl; - continue; - } - - Addressee a; - - // Convert custom entries - int count = 0; - bool idFound = false; - TQStringList::ConstIterator customIt; - for ( customIt = entry.custom.begin(); customIt != entry.custom.end(); ++customIt ) { - if ( (*customIt).startsWith( "X-KABC-UID:" ) ) { - a.setUid( (*customIt).mid( (*customIt).find( ":" ) + 1 ) ); - idFound = true; - } else if ( (*customIt).startsWith( "KMail:1.0\n" ) ) { - readKAddressBookEntries( *customIt, a ); - } else { - a.insertCustom( "kab2kabc", TQString::number( count++ ), *customIt ); - } - } - if ( idFound ) { - if ( !override ) continue; - } else { - entry.custom << "X-KABC-UID:" + a.uid(); - ::AddressBook::ErrorCode error = kab.addressbook()->change( key, entry ); - if ( error != ::AddressBook::NoError ) { - kdDebug(5700) << "kab.change returned with error " << error << endl; - } else { - kdDebug(5700) << "Wrote back to kab uid " << a.uid() << endl; - } - } - - a.setTitle( entry.title ); - a.setFormattedName( entry.fn ); - a.setPrefix( entry.nameprefix ); - a.setGivenName( entry.firstname ); - a.setAdditionalName( entry.middlename ); - a.setFamilyName( entry.lastname ); - a.setBirthday( entry.birthday ); - - TQStringList::ConstIterator emailIt; - for ( emailIt = entry.emails.begin(); emailIt != entry.emails.end(); ++emailIt ) - a.insertEmail( *emailIt ); - - TQStringList::ConstIterator phoneIt; - for ( phoneIt = entry.telephone.begin(); phoneIt != entry.telephone.end(); ++phoneIt ) { - int kabType = (*phoneIt++).toInt(); - if ( phoneIt == entry.telephone.end() ) break; - TQString number = *phoneIt; - int type = 0; - if ( kabType == ::AddressBook::Fixed ) type = PhoneNumber::Voice; - else if ( kabType == ::AddressBook::Mobile ) type = PhoneNumber::Cell | PhoneNumber::Voice; - else if ( kabType == ::AddressBook::Fax ) type = PhoneNumber::Fax; - else if ( kabType == ::AddressBook::Modem ) type = PhoneNumber::Modem; - a.insertPhoneNumber( PhoneNumber( number, type ) ); - } - - if ( entry.URLs.count() > 0 ) { - a.setUrl( KURL( entry.URLs.first() ) ); - if ( entry.URLs.count() > 1 ) { - kdWarning() << "More than one URL. Ignoring all but the first." << endl; - } - } - - int noAdr = entry.noOfAddresses(); - for ( int j = 0; j < noAdr; ++j ) { - ::AddressBook::Entry::Address kabAddress; - entry.getAddress( j, kabAddress ); - - Address adr; - - adr.setStreet( kabAddress.address ); - adr.setPostalCode( kabAddress.zip ); - adr.setLocality( kabAddress.town ); - adr.setCountry( kabAddress.country ); - adr.setRegion( kabAddress.state ); - - TQString label; - if ( !kabAddress.headline.isEmpty() ) label += kabAddress.headline + "\n"; - if ( !kabAddress.position.isEmpty() ) label += kabAddress.position + "\n"; - if ( !kabAddress.org.isEmpty() ) label += kabAddress.org + "\n"; - if ( !kabAddress.orgUnit.isEmpty() ) label += kabAddress.orgUnit + "\n"; - if ( !kabAddress.orgSubUnit.isEmpty() ) label += kabAddress.orgSubUnit + "\n"; - if ( !kabAddress.deliveryLabel.isEmpty() ) label += kabAddress.deliveryLabel + "\n"; - adr.setLabel( label ); - - a.insertAddress( adr ); - } - - TQString note = entry.comment; - - if ( !entry.user1.isEmpty() ) note += "\nUser1: " + entry.user1; - if ( !entry.user2.isEmpty() ) note += "\nUser2: " + entry.user2; - if ( !entry.user3.isEmpty() ) note += "\nUser3: " + entry.user3; - if ( !entry.user4.isEmpty() ) note += "\nUser4: " + entry.user4; - - if ( !entry.keywords.count() == 0 ) note += "\nKeywords: " + entry.keywords.join( ", " ); - - TQStringList::ConstIterator talkIt; - for ( talkIt = entry.talk.begin(); talkIt != entry.talk.end(); ++talkIt ) { - note += "\nTalk: " + (*talkIt); - } - - a.setNote( note ); - - a.setPrefix( entry.rank + a.prefix() ); // Add rank to prefix - - a.setCategories( entry.categories ); - - kdDebug(5700) << "Addressee: " << a.familyName() << endl; - - ab->insertAddressee( a ); - } - - kab.save( true ); -} - -int main( int argc, char **argv ) -{ - TDEAboutData aboutData( "kab2kabc", I18N_NOOP( "Kab to Kabc Converter" ), "0.1" ); - aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); - - TDECmdLineArgs::init( argc, argv, &aboutData ); - TDECmdLineArgs::addCmdLineOptions( options ); - - TDEApplication app; - - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - - bool override = false; - - if ( args->isSet( "override" ) ) { - kdDebug() << "Override existing entries." << endl; - - override = true; - } - - bool quiet = false; - - if ( args->isSet( "quiet" ) ) - quiet = true; - - if ( args->isSet( "disable-autostart" ) ) { - kdDebug() << "Disable autostart." << endl; - - TDEConfig *config = app.config(); - config->setGroup( "Startup" ); - config->writeEntry( "EnableAutostart", false ); - } - - KABC::AddressBook *kabcBook = StdAddressBook::self(); - - importKMailAddressBook( kabcBook ); - - importKab( kabcBook, override, quiet ); - - StdAddressBook::save(); - - kdDebug(5700) << "Saved kabc addressbook to '" << kabcBook->identifier() << "'" << endl; -} - diff --git a/kabc/kab2kabc.desktop b/kabc/kab2kabc.desktop deleted file mode 100644 index 3015b393..00000000 --- a/kabc/kab2kabc.desktop +++ /dev/null @@ -1,105 +0,0 @@ -[Desktop Entry] -Name=kab2kabc -Name[af]=kab-na-kabc -Name[csb]=Kònwersëjô adresowi knéżczi -Name[eo]=Konvertilo de "kab" al "kabc" -Name[fr]=KAB2KABC -Name[fy]=Kab2kabc -Name[hu]=Kab2kabc -Name[it]=Kab2Kabc -Name[nl]=Kab2kabc -Name[pl]=Konwersja książki adresowej -Name[pt_BR]=Conversão de kab para kabc -Name[ro]=Kab2kabc -Name[sv]=Kab2kabc -Name[te]=కెఎబి2కెఎబిసి -Name[zu]=i-kab2kabc -Exec=kab2kabc --disable-autostart --quiet -Icon=misc -Type=Application -Comment=libkab to libkabc conversion tool. -Comment[af]=libkab na libkabc omskakeling program. -Comment[ar]=أداة تحويل libkab إلى libkabc. -Comment[az]=libkab - libkabc dönüşdürmə vasitəsi. -Comment[be]=Інструмент пераўтварэння libkab у libkabc. -Comment[bg]=Програма за конвертиране на libkab до libkabc. -Comment[bn]=libkab থেকে libkabc-তে পরিবর্তন করার প্রোগ্রাম। -Comment[bs]=alat za pretvaranje libkab u libkabc. -Comment[ca]=Eina de conversió de libkab a libkabc. -Comment[cs]=Převod dat z libkab do libkabc. -Comment[csb]=Nôrzãdze do kònwersëji z libkab do libkabc. -Comment[cy]=erfyn trosi libkab i libkabc -Comment[da]=libkab-til-libkabc-konverteringsværktøj. -Comment[de]=Konvertierung von libkab in libkabc -Comment[el]=Εργαλείο μετατροπής από το libkab στο libkabc. -Comment[eo]=Konvertilo de "libkab" al "libkabc" -Comment[es]=Conversor libkab a libkabc. -Comment[et]=libkab -> libkabc teisendamine -Comment[eu]=libkab-etik libkabc-era bihurtzeko tresna. -Comment[fa]=ابزار تبدیل libkab به libcabc. -Comment[fi]=libkab-libkabc -muunnin -Comment[fr]=Outil de conversion de libkab vers libkabc. -Comment[fy]=Konversjeprogramma fan libkab nei libkabc. -Comment[ga]=Uirlis tiontaithe ó libkab go libkabc. -Comment[gl]=Ferramenta de conversión de libkab a libkabc. -Comment[he]=כלי המרה מ־libkab ל־libkabc -Comment[hi]=libkab से libkabc बदलने वाला औजार -Comment[hr]=Alat za pretvaranje iz libkab u libkabc -Comment[hsb]=libkab -> libkabc konwerter -Comment[hu]=libkab -> libkabc konvertáló. -Comment[id]=konverter libkab ke libkabc. -Comment[is]=libkab í libkabc breytingatól. -Comment[it]=Strumento di conversione da libkab a libkabc. -Comment[ja]=libkab から libkabc への変換ツール -Comment[ka]=libkab => libkabc გარდაქმნის ხელსაწყო. -Comment[kk]=libkab дегеннен libkabc дегенге айналдыру құралы. -Comment[km]=ឧបករណ៍បម្លែងពី libkab ទៅ libkabc -Comment[ko]=libkab을 libkabc로 바꿔주는 연장. -Comment[lb]=libkab op libkabc Konvertéierungs-Hëllefsmëttel. -Comment[lt]=libkab į libkabc konvertavimo įrankis. -Comment[lv]=libkab uz libkabc kovertēšanas rīks. -Comment[mk]=алатка за претворање од libkab во libkabc. -Comment[mn]=libkab-аас libkabc-руу хөрвүүлэгч -Comment[ms]=perkakasan penukaran libkab to libkabc. -Comment[mt]=Għodda għall-konverżjoni libkab għal libkabc -Comment[nb]=libkab til libkabc konverteringsverktøy. -Comment[nds]=Warktüüch för't Ümwanneln vun libkab na libkabc. -Comment[ne]=libkab to libkabc रूपान्तरण उपकरण । -Comment[nl]=Conversieprogramma van libkab naar libkabc. -Comment[nn]=Konverterer libkab til libkabc -Comment[nso]=Sebereka sa phetosetso ya libkab go libkabc -Comment[pa]=libkab ਤੋ libkabc ਤਬਦੀਲੀ ਸੰਦ। -Comment[pl]=Narzędzie do konwersji z libkab do libkabc. -Comment[pt]=Ferramenta de conversão de libkab para libkabc. -Comment[pt_BR]=Ferramenta de conversão de libkab para libkabc. -Comment[ro]=Utilitar de conversie de la "libkab" la "libkabc". -Comment[ru]=утилита преобразования libkab в libkabc. -Comment[rw]=Igikoresho cy'ihindura libkab muri libkabc. -Comment[se]=konverterenreaidu libkab:as libkabc:ai -Comment[sk]=Prevod dát z libkab do libkabc. -Comment[sl]=Orodje za pretvorbo iz libkab v libkabc -Comment[sq]=Vegla për shëndrimin e libkab në libkabc. -Comment[sr]=Алат за конверзију из libkab-а у libkabc. -Comment[sr@Latn]=Alat za konverziju iz libkab-a u libkabc. -Comment[ss]=Lithulusi lekutjintja le-libkab kuya ku-libkabc. -Comment[sv]=Konverteringsverktyg från libkab till libkabc -Comment[ta]=libkab இலிருந்து libkabc க்கு மாற்றும் கருவி. -Comment[te]=libkab నుంచి libkabc కు మార్చు పనిముట్టు -Comment[tg]=асбоби дигаргунсози libkab ба libkabc -Comment[th]=เครื่องมือเปลี่ยน libkab เป็น libkabc -Comment[tr]=libkab' tan libkabc' ye dönüştürme aracı -Comment[tt]=libkab-›libkabc äyländerü qoralı. -Comment[uk]=Засіб перетворення libkab до libkabc. -Comment[uz]=libkab'ni libkabc'ga aylantiradigan vosita. -Comment[uz@cyrillic]=libkab'ни libkabc'га айлантирадиган восита. -Comment[ven]=Tshishumiswa tsha u shandukisa libkab itshi ya kha libkabc -Comment[vi]=Công cụ chuyển đổi libkab sang libkabc. -Comment[xh]=libkab kwi libkabc isixhobo sokuguqulela. -Comment[zh_CN]=libkab 到 libkabc 的转换工具。 -Comment[zh_HK]=libkab 至 libkabc 的轉換工具 -Comment[zh_TW]=libkab 至 libkabc 轉換工具 -Comment[zu]=Ithuluzi lokuguqula le-libkab kuyaku-libkabc -Terminal=false -NoDisplay=true -X-TDE-autostart-condition=kab2kabcrc:Startup:EnableAutostart:true -OnlyShowIn=TDE; diff --git a/kabc/ldapclient.cpp b/kabc/ldapclient.cpp index 568408ba..f696ae91 100644 --- a/kabc/ldapclient.cpp +++ b/kabc/ldapclient.cpp @@ -30,7 +30,7 @@ #include <tqurl.h> #include <kapplication.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kdebug.h> #include <kmdcodec.h> #include <kprotocolinfo.h> diff --git a/kabc/ldapclient.h b/kabc/ldapclient.h index 5f851359..f43a644c 100644 --- a/kabc/ldapclient.h +++ b/kabc/ldapclient.h @@ -31,7 +31,7 @@ #include <tqguardedptr.h> #include <tqtimer.h> -#include <kio/job.h> +#include <tdeio/job.h> namespace KABC { diff --git a/kabc/ldapconfigwidget.h b/kabc/ldapconfigwidget.h index 0fd0dd7e..01074292 100644 --- a/kabc/ldapconfigwidget.h +++ b/kabc/ldapconfigwidget.h @@ -27,7 +27,7 @@ #include <kabc/ldapurl.h> #include <kabc/ldif.h> -#include <kio/job.h> +#include <tdeio/job.h> class TQGridLayout; class TQSpinBox; diff --git a/kabc/plugins/dir/CMakeLists.txt b/kabc/plugins/dir/CMakeLists.txt index 47f81a35..737d1144 100644 --- a/kabc/plugins/dir/CMakeLists.txt +++ b/kabc/plugins/dir/CMakeLists.txt @@ -20,9 +20,9 @@ include_directories( ${CMAKE_SOURCE_DIR}/dcop ${CMAKE_SOURCE_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio - ${CMAKE_SOURCE_DIR}/kio/kfile + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile ) link_directories( diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp index 0dfd0352..6b1759f1 100644 --- a/kabc/plugins/dir/resourcedir.cpp +++ b/kabc/plugins/dir/resourcedir.cpp @@ -29,7 +29,7 @@ #include <tqwidget.h> #include <kapplication.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kdebug.h> #include <kgenericfactory.h> #include <kglobal.h> diff --git a/kabc/plugins/dir/resourcedir.h b/kabc/plugins/dir/resourcedir.h index a7b04164..f62ee91b 100644 --- a/kabc/plugins/dir/resourcedir.h +++ b/kabc/plugins/dir/resourcedir.h @@ -21,7 +21,7 @@ #ifndef KABC_RESOURCEDIR_H #define KABC_RESOURCEDIR_H -#include <kconfig.h> +#include <tdeconfig.h> #include <kdirwatch.h> #include <sys/types.h> diff --git a/kabc/plugins/file/CMakeLists.txt b/kabc/plugins/file/CMakeLists.txt index 3dbcd639..f8847d7e 100644 --- a/kabc/plugins/file/CMakeLists.txt +++ b/kabc/plugins/file/CMakeLists.txt @@ -20,9 +20,9 @@ include_directories( ${CMAKE_SOURCE_DIR}/dcop ${CMAKE_SOURCE_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio - ${CMAKE_SOURCE_DIR}/kio/kfile + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile ) link_directories( diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp index 3e5b1fa8..2d2008c0 100644 --- a/kabc/plugins/file/resourcefile.cpp +++ b/kabc/plugins/file/resourcefile.cpp @@ -30,9 +30,9 @@ #include <tqtimer.h> #include <kapplication.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kdebug.h> -#include <kio/scheduler.h> +#include <tdeio/scheduler.h> #include <klocale.h> #include <ksavefile.h> #include <kstandarddirs.h> diff --git a/kabc/plugins/file/resourcefile.h b/kabc/plugins/file/resourcefile.h index 494c43ea..3d2efe85 100644 --- a/kabc/plugins/file/resourcefile.h +++ b/kabc/plugins/file/resourcefile.h @@ -21,7 +21,7 @@ #ifndef KABC_RESOURCEFILE_H #define KABC_RESOURCEFILE_H -#include <kconfig.h> +#include <tdeconfig.h> #include <kdirwatch.h> #include <sys/types.h> diff --git a/kabc/plugins/ldapkio/CMakeLists.txt b/kabc/plugins/ldapkio/CMakeLists.txt index 150377bd..0869c54e 100644 --- a/kabc/plugins/ldapkio/CMakeLists.txt +++ b/kabc/plugins/ldapkio/CMakeLists.txt @@ -20,9 +20,9 @@ include_directories( ${CMAKE_SOURCE_DIR}/dcop ${CMAKE_SOURCE_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio - ${CMAKE_SOURCE_DIR}/kio/kfiles + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefiles ) link_directories( @@ -68,6 +68,6 @@ set( ${target}_SRCS tde_add_kpart( ${target} SOURCES ${${target}_SRCS} - LINK kabc_ldapkio-shared + LINK kabc_ldaptdeio-shared DESTINATION ${PLUGIN_INSTALL_DIR} ) diff --git a/kabc/plugins/ldapkio/resourceldapkio.cpp b/kabc/plugins/ldapkio/resourceldapkio.cpp index cdf21fb8..034fb0ef 100644 --- a/kabc/plugins/ldapkio/resourceldapkio.cpp +++ b/kabc/plugins/ldapkio/resourceldapkio.cpp @@ -29,12 +29,12 @@ #include <kstandarddirs.h> #include <klineedit.h> #include <klocale.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kstringhandler.h> #include <ktempfile.h> #include <stdlib.h> -#include <kio/netaccess.h> +#include <tdeio/netaccess.h> #include <kabc/ldif.h> #include <kabc/ldapurl.h> diff --git a/kabc/plugins/ldapkio/resourceldapkio.h b/kabc/plugins/ldapkio/resourceldapkio.h index 6f40b12f..5c9282b9 100644 --- a/kabc/plugins/ldapkio/resourceldapkio.h +++ b/kabc/plugins/ldapkio/resourceldapkio.h @@ -24,7 +24,7 @@ #include <kabc/resource.h> #include <kabc/ldif.h> -#include <kio/job.h> +#include <tdeio/job.h> class TDEConfig; diff --git a/kabc/plugins/ldapkio/resourceldapkioconfig.cpp b/kabc/plugins/ldapkio/resourceldapkioconfig.cpp index 53c72aa2..b517cffa 100644 --- a/kabc/plugins/ldapkio/resourceldapkioconfig.cpp +++ b/kabc/plugins/ldapkio/resourceldapkioconfig.cpp @@ -36,7 +36,7 @@ #include <klocale.h> #include <klineedit.h> #include <kmessagebox.h> -#include <kio/netaccess.h> +#include <tdeio/netaccess.h> #include "resourceldapkio.h" diff --git a/kabc/plugins/net/CMakeLists.txt b/kabc/plugins/net/CMakeLists.txt index 365922d6..e92fbfc3 100644 --- a/kabc/plugins/net/CMakeLists.txt +++ b/kabc/plugins/net/CMakeLists.txt @@ -20,9 +20,9 @@ include_directories( ${CMAKE_SOURCE_DIR}/dcop ${CMAKE_SOURCE_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio - ${CMAKE_SOURCE_DIR}/kio/kfile + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile ) link_directories( diff --git a/kabc/plugins/net/resourcenet.cpp b/kabc/plugins/net/resourcenet.cpp index 78fb1625..9ef90990 100644 --- a/kabc/plugins/net/resourcenet.cpp +++ b/kabc/plugins/net/resourcenet.cpp @@ -21,8 +21,8 @@ #include <tqfile.h> #include <kdebug.h> -#include <kio/netaccess.h> -#include <kio/scheduler.h> +#include <tdeio/netaccess.h> +#include <tdeio/scheduler.h> #include <klocale.h> #include <ksavefile.h> #include <ktempfile.h> diff --git a/kabc/plugins/net/resourcenet.h b/kabc/plugins/net/resourcenet.h index a13bfa17..940627ec 100644 --- a/kabc/plugins/net/resourcenet.h +++ b/kabc/plugins/net/resourcenet.h @@ -21,7 +21,7 @@ #ifndef KABC_RESOURCENET_H #define KABC_RESOURCENET_H -#include <kconfig.h> +#include <tdeconfig.h> #include <sys/types.h> diff --git a/kabc/plugins/sql/resourcesql.h b/kabc/plugins/sql/resourcesql.h index 9f120184..770e5b73 100644 --- a/kabc/plugins/sql/resourcesql.h +++ b/kabc/plugins/sql/resourcesql.h @@ -21,7 +21,7 @@ #ifndef KABC_RESOURCESQL_H #define KABC_RESOURCESQL_H -#include <kconfig.h> +#include <tdeconfig.h> #include "addressbook.h" #include "resource.h" diff --git a/kabc/scripts/field.src.cpp b/kabc/scripts/field.src.cpp index 6362d223..2c80810b 100644 --- a/kabc/scripts/field.src.cpp +++ b/kabc/scripts/field.src.cpp @@ -19,7 +19,7 @@ */ #include <klocale.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kglobal.h> #include "field.h" diff --git a/kabc/tdeab2tdeabc.cpp b/kabc/tdeab2tdeabc.cpp new file mode 100644 index 00000000..afb68807 --- /dev/null +++ b/kabc/tdeab2tdeabc.cpp @@ -0,0 +1,476 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> + + 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 Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <tqfile.h> +#include <tqtextstream.h> + +#include <kabapi.h> +#include <kaboutdata.h> +#include <kapplication.h> +#include <kcmdlineargs.h> +#include <tdeconfig.h> +#include <kdebug.h> +#include <kglobal.h> +#include <klocale.h> +#include <kmessagebox.h> +#include <kstandarddirs.h> + +#include "addressbook.h" +#include "stdaddressbook.h" + +using namespace KABC; + +static const KCmdLineOptions options[] = +{ + { "disable-autostart", I18N_NOOP( "Disable automatic startup on login" ), 0 }, + { "quiet", "", 0 }, + { "o", 0, 0 }, + { "override", I18N_NOOP( "Override existing entries" ), "1" }, + KCmdLineLastOption +}; + +void readKMailEntry( const TQString &kmailEntry, KABC::AddressBook *ab ) +{ + kdDebug() << "KMAILENTRY: " << kmailEntry << endl; + + TQString entry = kmailEntry.simplifyWhiteSpace(); + if ( entry.isEmpty() ) return; + + TQString email; + TQString name; + TQString comment; + + if ( entry.at( entry.length() -1 ) == ')' ) { + int br = entry.findRev( '(' ); + if ( br >= 0 ) { + comment = entry.mid( br + 1, entry.length() - br - 2 ); + entry.truncate( br ); + if ( entry.at( entry.length() - 1 ).isSpace() ) { + entry.truncate( br - 1 ); + } + } + } + + int posSpace = entry.findRev( ' ' ); + if ( posSpace < 0 ) { + email = entry; + if ( !comment.isEmpty() ) { + name = comment; + comment = ""; + } + } else { + email = entry.mid( posSpace + 1 ); + name = entry.left( posSpace ); + } + + if ( email.at( 0 ) == '<' && email.at( email.length() - 1) == '>' ) { + email = email.mid( 1, email.length() - 2 ); + } + if ( name.at( 0 ) == '"' && name.at( name.length() - 1) == '"' ) { + name = name.mid( 1, name.length() - 2 ); + } + if ( name.at( 0 ) == '\'' && name.at( name.length() - 1) == '\'' ) { + name = name.mid( 1, name.length() - 2 ); + } + + if ( name.at( name.length() -1 ) == ')' ) { + int br = name.findRev( '(' ); + if ( br >= 0 ) { + comment = name.mid( br + 1, name.length() - br - 2 ) + " " + comment; + name.truncate( br ); + if ( name.at( name.length() - 1 ).isSpace() ) { + name.truncate( br - 1 ); + } + } + } + + kdDebug() << " EMAIL : " << email << endl; + kdDebug() << " NAME : " << name << endl; + kdDebug() << " COMMENT : " << comment << endl; + + KABC::Addressee::List al = ab->findByEmail( email ); + if ( al.isEmpty() ) { + KABC::Addressee a; + a.setNameFromString( name ); + a.insertEmail( email ); + a.setNote( comment ); + + ab->insertAddressee( a ); + + kdDebug() << "--INSERTED: " << a.realName() << endl; + } +} + +void importKMailAddressBook( KABC::AddressBook *ab ) +{ + TQString fileName = locateLocal( "data", "kmail/addressbook" ); + TQString kmailConfigName = locate( "config", "kmailrc" ); + if ( !kmailConfigName.isEmpty() ) { + TDEConfig cfg( kmailConfigName ); + cfg.setGroup( "Addressbook" ); + fileName = cfg.readPathEntry( "default", fileName ); + } + if ( !KStandardDirs::exists( fileName ) ) { + kdDebug(5700) << "Couldn't find KMail addressbook." << endl; + return; + } + + TQFile f( fileName ); + if ( !f.open(IO_ReadOnly) ) { + kdDebug(5700) << "Couldn't open file '" << fileName << "'" << endl; + return; + } + + TQStringList kmailEntries; + + TQTextStream t( &f ); + while ( !t.eof() ) { + kmailEntries.append( t.readLine() ); + } + f.close(); + + TQStringList::ConstIterator it; + for ( it = kmailEntries.begin(); it != kmailEntries.end(); ++it ) { + if ( (*it).at( 0 ) == '#' ) continue; + bool insideQuote = false; + int end = (*it).length() - 1; + for ( int i = end; i; i-- ) { + if ( (*it).at( i ) == '"' ) { + if ( insideQuote ) + insideQuote = false; + else + insideQuote = true; + } else if ( (*it).at( i ) == ',' && !insideQuote ) { + readKMailEntry( (*it).mid( i + 1, end - i ), ab ); + end = i - 1; + } + } + + readKMailEntry( (*it).mid( 0, end + 1 ), ab ); + } +} + +void readKAddressBookEntries( const TQString &dataString, Addressee &a ) +{ + // Strip "KMail:1.0" prefix and "[EOS]" suffix. + TQString str = dataString.mid( 11, dataString.length() - 24 ); + + TQStringList entries = TQStringList::split( "\n[EOR]\n ", str ); + + Address homeAddress( Address::Home ); + Address businessAddress( Address::Work ); + Address otherAddress; + + TQStringList::ConstIterator it; + for ( it = entries.begin(); it != entries.end(); ++it ) { + int pos = (*it).find( "\n" ); + TQString fieldName = (*it).left( pos ); + TQString fieldValue = (*it).mid( pos + 2 ); + + if ( fieldName == "X-HomeFax" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Home | + PhoneNumber::Fax ) ); + } else if ( fieldName == "X-OtherPhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, 0 ) ); + } else if ( fieldName == "X-PrimaryPhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Pref ) ); + } else if ( fieldName == "X-BusinessFax" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Work | + PhoneNumber::Fax ) ); + } else if ( fieldName == "X-CarPhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Car ) ); + } else if ( fieldName == "X-MobilePhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Cell ) ); + } else if ( fieldName == "X-ISDN" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Isdn ) ); + } else if ( fieldName == "X-OtherFax" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Fax ) ); + } else if ( fieldName == "X-Pager" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Pager ) ); + } else if ( fieldName == "X-BusinessPhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Work ) ); + } else if ( fieldName == "X-HomePhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Home ) ); + } else if ( fieldName == "X-HomeAddress" ) { + homeAddress.setLabel( fieldValue ); + } else if ( fieldName == "X-HomeAddressStreet" ) { + homeAddress.setStreet( fieldValue ); + } else if ( fieldName == "X-HomeAddressCity" ) { + homeAddress.setLocality( fieldValue ); + } else if ( fieldName == "X-HomeAddressPostalCode" ) { + homeAddress.setPostalCode( fieldValue ); + } else if ( fieldName == "X-HomeAddressState" ) { + homeAddress.setRegion( fieldValue ); + } else if ( fieldName == "X-HomeAddressCountry" ) { + homeAddress.setCountry( fieldValue ); + } else if ( fieldName == "X-BusinessAddress" ) { + businessAddress.setLabel( fieldValue ); + } else if ( fieldName == "X-BusinessAddressStreet" ) { + businessAddress.setStreet( fieldValue ); + } else if ( fieldName == "X-BusinessAddressCity" ) { + businessAddress.setLocality( fieldValue ); + } else if ( fieldName == "X-BusinessAddressPostalCode" ) { + businessAddress.setPostalCode( fieldValue ); + } else if ( fieldName == "X-BusinessAddressState" ) { + businessAddress.setRegion( fieldValue ); + } else if ( fieldName == "X-BusinessAddressCountry" ) { + businessAddress.setCountry( fieldValue ); + } else if ( fieldName == "X-OtherAddress" ) { + otherAddress.setLabel( fieldValue ); + } else if ( fieldName == "X-OtherAddressStreet" ) { + otherAddress.setStreet( fieldValue ); + } else if ( fieldName == "X-OtherAddressCity" ) { + otherAddress.setLocality( fieldValue ); + } else if ( fieldName == "X-OtherAddressPostalCode" ) { + otherAddress.setPostalCode( fieldValue ); + } else if ( fieldName == "X-OtherAddressState" ) { + otherAddress.setRegion( fieldValue ); + } else if ( fieldName == "X-OtherAddressCountry" ) { + otherAddress.setCountry( fieldValue ); + } else if ( fieldName == "NICKNAME" ) { + a.setNickName( fieldValue ); + } else if ( fieldName == "ORG" ) { + a.setOrganization( fieldValue ); + } else if ( fieldName == "ROLE" ) { + a.setRole( fieldValue ); + } else if ( fieldName == "BDAY" ) { + a.setBirthday( TDEGlobal::locale()->readDate( fieldValue ) ); + } else if ( fieldName == "WEBPAGE" ) { + a.setUrl( KURL( fieldValue ) ); + } else if ( fieldName == "N" ) { + } else if ( fieldName == "X-FirstName" ) { + } else if ( fieldName == "X-MiddleName" ) { + } else if ( fieldName == "X-LastName" ) { + } else if ( fieldName == "X-Title" ) { + } else if ( fieldName == "X-Suffix" ) { + } else if ( fieldName == "X-FileAs" ) { + } else if ( fieldName == "EMAIL" ) { + a.insertEmail( fieldValue, true ); + } else if ( fieldName == "X-E-mail2" ) { + a.insertEmail( fieldValue ); + } else if ( fieldName == "X-E-mail3" ) { + a.insertEmail( fieldValue ); + } else if ( fieldName == "X-Notes" ) { + } else { + a.insertCustom( "KADDRESSBOOK", fieldName, fieldValue ); + } + } + + if ( !homeAddress.isEmpty() ) a.insertAddress( homeAddress ); + if ( !businessAddress.isEmpty() ) a.insertAddress( businessAddress ); + if ( !otherAddress.isEmpty() ) a.insertAddress( otherAddress ); +} + +void importKab( KABC::AddressBook *ab, bool override, bool quiet ) +{ + TQString fileName = TDEGlobal::dirs()->saveLocation( "data", "kab/" ); + fileName += "addressbook.kab"; + if ( !TQFile::exists( fileName ) ) { + if ( !quiet ) { + KMessageBox::error( 0, "<qt>" + i18n( "Address book file <b>%1</b> not found! Make sure the old address book is located there and you have read permission for this file." ) + .arg( fileName ) + "</qt>" ); + } + kdDebug(5700) << "No KDE 2 addressbook found." << endl; + return; + } + + kdDebug(5700) << "Converting old-style kab addressbook to " + "new-style kabc addressbook." << endl; + + KabAPI kab( 0 ); + if ( kab.init() != ::AddressBook::NoError ) { + kdDebug(5700) << "Error initing kab" << endl; + exit( 1 ); + } + + KabKey key; + ::AddressBook::Entry entry; + + int num = kab.addressbook()->noOfEntries(); + + kdDebug(5700) << "kab Addressbook has " << num << " entries." << endl; + + for ( int i = 0; i < num; ++i ) { + if ( ::AddressBook::NoError != kab.addressbook()->getKey( i, key ) ) { + kdDebug(5700) << "Error getting key for index " << i << " from kab." << endl; + continue; + } + if ( ::AddressBook::NoError != kab.addressbook()->getEntry( key, entry ) ) { + kdDebug(5700) << "Error getting entry for index " << i << " from kab." << endl; + continue; + } + + Addressee a; + + // Convert custom entries + int count = 0; + bool idFound = false; + TQStringList::ConstIterator customIt; + for ( customIt = entry.custom.begin(); customIt != entry.custom.end(); ++customIt ) { + if ( (*customIt).startsWith( "X-KABC-UID:" ) ) { + a.setUid( (*customIt).mid( (*customIt).find( ":" ) + 1 ) ); + idFound = true; + } else if ( (*customIt).startsWith( "KMail:1.0\n" ) ) { + readKAddressBookEntries( *customIt, a ); + } else { + a.insertCustom( "tdeab2tdeabc", TQString::number( count++ ), *customIt ); + } + } + if ( idFound ) { + if ( !override ) continue; + } else { + entry.custom << "X-KABC-UID:" + a.uid(); + ::AddressBook::ErrorCode error = kab.addressbook()->change( key, entry ); + if ( error != ::AddressBook::NoError ) { + kdDebug(5700) << "kab.change returned with error " << error << endl; + } else { + kdDebug(5700) << "Wrote back to kab uid " << a.uid() << endl; + } + } + + a.setTitle( entry.title ); + a.setFormattedName( entry.fn ); + a.setPrefix( entry.nameprefix ); + a.setGivenName( entry.firstname ); + a.setAdditionalName( entry.middlename ); + a.setFamilyName( entry.lastname ); + a.setBirthday( entry.birthday ); + + TQStringList::ConstIterator emailIt; + for ( emailIt = entry.emails.begin(); emailIt != entry.emails.end(); ++emailIt ) + a.insertEmail( *emailIt ); + + TQStringList::ConstIterator phoneIt; + for ( phoneIt = entry.telephone.begin(); phoneIt != entry.telephone.end(); ++phoneIt ) { + int kabType = (*phoneIt++).toInt(); + if ( phoneIt == entry.telephone.end() ) break; + TQString number = *phoneIt; + int type = 0; + if ( kabType == ::AddressBook::Fixed ) type = PhoneNumber::Voice; + else if ( kabType == ::AddressBook::Mobile ) type = PhoneNumber::Cell | PhoneNumber::Voice; + else if ( kabType == ::AddressBook::Fax ) type = PhoneNumber::Fax; + else if ( kabType == ::AddressBook::Modem ) type = PhoneNumber::Modem; + a.insertPhoneNumber( PhoneNumber( number, type ) ); + } + + if ( entry.URLs.count() > 0 ) { + a.setUrl( KURL( entry.URLs.first() ) ); + if ( entry.URLs.count() > 1 ) { + kdWarning() << "More than one URL. Ignoring all but the first." << endl; + } + } + + int noAdr = entry.noOfAddresses(); + for ( int j = 0; j < noAdr; ++j ) { + ::AddressBook::Entry::Address kabAddress; + entry.getAddress( j, kabAddress ); + + Address adr; + + adr.setStreet( kabAddress.address ); + adr.setPostalCode( kabAddress.zip ); + adr.setLocality( kabAddress.town ); + adr.setCountry( kabAddress.country ); + adr.setRegion( kabAddress.state ); + + TQString label; + if ( !kabAddress.headline.isEmpty() ) label += kabAddress.headline + "\n"; + if ( !kabAddress.position.isEmpty() ) label += kabAddress.position + "\n"; + if ( !kabAddress.org.isEmpty() ) label += kabAddress.org + "\n"; + if ( !kabAddress.orgUnit.isEmpty() ) label += kabAddress.orgUnit + "\n"; + if ( !kabAddress.orgSubUnit.isEmpty() ) label += kabAddress.orgSubUnit + "\n"; + if ( !kabAddress.deliveryLabel.isEmpty() ) label += kabAddress.deliveryLabel + "\n"; + adr.setLabel( label ); + + a.insertAddress( adr ); + } + + TQString note = entry.comment; + + if ( !entry.user1.isEmpty() ) note += "\nUser1: " + entry.user1; + if ( !entry.user2.isEmpty() ) note += "\nUser2: " + entry.user2; + if ( !entry.user3.isEmpty() ) note += "\nUser3: " + entry.user3; + if ( !entry.user4.isEmpty() ) note += "\nUser4: " + entry.user4; + + if ( !entry.keywords.count() == 0 ) note += "\nKeywords: " + entry.keywords.join( ", " ); + + TQStringList::ConstIterator talkIt; + for ( talkIt = entry.talk.begin(); talkIt != entry.talk.end(); ++talkIt ) { + note += "\nTalk: " + (*talkIt); + } + + a.setNote( note ); + + a.setPrefix( entry.rank + a.prefix() ); // Add rank to prefix + + a.setCategories( entry.categories ); + + kdDebug(5700) << "Addressee: " << a.familyName() << endl; + + ab->insertAddressee( a ); + } + + kab.save( true ); +} + +int main( int argc, char **argv ) +{ + TDEAboutData aboutData( "tdeab2tdeabc", I18N_NOOP( "Kab to Kabc Converter" ), "0.1" ); + aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); + + TDECmdLineArgs::init( argc, argv, &aboutData ); + TDECmdLineArgs::addCmdLineOptions( options ); + + TDEApplication app; + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + + bool override = false; + + if ( args->isSet( "override" ) ) { + kdDebug() << "Override existing entries." << endl; + + override = true; + } + + bool quiet = false; + + if ( args->isSet( "quiet" ) ) + quiet = true; + + if ( args->isSet( "disable-autostart" ) ) { + kdDebug() << "Disable autostart." << endl; + + TDEConfig *config = app.config(); + config->setGroup( "Startup" ); + config->writeEntry( "EnableAutostart", false ); + } + + KABC::AddressBook *kabcBook = StdAddressBook::self(); + + importKMailAddressBook( kabcBook ); + + importKab( kabcBook, override, quiet ); + + StdAddressBook::save(); + + kdDebug(5700) << "Saved kabc addressbook to '" << kabcBook->identifier() << "'" << endl; +} + diff --git a/kabc/tdeab2tdeabc.desktop b/kabc/tdeab2tdeabc.desktop new file mode 100644 index 00000000..945f044d --- /dev/null +++ b/kabc/tdeab2tdeabc.desktop @@ -0,0 +1,105 @@ +[Desktop Entry] +Name=tdeab2tdeabc +Name[af]=kab-na-kabc +Name[csb]=Kònwersëjô adresowi knéżczi +Name[eo]=Konvertilo de "kab" al "kabc" +Name[fr]=KAB2KABC +Name[fy]=Kab2kabc +Name[hu]=Kab2kabc +Name[it]=Kab2Kabc +Name[nl]=Kab2kabc +Name[pl]=Konwersja książki adresowej +Name[pt_BR]=Conversão de kab para kabc +Name[ro]=Kab2kabc +Name[sv]=Kab2kabc +Name[te]=కెఎబి2కెఎబిసి +Name[zu]=i-tdeab2tdeabc +Exec=tdeab2tdeabc --disable-autostart --quiet +Icon=misc +Type=Application +Comment=libkab to libkabc conversion tool. +Comment[af]=libkab na libkabc omskakeling program. +Comment[ar]=أداة تحويل libkab إلى libkabc. +Comment[az]=libkab - libkabc dönüşdürmə vasitəsi. +Comment[be]=Інструмент пераўтварэння libkab у libkabc. +Comment[bg]=Програма за конвертиране на libkab до libkabc. +Comment[bn]=libkab থেকে libkabc-তে পরিবর্তন করার প্রোগ্রাম। +Comment[bs]=alat za pretvaranje libkab u libkabc. +Comment[ca]=Eina de conversió de libkab a libkabc. +Comment[cs]=Převod dat z libkab do libkabc. +Comment[csb]=Nôrzãdze do kònwersëji z libkab do libkabc. +Comment[cy]=erfyn trosi libkab i libkabc +Comment[da]=libkab-til-libkabc-konverteringsværktøj. +Comment[de]=Konvertierung von libkab in libkabc +Comment[el]=Εργαλείο μετατροπής από το libkab στο libkabc. +Comment[eo]=Konvertilo de "libkab" al "libkabc" +Comment[es]=Conversor libkab a libkabc. +Comment[et]=libkab -> libkabc teisendamine +Comment[eu]=libkab-etik libkabc-era bihurtzeko tresna. +Comment[fa]=ابزار تبدیل libkab به libcabc. +Comment[fi]=libkab-libkabc -muunnin +Comment[fr]=Outil de conversion de libkab vers libkabc. +Comment[fy]=Konversjeprogramma fan libkab nei libkabc. +Comment[ga]=Uirlis tiontaithe ó libkab go libkabc. +Comment[gl]=Ferramenta de conversión de libkab a libkabc. +Comment[he]=כלי המרה מ־libkab ל־libkabc +Comment[hi]=libkab से libkabc बदलने वाला औजार +Comment[hr]=Alat za pretvaranje iz libkab u libkabc +Comment[hsb]=libkab -> libkabc konwerter +Comment[hu]=libkab -> libkabc konvertáló. +Comment[id]=konverter libkab ke libkabc. +Comment[is]=libkab í libkabc breytingatól. +Comment[it]=Strumento di conversione da libkab a libkabc. +Comment[ja]=libkab から libkabc への変換ツール +Comment[ka]=libkab => libkabc გარდაქმნის ხელსაწყო. +Comment[kk]=libkab дегеннен libkabc дегенге айналдыру құралы. +Comment[km]=ឧបករណ៍បម្លែងពី libkab ទៅ libkabc +Comment[ko]=libkab을 libkabc로 바꿔주는 연장. +Comment[lb]=libkab op libkabc Konvertéierungs-Hëllefsmëttel. +Comment[lt]=libkab į libkabc konvertavimo įrankis. +Comment[lv]=libkab uz libkabc kovertēšanas rīks. +Comment[mk]=алатка за претворање од libkab во libkabc. +Comment[mn]=libkab-аас libkabc-руу хөрвүүлэгч +Comment[ms]=perkakasan penukaran libkab to libkabc. +Comment[mt]=Għodda għall-konverżjoni libkab għal libkabc +Comment[nb]=libkab til libkabc konverteringsverktøy. +Comment[nds]=Warktüüch för't Ümwanneln vun libkab na libkabc. +Comment[ne]=libkab to libkabc रूपान्तरण उपकरण । +Comment[nl]=Conversieprogramma van libkab naar libkabc. +Comment[nn]=Konverterer libkab til libkabc +Comment[nso]=Sebereka sa phetosetso ya libkab go libkabc +Comment[pa]=libkab ਤੋ libkabc ਤਬਦੀਲੀ ਸੰਦ। +Comment[pl]=Narzędzie do konwersji z libkab do libkabc. +Comment[pt]=Ferramenta de conversão de libkab para libkabc. +Comment[pt_BR]=Ferramenta de conversão de libkab para libkabc. +Comment[ro]=Utilitar de conversie de la "libkab" la "libkabc". +Comment[ru]=утилита преобразования libkab в libkabc. +Comment[rw]=Igikoresho cy'ihindura libkab muri libkabc. +Comment[se]=konverterenreaidu libkab:as libkabc:ai +Comment[sk]=Prevod dát z libkab do libkabc. +Comment[sl]=Orodje za pretvorbo iz libkab v libkabc +Comment[sq]=Vegla për shëndrimin e libkab në libkabc. +Comment[sr]=Алат за конверзију из libkab-а у libkabc. +Comment[sr@Latn]=Alat za konverziju iz libkab-a u libkabc. +Comment[ss]=Lithulusi lekutjintja le-libkab kuya ku-libkabc. +Comment[sv]=Konverteringsverktyg från libkab till libkabc +Comment[ta]=libkab இலிருந்து libkabc க்கு மாற்றும் கருவி. +Comment[te]=libkab నుంచి libkabc కు మార్చు పనిముట్టు +Comment[tg]=асбоби дигаргунсози libkab ба libkabc +Comment[th]=เครื่องมือเปลี่ยน libkab เป็น libkabc +Comment[tr]=libkab' tan libkabc' ye dönüştürme aracı +Comment[tt]=libkab-›libkabc äyländerü qoralı. +Comment[uk]=Засіб перетворення libkab до libkabc. +Comment[uz]=libkab'ni libkabc'ga aylantiradigan vosita. +Comment[uz@cyrillic]=libkab'ни libkabc'га айлантирадиган восита. +Comment[ven]=Tshishumiswa tsha u shandukisa libkab itshi ya kha libkabc +Comment[vi]=Công cụ chuyển đổi libkab sang libkabc. +Comment[xh]=libkab kwi libkabc isixhobo sokuguqulela. +Comment[zh_CN]=libkab 到 libkabc 的转换工具。 +Comment[zh_HK]=libkab 至 libkabc 的轉換工具 +Comment[zh_TW]=libkab 至 libkabc 轉換工具 +Comment[zu]=Ithuluzi lokuguqula le-libkab kuyaku-libkabc +Terminal=false +NoDisplay=true +X-TDE-autostart-condition=tdeab2tdeabcrc:Startup:EnableAutostart:true +OnlyShowIn=TDE; diff --git a/kate/data/bash.xml b/kate/data/bash.xml index 84c91596..e3bc4abd 100644 --- a/kate/data/bash.xml +++ b/kate/data/bash.xml @@ -439,7 +439,7 @@ <!-- others --> <item> dcop </item> <item> kdialog </item> - <item> kfile </item> + <item> tdefile </item> <item> xhost </item> <item> xmodmap </item> <item> xset </item> diff --git a/kate/data/tcsh.xml b/kate/data/tcsh.xml index f9dffa2e..19c94bea 100644 --- a/kate/data/tcsh.xml +++ b/kate/data/tcsh.xml @@ -431,7 +431,7 @@ <!-- others --> <item> dcop </item> <item> kdialog </item> - <item> kfile </item> + <item> tdefile </item> <item> xhost </item> <item> xmodmap </item> <item> xset </item> diff --git a/kate/data/zsh.xml b/kate/data/zsh.xml index 5d0575ab..e69c1535 100644 --- a/kate/data/zsh.xml +++ b/kate/data/zsh.xml @@ -497,7 +497,7 @@ <!-- others --> <item> dcop </item> <item> kdialog </item> - <item> kfile </item> + <item> tdefile </item> <item> xhost </item> <item> xmodmap </item> <item> xset </item> diff --git a/kate/interfaces/katecmd.cpp b/kate/interfaces/katecmd.cpp index 69263b57..2104ef15 100644 --- a/kate/interfaces/katecmd.cpp +++ b/kate/interfaces/katecmd.cpp @@ -118,7 +118,7 @@ const TQString KateCmd::fromHistory( uint index ) const //BEGIN KateCmdShellCompletion /* A lot of the code in the below class is copied from - tdelibs/kio/kio/kshellcompletion.cpp + tdelibs/tdeio/tdeio/kshellcompletion.cpp Copyright (C) 2000 David Smith <dsmith@algonet.se> Copyright (C) 2004 Anders Lund <anders@alweb.dk> */ diff --git a/kate/part/CMakeLists.txt b/kate/part/CMakeLists.txt index 72ac36f8..dcbc0eec 100644 --- a/kate/part/CMakeLists.txt +++ b/kate/part/CMakeLists.txt @@ -21,9 +21,9 @@ include_directories( ${CMAKE_SOURCE_DIR}/tdefx ${CMAKE_SOURCE_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio - ${CMAKE_SOURCE_DIR}/kio/kfile + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile ${CMAKE_SOURCE_DIR}/kjs ${CMAKE_SOURCE_DIR}/tdeutils ${CMAKE_SOURCE_DIR}/tdeprint diff --git a/kate/part/kateconfig.cpp b/kate/part/kateconfig.cpp index 81b001c3..d1c9fd1e 100644 --- a/kate/part/kateconfig.cpp +++ b/kate/part/kateconfig.cpp @@ -28,7 +28,7 @@ #include <math.h> #include <kapplication.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kglobalsettings.h> #include <kcharsets.h> #include <klocale.h> diff --git a/kate/part/katedialogs.cpp b/kate/part/katedialogs.cpp index 43f5977d..5006ddd6 100644 --- a/kate/part/katedialogs.cpp +++ b/kate/part/katedialogs.cpp @@ -38,9 +38,9 @@ #include <tdetexteditor/configinterfaceextension.h> #include <tdetexteditor/plugin.h> -#include <kio/job.h> -#include <kio/jobclasses.h> -#include <kio/netaccess.h> +#include <tdeio/job.h> +#include <tdeio/jobclasses.h> +#include <tdeio/netaccess.h> #include <kaccel.h> #include <kapplication.h> @@ -50,7 +50,7 @@ #include <kcolorcombo.h> #include <kcolordialog.h> #include <kcombobox.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kdebug.h> #include <kfontdialog.h> #include <kglobal.h> diff --git a/kate/part/katedocument.cpp b/kate/part/katedocument.cpp index 03c8ac63..74e5c322 100644 --- a/kate/part/katedocument.cpp +++ b/kate/part/katedocument.cpp @@ -42,9 +42,9 @@ #include "katetemplatehandler.h" #include <tdetexteditor/plugin.h> -#include <kio/job.h> -#include <kio/netaccess.h> -#include <kio/kfileitem.h> +#include <tdeio/job.h> +#include <tdeio/netaccess.h> +#include <tdeio/tdefileitem.h> #include <tdeparts/event.h> @@ -53,8 +53,8 @@ #include <kglobal.h> #include <kapplication.h> #include <kpopupmenu.h> -#include <kconfig.h> -#include <kfiledialog.h> +#include <tdeconfig.h> +#include <tdefiledialog.h> #include <kmessagebox.h> #include <kstdaction.h> #include <kiconloader.h> @@ -1924,13 +1924,13 @@ void KateDocument::writeConfig() config->sync(); } -void KateDocument::readSessionConfig(TDEConfig *kconfig) +void KateDocument::readSessionConfig(TDEConfig *tdeconfig) { // restore the url - KURL url (kconfig->readEntry("URL")); + KURL url (tdeconfig->readEntry("URL")); // get the encoding - TQString tmpenc=kconfig->readEntry("Encoding"); + TQString tmpenc=tdeconfig->readEntry("Encoding"); if (!tmpenc.isEmpty() && (tmpenc != encoding())) setEncoding(tmpenc); @@ -1939,34 +1939,34 @@ void KateDocument::readSessionConfig(TDEConfig *kconfig) openURL (url); // restore the hl stuff - m_buffer->setHighlight(KateHlManager::self()->nameFind(kconfig->readEntry("Highlighting"))); + m_buffer->setHighlight(KateHlManager::self()->nameFind(tdeconfig->readEntry("Highlighting"))); if (hlMode() > 0) hlSetByUser = true; // indent mode - config()->setIndentationMode( (uint)kconfig->readNumEntry("Indentation Mode", config()->indentationMode() ) ); + config()->setIndentationMode( (uint)tdeconfig->readNumEntry("Indentation Mode", config()->indentationMode() ) ); // Restore Bookmarks - TQValueList<int> marks = kconfig->readIntListEntry("Bookmarks"); + TQValueList<int> marks = tdeconfig->readIntListEntry("Bookmarks"); for( uint i = 0; i < marks.count(); i++ ) addMark( marks[i], KateDocument::markType01 ); } -void KateDocument::writeSessionConfig(TDEConfig *kconfig) +void KateDocument::writeSessionConfig(TDEConfig *tdeconfig) { if ( m_url.isLocalFile() && !TDEGlobal::dirs()->relativeLocation("tmp", m_url.path()).startsWith("/")) return; // save url - kconfig->writeEntry("URL", m_url.prettyURL() ); + tdeconfig->writeEntry("URL", m_url.prettyURL() ); // save encoding - kconfig->writeEntry("Encoding",encoding()); + tdeconfig->writeEntry("Encoding",encoding()); // save hl - kconfig->writeEntry("Highlighting", highlight()->name()); + tdeconfig->writeEntry("Highlighting", highlight()->name()); - kconfig->writeEntry("Indentation Mode", config()->indentationMode() ); + tdeconfig->writeEntry("Indentation Mode", config()->indentationMode() ); // Save Bookmarks TQValueList<int> marks; @@ -1975,7 +1975,7 @@ void KateDocument::writeSessionConfig(TDEConfig *kconfig) ++it ) marks << it.current()->line; - kconfig->writeEntry( "Bookmarks", marks ); + tdeconfig->writeEntry( "Bookmarks", marks ); } void KateDocument::configDialog() diff --git a/kate/part/katefiletype.cpp b/kate/part/katefiletype.cpp index a00d39bf..15dd7c9f 100644 --- a/kate/part/katefiletype.cpp +++ b/kate/part/katefiletype.cpp @@ -25,7 +25,7 @@ #include "kateview.h" #include "katefactory.h" -#include <kconfig.h> +#include <tdeconfig.h> #include <kmimemagic.h> #include <kmimetype.h> #include <kmimetypechooser.h> diff --git a/kate/part/katehighlight.cpp b/kate/part/katehighlight.cpp index 08da7e97..f0651864 100644 --- a/kate/part/katehighlight.cpp +++ b/kate/part/katehighlight.cpp @@ -32,7 +32,7 @@ #include "kateschema.h" #include "kateconfig.h" -#include <kconfig.h> +#include <tdeconfig.h> #include <kglobal.h> #include <kinstance.h> #include <kmimetype.h> diff --git a/kate/part/katehighlight.h b/kate/part/katehighlight.h index 1b71e454..8ff5e31b 100644 --- a/kate/part/katehighlight.h +++ b/kate/part/katehighlight.h @@ -26,7 +26,7 @@ #include "../interfaces/document.h" -#include <kconfig.h> +#include <tdeconfig.h> #include <tqptrlist.h> #include <tqvaluelist.h> diff --git a/kate/part/katejscript.cpp b/kate/part/katejscript.cpp index 28b22c74..f3a5cd54 100644 --- a/kate/part/katejscript.cpp +++ b/kate/part/katejscript.cpp @@ -37,7 +37,7 @@ #include <kstandarddirs.h> #include <klocale.h> #include <kmessagebox.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kjs/function_object.h> #include <kjs/interpreter.h> @@ -688,7 +688,7 @@ void KateJScriptManager::collectScripts (bool force) TDEConfig df (desktopFile, true, false); df.setDesktopGroup (); - // get cmdname, fallback to baseName, if it is empty, therefor not use the kconfig fallback + // get cmdname, fallback to baseName, if it is empty, therefor not use the tdeconfig fallback TQString cmdname = df.readEntry ("X-Kate-Command"); if (cmdname.isEmpty()) { diff --git a/kate/part/kateluaindentscript.cpp b/kate/part/kateluaindentscript.cpp index c06f3864..46cf531a 100644 --- a/kate/part/kateluaindentscript.cpp +++ b/kate/part/kateluaindentscript.cpp @@ -31,7 +31,7 @@ #include <tqfileinfo.h> #include <kstandarddirs.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kglobal.h> #include <klocale.h> diff --git a/kate/part/kateschema.h b/kate/part/kateschema.h index f6eb8ef6..2e92812d 100644 --- a/kate/part/kateschema.h +++ b/kate/part/kateschema.h @@ -29,7 +29,7 @@ #include <tqlistview.h> #include <tqfont.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kaction.h> class KateView; @@ -53,7 +53,7 @@ class KateSchemaManager void update (bool readfromfile = true); /** - * return kconfig with right group set or set to Normal if not there + * return tdeconfig with right group set or set to Normal if not there */ TDEConfig *schema (uint number); diff --git a/kate/part/katesyntaxdocument.cpp b/kate/part/katesyntaxdocument.cpp index 4093f872..d90f5de7 100644 --- a/kate/part/katesyntaxdocument.cpp +++ b/kate/part/katesyntaxdocument.cpp @@ -27,7 +27,7 @@ #include <kstandarddirs.h> #include <klocale.h> #include <kmessagebox.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <tqfile.h> diff --git a/kate/part/kateview.cpp b/kate/part/kateview.cpp index 193f411f..22a4799d 100644 --- a/kate/part/kateview.cpp +++ b/kate/part/kateview.cpp @@ -50,9 +50,9 @@ #include <tdeparts/event.h> -#include <kio/netaccess.h> +#include <tdeio/netaccess.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kurldrag.h> #include <kdebug.h> #include <kapplication.h> diff --git a/kate/part/test_regression.cpp b/kate/part/test_regression.cpp index 4f2ef26a..1463c8bc 100644 --- a/kate/part/test_regression.cpp +++ b/kate/part/test_regression.cpp @@ -42,7 +42,7 @@ #include <kaction.h> #include <kcmdlineargs.h> #include "katefactory.h" -#include <kio/job.h> +#include <tdeio/job.h> #include <kmainwindow.h> #include <ksimpleconfig.h> #include <kglobalsettings.h> diff --git a/kate/plugins/autobookmarker/autobookmarker.cpp b/kate/plugins/autobookmarker/autobookmarker.cpp index ceb76eed..cf3190c4 100644 --- a/kate/plugins/autobookmarker/autobookmarker.cpp +++ b/kate/plugins/autobookmarker/autobookmarker.cpp @@ -30,7 +30,7 @@ #include <kaction.h> #include <kapplication.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kgenericfactory.h> #include <kiconloader.h> #include <klistview.h> diff --git a/kate/plugins/insertfile/CMakeLists.txt b/kate/plugins/insertfile/CMakeLists.txt index 0c80a1e0..56bdfd9c 100644 --- a/kate/plugins/insertfile/CMakeLists.txt +++ b/kate/plugins/insertfile/CMakeLists.txt @@ -16,9 +16,9 @@ include_directories( ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio - ${CMAKE_SOURCE_DIR}/kio/kfile + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile ${CMAKE_SOURCE_DIR}/interfaces ) diff --git a/kate/plugins/insertfile/insertfileplugin.cpp b/kate/plugins/insertfile/insertfileplugin.cpp index ee46a7cf..aa9f998b 100644 --- a/kate/plugins/insertfile/insertfileplugin.cpp +++ b/kate/plugins/insertfile/insertfileplugin.cpp @@ -24,9 +24,9 @@ #include <tdetexteditor/editinterface.h> #include <assert.h> -#include <kio/job.h> +#include <tdeio/job.h> #include <kaction.h> -#include <kfiledialog.h> +#include <tdefiledialog.h> #include <kgenericfactory.h> #include <klocale.h> #include <kmessagebox.h> diff --git a/kate/plugins/isearch/ISearchPlugin.cpp b/kate/plugins/isearch/ISearchPlugin.cpp index 26c49576..de1c1c37 100644 --- a/kate/plugins/isearch/ISearchPlugin.cpp +++ b/kate/plugins/isearch/ISearchPlugin.cpp @@ -24,7 +24,7 @@ #include <klocale.h> #include <kaction.h> #include <kcombobox.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kdebug.h> #include "ISearchPlugin.h" diff --git a/kate/plugins/kdatatool/CMakeLists.txt b/kate/plugins/kdatatool/CMakeLists.txt index 1adced17..7ceccc10 100644 --- a/kate/plugins/kdatatool/CMakeLists.txt +++ b/kate/plugins/kdatatool/CMakeLists.txt @@ -17,8 +17,8 @@ include_directories( ${CMAKE_SOURCE_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdefx ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio ${CMAKE_SOURCE_DIR}/interfaces ) diff --git a/kate/plugins/wordcompletion/docwordcompletion.cpp b/kate/plugins/wordcompletion/docwordcompletion.cpp index a468edd1..fbd5a4db 100644 --- a/kate/plugins/wordcompletion/docwordcompletion.cpp +++ b/kate/plugins/wordcompletion/docwordcompletion.cpp @@ -34,7 +34,7 @@ #include <tdetexteditor/variableinterface.h> #include <kapplication.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kdialog.h> #include <kgenericfactory.h> #include <klocale.h> diff --git a/kcmshell/CMakeLists.txt b/kcmshell/CMakeLists.txt deleted file mode 100644 index 92c2205d..00000000 --- a/kcmshell/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${TQT_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/dcop - ${CMAKE_SOURCE_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio - ${CMAKE_SOURCE_DIR}/tdeutils -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### kcmshell ################################## - -set( target kcmshell ) - -set( ${target}_SRCS - main.cpp main.skel -) - -tde_add_tdeinit_executable( ${target} AUTOMOC - SOURCES ${${target}_SRCS} - LINK tdeutils-shared - DEPENDENCIES dcopidl -) diff --git a/kcmshell/Makefile.am b/kcmshell/Makefile.am deleted file mode 100644 index 9c755d8b..00000000 --- a/kcmshell/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -# -# Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> -# Copyright (c) 2000 Matthias Elter <elter@kde.org> -# Copyright (c) 2004 Frans Englich <frans.englich@telia.com> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -AM_CPPFLAGS = -I$(top_srcdir)/tdeutils $(all_includes) -METASOURCES = AUTO - -lib_LTLIBRARIES = -bin_PROGRAMS = -tdeinit_LTLIBRARIES = kcmshell.la - -kcmshell_la_SOURCES = main.cpp main.skel -kcmshell_la_LIBADD = ../tdeutils/libtdeutils.la $(LIB_QT) $(LIB_TDEUI) $(top_builddir)/dcop/libDCOP.la $(LIB_TDECORE) $(LIB_KFILE) -kcmshell_la_LDFLAGS = $(all_libraries) -module -avoid-version - -noinst_HEADERS = main.h - -messages: rc.cpp - $(XGETTEXT) *.cpp -o $(podir)/kcmshell.pot - - -include $(top_srcdir)/admin/Doxyfile.am - diff --git a/kcmshell/main.cpp b/kcmshell/main.cpp deleted file mode 100644 index 29aba050..00000000 --- a/kcmshell/main.cpp +++ /dev/null @@ -1,350 +0,0 @@ -/* - Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> - Copyright (c) 2000 Matthias Elter <elter@kde.org> - Copyright (c) 2004 Frans Englich <frans.englich@telia.com> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#include <iostream> - -#include <tqcstring.h> -#include <tqfile.h> - -#include <dcopclient.h> -#include <qxembed.h> - -#include <kaboutdata.h> -#include <kapplication.h> -#include <kcmdlineargs.h> -#include <tdecmoduleinfo.h> -#include <tdecmoduleloader.h> -#include <tdecmoduleproxy.h> -#include <kcmultidialog.h> -#include <kdebug.h> -#include <kdialogbase.h> -#include <kiconloader.h> -#include <klocale.h> -#include <kservice.h> -#include <kservicegroup.h> -#include <kstartupinfo.h> -#include <twin.h> -#include <kglobal.h> - -#include "main.h" -#include "main.moc" - -using namespace std; - -KService::List m_modules; - -static KCmdLineOptions options[] = -{ - { "list", I18N_NOOP("List all possible modules"), 0}, - { "+module", I18N_NOOP("Configuration module to open"), 0 }, - { "lang <language>", I18N_NOOP("Specify a particular language"), 0 }, - { "embed <id>", I18N_NOOP("Embeds the module with buttons in window with id <id>"), 0 }, - { "embed-proxy <id>", I18N_NOOP("Embeds the module without buttons in window with id <id>"), 0 }, - { "silent", I18N_NOOP("Do not display main window"), 0 }, - KCmdLineLastOption -}; - -static void listModules(const TQString &baseGroup) -{ - - KServiceGroup::Ptr group = KServiceGroup::group(baseGroup); - - if (!group || !group->isValid()) - return; - - KServiceGroup::List list = group->entries(true, true); - - for( KServiceGroup::List::ConstIterator it = list.begin(); - it != list.end(); it++) - { - KSycocaEntry *p = (*it); - if (p->isType(KST_KService)) - { - KService *s = static_cast<KService*>(p); - if (!kapp->authorizeControlModule(s->menuId())) - continue; - m_modules.append(s); - } - else if (p->isType(KST_KServiceGroup)) - listModules(p->entryPath()); - } -} - -static KService::Ptr locateModule(const TQCString& module) -{ - TQString path = TQFile::decodeName(module); - - if (!path.endsWith(".desktop")) - path += ".desktop"; - - KService::Ptr service = KService::serviceByStorageId( path ); - if (!service) - { - kdWarning(780) << "Could not find module '" << module << "'." << endl; - return 0; - } - - // avoid finding random non-TDE applications - if ( module.left( 4 ) != "kde-" && service->library().isEmpty() ) - return locateModule( "kde-" + module ); - - if(!TDECModuleLoader::testModule( module )) - { - kdDebug(780) << "According to \"" << module << "\"'s test function, it should Not be loaded." << endl; - return 0; - } - - return service; -} - -bool KCMShell::isRunning() -{ - if( dcopClient()->appId() == m_dcopName ) - return false; // We are the one and only. - - kdDebug(780) << "kcmshell with modules '" << - m_dcopName << "' is already running." << endl; - - dcopClient()->attach(); // Reregister as anonymous - dcopClient()->setNotifications(true); - - TQByteArray data; - TQDataStream str( data, IO_WriteOnly ); - str << kapp->startupId(); - TQCString replyType; - TQByteArray replyData; - if (!dcopClient()->call(m_dcopName, "dialog", "activate(TQCString)", - data, replyType, replyData)) - { - kdDebug(780) << "Calling DCOP function dialog::activate() failed." << endl; - return false; // Error, we have to do it ourselves. - } - - return true; -} - -KCMShellMultiDialog::KCMShellMultiDialog( int dialogFace, const TQString& caption, - TQWidget *parent, const char *name, bool modal) - : KCMultiDialog( dialogFace, caption, parent, name, modal ), - DCOPObject("dialog") -{ -} - -void KCMShellMultiDialog::activate( TQCString asn_id ) -{ - kdDebug(780) << k_funcinfo << endl; - - KStartupInfo::setNewStartupId( this, asn_id ); -} - -void KCMShell::setDCOPName(const TQCString &dcopName, bool rootMode ) -{ - m_dcopName = "kcmshell_"; - if( rootMode ) - m_dcopName += "rootMode_"; - - m_dcopName += dcopName; - - dcopClient()->registerAs(m_dcopName, false); -} - -void KCMShell::waitForExit() -{ - kdDebug(780) << k_funcinfo << endl; - - connect(dcopClient(), TQT_SIGNAL(applicationRemoved(const TQCString&)), - TQT_SLOT( appExit(const TQCString&) )); - exec(); -} - -void KCMShell::appExit(const TQCString &appId) -{ - kdDebug(780) << k_funcinfo << endl; - - if( appId == m_dcopName ) - { - kdDebug(780) << "'" << appId << "' closed, dereferencing." << endl; - deref(); - } -} - -static void setIcon(TQWidget *w, const TQString &iconName) -{ - TQPixmap icon = DesktopIcon(iconName); - TQPixmap miniIcon = SmallIcon(iconName); - w->setIcon( icon ); //standard X11 -#if defined Q_WS_X11 && ! defined K_WS_QTONLY - KWin::setIcons(w->winId(), icon, miniIcon ); -#endif -} - -extern "C" KDE_EXPORT int kdemain(int _argc, char *_argv[]) -{ - TDEAboutData aboutData( "kcmshell", I18N_NOOP("TDE Control Module"), - 0, - I18N_NOOP("A tool to start single TDE control modules"), - TDEAboutData::License_GPL, - I18N_NOOP("(c) 1999-2004, The KDE Developers") ); - - aboutData.addAuthor("Frans Englich", I18N_NOOP("Maintainer"), "frans.englich@kde.org"); - aboutData.addAuthor("Daniel Molkentin", 0, "molkentin@kde.org"); - aboutData.addAuthor("Matthias Hoelzer-Kluepfel",0, "hoelzer@kde.org"); - aboutData.addAuthor("Matthias Elter",0, "elter@kde.org"); - aboutData.addAuthor("Matthias Ettrich",0, "ettrich@kde.org"); - aboutData.addAuthor("Waldo Bastian",0, "bastian@kde.org"); - - TDEGlobal::locale()->setMainCatalogue("kcmshell"); - - TDECmdLineArgs::init(_argc, _argv, &aboutData); - TDECmdLineArgs::addCmdLineOptions( options ); // Add our own options. - KCMShell app; - - const TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - - const TQCString lang = args->getOption("lang"); - if( !lang.isNull() ) - TDEGlobal::locale()->setLanguage(lang); - - if (args->isSet("list")) - { - cout << static_cast<const char *>(i18n("The following modules are available:").local8Bit()) << endl; - - listModules( "Settings/" ); - - int maxLen=0; - - for( KService::List::ConstIterator it = m_modules.begin(); it != m_modules.end(); ++it) - { - int len = (*it)->desktopEntryName().length(); - if (len > maxLen) - maxLen = len; - } - - for( KService::List::ConstIterator it = m_modules.begin(); it != m_modules.end(); ++it) - { - TQString entry("%1 - %2"); - - entry = entry.arg((*it)->desktopEntryName().leftJustify(maxLen, ' ')) - .arg(!(*it)->comment().isEmpty() ? (*it)->comment() - : i18n("No description available")); - - cout << static_cast<const char *>(entry.local8Bit()) << endl; - } - return 0; - } - - if (args->count() < 1) - { - args->usage(); - return -1; - } - - TQCString dcopName; - KService::List modules; - for (int i = 0; i < args->count(); i++) - { - KService::Ptr service = locateModule(args->arg(i)); - if( service ) - { - modules.append(service); - if( !dcopName.isEmpty() ) - dcopName += "_"; - - dcopName += args->arg(i); - } - } - - /* Check if this particular module combination is already running, but - * allow the same module to run when embedding(root mode) */ - app.setDCOPName(dcopName, - ( args->isSet( "embed-proxy" ) || args->isSet( "embed" ))); - if( app.isRunning() ) - { - app.waitForExit(); - return 0; - } - - //KDialogBase::DialogType dtype = KDialogBase::Plain; // FIXME - KDialogBase::DialogType dtype = KDialogBase::IconList; // Work around a bug whereby several kcontrol modules (such as displayconfig) use an incorrect size when loaded with kcmshell in the Plain mode - // This bug is possibly related to kcmultidialog.cpp:266 [( new TQHBoxLayout( page ) )->setAutoAdd( true );] - // In fact, this method of display may be preferable to the Plain mode from a UX perspective, - // as the icon shows the user what the active kcontrol module is called. - - if ( modules.count() < 1 ) - return 0; - else if( modules.count() > 1 ) - dtype = KDialogBase::IconList; - - bool idValid; - int id; - - if ( args->isSet( "embed-proxy" )) - { - id = args->getOption( "embed-proxy" ).toInt(&idValid); - if( idValid ) - { - TDECModuleProxy *module = new TDECModuleProxy( modules.first()->desktopEntryName() ); - module->realModule(); - QXEmbed::embedClientIntoWindow( module, id); - app.exec(); - delete module; - } - else - kdDebug(780) << "Supplied id '" << id << "' is not valid." << endl; - - return 0; - - } - - KCMShellMultiDialog *dlg = new KCMShellMultiDialog( dtype, - i18n("Configure - %1").arg(kapp->caption()), 0, "", true ); - - for (KService::List::ConstIterator it = modules.begin(); it != modules.end(); ++it) - dlg->addModule(TDECModuleInfo(*it)); - - if ( args->isSet( "embed" )) - { - id = args->getOption( "embed" ).toInt(&idValid); - if( idValid ) - { - QXEmbed::embedClientIntoWindow( dlg, id ); - dlg->exec(); - delete dlg; - } - else - kdDebug(780) << "Supplied id '" << id << "' is not valid." << endl; - - } - else - { - - if (kapp->iconName() != kapp->name()) - setIcon(dlg, kapp->iconName()); - else if ( modules.count() == 1 ) - setIcon(dlg, TDECModuleInfo( modules.first()).icon()); - - dlg->exec(); - delete dlg; - } - - return 0; -} -// vim: sw=4 et sts=4 diff --git a/kcmshell/main.h b/kcmshell/main.h deleted file mode 100644 index f43cf98c..00000000 --- a/kcmshell/main.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - Copyright (c) 2001 Waldo Bastian <bastian@kde.org> - Copyright (c) 2004 Frans Englich <frans.englich@telia.com> - - 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 Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - -#ifndef __kcmshell_h__ -#define __kcmshell_h__ - -#include <dcopobject.h> - -#include <kapplication.h> -#include <kcmultidialog.h> - -/** - * The TDEApplication instance for kcmshell. - */ -class KCMShell : public TDEApplication -{ - Q_OBJECT - -public: - - /** - * Sets m_dcopName basically to @p dcopName, - * and then registers with DCOP. - * - * @param dcopName name to set the DCOP name to - * @param rootMode true if the kcmshell is embedding - */ - void setDCOPName(const TQCString &dcopName, bool rootMode ); - - /** - * Waits until the last instance of kcmshell with the same - * module as this one exits, and then exits. - */ - void waitForExit(); - - /** - * @return true if the shell is running - */ - bool isRunning(); - -private slots: - - /** - */ - void appExit( const TQCString &appId ); - -private: - - /** - * The DCOP name which actually is registered. - * For example "kcmshell_mouse". - */ - TQCString m_dcopName; - -}; - - -/** - * Essentially a plain KCMultiDialog, but has the additional functionality - * of allowing it to be told to request windows focus. - * - * @author Waldo Bastian <bastian@kde.org> - */ -class KCMShellMultiDialog : public KCMultiDialog, public DCOPObject -{ - Q_OBJECT - K_DCOP - -public: - - /** - */ - KCMShellMultiDialog( int dialogFace, const TQString& caption, - TQWidget *parent=0, const char *name=0, bool modal=false); - -k_dcop: - - /** - */ - virtual void activate( TQCString asn_id ); - -}; - - -// vim: sw=4 et sts=4 -#endif //__kcmshell_h__ diff --git a/kconf_update/CMakeLists.txt b/kconf_update/CMakeLists.txt deleted file mode 100644 index 2e25811a..00000000 --- a/kconf_update/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${TQT_INCLUDE_DIRS} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdecore -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### kconf_update ############################## - -set( target kconf_update ) - -set( ${target}_SRCS - kconf_update.cpp -) - -tde_add_tdeinit_executable( ${target} AUTOMOC - SOURCES ${${target}_SRCS} - LINK tdecore-shared -) diff --git a/kconf_update/Mainpage.dox b/kconf_update/Mainpage.dox deleted file mode 100644 index 9db5adb3..00000000 --- a/kconf_update/Mainpage.dox +++ /dev/null @@ -1,31 +0,0 @@ -/** @mainpage ./kconf_update - -kconf_update is a tool designed to update config files. Over time applications -sometimes need to rearrange the way configuration options are stored. Since -such an update shouldn't influence the configuration options that the user -has selected, the application must take care that the options stored in the -old way will still be honored. - -What used to happen is that the application looks up both the old and the -new configuration option and then decides which one to use. This method has -several drawbacks: -- The application may need to read more configuration files than strictly - needed, resulting in a slower startup. -- The application becomes bigger with code that will only be used once. - -kconf_update addresses these problems by offering a framework to update -configuration files without adding code to the application itself. - -See the README file for more information. - -@authors -Waldo Bastian \<bastian@kde.org\> - -@maintainers -[Unknown/None] - -@licenses -@lgpl - -*/ -// vim:ts=4:sw=4:expandtab:filetype=doxygen diff --git a/kconf_update/Makefile.am b/kconf_update/Makefile.am deleted file mode 100644 index afe3864d..00000000 --- a/kconf_update/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ -# This file is part of the KDE libraries -# Copyright (C) 2001 Waldo Bastian <bastian@kde.org> - -# 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 Street, Fifth Floor, -# Boston, MA 02110-1301, USA. - -INCLUDES= -I../kded $(all_includes) - -bin_PROGRAMS = -lib_LTLIBRARIES = -tdeinit_LTLIBRARIES = kconf_update.la - -kconf_update_la_SOURCES = kconf_update.cpp -kconf_update_la_LIBADD = $(LIB_TDECORE) $(LIB_QT) -kconf_update_la_LDFLAGS = $(all_libraries) -module -avoid-version - -METASOURCES = AUTO - -# Internal -# noinst_HEADERS = kconf_update.h - diff --git a/kconf_update/README.kconf_update b/kconf_update/README.kconf_update deleted file mode 100644 index c8229c73..00000000 --- a/kconf_update/README.kconf_update +++ /dev/null @@ -1,251 +0,0 @@ -README kconf_update - -Version: 1.1 -Author: Waldo Bastian <bastian@kde.org>, <bastian@suse.com> - -What it does -============ - -kconf_update is a tool designed to update config files. Over time applications -sometimes need to rearrange the way configuration options are stored. Since -such an update shouldn't influence the configuration options that the user -has selected, the application must take care that the options stored in the -old way will still be honored. - -What used to happen is that the application looks up both the old and the -new configuration option and then decides which one to use. This method has -several drawbacks: -* The application may need to read more configuration files than strictly -needed, resulting in a slower startup. -* The application becomes bigger with code that will only be used once. - -kconf_update addresses these problems by offering a framework to update -configuration files without adding code to the application itself. - - -How it works -============ - -Applications can install so called "update files" under -$TDEDIR/share/apps/kconf_update. An update file has ".upd" as extension and -contains instructions for transferring/converting configuration information -from one place to another. - -Updating the configuration happens automatically, either when KDE gets started -or when kded detects a new update file in the above mentioned location. - -Update files are separated into sections. Each section has an Id. When a -section describing a configuration change has been applied, the Id will be -stored in the file "kconf_updaterc". This information is used to make sure -that a configuration update is only performed once. - -If you overwrite an existing update file with a new version that contains a -new section, only the update instructions from this extra section will be -performed. - -File format of the update file -============================== - -Empty lines or lines that start with '#' are considered comments. -Commas (,) are used to seperate fields and may not occur as part -of any field and all of the keywords are case-sensitive, i.e. you -cannot say "key" instead of "Key" for example. - -For the rest the file is parsed and executed sequentially from top to bottom. -Each line can contain one entry. The following entries are recognized: - - -Id=<id> - -With <id> identifying the group of update entries that follows. Once a group -of entries have been applied, their <id> is stored and this group of entries -will not be applied again. - - -File=<oldfile>,<newfile> -File=<oldfile> - -Specifies that configuration information is read from <oldfile> and written -to <newfile>. If you only specify <oldfile>, the information is read from -as well as written to <oldfile>. - -Script=<script>[,<interpreter>] - -All entries from <oldfile> are piped into <script>. The output of script -is used as new entries for <newfile>. Existing entries can be deleted by -adding lines with "# DELETE [group]key" in the output of the script. -To delete a whole group use "# DELETEGROUP [group]". - -<script> should be installed into $(kde_datadir)/kconf_update, or -kconf_update will not be able to find it. It is not portable to install -binary applications in $kde_datadir, so you have to stick with interpreted -scripts like sh or perl scripts. From KDE 3.2 onwards it's also possible -to install kconf_update applications in $(kde_bindir)/kconf_update_bin, -which opens the door to kconf_update applications that are written in C++ -and use Qt's powerful string API instead. - -A workaround for KDE 3.1.x and older is to install a .sh script in -$(kde_datadir) that contains a simple exec: - - exec "`tde-config --prefix`/bin/kconf_update_bin/my_update_app" - -This is equivalent to what KDE 3.2 can do directly, but of course the .upd -file now points to the .sh script instead of the binary application. - -If Script was issued after a "Group" command the behavior is slightly -different: -All entries from <oldfile>/<oldgroup> are piped into <script>. The output -of script is used as new entries for <newfile>/<newgroup>, unless a different -group is specified with "[group]". Existing entries can be deleted from -<oldgroup> by adding lines with "# DELETE key" in the output of the script. -To delete <oldgroup> use "# DELETEGROUP". - -<interpreter> can be something like "perl". - -Since KDE 3.3 it is also possible to have a Script without specifying -<oldfile> or <newfile>. In that case the script is run but it will not be -fed any input and its output will simply be discarded. - -ScriptArguments=<arguments> - -If specified, the arguments will be passed to <script>. -IMPORTANT: It has to be specified before Script=. - -Group=<oldgroup>,<newgroup> -Group=<oldgroup> - -Specifies that configuration information is read from the group <oldgroup> -and written to <newgroup>. If you only specify <oldgroup>, the information -is read from as well as written to <oldgroup>. You can use <default> to -specify keys that are not under any group. - -RemoveGroup=<oldgroup> - -Specifies that <oldgroup> is removed entirely. This can be used -to remove obsolete entries or to force a revert to default values. - -Options=<option1>, <option2>, .... - -With this entry you can specify options that apply to the next "Script", -"Key" or "AllKeys" entry (only to the first!). Possible options are: - -- "copy" Copy the configuration item instead of moving it. This means that - the configuration item will not be deleted from <oldfile>/<oldgroup>. - -- "overwrite" Normally, a configuration item is not moved if an item with the - new name already exists. When this option is specified the old - configuration item will overwrite any existing item. - - -Key=<oldkey>,<newkey> -Key=<oldkey> - -Specifies that configuration information is read from the key <oldkey> -and written to <newkey>. If you only specify <oldkey>, the information -is read from as well as written to <oldkey>. - - -AllKeys - -Specifies that all configuration information in the selected group should -be moved (All keys). - -AllGroups - -Specifies that all configuration information from all keys in ALL -groups should be moved. - - -RemoveKey=<oldkey> - -Specifies that <oldkey> is removed from the selected group. This can be used -to remove obsolete entries or to force a revert to default values. - - -Example update file -=================== - -# This is comment -Id=kde2.2 -File=kioslaverc,kio_httprc -Group=Proxy Settings -Key=NoProxyFor -Key=UseProxy -Key=httpProxy,Proxy -Group=Cache Settings,Cache -Key=MaxCacheSize -Key=UseCache -Group=UserAgent -AllKeys -RemoveGroup=KDE -# End of file - - -The above update file extracts config information from the file "kioslaverc" -and stores it into the file "kio_httprc". - -It reads the keys "NoProxyFor", "UseProxy" and "httpProxy" from the group -"Proxy Settings" in the "kioslaverc" file. If any of these options are present -they are written to the keys "NoProxyFor", "UseProxy" and "Proxy" (!) in -the group "Proxy Settings" in the "kio_httprc" file. - -It also reads the keys "MaxCacheSize" and "UseCache" from the group -"Cache Settings" in the "kioslaverc" file and writes this information to the -keys "MaxCacheSize" and "UseCache" in the group "Cache" (!) in the -"kio_httprc" file. - -Then it takes all keys in the "UserAgent" group of the file "kioslaverc" -and moves then to the "UserAgent" group in the "kio_httprc" file. - -Finally it removes the entire "KDE" group in the kioslaverc file. - - -Debugging and testing -===================== - -If you are developing a kconf_update script and want to test or debug it you -need to make sure kconf_update runs again after each of your changes. There -are a number of ways to achieve this. - -The easiest is to not install the kconf_update script in the first place, but -manually call it through a pipe. If you want to test the update script for -your application KHello's config file khellorc, you can test by using - - cat ~/.trinity/share/config/khellorc | khello_conf_update.sh - -(assuming khello_conf_update.sh is the kconf_update script and ~/.trinity is your -$TDEHOME). This is easier than making install every time, but has the obvious -downside that you need to 'parse' your script's output yourself instead of -letting kconf_update do it and check the resulting output file. - -After 'make install' the kconf_update script is run by kded, but it does so -only once. This is of course the idea behind it, but while developing it can -be a problem. You can increase the revision number for each subsequent run -of 'make install' to force a new kconf_update run, but there's a better -approach that doesn't skyrocket the version number for a mediocre debug -session. - -kded doesn't really ignore scripts that it has already run right away. -Instead it checks the affected config file every time a .upd file is added -or changed. The reason it still doesn't run again on your config file lies -in the traces kconf_update leaves behind: it adds a special config group -'[$Version]' with a key 'update_info'. This key lists all kconf_update -scripts that have already been run on this config file. Just remove your -file's entry, 'make install', and kconf_update will happily run your script -again, without you having to increase the version number. - -If you want to know what kconf_update has been up to lately, have a look -at $TDEHOME/share/apps/kconf_update/update.log - - -Common Problems -=============== - -* kconf_update refuses to update an entry -If you change the value of an entry without changing the key or file, -make sure to tell kconf_update that it should overwrite the old entry -by adding "Options=overwrite". - - -Have fun, -Waldo diff --git a/kconf_update/kconf_update.cpp b/kconf_update/kconf_update.cpp deleted file mode 100644 index daf66ca9..00000000 --- a/kconf_update/kconf_update.cpp +++ /dev/null @@ -1,959 +0,0 @@ -/* - * - * This file is part of the KDE libraries - * Copyright (c) 2001 Waldo Bastian <bastian@kde.org> - * - * $Id$ - * - * 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. - **/ - -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <stdlib.h> - -#include <tqfile.h> -#include <tqtextstream.h> - -#include <kconfig.h> -#include <ksimpleconfig.h> -#include <klocale.h> -#include <kcmdlineargs.h> -#include <kglobal.h> -#include <kstandarddirs.h> -#include <kaboutdata.h> -#include <kinstance.h> -#include <ktempfile.h> - -static KCmdLineOptions options[] = -{ - { "debug", I18N_NOOP("Keep output results from scripts"), 0 }, - { "check <update-file>", I18N_NOOP("Check whether config file itself requires updating"), 0 }, - { "+[file]", I18N_NOOP("File to read update instructions from"), 0 }, - KCmdLineLastOption -}; - -class KonfUpdate -{ -public: - KonfUpdate(); - ~KonfUpdate(); - TQStringList findUpdateFiles(bool dirtyOnly); - - TQTextStream &log(); - - bool checkFile(const TQString &filename); - void checkGotFile(const TQString &_file, const TQString &id); - - bool updateFile(const TQString &filename); - - void gotId(const TQString &_id); - void gotFile(const TQString &_file); - void gotGroup(const TQString &_group); - void gotRemoveGroup(const TQString &_group); - void gotKey(const TQString &_key); - void gotRemoveKey(const TQString &_key); - void gotAllKeys(); - void gotAllGroups(); - void gotOptions(const TQString &_options); - void gotScript(const TQString &_script); - void gotScriptArguments(const TQString &_arguments); - void resetOptions(); - - void copyGroup(TDEConfigBase *cfg1, const TQString &grp1, - TDEConfigBase *cfg2, const TQString &grp2); - -protected: - TDEConfig *config; - TQString currentFilename; - bool skip; - bool debug; - TQString id; - - TQString oldFile; - TQString newFile; - TQString newFileName; - TDEConfig *oldConfig1; // Config to read keys from. - TDEConfig *oldConfig2; // Config to delete keys from. - TDEConfig *newConfig; - - TQString oldGroup; - TQString newGroup; - TQString oldKey; - TQString newKey; - - bool m_bCopy; - bool m_bOverwrite; - bool m_bUseConfigInfo; - TQString m_arguments; - TQTextStream *m_textStream; - TQFile *m_file; - TQString m_line; - int m_lineCount; -}; - -KonfUpdate::KonfUpdate() - : m_textStream(0), m_file(0) -{ - bool updateAll = false; - oldConfig1 = 0; - oldConfig2 = 0; - newConfig = 0; - - config = new TDEConfig("kconf_updaterc"); - - TQStringList updateFiles; - TDECmdLineArgs *args=TDECmdLineArgs::parsedArgs(); - - debug = args->isSet("debug"); - - m_bUseConfigInfo = false; - if (args->isSet("check")) - { - m_bUseConfigInfo = true; - TQString file = locate("data", "kconf_update/"+TQFile::decodeName(args->getOption("check"))); - if (file.isEmpty()) - { - tqWarning("File '%s' not found.", args->getOption("check").data()); - log() << "File '" << TQFile::decodeName(args->getOption("check")) << "' passed on command line not found" << endl; - return; - } - updateFiles.append(file); - } - else if (args->count()) - { - for(int i = 0; i < args->count(); i++) - { - KURL url = args->url(i); - if (!url.isLocalFile()) - TDECmdLineArgs::usage(i18n("Only local files are supported.")); - updateFiles.append(url.path()); - } - } - else - { - if (config->readBoolEntry("autoUpdateDisabled", false)) - return; - updateFiles = findUpdateFiles(true); - updateAll = true; - } - - for(TQStringList::ConstIterator it = updateFiles.begin(); - it != updateFiles.end(); - ++it) - { - TQString file = *it; - updateFile(file); - } - - config->setGroup(TQString::null); - if (updateAll && !config->readBoolEntry("updateInfoAdded", false)) - { - config->writeEntry("updateInfoAdded", true); - updateFiles = findUpdateFiles(false); - - for(TQStringList::ConstIterator it = updateFiles.begin(); - it != updateFiles.end(); - ++it) - { - TQString file = *it; - checkFile(file); - } - updateFiles.clear(); - } -} - -KonfUpdate::~KonfUpdate() -{ - delete config; - delete m_file; - delete m_textStream; -} - -TQTextStream & -KonfUpdate::log() -{ - if (!m_textStream) - { - TQString file = locateLocal("data", "kconf_update/log/update.log"); - m_file = new TQFile(file); - if (m_file->open(IO_WriteOnly | IO_Append)) - { - m_textStream = new TQTextStream(m_file); - } - else - { - // Error - m_textStream = new TQTextStream(stderr, IO_WriteOnly); - } - } - - (*m_textStream) << TQDateTime::currentDateTime().toString( Qt::ISODate ) << " "; - - return *m_textStream; -} - -TQStringList KonfUpdate::findUpdateFiles(bool dirtyOnly) -{ - TQStringList result; - TQStringList list = TDEGlobal::dirs()->findAllResources("data", "kconf_update/*.upd", false, true); - for(TQStringList::ConstIterator it = list.begin(); - it != list.end(); - ++it) - { - TQString file = *it; - struct stat buff; - if (stat( TQFile::encodeName(file), &buff) == 0) - { - int i = file.findRev('/'); - if (i != -1) - file = file.mid(i+1); - config->setGroup(file); - time_t ctime = config->readUnsignedLongNumEntry("ctime"); - time_t mtime = config->readUnsignedLongNumEntry("mtime"); - if (!dirtyOnly || - (ctime != buff.st_ctime) || (mtime != buff.st_mtime)) - { - result.append(*it); - } - } - } - return result; -} - -bool KonfUpdate::checkFile(const TQString &filename) -{ - currentFilename = filename; - int i = currentFilename.findRev('/'); - if (i != -1) - currentFilename = currentFilename.mid(i+1); - skip = true; - TQFile file(filename); - if (!file.open(IO_ReadOnly)) - return false; - - TQTextStream ts(&file); - ts.setEncoding(TQTextStream::Latin1); - int lineCount = 0; - resetOptions(); - TQString id; - while(!ts.atEnd()) - { - TQString line = ts.readLine().stripWhiteSpace(); - lineCount++; - if (line.isEmpty() || (line[0] == '#')) - continue; - if (line.startsWith("Id=")) - id = currentFilename+":"+line.mid(3); - else if (line.startsWith("File=")) - checkGotFile(line.mid(5), id); - } - - return true; -} - -void KonfUpdate::checkGotFile(const TQString &_file, const TQString &id) -{ - TQString file; - int i = _file.find(','); - if (i == -1) - { - file = _file.stripWhiteSpace(); - } - else - { - file = _file.mid(i+1).stripWhiteSpace(); - } - -// tqDebug("File %s, id %s", file.latin1(), id.latin1()); - - KSimpleConfig cfg(file); - cfg.setGroup("$Version"); - TQStringList ids = cfg.readListEntry("update_info"); - if (ids.contains(id)) - return; - ids.append(id); - cfg.writeEntry("update_info", ids); -} - -/** - * Syntax: - * # Comment - * Id=id - * File=oldfile[,newfile] - * AllGroups - * Group=oldgroup[,newgroup] - * RemoveGroup=oldgroup - * Options=[copy,][overwrite,] - * Key=oldkey[,newkey] - * RemoveKey=ldkey - * AllKeys - * Keys= [Options](AllKeys|(Key|RemoveKey)*) - * ScriptArguments=arguments - * Script=scriptfile[,interpreter] - * - * Sequence: - * (Id,(File(Group,Keys)*)*)* - **/ -bool KonfUpdate::updateFile(const TQString &filename) -{ - currentFilename = filename; - int i = currentFilename.findRev('/'); - if (i != -1) - currentFilename = currentFilename.mid(i+1); - skip = true; - TQFile file(filename); - if (!file.open(IO_ReadOnly)) - return false; - - log() << "Checking update-file '" << filename << "' for new updates" << endl; - - TQTextStream ts(&file); - ts.setEncoding(TQTextStream::Latin1); - m_lineCount = 0; - resetOptions(); - while(!ts.atEnd()) - { - m_line = ts.readLine().stripWhiteSpace(); - m_lineCount++; - if (m_line.isEmpty() || (m_line[0] == '#')) - continue; - if (m_line.startsWith("Id=")) - gotId(m_line.mid(3)); - else if (skip) - continue; - else if (m_line.startsWith("Options=")) - gotOptions(m_line.mid(8)); - else if (m_line.startsWith("File=")) - gotFile(m_line.mid(5)); - else if (m_line.startsWith("Group=")) - gotGroup(m_line.mid(6)); - else if (m_line.startsWith("RemoveGroup=")) - { - gotRemoveGroup(m_line.mid(12)); - resetOptions(); - } - else if (m_line.startsWith("Script=")) - { - gotScript(m_line.mid(7)); - resetOptions(); - } - else if (m_line.startsWith("ScriptArguments=")) - gotScriptArguments(m_line.mid(16)); - else if (m_line.startsWith("Key=")) - { - gotKey(m_line.mid(4)); - resetOptions(); - } - else if (m_line.startsWith("RemoveKey=")) - { - gotRemoveKey(m_line.mid(10)); - resetOptions(); - } - else if (m_line == "AllKeys") - { - gotAllKeys(); - resetOptions(); - } - else if (m_line == "AllGroups") - { - gotAllGroups(); - resetOptions(); - } - else - { - log() << currentFilename << ": parse error in line " << m_lineCount << " : '" << m_line << "'" << endl; - } - } - // Flush. - gotId(TQString::null); - - struct stat buff; - stat( TQFile::encodeName(filename), &buff); - config->setGroup(currentFilename); - config->writeEntry("ctime", buff.st_ctime); - config->writeEntry("mtime", buff.st_mtime); - config->sync(); - return true; -} - - - -void KonfUpdate::gotId(const TQString &_id) -{ - if (!id.isEmpty() && !skip) - { - config->setGroup(currentFilename); - TQStringList ids = config->readListEntry("done"); - if (!ids.contains(id)) - { - ids.append(id); - config->writeEntry("done", ids); - config->sync(); - } - } - - // Flush pending changes - gotFile(TQString::null); - - config->setGroup(currentFilename); - TQStringList ids = config->readListEntry("done"); - if (!_id.isEmpty()) - { - if (ids.contains(_id)) - { - //tqDebug("Id '%s' was already in done-list", _id.latin1()); - if (!m_bUseConfigInfo) - { - skip = true; - return; - } - } - skip = false; - id = _id; - if (m_bUseConfigInfo) - log() << currentFilename << ": Checking update '" << _id << "'" << endl; - else - log() << currentFilename << ": Found new update '" << _id << "'" << endl; - } -} - -void KonfUpdate::gotFile(const TQString &_file) -{ - // Reset group - gotGroup(TQString::null); - - if (!oldFile.isEmpty()) - { - // Close old file. - delete oldConfig1; - oldConfig1 = 0; - - oldConfig2->setGroup("$Version"); - TQStringList ids = oldConfig2->readListEntry("update_info"); - TQString cfg_id = currentFilename + ":" + id; - if (!ids.contains(cfg_id) && !skip) - { - ids.append(cfg_id); - oldConfig2->writeEntry("update_info", ids); - } - oldConfig2->sync(); - delete oldConfig2; - oldConfig2 = 0; - - TQString file = locateLocal("config", oldFile); - struct stat s_buf; - if (stat(TQFile::encodeName(file), &s_buf) == 0) - { - if (s_buf.st_size == 0) - { - // Delete empty file. - unlink(TQFile::encodeName(file)); - } - } - - oldFile = TQString::null; - } - if (!newFile.isEmpty()) - { - // Close new file. - newConfig->setGroup("$Version"); - TQStringList ids = newConfig->readListEntry("update_info"); - TQString cfg_id = currentFilename + ":" + id; - if (!ids.contains(cfg_id) && !skip) - { - ids.append(cfg_id); - newConfig->writeEntry("update_info", ids); - } - newConfig->sync(); - delete newConfig; - newConfig = 0; - - newFile = TQString::null; - } - newConfig = 0; - - int i = _file.find(','); - if (i == -1) - { - oldFile = _file.stripWhiteSpace(); - } - else - { - oldFile = _file.left(i).stripWhiteSpace(); - newFile = _file.mid(i+1).stripWhiteSpace(); - if (oldFile == newFile) - newFile = TQString::null; - } - - if (!oldFile.isEmpty()) - { - oldConfig2 = new TDEConfig(oldFile, false, false); - TQString cfg_id = currentFilename + ":" + id; - oldConfig2->setGroup("$Version"); - TQStringList ids = oldConfig2->readListEntry("update_info"); - if (ids.contains(cfg_id)) - { - skip = true; - newFile = TQString::null; - log() << currentFilename << ": Skipping update '" << id << "'" << endl; - } - - if (!newFile.isEmpty()) - { - newConfig = new TDEConfig(newFile, false, false); - newConfig->setGroup("$Version"); - ids = newConfig->readListEntry("update_info"); - if (ids.contains(cfg_id)) - { - skip = true; - log() << currentFilename << ": Skipping update '" << id << "'" << endl; - } - } - else - { - newConfig = oldConfig2; - } - - oldConfig1 = new TDEConfig(oldFile, true, false); - } - else - { - newFile = TQString::null; - } - newFileName = newFile; - if (newFileName.isEmpty()) - newFileName = oldFile; -} - -void KonfUpdate::gotGroup(const TQString &_group) -{ - int i = _group.find(','); - if (i == -1) - { - oldGroup = _group.stripWhiteSpace(); - newGroup = oldGroup; - } - else - { - oldGroup = _group.left(i).stripWhiteSpace(); - newGroup = _group.mid(i+1).stripWhiteSpace(); - } -} - -void KonfUpdate::gotRemoveGroup(const TQString &_group) -{ - oldGroup = _group.stripWhiteSpace(); - - if (!oldConfig1) - { - log() << currentFilename << ": !! RemoveGroup without previous File specification in line " << m_lineCount << " : '" << m_line << "'" << endl; - return; - } - - if (!oldConfig1->hasGroup(oldGroup)) - return; - // Delete group. - oldConfig2->deleteGroup(oldGroup, true); - log() << currentFilename << ": RemoveGroup removes group " << oldFile << ":" << oldGroup << endl; -} - - -void KonfUpdate::gotKey(const TQString &_key) -{ - int i = _key.find(','); - if (i == -1) - { - oldKey = _key.stripWhiteSpace(); - newKey = oldKey; - } - else - { - oldKey = _key.left(i).stripWhiteSpace(); - newKey = _key.mid(i+1).stripWhiteSpace(); - } - - if (oldKey.isEmpty() || newKey.isEmpty()) - { - log() << currentFilename << ": !! Key specifies invalid key in line " << m_lineCount << " : '" << m_line << "'" << endl; - return; - } - if (!oldConfig1) - { - log() << currentFilename << ": !! Key without previous File specification in line " << m_lineCount << " : '" << m_line << "'" << endl; - return; - } - oldConfig1->setGroup(oldGroup); - if (!oldConfig1->hasKey(oldKey)) - return; - TQString value = oldConfig1->readEntry(oldKey); - newConfig->setGroup(newGroup); - if (!m_bOverwrite && newConfig->hasKey(newKey)) - { - log() << currentFilename << ": Skipping " << newFileName << ":" << newGroup << ":" << newKey << ", already exists."<< endl; - return; - } - log() << currentFilename << ": Updating " << newFileName << ":" << newGroup << ":" << newKey << " to '" << value << "'" << endl; - newConfig->writeEntry(newKey, value); - - if (m_bCopy) - return; // Done. - - // Delete old entry - if ((oldConfig2 == newConfig) && - (oldGroup == newGroup) && - (oldKey == newKey)) - return; // Don't delete! - oldConfig2->setGroup(oldGroup); - oldConfig2->deleteEntry(oldKey, false); - log() << currentFilename << ": Removing " << oldFile << ":" << oldGroup << ":" << oldKey << ", moved." << endl; - if (oldConfig2->deleteGroup(oldGroup, false)) { // Delete group if empty. - log() << currentFilename << ": Removing empty group " << oldFile << ":" << oldGroup << endl; - } -} - -void KonfUpdate::gotRemoveKey(const TQString &_key) -{ - oldKey = _key.stripWhiteSpace(); - - if (oldKey.isEmpty()) - { - log() << currentFilename << ": !! RemoveKey specifies invalid key in line " << m_lineCount << " : '" << m_line << "'" << endl; - return; - } - - if (!oldConfig1) - { - log() << currentFilename << ": !! Key without previous File specification in line " << m_lineCount << " : '" << m_line << "'" << endl; - return; - } - - oldConfig1->setGroup(oldGroup); - if (!oldConfig1->hasKey(oldKey)) - return; - log() << currentFilename << ": RemoveKey removes " << oldFile << ":" << oldGroup << ":" << oldKey << endl; - - // Delete old entry - oldConfig2->setGroup(oldGroup); - oldConfig2->deleteEntry(oldKey, false); - if (oldConfig2->deleteGroup(oldGroup, false)) { // Delete group if empty. - log() << currentFilename << ": Removing empty group " << oldFile << ":" << oldGroup << endl; - } -} - -void KonfUpdate::gotAllKeys() -{ - if (!oldConfig1) - { - log() << currentFilename << ": !! AllKeys without previous File specification in line " << m_lineCount << " : '" << m_line << "'" << endl; - return; - } - - TQMap<TQString, TQString> list = oldConfig1->entryMap(oldGroup); - for(TQMap<TQString, TQString>::Iterator it = list.begin(); - it != list.end(); ++it) - { - gotKey(it.key()); - } -} - -void KonfUpdate::gotAllGroups() -{ - if (!oldConfig1) - { - log() << currentFilename << ": !! AllGroups without previous File specification in line " << m_lineCount << " : '" << m_line << "'" << endl; - return; - } - - TQStringList allGroups = oldConfig1->groupList(); - for(TQStringList::ConstIterator it = allGroups.begin(); - it != allGroups.end(); ++it) - { - oldGroup = *it; - newGroup = oldGroup; - gotAllKeys(); - } -} - -void KonfUpdate::gotOptions(const TQString &_options) -{ - TQStringList options = TQStringList::split(',', _options); - for(TQStringList::ConstIterator it = options.begin(); - it != options.end(); - ++it) - { - if ( (*it).lower().stripWhiteSpace() == "copy") - m_bCopy = true; - - if ( (*it).lower().stripWhiteSpace() == "overwrite") - m_bOverwrite = true; - } -} - -void KonfUpdate::copyGroup(TDEConfigBase *cfg1, const TQString &grp1, - TDEConfigBase *cfg2, const TQString &grp2) -{ - cfg1->setGroup(grp1); - cfg2->setGroup(grp2); - TQMap<TQString, TQString> list = cfg1->entryMap(grp1); - for(TQMap<TQString, TQString>::Iterator it = list.begin(); - it != list.end(); ++it) - { - cfg2->writeEntry(it.key(), cfg1->readEntry(it.key())); - } -} - -void KonfUpdate::gotScriptArguments(const TQString &_arguments) -{ - m_arguments = _arguments; -} - -void KonfUpdate::gotScript(const TQString &_script) -{ - TQString script, interpreter; - int i = _script.find(','); - if (i == -1) - { - script = _script.stripWhiteSpace(); - } - else - { - script = _script.left(i).stripWhiteSpace(); - interpreter = _script.mid(i+1).stripWhiteSpace(); - } - - - if (script.isEmpty()) - { - log() << currentFilename << ": !! Script fails to specifiy filename in line " << m_lineCount << " : '" << m_line << "'" << endl; - skip = true; - return; - } - - - - TQString path = locate("data","kconf_update/"+script); - if (path.isEmpty()) - { - if (interpreter.isEmpty()) - path = locate("lib", "kconf_update_bin/"+script); - - if (path.isEmpty()) - { - log() << currentFilename << ": !! Script '" << script << "' not found in line " << m_lineCount << " : '" << m_line << "'" << endl; - skip = true; - return; - } - } - - if( !m_arguments.isNull()) - log() << currentFilename << ": Running script '" << script << "' with arguments '" << m_arguments << "'" << endl; - else - log() << currentFilename << ": Running script '" << script << "'" << endl; - - TQString cmd; - if (interpreter.isEmpty()) - cmd = path; - else - cmd = interpreter + " " + path; - - if( !m_arguments.isNull()) - { - cmd += ' '; - cmd += m_arguments; - } - - KTempFile tmp1; - tmp1.setAutoDelete(true); - KTempFile tmp2; - tmp2.setAutoDelete(true); - KTempFile tmp3; - tmp3.setAutoDelete(true); - - int result; - if (oldConfig1) - { - if (debug) - { - tmp1.setAutoDelete(false); - log() << "Script input stored in " << tmp1.name() << endl; - } - KSimpleConfig cfg(tmp1.name()); - - if (oldGroup.isEmpty()) - { - // Write all entries to tmpFile; - TQStringList grpList = oldConfig1->groupList(); - for(TQStringList::ConstIterator it = grpList.begin(); - it != grpList.end(); - ++it) - { - copyGroup(oldConfig1, *it, &cfg, *it); - } - } - else - { - copyGroup(oldConfig1, oldGroup, &cfg, TQString::null); - } - cfg.sync(); - result = system(TQFile::encodeName(TQString("%1 < %2 > %3 2> %4").arg(cmd, tmp1.name(), tmp2.name(), tmp3.name()))); - } - else - { - // No config file - result = system(TQFile::encodeName(TQString("%1 2> %2").arg(cmd, tmp3.name()))); - } - - // Copy script stderr to log file - { - TQFile output(tmp3.name()); - if (output.open(IO_ReadOnly)) - { - TQTextStream ts( &output ); - ts.setEncoding(TQTextStream::UnicodeUTF8); - while(!ts.atEnd()) - { - TQString line = ts.readLine(); - log() << "[Script] " << line << endl; - } - } - } - - if (result) - { - log() << currentFilename << ": !! An error occured while running '" << cmd << "'" << endl; - return; - } - - if (!oldConfig1) - return; // Nothing to merge - - if (debug) - { - tmp2.setAutoDelete(false); - log() << "Script output stored in " << tmp2.name() << endl; - } - - // Deleting old entries - { - TQString group = oldGroup; - TQFile output(tmp2.name()); - if (output.open(IO_ReadOnly)) - { - TQTextStream ts( &output ); - ts.setEncoding(TQTextStream::UnicodeUTF8); - while(!ts.atEnd()) - { - TQString line = ts.readLine(); - if (line.startsWith("[")) - { - int j = line.find(']')+1; - if (j > 0) - group = line.mid(1, j-2); - } - else if (line.startsWith("# DELETE ")) - { - TQString key = line.mid(9); - if (key[0] == '[') - { - int j = key.find(']')+1; - if (j > 0) - { - group = key.mid(1,j-2); - key = key.mid(j); - } - } - oldConfig2->setGroup(group); - oldConfig2->deleteEntry(key, false); - log() << currentFilename << ": Script removes " << oldFile << ":" << group << ":" << key << endl; - if (oldConfig2->deleteGroup(group, false)) { // Delete group if empty. - log() << currentFilename << ": Removing empty group " << oldFile << ":" << group << endl; - } - } - else if (line.startsWith("# DELETEGROUP")) - { - TQString key = line.mid(13).stripWhiteSpace(); - if (key[0] == '[') - { - int j = key.find(']')+1; - if (j > 0) - { - group = key.mid(1,j-2); - } - } - if (oldConfig2->deleteGroup(group, true)) { // Delete group - log() << currentFilename << ": Script removes group " << oldFile << ":" << group << endl; - } - } - } - } - } - - // Merging in new entries. - m_bCopy = true; - { - TDEConfig *saveOldConfig1 = oldConfig1; - TQString saveOldGroup = oldGroup; - TQString saveNewGroup = newGroup; - oldConfig1 = new TDEConfig(tmp2.name(), true, false); - - // For all groups... - TQStringList grpList = oldConfig1->groupList(); - for(TQStringList::ConstIterator it = grpList.begin(); - it != grpList.end(); - ++it) - { - oldGroup = *it; - if (oldGroup != "<default>") - { - newGroup = oldGroup; - } - gotAllKeys(); // Copy all keys - } - delete oldConfig1; - oldConfig1 = saveOldConfig1; - oldGroup = saveOldGroup; - newGroup = saveNewGroup; - } -} - -void KonfUpdate::resetOptions() -{ - m_bCopy = false; - m_bOverwrite = false; - m_arguments = TQString::null; -} - - -extern "C" KDE_EXPORT int kdemain(int argc, char **argv) -{ - TDEAboutData aboutData("kconf_update", I18N_NOOP("KConf Update"), - "1.0.2", - I18N_NOOP("TDE Tool for updating user configuration files"), - TDEAboutData::License_GPL, - "(c) 2001, Waldo Bastian"); - - aboutData.addAuthor("Waldo Bastian", 0, "bastian@kde.org"); - - TDECmdLineArgs::init(argc, argv, &aboutData); - TDECmdLineArgs::addCmdLineOptions(options); - - TDEInstance instance(&aboutData); - - KonfUpdate konfUpdate; - - return 0; -} diff --git a/kded/CMakeLists.txt b/kded/CMakeLists.txt index 903126ca..ee693fb4 100644 --- a/kded/CMakeLists.txt +++ b/kded/CMakeLists.txt @@ -18,8 +18,8 @@ include_directories( ${CMAKE_SOURCE_DIR}/dcop ${CMAKE_SOURCE_DIR}/tdecore ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio ) link_directories( @@ -51,16 +51,16 @@ set( ${target}_SRCS # modules need this library tde_add_tdeinit_executable( ${target} AUTOMOC EXPORT SOURCES ${${target}_SRCS} - LINK kio-shared + LINK tdeio-shared ) -#### kbuildsycoca ############################### +#### tdebuildsycoca ############################### -set( target kbuildsycoca ) +set( target tdebuildsycoca ) set( ${target}_SRCS - kbuildsycoca.cpp kbuildservicetypefactory.cpp + tdebuildsycoca.cpp kbuildservicetypefactory.cpp kbuildservicefactory.cpp kbuildservicegroupfactory.cpp kbuildimageiofactory.cpp kbuildprotocolinfofactory.cpp kctimefactory.cpp vfolder_menu.cpp @@ -68,7 +68,7 @@ set( ${target}_SRCS tde_add_tdeinit_executable( ${target} AUTOMOC SOURCES ${${target}_SRCS} - LINK kio-shared + LINK tdeio-shared ) @@ -87,31 +87,31 @@ tde_add_executable( ${target} ) -#### kde-menu ################################### +#### tde-menu ################################### -set( target kde-menu ) +set( target tde-menu ) set( ${target}_SRCS - kde-menu.cpp + tde-menu.cpp ) tde_add_executable( ${target} SOURCES ${${target}_SRCS} - LINK kio-shared + LINK tdeio-shared DESTINATION ${BIN_INSTALL_DIR} ) -#### kmimelist ################################## +#### tdemimelist ################################## -set( target kmimelist ) +set( target tdemimelist ) set( ${target}_SRCS - kmimelist.cpp + tdemimelist.cpp ) tde_add_executable( ${target} SOURCES ${${target}_SRCS} - LINK kio-shared + LINK tdeio-shared DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/kded/DESIGN b/kded/DESIGN index e6653807..0fffb045 100644 --- a/kded/DESIGN +++ b/kded/DESIGN @@ -6,9 +6,9 @@ cache of servicetypes, mimetypes and services, for a particular user. It uses KDirWatch to monitor the directories contain the .desktop files. When a file is added/removed, it waits 5 seconds (in case of series of -updates), and then launches kbuildsycoca. +updates), and then launches tdebuildsycoca. -kbuildsycoca recreates the sycoca file by: +tdebuildsycoca recreates the sycoca file by: * parsing all .desktop files, replacing global ones by local ones (at any level of the hierarchy) * creating all objects in memory diff --git a/kded/Makefile.am b/kded/Makefile.am index 1baf30e4..093b5db0 100644 --- a/kded/Makefile.am +++ b/kded/Makefile.am @@ -20,15 +20,15 @@ INCLUDES= -I$(srcdir)/.. -I$(top_srcdir) $(all_includes) lib_LTLIBRARIES = -tdeinit_LTLIBRARIES = kded.la kbuildsycoca.la +tdeinit_LTLIBRARIES = kded.la tdebuildsycoca.la kded_la_LDFLAGS = $(all_libraries) -module -avoid-version kded_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_TDECORE) $(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) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_TDECORE) -kbuildsycoca_la_SOURCES = kbuildsycoca.cpp kbuildservicetypefactory.cpp \ +tdebuildsycoca_la_LDFLAGS = $(all_libraries) -module -avoid-version +tdebuildsycoca_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_TDECORE) +tdebuildsycoca_la_SOURCES = tdebuildsycoca.cpp kbuildservicetypefactory.cpp \ kbuildservicefactory.cpp \ kbuildservicegroupfactory.cpp \ kbuildimageiofactory.cpp \ @@ -36,25 +36,25 @@ kbuildsycoca_la_SOURCES = kbuildsycoca.cpp kbuildservicetypefactory.cpp \ kctimefactory.cpp \ vfolder_menu.cpp -bin_PROGRAMS = kdontchangethehostname kde-menu kmimelist +bin_PROGRAMS = kdontchangethehostname tde-menu tdemimelist kdontchangethehostname_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor kdontchangethehostname_LDADD = $(LIB_TDECORE) kdontchangethehostname_SOURCES = khostname.cpp -kmimelist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -kmimelist_LDADD = ../kio/libkio.la -kmimelist_SOURCES = kmimelist.cpp +tdemimelist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +tdemimelist_LDADD = ../tdeio/libtdeio.la +tdemimelist_SOURCES = tdemimelist.cpp kde_menu_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor kde_menu_LDADD = $(LIB_KIO) -kde_menu_SOURCES = kde-menu.cpp +kde_menu_SOURCES = tde-menu.cpp METASOURCES = AUTO include_HEADERS = kdedmodule.h -noinst_HEADERS = kbuildsycoca.h kbuildservicetypefactory.h \ +noinst_HEADERS = tdebuildsycoca.h kbuildservicetypefactory.h \ kbuildservicefactory.h kbuildservicegroupfactory.h \ kbuildimageiofactory.h kresourcelist.h \ kbuildprotocolinfofactory.h @@ -65,7 +65,7 @@ servicetypedir = $(kde_servicetypesdir) xdg_menu_DATA = applications.menu applications.menu-no-kde update_DATA = kded.upd -updatedir = $(kde_datadir)/kconf_update +updatedir = $(kde_datadir)/tdeconf_update include $(top_srcdir)/admin/Doxyfile.am diff --git a/kded/README.kded b/kded/README.kded index 1cf38227..7265a108 100644 --- a/kded/README.kded +++ b/kded/README.kded @@ -7,19 +7,19 @@ Some of these tasks are built in, others are started on demand. Built in tasks ============== *) Checking for newly installed software and updating tdesycoca when new -software is detected. Updating of tdesycoca is done by the program kbuildsycoca +software is detected. Updating of tdesycoca is done by the program tdebuildsycoca which gets started by kded. When kded is first started it always runs -kbuildsycoca to ensure that tdesycoca is up to date. +tdebuildsycoca to ensure that tdesycoca is up to date. *) Checking for newly installed update files. Applications can install *.upd update files. These *.upd files are used to update configuration files of users, primarily when new versions of applications are installed with (slightly) different configuration file formats. Updating of configuration -files is done by kconf_update. kded starts kconf_update when it detects a -new update file. When kded is first started it always runs kconf_update to -ensure that it has not missed any update files. kconf_update keeps track +files is done by tdeconf_update. kded starts tdeconf_update when it detects a +new update file. When kded is first started it always runs tdeconf_update to +ensure that it has not missed any update files. tdeconf_update keeps track of which update files have been processed already in the config-file -kconf_updaterc. It only performs a certain update once. +tdeconf_updaterc. It only performs a certain update once. *) Checking for hostname changes. It is a really bad idea to change the hostname of a running system and it usually only happens with incorrectly @@ -42,12 +42,12 @@ and has a default of 5000 (5 seconds). CheckSycoca: This option can be used to disable checking for new software. tdesycoca will still be built when kded starts up and when applications explicitly request a rebuild of the tdesycoca database. The user can -also manually rebuild tdesycoca by running the kbuildsycoca program. +also manually rebuild tdesycoca by running the tdebuildsycoca program. The default value of this option is "true". Checking can be disabled by setting this option to "false". CheckUpdates: This option can be used to disable checking for update files. -kconf_update will still be run when kded starts up. +tdeconf_update will still be run when kded starts up. The default value of this option is "true". Checking can be disabled by setting this option to "false". diff --git a/kded/kbuildsycoca.cpp b/kded/kbuildsycoca.cpp deleted file mode 100644 index 13a64539..00000000 --- a/kded/kbuildsycoca.cpp +++ /dev/null @@ -1,959 +0,0 @@ -/* This file is part of the KDE libraries - * Copyright (C) 1999 David Faure <faure@kde.org> - * Copyright (C) 2002-2003 Waldo Bastian <bastian@kde.org> - * - * 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. - **/ - -#include <tqdir.h> -#include <tqeventloop.h> -#include <config.h> - -#include "kbuildsycoca.h" -#include "kresourcelist.h" -#include "vfolder_menu.h" - -#include <kservice.h> -#include <kmimetype.h> -#include <kbuildservicetypefactory.h> -#include <kbuildservicefactory.h> -#include <kbuildservicegroupfactory.h> -#include <kbuildimageiofactory.h> -#include <kbuildprotocolinfofactory.h> -#include <kctimefactory.h> -#include <kdatastream.h> - -#include <tqdatastream.h> -#include <tqfile.h> -#include <tqtimer.h> - -#include <assert.h> -#include <kapplication.h> -#include <dcopclient.h> -#include <kglobal.h> -#include <kdebug.h> -#include <kdirwatch.h> -#include <kstandarddirs.h> -#include <ksavefile.h> -#include <klocale.h> -#include <kaboutdata.h> -#include <kcmdlineargs.h> -#include <kcrash.h> - -#ifdef KBUILDSYCOCA_GUI // KBUILDSYCOCA_GUI is used on win32 to build - // GUI version of kbuildsycoca, so-called "kbuildsycocaw". -# include <tqlabel.h> -# include <kmessagebox.h> - bool silent; - bool showprogress; -#endif - -#include <stdlib.h> -#include <unistd.h> -#include <time.h> -#include <memory> // auto_ptr - -typedef TQDict<KSycocaEntry> KBSEntryDict; -typedef TQValueList<KSycocaEntry::List> KSycocaEntryListList; - -static TQ_UINT32 newTimestamp = 0; - -static KBuildServiceFactory *g_bsf = 0; -static KBuildServiceGroupFactory *g_bsgf = 0; -static KSycocaFactory *g_factory = 0; -static KCTimeInfo *g_ctimeInfo = 0; -static TQDict<TQ_UINT32> *g_ctimeDict = 0; -static const char *g_resource = 0; -static KBSEntryDict *g_entryDict = 0; -static KBSEntryDict *g_serviceGroupEntryDict = 0; -static KSycocaEntryListList *g_allEntries = 0; -static TQStringList *g_changeList = 0; -static TQStringList *g_allResourceDirs = 0; -static bool g_changed = false; -static KSycocaEntry::List g_tempStorage; -static VFolderMenu *g_vfolder = 0; - -static const char *cSycocaPath = 0; - -static bool bGlobalDatabase = false; -static bool bMenuTest = false; - -void crashHandler(int) -{ - // If we crash while reading sycoca, we delete the database - // in an attempt to recover. - if (cSycocaPath) - unlink(cSycocaPath); -} - -static TQString sycocaPath() -{ - TQString path; - - if (bGlobalDatabase) - { - path = TDEGlobal::dirs()->saveLocation("services")+"tdesycoca"; - } - else - { - TQCString tdesycoca_env = getenv("TDESYCOCA"); - if (tdesycoca_env.isEmpty()) - path = TDEGlobal::dirs()->saveLocation("cache")+"tdesycoca"; - else - path = TQFile::decodeName(tdesycoca_env); - } - - return path; -} - -static TQString oldSycocaPath() -{ - TQCString tdesycoca_env = getenv("TDESYCOCA"); - if (tdesycoca_env.isEmpty()) - return TDEGlobal::dirs()->saveLocation("tmp")+"tdesycoca"; - - return TQString::null; -} - -KBuildSycoca::KBuildSycoca() - : KSycoca( true ) -{ -} - -KBuildSycoca::~KBuildSycoca() -{ - -} - -void KBuildSycoca::processGnomeVfs() -{ - TQString file = locate("app-reg", "gnome-vfs.applications"); - if (file.isEmpty()) - { -// kdDebug(7021) << "gnome-vfs.applications not found." << endl; - return; - } - - TQString app; - - char line[1024*64]; - - FILE *f = fopen(TQFile::encodeName(file), "r"); - while (!feof(f)) - { - if (!fgets(line, sizeof(line)-1, f)) - { - break; - } - - if (line[0] != '\t') - { - app = TQString::fromLatin1(line); - app.truncate(app.length()-1); - } - else if (strncmp(line+1, "mime_types=", 11) == 0) - { - TQString mimetypes = TQString::fromLatin1(line+12); - mimetypes.truncate(mimetypes.length()-1); - mimetypes.replace(TQRegExp("\\*"), "all"); - KService *s = g_bsf->findServiceByName(app); - if (!s) - continue; - - TQStringList &serviceTypes = s->accessServiceTypes(); - if (serviceTypes.count() <= 1) - { - serviceTypes += TQStringList::split(',', mimetypes); -// kdDebug(7021) << "Adding gnome mimetypes for '" << app << "'.\n"; -// kdDebug(7021) << "ServiceTypes=" << s->serviceTypes().join(":") << endl; - } - } - } - fclose( f ); -} - -KSycocaEntry *KBuildSycoca::createEntry(const TQString &file, bool addToFactory) -{ - TQ_UINT32 timeStamp = g_ctimeInfo->ctime(file); - if (!timeStamp) - { - timeStamp = TDEGlobal::dirs()->calcResourceHash( g_resource, file, true); - } - KSycocaEntry* entry = 0; - if (g_allEntries) - { - assert(g_ctimeDict); - TQ_UINT32 *timeP = (*g_ctimeDict)[file]; - TQ_UINT32 oldTimestamp = timeP ? *timeP : 0; - - if (timeStamp && (timeStamp == oldTimestamp)) - { - // Re-use old entry - if (g_factory == g_bsgf) // Strip .directory from service-group entries - { - entry = g_entryDict->find(file.left(file.length()-10)); - } - else if (g_factory == g_bsf) - { - entry = g_entryDict->find(file); - } - else - { - entry = g_entryDict->find(file); - } - // remove from g_ctimeDict; if g_ctimeDict is not empty - // after all files have been processed, it means - // some files were removed since last time - g_ctimeDict->remove( file ); - } - else if (oldTimestamp) - { - g_changed = true; - kdDebug(7021) << "modified: " << file << endl; - } - else - { - g_changed = true; - kdDebug(7021) << "new: " << file << endl; - } - } - g_ctimeInfo->addCTime(file, timeStamp ); - if (!entry) - { - // Create a new entry - entry = g_factory->createEntry( file, g_resource ); - } - if ( entry && entry->isValid() ) - { - if (addToFactory) - g_factory->addEntry( entry, g_resource ); - else - g_tempStorage.append(entry); - return entry; - } - return 0; -} - -void KBuildSycoca::slotCreateEntry(const TQString &file, KService **service) -{ - KSycocaEntry *entry = createEntry(file, false); - *service = dynamic_cast<KService *>(entry); -} - -// returns false if the database is up to date -bool KBuildSycoca::build() -{ - typedef TQPtrList<KBSEntryDict> KBSEntryDictList; - KBSEntryDictList *entryDictList = 0; - KBSEntryDict *serviceEntryDict = 0; - - entryDictList = new KBSEntryDictList(); - // Convert for each factory the entryList to a Dict. - int i = 0; - // For each factory - for (KSycocaFactory *factory = m_lstFactories->first(); - factory; - factory = m_lstFactories->next() ) - { - KBSEntryDict *entryDict = new KBSEntryDict(); - if (g_allEntries) - { - KSycocaEntry::List list = (*g_allEntries)[i++]; - for( KSycocaEntry::List::Iterator it = list.begin(); - it != list.end(); - ++it) - { - entryDict->insert( (*it)->entryPath(), static_cast<KSycocaEntry *>(*it)); - } - } - if (factory == g_bsf) - serviceEntryDict = entryDict; - else if (factory == g_bsgf) - g_serviceGroupEntryDict = entryDict; - entryDictList->append(entryDict); - } - - TQStringList allResources; - // For each factory - for (KSycocaFactory *factory = m_lstFactories->first(); - factory; - factory = m_lstFactories->next() ) - { - // For each resource the factory deals with - const KSycocaResourceList *list = factory->resourceList(); - if (!list) continue; - - for( KSycocaResourceList::ConstIterator it1 = list->begin(); - it1 != list->end(); - ++it1 ) - { - KSycocaResource res = (*it1); - if (!allResources.contains(res.resource)) - allResources.append(res.resource); - } - } - - g_ctimeInfo = new KCTimeInfo(); // This is a build factory too, don't delete!! - bool uptodate = true; - // For all resources - for( TQStringList::ConstIterator it1 = allResources.begin(); - it1 != allResources.end(); - ++it1 ) - { - g_changed = false; - g_resource = (*it1).ascii(); - - TQStringList relFiles; - - (void) TDEGlobal::dirs()->findAllResources( g_resource, - TQString::null, - true, // Recursive! - true, // uniq - relFiles); - - - // Now find all factories that use this resource.... - // For each factory - g_entryDict = entryDictList->first(); - for (g_factory = m_lstFactories->first(); - g_factory; - g_factory = m_lstFactories->next(), - g_entryDict = entryDictList->next() ) - { - // For each resource the factory deals with - const KSycocaResourceList *list = g_factory->resourceList(); - if (!list) continue; - - for( KSycocaResourceList::ConstIterator it2 = list->begin(); - it2 != list->end(); - ++it2 ) - { - KSycocaResource res = (*it2); - if (res.resource != (*it1)) continue; - - // For each file in the resource - for( TQStringList::ConstIterator it3 = relFiles.begin(); - it3 != relFiles.end(); - ++it3 ) - { - // Check if file matches filter - if ((*it3).endsWith(res.extension)) - createEntry(*it3, true); - } - } - if ((g_factory == g_bsf) && (strcmp(g_resource, "services") == 0)) - processGnomeVfs(); - } - if (g_changed || !g_allEntries) - { - uptodate = false; - g_changeList->append(g_resource); - } - } - - bool result = !uptodate || !g_ctimeDict->isEmpty(); - - if (result || bMenuTest) - { - g_resource = "apps"; - g_factory = g_bsf; - g_entryDict = serviceEntryDict; - g_changed = false; - - g_vfolder = new VFolderMenu; - if (!m_trackId.isEmpty()) - g_vfolder->setTrackId(m_trackId); - - connect(g_vfolder, TQT_SIGNAL(newService(const TQString &, KService **)), - this, TQT_SLOT(slotCreateEntry(const TQString &, KService **))); - - VFolderMenu::SubMenu *kdeMenu = g_vfolder->parseMenu("applications.menu", true); - - KServiceGroup *entry = g_bsgf->addNew("/", kdeMenu->directoryFile, 0, false); - entry->setLayoutInfo(kdeMenu->layoutList); - createMenu(TQString::null, TQString::null, kdeMenu); - - KServiceGroup::Ptr g(entry); - - (void) existingResourceDirs(); - *g_allResourceDirs += g_vfolder->allDirectories(); - - disconnect(g_vfolder, TQT_SIGNAL(newService(const TQString &, KService **)), - this, TQT_SLOT(slotCreateEntry(const TQString &, KService **))); - - if (g_changed || !g_allEntries) - { - uptodate = false; - g_changeList->append(g_resource); - } - if (bMenuTest) - return false; - } - - return result; -} - -void KBuildSycoca::createMenu(TQString caption, TQString name, VFolderMenu::SubMenu *menu) -{ - for(VFolderMenu::SubMenu *subMenu = menu->subMenus.first(); subMenu; subMenu = menu->subMenus.next()) - { - TQString subName = name+subMenu->name+"/"; - - TQString directoryFile = subMenu->directoryFile; - if (directoryFile.isEmpty()) - directoryFile = subName+".directory"; - TQ_UINT32 timeStamp = g_ctimeInfo->ctime(directoryFile); - if (!timeStamp) - { - timeStamp = TDEGlobal::dirs()->calcResourceHash( g_resource, directoryFile, true); - } - - KServiceGroup* entry = 0; - if (g_allEntries) - { - TQ_UINT32 *timeP = (*g_ctimeDict)[directoryFile]; - TQ_UINT32 oldTimestamp = timeP ? *timeP : 0; - - if (timeStamp && (timeStamp == oldTimestamp)) - { - entry = dynamic_cast<KServiceGroup *> (g_serviceGroupEntryDict->find(subName)); - if (entry && (entry->directoryEntryPath() != directoryFile)) - entry = 0; // Can't reuse this one! - } - } - g_ctimeInfo->addCTime(directoryFile, timeStamp); - - entry = g_bsgf->addNew(subName, subMenu->directoryFile, entry, subMenu->isDeleted); - entry->setLayoutInfo(subMenu->layoutList); - if (! (bMenuTest && entry->noDisplay()) ) - createMenu(caption + entry->caption() + "/", subName, subMenu); - } - if (caption.isEmpty()) - caption += "/"; - if (name.isEmpty()) - name += "/"; - for(TQDictIterator<KService> it(menu->items); it.current(); ++it) - { - if (bMenuTest) - { - if (!menu->isDeleted && !it.current()->noDisplay()) - printf("%s\t%s\t%s\n", caption.local8Bit().data(), it.current()->menuId().local8Bit().data(), locate("apps", it.current()->desktopEntryPath()).local8Bit().data()); - } - else - { - g_bsf->addEntry( it.current(), g_resource ); - g_bsgf->addNewEntryTo(name, it.current()); - } - } -} - -bool KBuildSycoca::recreate() -{ - TQString path(sycocaPath()); -#ifdef Q_WS_WIN - printf("kbuildsycoca: path='%s'\n", (const char*)path); -#endif - - // KSaveFile first writes to a temp file. - // Upon close() it moves the stuff to the right place. - std::auto_ptr<KSaveFile> database( new KSaveFile(path) ); - if (database->status() == EACCES && TQFile::exists(path)) - { - TQFile::remove( path ); - database.reset( new KSaveFile(path) ); // try again - } - if (database->status() != 0) - { - fprintf(stderr, "[kbuildsycoca] ERROR creating database '%s'! %s\n", path.local8Bit().data(),strerror(database->status())); -#ifdef KBUILDSYCOCA_GUI // KBUILDSYCOCA_GUI is used on win32 to build - // GUI version of kbuildsycoca, so-called "kbuildsycocaw". - if (!silent) - KMessageBox::error(0, i18n("Error creating database '%1'.\nCheck that the permissions are correct on the directory and the disk is not full.\n").arg(path.local8Bit().data()), i18n("KBuildSycoca")); -#endif - return false; - } - - m_str = database->dataStream(); - - kdDebug(7021) << "Recreating tdesycoca file (" << path << ", version " << KSycoca::version() << ")" << endl; - - // It is very important to build the servicetype one first - // Both are registered in KSycoca, no need to keep the pointers - KSycocaFactory *stf = new KBuildServiceTypeFactory; - g_bsgf = new KBuildServiceGroupFactory(); - g_bsf = new KBuildServiceFactory(stf, g_bsgf); - (void) new KBuildImageIOFactory(); - (void) new KBuildProtocolInfoFactory(); - - if( build()) // Parse dirs - { - save(); // Save database - if (m_str->device()->status()) - database->abort(); // Error - m_str = 0L; - if (!database->close()) - { - fprintf(stderr, "[kbuildsycoca] ERROR writing database '%s'!\n", database->name().local8Bit().data()); - fprintf(stderr, "[kbuildsycoca] Disk full?\n"); -#ifdef KBUILDSYCOCA_GUI - if (!silent) - KMessageBox::error(0, i18n("[kbuildsycoca] Error writing database '%1'.\nCheck that the permissions are correct on the directory and the disk is not full.\n").arg(path.local8Bit().data()), i18n("KBuildSycoca")); -#endif |