diff options
Diffstat (limited to 'tdecore')
28 files changed, 144 insertions, 125 deletions
diff --git a/tdecore/CMakeLists.txt b/tdecore/CMakeLists.txt index c794a8039..3857660ad 100644 --- a/tdecore/CMakeLists.txt +++ b/tdecore/CMakeLists.txt @@ -52,7 +52,7 @@ install( FILES tdeconfig.h tdeconfigskeleton.h tdeconfigdata.h ksimpleconfig.h tdeconfigdialogmanager.h tdeconfigbase.h kdesktopfile.h kurl.h ksock.h tdeaboutdata.h tdecmdlineargs.h tdeconfigbackend.h - kapp.h tdeapplication.h kuniqueapp.h kuniqueapplication.h + tdeapplication.h tdeuniqueapplication.h kcharsets.h tdeversion.h kpty.h kprocess.h kprocctrl.h tdelocale.h kicontheme.h kiconloader.h kdebug.h twinmodule.h twin.h krootprop.h tdeshortcut.h kkeynative.h tdeaccel.h @@ -73,7 +73,7 @@ install( FILES kmanagerselection.h kmountpoint.h kuser.h klockfile.h kidna.h ktempdir.h kshell.h fixx11h.h kxerrorhandler.h tdelibs_export.h kde_file.h ktimezones.h - ${CMAKE_CURRENT_BINARY_DIR}/kdemacros.h + ${CMAKE_CURRENT_BINARY_DIR}/tdemacros.h DESTINATION ${INCLUDE_INSTALL_DIR} ) @@ -117,7 +117,7 @@ set( ${target}_SRCS kcrash.cpp kurl.cpp kregexp.cpp tdeglobal.cpp tdeglobalsettings.cpp kallocator.cpp kvmallocator.cpp kmimesourcefactory.cpp kinstance.cpp kpalette.cpp kipc.cpp klibloader.cpp tdetempfile.cpp - kuniqueapplication.cpp tdeaccelmanager.cpp ksavefile.cpp + tdeuniqueapplication.cpp tdeaccelmanager.cpp ksavefile.cpp krandomsequence.cpp kstringhandler.cpp kcompletion.cpp tdecmdlineargs.cpp tdeaboutdata.cpp kcompletionbase.cpp knotifyclient.cpp kaudioplayer.cpp kdcoppropertyproxy.cpp ksockaddr.cpp diff --git a/tdecore/MAINTAINERS b/tdecore/MAINTAINERS index ae94ecd7c..99b6e7ef2 100644 --- a/tdecore/MAINTAINERS +++ b/tdecore/MAINTAINERS @@ -68,7 +68,7 @@ tdesycoca.cpp Waldo Bastian <bastian@kde.org> tdesycocadict.cpp Waldo Bastian <bastian@kde.org> tdesycocafactory.cpp Waldo Bastian <bastian@kde.org> tdetempfile.cpp Waldo Bastian <bastian@kde.org> -kuniqueapplication.cpp Waldo Bastian <bastian@kde.org> +tdeuniqueapplication.cpp Waldo Bastian <bastian@kde.org> kurl.cpp Waldo Bastian <bastian@kde.org> kurldrag.cpp David Faure <faure@kde.org> twin.cpp Lubos Lunak <l.lunak@kde.org> diff --git a/tdecore/Mainpage.dox b/tdecore/Mainpage.dox index c275aa84e..4a74d242a 100644 --- a/tdecore/Mainpage.dox +++ b/tdecore/Mainpage.dox @@ -37,5 +37,5 @@ Some helper utilities: @gpl */ // DOXYGEN_EXCLUDE = malloc kde_file.h -// DOXYGEN_SET_INPUT += @topdir@/kdemacros.h.cmake +// DOXYGEN_SET_INPUT += @topdir@/tdemacros.h.cmake // DOXYGEN_SET_PROJECT_NAME = TrinityCore diff --git a/tdecore/Makefile.am b/tdecore/Makefile.am index 58e74a010..d646aac94 100644 --- a/tdecore/Makefile.am +++ b/tdecore/Makefile.am @@ -39,8 +39,8 @@ lib_LIBRARIES = libtdefakes_nonpic.a libtdefakes_pic.a include_HEADERS = tdeconfig.h tdeconfigskeleton.h \ tdeconfigdata.h ksimpleconfig.h tdeconfigdialogmanager.h \ tdeconfigbase.h kdesktopfile.h kurl.h ksock.h tdeaboutdata.h \ - tdecmdlineargs.h tdeconfigbackend.h kapp.h tdeapplication.h kuniqueapp.h \ - kuniqueapplication.h kcharsets.h tdeversion.h kpty.h kprocess.h \ + tdecmdlineargs.h tdeconfigbackend.h tdeapplication.h \ + tdeuniqueapplication.h kcharsets.h tdeversion.h kpty.h kprocess.h \ kprocctrl.h tdelocale.h kicontheme.h kiconloader.h kdebug.h \ twinmodule.h twin.h krootprop.h tdeshortcut.h kkeynative.h tdeaccel.h \ kglobalaccel.h tdestdaccel.h tdeshortcutlist.h kcatalogue.h \ @@ -59,7 +59,7 @@ include_HEADERS = tdeconfig.h tdeconfigskeleton.h \ kcalendarsystem.h kcalendarsystemfactory.h kmacroexpander.h \ kmanagerselection.h kmountpoint.h kuser.h klockfile.h \ kidna.h ktempdir.h kshell.h fixx11h.h kxerrorhandler.h tdelibs_export.h \ - kdemacros.h kde_file.h ktimezones.h + tdemacros.h kde_file.h ktimezones.h libtdefakes_la_SOURCES = fakes.c vsnprintf.c libtdefakes_la_LDFLAGS = -version-info 6:0:2 @@ -101,7 +101,7 @@ libtdecore_la_SOURCES = libintl.cpp tdeapplication.cpp \ kcrash.cpp kurl.cpp kregexp.cpp tdeglobal.cpp tdeglobalsettings.cpp \ kallocator.cpp kvmallocator.cpp kmimesourcefactory.cpp \ kinstance.cpp kpalette.cpp kipc.cpp klibloader.cpp tdetempfile.cpp \ - kuniqueapplication.cpp tdeaccelmanager.cpp \ + tdeuniqueapplication.cpp tdeaccelmanager.cpp \ ksavefile.cpp krandomsequence.cpp kstringhandler.cpp kcompletion.cpp \ tdecmdlineargs.cpp tdeaboutdata.cpp kcompletionbase.cpp knotifyclient.cpp \ kaudioplayer.cpp kdcoppropertyproxy.cpp \ diff --git a/tdecore/README.tdestartupinfo b/tdecore/README.tdestartupinfo index 71e786b0d..e28bc99ed 100644 --- a/tdecore/README.tdestartupinfo +++ b/tdecore/README.tdestartupinfo @@ -119,7 +119,7 @@ Sending the application startup notification information : it's done by classes like KRun ). See e.g. KRun sources for details. During the starting of the application, the info may need some updating ( e.g. right after starting the app, the PID with hostname may be sent, -or a PID change when KUniqueApplication forks into background ). +or a PID change when TDEUniqueApplication forks into background ). When it's detected that the started process exited, it an ASN info about the finished process should be sent. Since the application may have forked into background, the finish info should include the PID @@ -143,7 +143,7 @@ Ideally, the application should read it, and set a window property called _TDE_STARTUP_ID ( type XA_STRING ) at least on its first mapped toplevel window to this value. It should also unset it, so it doesn't get propagated to other applications started from it. It should also -update the ASN info when necessary, e.g. when KUniqueApplication +update the ASN info when necessary, e.g. when TDEUniqueApplication forks into background, it sends the PID change. That's how compliant applications should work, and this support for ASN should be provided by toolkits. All TDE application should be compliant by now, since @@ -192,7 +192,7 @@ There are 3 types of messages : - change: message - this message is like new: message, but it's only for updating existing ASN info, if there's no ASN info for the given identification, it won't - be created. This is used e.g. in KUniqueApplication when it forks + be created. This is used e.g. in TDEUniqueApplication when it forks into background and sends info about the PID change - it should update any existing ASN info, but mustn't create a new one, otherwise there could appear ASN even for applications which shouldn't have ASN diff --git a/tdecore/configure.in.in b/tdecore/configure.in.in index d7ef1cd08..7ecda35e7 100644 --- a/tdecore/configure.in.in +++ b/tdecore/configure.in.in @@ -169,7 +169,7 @@ AC_CHECK_HEADERS(sys/mount.h) dnl AC_OUTPUT(tdecore/tde-config.cpp) -AM_CONFIG_HEADER(tdecore/kdemacros.h) +AM_CONFIG_HEADER(tdecore/tdemacros.h) SVGICONS= diff --git a/tdecore/kapp.h b/tdecore/kapp.h deleted file mode 100644 index 5d48a852f..000000000 --- a/tdecore/kapp.h +++ /dev/null @@ -1,6 +0,0 @@ -// kapp.h is the old name. Use #include <tdeapplication.h> from now on -#ifdef KDE_NO_COMPAT -#error include <tdeapplication.h> instead of <kapp.h> -#else -#include <tdeapplication.h> -#endif diff --git a/tdecore/kglobalaccel_x11.cpp b/tdecore/kglobalaccel_x11.cpp index d76b8cdac..41e58b959 100644 --- a/tdecore/kglobalaccel_x11.cpp +++ b/tdecore/kglobalaccel_x11.cpp @@ -30,7 +30,7 @@ #include <tqregexp.h> #include <tqwidget.h> #include <tqmetaobject.h> -#include <tqucomextra_p.h> +#include <private/tqucomextra_p.h> #include <tdeapplication.h> #include <kdebug.h> #include <kkeynative.h> diff --git a/tdecore/kuniqueapp.h b/tdecore/kuniqueapp.h deleted file mode 100644 index d3ec22dd5..000000000 --- a/tdecore/kuniqueapp.h +++ /dev/null @@ -1,6 +0,0 @@ -// kuniqueapp.h is the old name. Use #include <kuniqueapplication.h> from now on -#ifdef KDE_NO_COMPAT -#error kuniqueapp.h is the old name. Use #include <kuniqueapplication.h> from now on -#else -#include <kuniqueapplication.h> -#endif diff --git a/tdecore/libtdecore.nmcheck b/tdecore/libtdecore.nmcheck index 7c017a6e4..92ec3ff8f 100644 --- a/tdecore/libtdecore.nmcheck +++ b/tdecore/libtdecore.nmcheck @@ -44,6 +44,8 @@ operator>> operator<< qt_qclipboard_bailout_hack kasciistricmp +kasciitolower +kasciitoupper # from libtldl lt_dl* diff --git a/tdecore/netsupp.cpp b/tdecore/netsupp.cpp index 397005183..0ea43178d 100644 --- a/tdecore/netsupp.cpp +++ b/tdecore/netsupp.cpp @@ -49,7 +49,7 @@ extern int h_errno; #endif -#include <kdemacros.h> +#include <tdemacros.h> #if !defined(kde_sockaddr_in6) /* diff --git a/tdecore/tdeapplication.h b/tdecore/tdeapplication.h index f90e8a42b..b239922e2 100644 --- a/tdecore/tdeapplication.h +++ b/tdecore/tdeapplication.h @@ -30,8 +30,6 @@ class KCharsets; class DCOPClient; class DCOPObject; -#include <tqtglobaldefines.h> - typedef unsigned long Atom; #if !defined(TQ_WS_X11) typedef void Display; @@ -1258,13 +1256,13 @@ public slots: protected: /** - * @internal Used by KUniqueApplication + * @internal Used by TDEUniqueApplication */ TDEApplication( bool allowStyles, bool GUIenabled, TDEInstance* _instance ); #ifdef TQ_WS_X11 /** - * @internal Used by KUniqueApplication + * @internal Used by TDEUniqueApplication */ TDEApplication( Display *display, TQt::HANDLE visual, TQt::HANDLE colormap, bool allowStyles, TDEInstance* _instance ); diff --git a/tdecore/tdecmdlineargs.h b/tdecore/tdecmdlineargs.h index 013def801..fe97fa09c 100644 --- a/tdecore/tdecmdlineargs.h +++ b/tdecore/tdecmdlineargs.h @@ -69,7 +69,7 @@ struct TDECORE_EXPORT TDECmdLineOptions class TDECmdLineArgsList; class TDEApplication; -class KUniqueApplication; +class TDEUniqueApplication; class TDECmdLineParsedOptions; class TDECmdLineParsedArgs; class TDEAboutData; @@ -97,19 +97,19 @@ class TDECmdLineArgsPrivate; * TDECmdLineArgs::addCmdLineOptions( options ); * * // Add options from other components - * KUniqueApplication::addCmdLineOptions(); + * TDEUniqueApplication::addCmdLineOptions(); * * .... * * // Create application object without passing 'argc' and 'argv' again. - * KUniqueApplication app; + * TDEUniqueApplication app; * * .... * * // Handle our own options/arguments * // A TDEApplication will usually do this in main but this is not * // necessary. - * // A KUniqueApplication might want to handle it in newInstance(). + * // A TDEUniqueApplication might want to handle it in newInstance(). * * TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); * @@ -222,7 +222,7 @@ class TDECmdLineArgsPrivate; class TDECORE_EXPORT TDECmdLineArgs { friend class TDEApplication; - friend class KUniqueApplication; + friend class TDEUniqueApplication; friend class TQPtrList<TDECmdLineArgs>; public: // Static functions: @@ -373,7 +373,7 @@ public: * Get the CWD (Current Working Directory) associated with the * current command line arguments. * - * Typically this is needed in KUniqueApplication::newInstance() + * Typically this is needed in TDEUniqueApplication::newInstance() * since the CWD of the process may be different from the CWD * where the user started a second instance. * @return the current working directory @@ -606,7 +606,7 @@ private: static void removeArgs(const char *id); /** - * @internal for KUniqueApplication only: + * @internal for TDEUniqueApplication only: * * Save all but the Qt and KDE arguments to a stream. */ diff --git a/tdecore/tdeglobal.cpp b/tdecore/tdeglobal.cpp index 09f496034..aeac6f744 100644 --- a/tdecore/tdeglobal.cpp +++ b/tdecore/tdeglobal.cpp @@ -282,3 +282,20 @@ int kasciistricmp( const char *str1, const char *str2 ) return *s1 ? res : (*s2 ? -1 : 0); } +char* kasciitolower( char *s ) +{ + if ( !s ) + return 0; + for ( unsigned char *p = (unsigned char *) s; *p; ++p ) + *p = ( *p >= 'A' && *p <= 'Z' ) ? (*p - 'A' + 'a') : *p; + return s; +} + +char* kasciitoupper( char *s ) +{ + if ( !s ) + return 0; + for ( unsigned char *p = (unsigned char *) s; *p; ++p ) + *p = ( *p >= 'a' && *p <= 'z' ) ? (*p - 'a' + 'A') : *p; + return s; +} diff --git a/tdecore/tdeglobal.h b/tdecore/tdeglobal.h index 1269c36a9..d604a4244 100644 --- a/tdecore/tdeglobal.h +++ b/tdecore/tdeglobal.h @@ -234,7 +234,25 @@ inline const T& kClamp( const T& x, const T& low, const T& high ) * tqstricmp fails with e.g. the Turkish locale where 'I'.lower() != 'i' * @since 3.4 */ -int TDECORE_EXPORT kasciistricmp( const char *str1, const char *str2 ); +TDECORE_EXPORT int kasciistricmp( const char *str1, const char *str2 ); + +/** + Locale-independent function to convert ASCII strings to lower case ASCII + strings. This means that it affects @em only the ASCII characters A-Z. + + @param str pointer to the string which should be converted to lower case + @return pointer to the converted string (same as @a str) +*/ +TDECORE_EXPORT char* kasciitolower( char *str ); + +/** + Locale-independent function to convert ASCII strings to upper case ASCII + strings. This means that it affects @em only the ASCII characters a-z. + + @param str pointer to the string which should be converted to upper case + @return pointer to the converted string (same as @a str) +*/ +TDECORE_EXPORT char* kasciitoupper( char *str ); /** diff --git a/tdecore/tdehw/tdestoragedevice.h b/tdecore/tdehw/tdestoragedevice.h index 891b31573..88a387377 100644 --- a/tdecore/tdehw/tdestoragedevice.h +++ b/tdecore/tdehw/tdestoragedevice.h @@ -22,17 +22,13 @@ #include "tdegenericdevice.h" #include "tqvariant.h" -#include "kdemacros.h" +#include "tdemacros.h" struct crypt_device; // Keep readDiskDeviceSubtypeFromString() in tdehardwaredevices.cpp in sync with this enum namespace TDEDiskDeviceType { -#if __cplusplus >= 201103L enum TDEDiskDeviceType : unsigned long long { -#else -enum TDEDiskDeviceType { -#endif Null = 0x0000000000000000ULL, MediaDevice = 0x0000000000000001ULL, Floppy = 0x0000000000000002ULL, diff --git a/tdecore/tdelibs_export.h b/tdecore/tdelibs_export.h index bfe07b0e3..78f129f89 100644 --- a/tdecore/tdelibs_export.h +++ b/tdecore/tdelibs_export.h @@ -21,7 +21,7 @@ #define _TDELIBS_EXPORT_H /* needed for TDE_EXPORT macros */ -#include <kdemacros.h> +#include <tdemacros.h> /* needed, because e.g. Q_OS_UNIX is so frequently used */ #include <tqglobal.h> diff --git a/tdecore/kdemacros.h.cmake b/tdecore/tdemacros.h.cmake index 1c652176a..34c945872 100644 --- a/tdecore/kdemacros.h.cmake +++ b/tdecore/tdemacros.h.cmake @@ -1,5 +1,5 @@ -/* This file is part of the KDE libraries - Copyright (c) 2002-2003 KDE Team +/* This file is part of the TDE libraries + Copyright (c) 2002-2003 TDE Team This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -17,12 +17,12 @@ Boston, MA 02110-1301, USA. */ -#ifndef _KDE_MACROS_H_ -#define _KDE_MACROS_H_ +#ifndef _TDE_MACROS_H_ +#define _TDE_MACROS_H_ /* Set by configure */ #cmakedefine __TDE_HAVE_TDEHWLIB 1 -#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1 +#cmakedefine __TDE_HAVE_GCC_VISIBILITY 1 /** * The TDE_NO_EXPORT macro marks the symbol of the given variable @@ -38,7 +38,7 @@ * \end */ -#ifdef __KDE_HAVE_GCC_VISIBILITY +#ifdef __TDE_HAVE_GCC_VISIBILITY #define TDE_NO_EXPORT __attribute__ ((visibility("hidden"))) #define TDE_EXPORT __attribute__ ((visibility("default"))) #elif defined(TQ_WS_WIN) @@ -183,4 +183,4 @@ #define TDE_WEAK_SYMBOL #endif -#endif /* _KDE_MACROS_H_ */ +#endif /* _TDE_MACROS_H_ */ diff --git a/tdecore/kdemacros.h.in b/tdecore/tdemacros.h.in index 571d5fafe..9df1a77ab 100644 --- a/tdecore/kdemacros.h.in +++ b/tdecore/tdemacros.h.in @@ -17,11 +17,11 @@ Boston, MA 02110-1301, USA. */ -#ifndef _KDE_MACROS_H_ -#define _KDE_MACROS_H_ +#ifndef _TDE_MACROS_H_ +#define _TDE_MACROS_H_ /* Set by configure */ -#undef __KDE_HAVE_GCC_VISIBILITY +#undef __TDE_HAVE_GCC_VISIBILITY /** * The TDE_NO_EXPORT macro marks the symbol of the given variable @@ -37,7 +37,7 @@ * \end */ -#ifdef __KDE_HAVE_GCC_VISIBILITY +#ifdef __TDE_HAVE_GCC_VISIBILITY #define TDE_NO_EXPORT __attribute__ ((visibility("hidden"))) #define TDE_EXPORT __attribute__ ((visibility("default"))) #elif defined(TQ_WS_WIN) @@ -182,4 +182,4 @@ #define TDE_WEAK_SYMBOL #endif -#endif /* _KDE_MACROS_H_ */ +#endif /* _TDE_MACROS_H_ */ diff --git a/tdecore/tdestartupinfo.h b/tdecore/tdestartupinfo.h index dcbe599d1..bf507c026 100644 --- a/tdecore/tdestartupinfo.h +++ b/tdecore/tdestartupinfo.h @@ -94,7 +94,7 @@ class TDECORE_EXPORT TDEStartupInfo /** * Use this function if the application got a request with startup - * notification from outside (for example, when KUniqueApplication::newInstance() + * notification from outside (for example, when TDEUniqueApplication::newInstance() * is called, or e.g. when khelpcenter opens new URL in its window). * The window can be either an already existing and visible window, * or a new one, before being shown. Note that this function is usually diff --git a/tdecore/kuniqueapplication.cpp b/tdecore/tdeuniqueapplication.cpp index 8966063d1..7db9f528e 100644 --- a/tdecore/kuniqueapplication.cpp +++ b/tdecore/tdeuniqueapplication.cpp @@ -45,7 +45,7 @@ #include <tdeconfig.h> #include "kdebug.h" -#include "kuniqueapplication.h" +#include "tdeuniqueapplication.h" #if defined TQ_WS_X11 #include <netwm.h> @@ -59,12 +59,12 @@ # endif #endif -bool KUniqueApplication::s_nofork = false; -bool KUniqueApplication::s_multipleInstances = false; -bool KUniqueApplication::s_uniqueTestDone = false; -bool KUniqueApplication::s_handleAutoStarted = false; +bool TDEUniqueApplication::s_nofork = false; +bool TDEUniqueApplication::s_multipleInstances = false; +bool TDEUniqueApplication::s_uniqueTestDone = false; +bool TDEUniqueApplication::s_handleAutoStarted = false; -static TDECmdLineOptions kunique_options[] = +static TDECmdLineOptions tdeunique_options[] = { { "nofork", "Don't run in the background.", 0 }, TDECmdLineLastOption @@ -76,7 +76,7 @@ struct DCOPRequest { DCOPClientTransaction *transaction; }; -class KUniqueApplicationPrivate { +class TDEUniqueApplicationPrivate { public: TQPtrList <DCOPRequest> requestList; bool processingRequest; @@ -84,13 +84,13 @@ public: }; void -KUniqueApplication::addCmdLineOptions() +TDEUniqueApplication::addCmdLineOptions() { - TDECmdLineArgs::addCmdLineOptions(kunique_options, 0, "kuniqueapp", "tde" ); + TDECmdLineArgs::addCmdLineOptions(tdeunique_options, 0, "tdeuniqueapp", "tde" ); } bool -KUniqueApplication::start() +TDEUniqueApplication::start() { if( s_uniqueTestDone ) return true; @@ -99,7 +99,7 @@ KUniqueApplication::start() #ifdef TQ_WS_WIN s_nofork = true; #else - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs("kuniqueapp"); + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs("tdeuniqueapp"); s_nofork = !args->isSet("fork"); delete args; #endif @@ -122,7 +122,7 @@ KUniqueApplication::start() if(dcopClient()->registerAs(appName, false).isEmpty()) { startKdeinit(); if(dcopClient()->registerAs(appName, false).isEmpty()) { - kdError() << "KUniqueApplication: Can't setup DCOP communication." << endl; + kdError() << "TDEUniqueApplication: Can't setup DCOP communication." << endl; ::exit(255); } } @@ -136,13 +136,13 @@ KUniqueApplication::start() signed char result; if (0 > pipe(fd)) { - kdError() << "KUniqueApplication: pipe() failed!" << endl; + kdError() << "TDEUniqueApplication: pipe() failed!" << endl; ::exit(255); } int fork_result = fork(); switch(fork_result) { case -1: - kdError() << "KUniqueApplication: fork() failed!" << endl; + kdError() << "TDEUniqueApplication: fork() failed!" << endl; ::exit(255); break; case 0: @@ -158,7 +158,7 @@ KUniqueApplication::start() // Check DISPLAY if (TQCString(getenv(DISPLAY)).isEmpty()) { - kdError() << "KUniqueApplication: Can't determine DISPLAY. Aborting." << endl; + kdError() << "TDEUniqueApplication: Can't determine DISPLAY. Aborting." << endl; result = -1; // Error ::write(fd[1], &result, 1); ::exit(255); @@ -169,7 +169,7 @@ KUniqueApplication::start() regName = dc->registerAs(appName, false); if (regName.isEmpty()) { - kdError() << "KUniqueApplication: Can't setup DCOP communication." << endl; + kdError() << "TDEUniqueApplication: Can't setup DCOP communication." << endl; result = -1; delete dc; // Clean up DCOP commmunication ::write(fd[1], &result, 1); @@ -246,12 +246,12 @@ KUniqueApplication::start() if (n == 1) break; if (n == 0) { - kdError() << "KUniqueApplication: Pipe closed unexpectedly." << endl; + kdError() << "TDEUniqueApplication: Pipe closed unexpectedly." << endl; ::exit(255); } if (errno != EINTR) { - kdError() << "KUniqueApplication: Error reading from pipe." << endl; + kdError() << "TDEUniqueApplication: Error reading from pipe." << endl; ::exit(255); } } @@ -263,12 +263,12 @@ KUniqueApplication::start() dc = new DCOPClient(); if (!dc->attach()) { - kdError() << "KUniqueApplication: Parent process can't attach to DCOP." << endl; + kdError() << "TDEUniqueApplication: Parent process can't attach to DCOP." << endl; delete dc; // Clean up DCOP commmunication ::exit(255); } if (!dc->isApplicationRegistered(appName)) { - kdError() << "KUniqueApplication: Registering failed!" << endl; + kdError() << "TDEUniqueApplication: Registering failed!" << endl; } TQCString new_asn_id; @@ -299,7 +299,7 @@ KUniqueApplication::start() dc->setPriorityCall(false); if (replyType != "int") { - kdError() << "KUniqueApplication: DCOP communication error!" << endl; + kdError() << "TDEUniqueApplication: DCOP communication error!" << endl; delete dc; // Clean up DCOP commmunication ::exit(255); } @@ -314,11 +314,11 @@ KUniqueApplication::start() } -KUniqueApplication::KUniqueApplication(bool allowStyles, bool GUIenabled, bool configUnique) +TDEUniqueApplication::TDEUniqueApplication(bool allowStyles, bool GUIenabled, bool configUnique) : TDEApplication( allowStyles, GUIenabled, initHack( configUnique )), DCOPObject(TDECmdLineArgs::about->appName()) { - d = new KUniqueApplicationPrivate; + d = new TDEUniqueApplicationPrivate; d->processingRequest = false; d->firstInstance = true; @@ -334,12 +334,12 @@ KUniqueApplication::KUniqueApplication(bool allowStyles, bool GUIenabled, bool c #ifdef TQ_WS_X11 -KUniqueApplication::KUniqueApplication(Display *display, TQt::HANDLE visual, +TDEUniqueApplication::TDEUniqueApplication(Display *display, TQt::HANDLE visual, TQt::HANDLE colormap, bool allowStyles, bool configUnique) : TDEApplication( display, visual, colormap, allowStyles, initHack( configUnique )), DCOPObject(TDECmdLineArgs::about->appName()) { - d = new KUniqueApplicationPrivate; + d = new TDEUniqueApplicationPrivate; d->processingRequest = false; d->firstInstance = true; @@ -355,13 +355,13 @@ KUniqueApplication::KUniqueApplication(Display *display, TQt::HANDLE visual, #endif -KUniqueApplication::~KUniqueApplication() +TDEUniqueApplication::~TDEUniqueApplication() { delete d; } // this gets called before even entering TQApplication::TQApplication() -TDEInstance* KUniqueApplication::initHack( bool configUnique ) +TDEInstance* TDEUniqueApplication::initHack( bool configUnique ) { TDEInstance* inst = new TDEInstance( TDECmdLineArgs::about ); if (configUnique) @@ -375,7 +375,7 @@ TDEInstance* KUniqueApplication::initHack( bool configUnique ) return inst; } -void KUniqueApplication::newInstanceNoFork() +void TDEUniqueApplication::newInstanceNoFork() { if (dcopClient()->isSuspended()) { @@ -400,7 +400,7 @@ void KUniqueApplication::newInstanceNoFork() // What to do with the return value ? } -bool KUniqueApplication::process(const TQCString &fun, const TQByteArray &data, +bool TDEUniqueApplication::process(const TQCString &fun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData) { if (fun == "newInstance()") @@ -412,7 +412,7 @@ bool KUniqueApplication::process(const TQCString &fun, const TQByteArray &data, } void -KUniqueApplication::delayRequest(const TQCString &fun, const TQByteArray &data) +TDEUniqueApplication::delayRequest(const TQCString &fun, const TQByteArray &data) { DCOPRequest *request = new DCOPRequest; request->fun = fun; @@ -426,7 +426,7 @@ KUniqueApplication::delayRequest(const TQCString &fun, const TQByteArray &data) } void -KUniqueApplication::processDelayed() +TDEUniqueApplication::processDelayed() { if (dcopClient()->isSuspended()) { @@ -468,12 +468,12 @@ KUniqueApplication::processDelayed() d->processingRequest = false; } -bool KUniqueApplication::restoringSession() +bool TDEUniqueApplication::restoringSession() { return d->firstInstance && isRestored(); } -int KUniqueApplication::newInstance() +int TDEUniqueApplication::newInstance() { if (!d->firstInstance) { @@ -493,13 +493,13 @@ int KUniqueApplication::newInstance() return 0; // do nothing in default implementation } -void KUniqueApplication::setHandleAutoStarted() +void TDEUniqueApplication::setHandleAutoStarted() { s_handleAutoStarted = false; } -void KUniqueApplication::virtual_hook( int id, void* data ) +void TDEUniqueApplication::virtual_hook( int id, void* data ) { TDEApplication::virtual_hook( id, data ); DCOPObject::virtual_hook( id, data ); } -#include "kuniqueapplication.moc" +#include "tdeuniqueapplication.moc" diff --git a/tdecore/kuniqueapplication.h b/tdecore/tdeuniqueapplication.h index 6368b53ac..2334708bc 100644 --- a/tdecore/kuniqueapplication.h +++ b/tdecore/tdeuniqueapplication.h @@ -18,13 +18,13 @@ Boston, MA 02110-1301, USA. */ -#ifndef _KUNIQUEAPP_H -#define _KUNIQUEAPP_H +#ifndef _TDEUNIQUEAPP_H +#define _TDEUNIQUEAPP_H #include <tdeapplication.h> #include <dcopobject.h> -class KUniqueApplicationPrivate; +class TDEUniqueApplicationPrivate; /** * Maintains only a single @@ -45,7 +45,7 @@ class KUniqueApplicationPrivate; * @see TDEApplication DCOPObject * @author Preston Brown <pbrown@kde.org> */ -class TDECORE_EXPORT KUniqueApplication : public TDEApplication, public DCOPObject +class TDECORE_EXPORT TDEUniqueApplication : public TDEApplication, public DCOPObject { TQ_OBJECT public: @@ -64,7 +64,7 @@ public: * depend on the value of the "MultipleInstances" * key in the "KDE" group of the application config file. */ - KUniqueApplication( bool allowStyles=true, + TDEUniqueApplication( bool allowStyles=true, bool GUIenabled=true, bool configUnique=false); @@ -89,7 +89,7 @@ public: * key in the "KDE" group of the application config file. * @since KDE 3.3 */ - KUniqueApplication( Display *display, + TDEUniqueApplication( Display *display, TQt::HANDLE visual=0, TQt::HANDLE colormap=0, bool allowStyles=true, @@ -97,9 +97,9 @@ public: #endif /** - * Adds command line options specific for KUniqueApplication. + * Adds command line options specific for TDEUniqueApplication. * - * Should be called before calling KUniqueApplication constructor + * Should be called before calling TDEUniqueApplication constructor * and / or start(). */ static void addCmdLineOptions(); @@ -116,18 +116,18 @@ public: * TDEAboutData about("myappname", "myAppName", .....); * TDECmdLineArgs::init(argc, argv, &about); * TDECmdLineArgs::addCmdLineOptions( myCmdOptions ); - * KUniqueApplication::addCmdLineOptions(); + * TDEUniqueApplication::addCmdLineOptions(); * - * if (!KUniqueApplication::start()) { + * if (!TDEUniqueApplication::start()) { * fprintf(stderr, "myAppName is already running!\n"); * exit(0); * } - * KUniqueApplication a; + * TDEUniqueApplication a; * a.exec(); * } * \endcode * Note that it's not necessary to call start() explicitly. It will be - * called automatically before creating KUniqueApplication if it hasn't + * called automatically before creating TDEUniqueApplication if it hasn't * been called yet, without any performance impact. * * @return true if registration is successful. @@ -138,7 +138,7 @@ public: /** * Destructor */ - virtual ~KUniqueApplication(); + virtual ~TDEUniqueApplication(); /** * Dispatches any incoming DCOP message for a new instance. @@ -215,7 +215,7 @@ private: protected: virtual void virtual_hook( int id, void* data ); private: - KUniqueApplicationPrivate *d; + TDEUniqueApplicationPrivate *d; }; #endif diff --git a/tdecore/tests/CMakeLists.txt b/tdecore/tests/CMakeLists.txt index 36377a255..f3e0aae45 100644 --- a/tdecore/tests/CMakeLists.txt +++ b/tdecore/tests/CMakeLists.txt @@ -32,7 +32,7 @@ tde_add_library( tdeconfigtest SHARED AUTOMOC set( CHECKS tdeconfigtestgui klocaletest kprocesstest ksimpleconfigtest kstddirstest - kuniqueapptest ktempfiletest krandomsequencetest kdebugtest + tdeuniqueapptest ktempfiletest krandomsequencetest kdebugtest ksocktest kstringhandlertest kcmdlineargstest kapptest kmemtest dcopkonqtest kipctest cplusplustest kiconloadertest kresolvertest kmdcodectest knotifytest ksortablevaluelisttest krfcdatetest testqtargs diff --git a/tdecore/tests/Makefile.am b/tdecore/tests/Makefile.am index 73e06f588..9398716eb 100644 --- a/tdecore/tests/Makefile.am +++ b/tdecore/tests/Makefile.am @@ -22,7 +22,7 @@ INCLUDES = -I$(top_srcdir)/tdecore $(all_includes) AM_LDFLAGS = $(QT_LDFLAGS) $(X_LDFLAGS) $(KDE_RPATH) check_PROGRAMS = tdeconfigtestgui klocaletest kprocesstest ksimpleconfigtest \ - kstddirstest kurltest kuniqueapptest ktempfiletest krandomsequencetest \ + kstddirstest kurltest tdeuniqueapptest ktempfiletest krandomsequencetest \ kdebugtest ksocktest kstringhandlertest kcmdlineargstest kapptest \ kmemtest kidlservertest kidlclienttest dcopkonqtest kipctest \ cplusplustest kiconloadertest kresolvertest kmdcodectest knotifytest \ @@ -47,7 +47,7 @@ ksimpleconfigtest_SOURCES = ksimpleconfigtest.cpp kurltest_SOURCES = kurltest.cpp kstddirstest_SOURCES = kstddirstest.cpp kprocesstest_SOURCES = kprocesstest.cpp -kuniqueapptest_SOURCES = kuniqueapptest.cpp +tdeuniqueapptest_SOURCES = tdeuniqueapptest.cpp kapptest_SOURCES = kapptest.cpp ksocktest_SOURCES = ksocktest.cpp ktempfiletest_SOURCES = ktempfiletest.cpp diff --git a/tdecore/tests/kresolvertest.cpp b/tdecore/tests/kresolvertest.cpp index 9f476cd51..58d0e9ac1 100644 --- a/tdecore/tests/kresolvertest.cpp +++ b/tdecore/tests/kresolvertest.cpp @@ -36,7 +36,7 @@ #include <tqptrlist.h> #include <tqstring.h> -#include <kuniqueapplication.h> +#include <tdeuniqueapplication.h> #include <ksocks.h> #include <ksockaddr.h> #include <kextsock.h> @@ -62,11 +62,11 @@ namespace KDE extern const int resolverFlags; } -class TestApp : public KUniqueApplication +class TestApp : public TDEUniqueApplication { public: TestApp() : - KUniqueApplication() + TDEUniqueApplication() { } int newInstance(TQValueList<TQCString> params); @@ -412,7 +412,7 @@ int main(int argc, char **argv) { TDEAboutData about("socktest2", "SockTest", "1.0"); TDECmdLineArgs::init(argc, argv, &about); - KUniqueApplication::addCmdLineOptions(); + TDEUniqueApplication::addCmdLineOptions(); /* TestApp a; a.exec();*/ diff --git a/tdecore/tests/ksocktest.cpp b/tdecore/tests/ksocktest.cpp index a1ce8f86b..ac0bf5510 100644 --- a/tdecore/tests/ksocktest.cpp +++ b/tdecore/tests/ksocktest.cpp @@ -16,7 +16,7 @@ Boston, MA 02110-1301, USA. */ -#include "kuniqueapplication.h" +#include "tdeuniqueapplication.h" #include "tdeglobal.h" #include "kdebug.h" #include "ksock.h" diff --git a/tdecore/tests/kuniqueapptest.cpp b/tdecore/tests/tdeuniqueapptest.cpp index 13b8ca534..9a002c6d8 100644 --- a/tdecore/tests/kuniqueapptest.cpp +++ b/tdecore/tests/tdeuniqueapptest.cpp @@ -16,7 +16,7 @@ Boston, MA 02110-1301, USA. */ -#include "kuniqueapplication.h" +#include "tdeuniqueapplication.h" #include "tdeglobalsettings.h" #include <unistd.h> @@ -25,10 +25,10 @@ #include <tdecmdlineargs.h> #include <tdeaboutdata.h> -class TestApp : public KUniqueApplication +class TestApp : public TDEUniqueApplication { public: - TestApp() : KUniqueApplication("TestApp") { } + TestApp() : TDEUniqueApplication("TestApp") { } virtual int newInstance( ); }; @@ -43,9 +43,9 @@ TestApp::newInstance( ) int main(int argc, char *argv[]) { - TDEAboutData about("kuniqueapptest", "kuniqueapptest", "version"); + TDEAboutData about("tdeuniqueapptest", "tdeuniqueapptest", "version"); TDECmdLineArgs::init(argc, argv, &about); - KUniqueApplication::addCmdLineOptions(); + TDEUniqueApplication::addCmdLineOptions(); if (!TestApp::start()) { diff --git a/tdecore/twin.cpp b/tdecore/twin.cpp index 5486a2828..3871f3513 100644 --- a/tdecore/twin.cpp +++ b/tdecore/twin.cpp @@ -26,7 +26,7 @@ #include <sysent.h> #endif -#include <kuniqueapplication.h> +#include <tdeuniqueapplication.h> #include <tqbitmap.h> #include <tqimage.h> #include <tqwhatsthis.h> @@ -243,7 +243,7 @@ void KWin::activateWindow( WId win, long time ) info.setActiveWindow( win, NET::FromApplication, time, kapp->activeWindow() ? kapp->activeWindow()->winId() : 0 ); #endif // TQ_WS_X11 ... - KUniqueApplication::setHandleAutoStarted(); + TDEUniqueApplication::setHandleAutoStarted(); } void KWin::forceActiveWindow( WId win, long time ) @@ -254,7 +254,7 @@ void KWin::forceActiveWindow( WId win, long time ) time = get_tqt_x_time(); info.setActiveWindow( win, NET::FromTool, time, 0 ); #endif // TQ_WS_X11 - KUniqueApplication::setHandleAutoStarted(); + TDEUniqueApplication::setHandleAutoStarted(); } void KWin::setActiveWindow( WId win ) @@ -263,7 +263,7 @@ void KWin::setActiveWindow( WId win ) NETRootInfo info( tqt_xdisplay(), 0 ); info.setActiveWindow( win, NET::FromUnknown, 0, 0 ); #endif - KUniqueApplication::setHandleAutoStarted(); + TDEUniqueApplication::setHandleAutoStarted(); } void KWin::demandAttention( WId win, bool set ) |