diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2013-03-02 15:57:34 -0600 |
---|---|---|
committer | Darrell Anderson <humanreadable@yahoo.com> | 2013-03-02 15:57:34 -0600 |
commit | 7c0b0c9dc9fcbe9c198925bdc7ee18ac6be49f4f (patch) | |
tree | c76702a7f6310fbe9d437e347535422e836e94e9 /kinit | |
parent | a2a38be7600e2a2c2b49c66902d912ca036a2c0f (diff) | |
parent | 27bbee9a5f9dcda53d8eb23863ee670ad1360e41 (diff) | |
download | tdelibs-7c0b0c9dc9fcbe9c198925bdc7ee18ac6be49f4f.tar.gz tdelibs-7c0b0c9dc9fcbe9c198925bdc7ee18ac6be49f4f.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tdelibs
Diffstat (limited to 'kinit')
-rw-r--r-- | kinit/CMakeLists.txt | 34 | ||||
-rw-r--r-- | kinit/Makefile.am | 30 | ||||
-rw-r--r-- | kinit/README | 8 | ||||
-rw-r--r-- | kinit/README.DCOP | 2 | ||||
-rw-r--r-- | kinit/autostart.cpp | 16 | ||||
-rw-r--r-- | kinit/kinit.cpp | 98 | ||||
-rw-r--r-- | kinit/tdedostartupconfig.cpp (renamed from kinit/kdostartupconfig.cpp) | 16 | ||||
-rw-r--r-- | kinit/tdeioslave.cpp (renamed from kinit/kioslave.cpp) | 8 | ||||
-rw-r--r-- | kinit/tdelauncher.cpp (renamed from kinit/klauncher.cpp) | 226 | ||||
-rw-r--r-- | kinit/tdelauncher.h (renamed from kinit/klauncher.h) | 36 | ||||
-rw-r--r-- | kinit/tdelauncher_cmds.h (renamed from kinit/klauncher_cmds.h) | 2 | ||||
-rw-r--r-- | kinit/tdelauncher_main.cpp (renamed from kinit/klauncher_main.cpp) | 46 | ||||
-rw-r--r-- | kinit/tdestartupconfig.cpp (renamed from kinit/kstartupconfig.cpp) | 18 | ||||
-rw-r--r-- | kinit/tests/Makefile.am | 6 | ||||
-rw-r--r-- | kinit/tests/tdelaunchertest.cpp (renamed from kinit/tests/klaunchertest.cpp) | 10 | ||||
-rw-r--r-- | kinit/wrapper.c | 4 |
16 files changed, 280 insertions, 280 deletions
diff --git a/kinit/CMakeLists.txt b/kinit/CMakeLists.txt index fd1408918..88be32621 100644 --- a/kinit/CMakeLists.txt +++ b/kinit/CMakeLists.txt @@ -19,8 +19,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 ${FREETYPE_INCLUDE_DIRS} ) @@ -39,7 +39,7 @@ set( ${target}_SRCS tde_add_executable( ${target} SOURCES ${${target}_SRCS} - LINK ltdlc-static kparts-shared + LINK ltdlc-static tdeparts-shared DESTINATION ${BIN_INSTALL_DIR} ) @@ -94,34 +94,34 @@ tde_add_executable( ${target} ) -#### kioslave ################################### +#### tdeioslave ################################### -set( target kioslave ) +set( target tdeioslave ) tde_add_executable( ${target} AUTOMOC - SOURCES kioslave.cpp - LINK ltdlc-static kio-shared + SOURCES tdeioslave.cpp + LINK ltdlc-static tdeio-shared DESTINATION ${BIN_INSTALL_DIR} ) -#### kstartupconfig ############################# +#### tdestartupconfig ############################# -set( target kstartupconfig ) +set( target tdestartupconfig ) tde_add_executable( ${target} AUTOMOC - SOURCES kstartupconfig.cpp + SOURCES tdestartupconfig.cpp LINK tdefakes-shared ${TQT_LIBRARIES} DESTINATION ${BIN_INSTALL_DIR} ) -#### kdostartupconfig ########################### +#### tdedostartupconfig ########################### -set( target kdostartupconfig ) +set( target tdedostartupconfig ) tde_add_executable( ${target} AUTOMOC - SOURCES kdostartupconfig.cpp + SOURCES tdedostartupconfig.cpp LINK tdecore-shared DESTINATION ${BIN_INSTALL_DIR} ) @@ -153,15 +153,15 @@ tde_add_executable( ${target} ) -#### klauncher ################################## +#### tdelauncher ################################## -set( target klauncher ) +set( target tdelauncher ) set( ${target}_SRCS - klauncher.cpp klauncher_main.cpp autostart.cpp + tdelauncher.cpp tdelauncher_main.cpp autostart.cpp ) tde_add_tdeinit_executable( ${target} AUTOMOC SOURCES ${${target}_SRCS} - LINK kio-shared + LINK tdeio-shared ) diff --git a/kinit/Makefile.am b/kinit/Makefile.am index ef329980a..3090d041e 100644 --- a/kinit/Makefile.am +++ b/kinit/Makefile.am @@ -19,11 +19,11 @@ INCLUDES = -I$(srcdir)/../libltdl/ $(all_includes) $(TDEINIT_XFT_INCLUDES) SUBDIRS = . tests -bin_PROGRAMS = tdeinit tdeinit_wrapper kshell tdeinit_shutdown lnusertemp kwrapper kioslave \ - kstartupconfig kdostartupconfig start_tdeinit start_tdeinit_wrapper +bin_PROGRAMS = tdeinit tdeinit_wrapper kshell tdeinit_shutdown lnusertemp kwrapper tdeioslave \ + tdestartupconfig tdedostartupconfig start_tdeinit start_tdeinit_wrapper lib_LTLIBRARIES = -tdeinit_LTLIBRARIES = klauncher.la +tdeinit_LTLIBRARIES = tdelauncher.la tdeinit_SOURCES = kinit.cpp setproctitle.cpp # NOTE: We link against all common libraries even if we don't need them ourselves. @@ -35,10 +35,10 @@ tdeinit_LDFLAGS = $(KDE_MT_LDFLAGS) $(QT_LDFLAGS) $(X_LDFLAGS) $(USER_LDFLAGS) \ $(KDE_RPATH) tdeinit_LDADD = $(LIB_KPARTS) -lXft $(LIB_QT) -kioslave_SOURCES = kioslave.cpp -kioslave_LDFLAGS = $(KDE_MT_LDFLAGS) $(QT_LDFLAGS) $(X_LDFLAGS) $(USER_LDFLAGS) \ +tdeioslave_SOURCES = tdeioslave.cpp +tdeioslave_LDFLAGS = $(KDE_MT_LDFLAGS) $(QT_LDFLAGS) $(X_LDFLAGS) $(USER_LDFLAGS) \ $(KDE_RPATH) -kioslave_LDADD = $(LIB_KIO) +tdeioslave_LDADD = $(LIB_KIO) tdeinit_wrapper_SOURCES = wrapper.c tdeinit_wrapper_LDADD = $(LIBSOCKET) @@ -55,16 +55,16 @@ lnusertemp_LDFLAGS = $(KDE_RPATH) kwrapper_SOURCES = kwrapper.c kwrapper_LDADD = $(LIBSOCKET) -klauncher_la_LDFLAGS = $(all_libraries) -module -avoid-version -klauncher_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_TDECORE) $(top_builddir)/dcop/libDCOP.la $(LIB_X11) -klauncher_la_SOURCES = klauncher.cpp klauncher_main.cpp autostart.cpp +tdelauncher_la_LDFLAGS = $(all_libraries) -module -avoid-version +tdelauncher_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_TDECORE) $(top_builddir)/dcop/libDCOP.la $(LIB_X11) +tdelauncher_la_SOURCES = tdelauncher.cpp tdelauncher_main.cpp autostart.cpp -kstartupconfig_SOURCES = kstartupconfig.cpp -kstartupconfig_LDADD = $(top_builddir)/tdecore/libtdefakes.la $(LIB_QT) -kdostartupconfig_SOURCES = kdostartupconfig.cpp -kdostartupconfig_LDFLAGS = $(KDE_MT_LDFLAGS) $(QT_LDFLAGS) $(X_LDFLAGS) $(USER_LDFLAGS) \ +tdestartupconfig_SOURCES = tdestartupconfig.cpp +tdestartupconfig_LDADD = $(top_builddir)/tdecore/libtdefakes.la $(LIB_QT) +tdedostartupconfig_SOURCES = tdedostartupconfig.cpp +tdedostartupconfig_LDFLAGS = $(KDE_MT_LDFLAGS) $(QT_LDFLAGS) $(X_LDFLAGS) $(USER_LDFLAGS) \ $(KDE_RPATH) -kdostartupconfig_LDADD = $(LIB_TDECORE) +tdedostartupconfig_LDADD = $(LIB_TDECORE) start_tdeinit_SOURCES = start_tdeinit.c tdeinitpath = $(bindir)/tdeinit @@ -75,7 +75,7 @@ start_tdeinit_wrapper_SOURCES = start_tdeinit_wrapper.c METASOURCES = AUTO -noinst_HEADERS = klauncher.h autostart.h klauncher_cmds.h setproctitle.h +noinst_HEADERS = tdelauncher.h autostart.h tdelauncher_cmds.h setproctitle.h kwrapper.o: wrapper.c diff --git a/kinit/README b/kinit/README index 97ce088cc..644efbaf6 100644 --- a/kinit/README +++ b/kinit/README @@ -33,7 +33,7 @@ Starting an application linked against libqt, libtdecore and libtdeui in the conventional way takes approx. 150ms on a Pentium III - 500Mhz. Starting the same application via tdeinit takes less than 10ms. -(application without KApplication constructor, the KApplication +(application without TDEApplication constructor, the TDEApplication constructor requires an extra 100ms in both cases) Memory Usage @@ -43,16 +43,16 @@ An application linked against libqt, libtdecore and libtdeui started in the conventional way requires about 498Kb memory. (average of 10 instances) If the same application is started via tdeinit it requires about 142Kb. A difference of 356Kb (application -without KApplication constructor) +without TDEApplication constructor) -If we take the KApplication constructor into account, an application +If we take the TDEApplication constructor into account, an application started in the conventional way takes about 679Kb memory while the same application started via tdeinit requires about 380Kb. Here the difference is somewhat less, 299Kb. This seems to be caused by the fact that the dynamic linker does "lazy linking". We can force the linker to link everything at startup by specifying "LD_BIND_NOW=true". When tdeinit is started with this option on, tdeinit is back to its full efficiency, an -application with a KApplication constructor now uses 338Kb of memory. +application with a TDEApplication constructor now uses 338Kb of memory. A difference of 341Kb with the normal case. Adapting programs to use tdeinit. diff --git a/kinit/README.DCOP b/kinit/README.DCOP index af5aff809..cd5ba983e 100644 --- a/kinit/README.DCOP +++ b/kinit/README.DCOP @@ -1,4 +1,4 @@ -"KLauncher" supports the following DCOP functions: +"TDELauncher" supports the following DCOP functions: /** * Starts a program. diff --git a/kinit/autostart.cpp b/kinit/autostart.cpp index c7feb1752..ccdbd3d97 100644 --- a/kinit/autostart.cpp +++ b/kinit/autostart.cpp @@ -22,9 +22,9 @@ #include "autostart.h" -#include <kconfig.h> +#include <tdeconfig.h> #include <kdesktopfile.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <stdlib.h> @@ -49,14 +49,14 @@ AutoStart::AutoStart( bool new_startup ) { m_startList = new AutoStartList; m_startList->setAutoDelete(true); - KGlobal::dirs()->addResourceType("autostart", "share/autostart"); + TDEGlobal::dirs()->addResourceType("autostart", "share/autostart"); TQString xdgdirs = getenv("XDG_CONFIG_DIRS"); if (xdgdirs.isEmpty()) xdgdirs = "/etc/xdg"; TQStringList xdgdirslist = TQStringList::split( ':', xdgdirs ); for ( TQStringList::Iterator itr = xdgdirslist.begin(); itr != xdgdirslist.end(); ++itr ) { - KGlobal::dirs()->addResourceDir("autostart", (*itr) +"/autostart"); + TDEGlobal::dirs()->addResourceDir("autostart", (*itr) +"/autostart"); } } @@ -102,7 +102,7 @@ static bool startCondition(const TQString &condition) if (list[0].isEmpty() || list[2].isEmpty()) return true; - KConfig config(list[0], true, false); + TDEConfig config(list[0], true, false); if (!list[1].isEmpty()) config.setGroup(list[1]); @@ -114,8 +114,8 @@ static bool startCondition(const TQString &condition) void AutoStart::loadAutoStartList() { - TQStringList files = KGlobal::dirs()->findAllResources("xdgconf-autostart", "*.desktop", false, true); - TQStringList kdefiles = KGlobal::dirs()->findAllResources("autostart", "*.desktop", false, true); + TQStringList files = TDEGlobal::dirs()->findAllResources("xdgconf-autostart", "*.desktop", false, true); + TQStringList kdefiles = TDEGlobal::dirs()->findAllResources("autostart", "*.desktop", false, true); files += kdefiles; for(TQStringList::ConstIterator it = files.begin(); @@ -143,7 +143,7 @@ AutoStart::loadAutoStartList() localit != files.end(); ++localit) { - if (((*localit).startsWith(KGlobal::dirs()->localxdgconfdir()) == true) || ((*localit).startsWith(KGlobal::dirs()->localtdedir()) == true)) { + if (((*localit).startsWith(TDEGlobal::dirs()->localxdgconfdir()) == true) || ((*localit).startsWith(TDEGlobal::dirs()->localtdedir()) == true)) { // Same local file name? TQString localOuter; TQString localInner; diff --git a/kinit/kinit.cpp b/kinit/kinit.cpp index 11fed9c34..1dc03002d 100644 --- a/kinit/kinit.cpp +++ b/kinit/kinit.cpp @@ -54,11 +54,11 @@ #include <tqfont.h> #include <kinstance.h> #include <kstandarddirs.h> -#include <kglobal.h> -#include <kconfig.h> +#include <tdeglobal.h> +#include <tdeconfig.h> #include <klibloader.h> -#include <kapplication.h> -#include <klocale.h> +#include <tdeapplication.h> +#include <tdelocale.h> #ifdef HAVE_SYS_PRCTL_H #include <sys/prctl.h> @@ -68,13 +68,13 @@ #endif #if defined Q_WS_X11 && ! defined K_WS_QTONLY -#include <kstartupinfo.h> // schroder +#include <tdestartupinfo.h> // schroder #endif #include <tdeversion.h> #include "ltdl.h" -#include "klauncher_cmds.h" +#include "tdelauncher_cmds.h" //#if defined Q_WS_X11 && ! defined K_WS_QTONLY #ifdef Q_WS_X11 @@ -113,7 +113,7 @@ static Display *X11display = 0; static int X11_startup_notify_fd = -1; static Display *X11_startup_notify_display = 0; #endif -static const KInstance *s_instance = 0; +static const TDEInstance *s_instance = 0; #define MAX_SOCK_FILE 255 static char sock_file[MAX_SOCK_FILE]; static char sock_file_old[MAX_SOCK_FILE]; @@ -166,12 +166,12 @@ int tdeinit_x_errhandler( Display *, XErrorEvent *err ); } #endif -/* These are to link libkparts even if 'smart' linker is used */ -#include <kparts/plugin.h> -extern "C" KParts::Plugin* _kinit_init_kparts() { return new KParts::Plugin(); } -/* These are to link libkio even if 'smart' linker is used */ -#include <kio/authinfo.h> -extern "C" KIO::AuthInfo* _kioslave_init_kio() { return new KIO::AuthInfo(); } +/* These are to link libtdeparts even if 'smart' linker is used */ +#include <tdeparts/plugin.h> +extern "C" KParts::Plugin* _kinit_init_tdeparts() { return new KParts::Plugin(); } +/* These are to link libtdeio even if 'smart' linker is used */ +#include <tdeio/authinfo.h> +extern "C" TDEIO::AuthInfo* _tdeioslave_init_kio() { return new TDEIO::AuthInfo(); } /* * Close fd's which are only useful for the parent process. @@ -318,7 +318,7 @@ const char* get_env_var( const char* var, int envc, const char* envs ) #if defined Q_WS_X11 && ! defined K_WS_QTONLY //#ifdef Q_WS_X11 // FIXME(E): Implement for Qt/Embedded -static void init_startup_info( KStartupInfoId& id, const char* bin, +static void init_startup_info( TDEStartupInfoId& id, const char* bin, int envc, const char* envs ) { const char* dpy = get_env_var( DISPLAY"=", envc, envs ); @@ -328,26 +328,26 @@ static void init_startup_info( KStartupInfoId& id, const char* bin, if( X11_startup_notify_display == NULL ) return; X11_startup_notify_fd = XConnectionNumber( X11_startup_notify_display ); - KStartupInfoData data; + TDEStartupInfoData data; int desktop = get_current_desktop( X11_startup_notify_display ); data.setDesktop( desktop ); data.setBin( bin ); - KStartupInfo::sendChangeX( X11_startup_notify_display, id, data ); + TDEStartupInfo::sendChangeX( X11_startup_notify_display, id, data ); XFlush( X11_startup_notify_display ); } -static void complete_startup_info( KStartupInfoId& id, pid_t pid ) +static void complete_startup_info( TDEStartupInfoId& id, pid_t pid ) { if( X11_startup_notify_display == NULL ) return; if( pid == 0 ) // failure - KStartupInfo::sendFinishX( X11_startup_notify_display, id ); + TDEStartupInfo::sendFinishX( X11_startup_notify_display, id ); else { - KStartupInfoData data; + TDEStartupInfoData data; data.addPid( pid ); data.setHostname(); - KStartupInfo::sendChangeX( X11_startup_notify_display, id, data ); + TDEStartupInfo::sendChangeX( X11_startup_notify_display, id, data ); } XCloseDisplay( X11_startup_notify_display ); X11_startup_notify_display = NULL; @@ -429,8 +429,8 @@ static pid_t launch(int argc, const char *_name, const char *args, TQCString name; TQCString exec; - if (strcmp(_name, "klauncher") == 0) { - /* klauncher is launched in a special way: + if (strcmp(_name, "tdelauncher") == 0) { + /* tdelauncher is launched in a special way: * It has a communication socket on LAUNCHER_FD */ if (0 > socketpair(AF_UNIX, SOCK_STREAM, 0, d.launcher)) @@ -482,7 +482,7 @@ static pid_t launch(int argc, const char *_name, const char *args, #if defined Q_WS_X11 && ! defined K_WS_QTONLY //#ifdef Q_WS_X11 - KStartupInfoId startup_id; + TDEStartupInfoId startup_id; startup_id.initId( startup_id_str ); if( !startup_id.none()) init_startup_info( startup_id, name, envc, envs ); @@ -551,7 +551,7 @@ static pid_t launch(int argc, const char *_name, const char *args, #if defined Q_WS_X11 && ! defined K_WS_QTONLY //#ifdef Q_WS_X11 if( startup_id.none()) - KStartupInfo::resetStartupEnv(); + TDEStartupInfo::resetStartupEnv(); else startup_id.setupStartupEnv(); #endif @@ -891,7 +891,7 @@ static void init_tdeinit_socket() if(connect(s, (struct sockaddr *)&server, socklen) == 0) { fprintf(stderr, "[tdeinit] Shutting down running client.\n"); - klauncher_header request_header; + tdelauncher_header request_header; request_header.cmd = LAUNCHER_TERMINATE_TDEINIT; request_header.arg_length = 0; write(s, &request_header, sizeof(request_header)); @@ -1074,9 +1074,9 @@ static void launcher_died() return; } - // KLauncher died... restart + // TDELauncher died... restart #ifndef NDEBUG - fprintf(stderr, "[tdeinit] KLauncher died unexpectedly.\n"); + fprintf(stderr, "[tdeinit] TDELauncher died unexpectedly.\n"); #endif // Make sure it's really dead. if (d.launcher_pid) @@ -1090,9 +1090,9 @@ static void launcher_died() close(d.launcher[0]); d.launcher[0] = -1; - pid_t pid = launch( 1, "klauncher", 0 ); + pid_t pid = launch( 1, "tdelauncher", 0 ); #ifndef NDEBUG - fprintf(stderr, "[tdeinit] Relaunching KLauncher, pid = %ld result = %d\n", (long) pid, d.result); + fprintf(stderr, "[tdeinit] Relaunching TDELauncher, pid = %ld result = %d\n", (long) pid, d.result); #endif } @@ -1105,7 +1105,7 @@ static void handle_launcher_request(int sock = -1) launcher = true; } - klauncher_header request_header; + tdelauncher_header request_header; char *request_data = 0L; int result = read_socket(sock, (char *) &request_header, sizeof(request_header)); if (result != 0) @@ -1141,7 +1141,7 @@ static void handle_launcher_request(int sock = -1) (request_header.cmd == LAUNCHER_EXEC_NEW))) { pid_t pid; - klauncher_header response_header; + tdelauncher_header response_header; long response_data; long l; memcpy( &l, request_data, sizeof( long )); @@ -1273,7 +1273,7 @@ static void handle_launcher_request(int sock = -1) #ifndef NDEBUG if (launcher) - fprintf(stderr, "[tdeinit] Got SETENV '%s=%s' from klauncher.\n", env_name, env_value); + fprintf(stderr, "[tdeinit] Got SETENV '%s=%s' from tdelauncher.\n", env_name, env_value); else fprintf(stderr, "[tdeinit] Got SETENV '%s=%s' from socket.\n", env_name, env_value); #endif @@ -1301,7 +1301,7 @@ static void handle_launcher_request(int sock = -1) else if (request_header.cmd == LAUNCHER_TERMINATE_TDEINIT) { #ifndef NDEBUG - fprintf(stderr,"[tdeinit] Killing tdeinit/klauncher.\n"); + fprintf(stderr,"[tdeinit] Killing tdeinit/tdelauncher.\n"); #endif if (d.launcher_pid) kill(d.launcher_pid, SIGTERM); @@ -1359,7 +1359,7 @@ static void handle_requests(pid_t waitForPid) if (d.launcher_pid) { // TODO send process died message - klauncher_header request_header; + tdelauncher_header request_header; long request_data[2]; request_header.cmd = LAUNCHER_DIED; request_header.arg_length = sizeof(long) * 2; @@ -1686,7 +1686,7 @@ int main(int argc, char **argv, char **envp) int i; pid_t pid; int launch_dcop = 1; - int launch_klauncher = 1; + int launch_tdelauncher = 1; int launch_kded = 1; int keep_running = 1; int new_startup = 0; @@ -1699,8 +1699,8 @@ int main(int argc, char **argv, char **envp) safe_argv[i] = strcpy((char*)malloc(strlen(argv[i])+1), argv[i]); if (strcmp(safe_argv[i], "--no-dcop") == 0) launch_dcop = 0; - if (strcmp(safe_argv[i], "--no-klauncher") == 0) - launch_klauncher = 0; + if (strcmp(safe_argv[i], "--no-tdelauncher") == 0) + launch_tdelauncher = 0; if (strcmp(safe_argv[i], "--no-kded") == 0) launch_kded = 0; if (strcmp(safe_argv[i], "--suicide") == 0) @@ -1717,7 +1717,7 @@ int main(int argc, char **argv, char **envp) { printf("Usage: tdeinit [options]\n"); // printf(" --no-dcop Do not start dcopserver\n"); - // printf(" --no-klauncher Do not start klauncher\n"); + // printf(" --no-tdelauncher Do not start tdelauncher\n"); printf(" --no-kded Do not start kded\n"); printf(" --suicide Terminate when no TDE applications are left running\n"); // printf(" --exit Terminate when kded has run\n"); @@ -1729,7 +1729,7 @@ int main(int argc, char **argv, char **envp) // Fork here and let parent process exit. // Parent process may only exit after all required services have been - // launched. (dcopserver/klauncher and services which start with '+') + // launched. (dcopserver/tdelauncher and services which start with '+') signal( SIGCHLD, secondary_child_handler); if (fork() > 0) // Go into background { @@ -1752,19 +1752,19 @@ int main(int argc, char **argv, char **envp) setsid(); /** Create our instance **/ - s_instance = new KInstance("tdeinit"); + s_instance = new TDEInstance("tdeinit"); /** Prepare to change process name **/ tdeinit_initsetproctitle(argc, argv, envp); tdeinit_library_path(); // Don't make our instance the global instance - // (do it only after tdeinit_library_path, that one indirectly uses KConfig, - // which seems to be buggy and always use KGlobal instead of the maching KInstance) - KGlobal::_instance = 0L; + // (do it only after tdeinit_library_path, that one indirectly uses TDEConfig, + // which seems to be buggy and always use TDEGlobal instead of the maching TDEInstance) + TDEGlobal::_instance = 0L; // don't change envvars before tdeinit_initsetproctitle() unsetenv("LD_BIND_NOW"); unsetenv("DYLD_BIND_AT_LAUNCH"); - KApplication::loadedByKdeinit = true; + TDEApplication::loadedByKdeinit = true; d.maxname = strlen(argv[0]); d.launcher_pid = 0; @@ -1812,16 +1812,16 @@ int main(int argc, char **argv, char **envp) (void) lt_dlopen(TQFile::encodeName(konq).data()); } #endif - if (launch_klauncher) + if (launch_tdelauncher) { if( new_startup ) - pid = launch( 2, "klauncher", "--new-startup" ); + pid = launch( 2, "tdelauncher", "--new-startup" ); else - pid = launch( 1, "klauncher", 0 ); + pid = launch( 1, "tdelauncher", 0 ); #ifndef NDEBUG - fprintf(stderr, "[tdeinit] Launched KLauncher, pid = %ld result = %d\n", (long) pid, d.result); + fprintf(stderr, "[tdeinit] Launched TDELauncher, pid = %ld result = %d\n", (long) pid, d.result); #endif - handle_requests(pid); // Wait for klauncher to be ready + handle_requests(pid); // Wait for tdelauncher to be ready } #if defined Q_WS_X11 && ! defined K_WS_QTONLY diff --git a/kinit/kdostartupconfig.cpp b/kinit/tdedostartupconfig.cpp index fceed88e2..bbfdf88a4 100644 --- a/kinit/kdostartupconfig.cpp +++ b/kinit/tdedostartupconfig.cpp @@ -24,13 +24,13 @@ DEALINGS IN THE SOFTWARE. #undef QT_NO_CAST_ASCII -// See description in kstartupconfig.cpp . +// See description in tdestartupconfig.cpp . #include <tqfile.h> #include <tqtextstream.h> #include <kinstance.h> #include <kstandarddirs.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kdebug.h> TQString get_entry( TQString* ll ) @@ -62,8 +62,8 @@ TQString get_entry( TQString* ll ) int main() { - KInstance inst( "kdostartupconfig" ); - kdDebug() << "Running kdostartupconfig." << endl; + TDEInstance inst( "tdedostartupconfig" ); + kdDebug() << "Running tdedostartupconfig." << endl; TQString keysname = locateLocal( "config", "startupconfigkeys" ); TQFile keys( keysname ); if( !keys.open( IO_ReadOnly )) @@ -95,7 +95,7 @@ int main() return 6; if( group.left( 1 ) == "[" && group.right( 1 ) == "]" ) { // whole config group - KConfig cfg( file ); + TDEConfig cfg( file ); group = group.mid( 1, group.length() - 2 ); TQMap< TQString, TQString > entries = cfg.entryMap( group ); startupconfig << "# " << line << "\n"; @@ -115,7 +115,7 @@ int main() { // a single key if( key.isEmpty()) return 7; - KConfig cfg( file ); + TDEConfig cfg( file ); cfg.setGroup( group ); TQString value = cfg.readEntry( key, def ); startupconfig << "# " << line << "\n"; @@ -126,13 +126,13 @@ int main() } startupconfigfiles << line << endl; // use even currently non-existing paths in $TDEDIRS - TQStringList dirs = TQStringList::split( KPATH_SEPARATOR, KGlobal::dirs()->kfsstnd_prefixes()); + TQStringList dirs = TQStringList::split( KPATH_SEPARATOR, TDEGlobal::dirs()->kfsstnd_prefixes()); for( TQStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it ) { TQString cfg = *it + "share/config/" + file; - if( KStandardDirs::exists( cfg )) + if( TDEStandardDirs::exists( cfg )) startupconfigfiles << cfg << "\n"; else startupconfigfiles << "!" << cfg << "\n"; diff --git a/kinit/kioslave.cpp b/kinit/tdeioslave.cpp index f132abb0d..1690ca2f7 100644 --- a/kinit/kioslave.cpp +++ b/kinit/tdeioslave.cpp @@ -47,15 +47,15 @@ # endif #endif -/* These are to link libkio even if 'smart' linker is used */ -#include <kio/authinfo.h> -extern "C" KIO::AuthInfo* _kioslave_init_kio() { return new KIO::AuthInfo(); } +/* These are to link libtdeio even if 'smart' linker is used */ +#include <tdeio/authinfo.h> +extern "C" TDEIO::AuthInfo* _tdeioslave_init_kio() { return new TDEIO::AuthInfo(); } int main(int argc, char **argv) { if (argc < 5) { - fprintf(stderr, "Usage: kioslave <slave-lib> <protocol> <klauncher-socket> <app-socket>\n\nThis program is part of TDE.\n"); + fprintf(stderr, "Usage: tdeioslave <slave-lib> <protocol> <tdelauncher-socket> <app-socket>\n\nThis program is part of TDE.\n"); exit(1); } TQCString libpath = argv[1]; diff --git a/kinit/klauncher.cpp b/kinit/tdelauncher.cpp index 2d706e36b..f7ca08678 100644 --- a/kinit/klauncher.cpp +++ b/kinit/tdelauncher.cpp @@ -29,28 +29,28 @@ #include <tqfile.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kdebug.h> #include <klibloader.h> -#include <klocale.h> -#include <kprotocolmanager.h> +#include <tdelocale.h> +#include <tdeprotocolmanager.h> #include <kprotocolinfo.h> #include <krun.h> #include <kstandarddirs.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <kurl.h> #if defined Q_WS_X11 && ! defined K_WS_QTONLY -#include <kstartupinfo.h> // schroder +#include <tdestartupinfo.h> // schroder #endif -#include "kio/global.h" -#include "kio/connection.h" -#include "kio/slaveinterface.h" +#include "tdeio/global.h" +#include "tdeio/connection.h" +#include "tdeio/slaveinterface.h" -#include "klauncher.h" -#include "klauncher_cmds.h" +#include "tdelauncher.h" +#include "tdelauncher_cmds.h" //#if defined Q_WS_X11 && ! defined K_WS_QTONLY #ifdef Q_WS_X11 @@ -61,12 +61,12 @@ // Dispose slaves after being idle for SLAVE_MAX_IDLE seconds #define SLAVE_MAX_IDLE 30 -using namespace KIO; +using namespace TDEIO; -template class TQPtrList<KLaunchRequest>; +template class TQPtrList<TDELaunchRequest>; template class TQPtrList<IdleSlave>; -IdleSlave::IdleSlave(KSocket *socket) +IdleSlave::IdleSlave(TDESocket *socket) { mConn.init(socket); mConn.connect(this, TQT_SLOT(gotInput())); @@ -162,10 +162,10 @@ IdleSlave::age(time_t now) return (int) difftime(now, mBirthDate); } -KLauncher::KLauncher(int _tdeinitSocket, bool new_startup) -// : KApplication( false, false ), // No Styles, No GUI - : KApplication( false, true ), // TQClipboard tries to construct a QWidget so a GUI is technically needed, even though it is not used - DCOPObject("klauncher"), +TDELauncher::TDELauncher(int _tdeinitSocket, bool new_startup) +// : TDEApplication( false, false ), // No Styles, No GUI + : TDEApplication( false, true ), // TQClipboard tries to construct a QWidget so a GUI is technically needed, even though it is not used + DCOPObject("tdelauncher"), tdeinitSocket(_tdeinitSocket), mAutoStart( new_startup ), dontBlockReading(false), newStartup( new_startup ) { @@ -181,12 +181,12 @@ KLauncher::KLauncher(int _tdeinitSocket, bool new_startup) dcopClient()->connectDCOPSignal( "DCOPServer", "", "terminateKDE()", objId(), "terminateKDE()", false ); - TQString prefix = locateLocal("socket", "klauncher"); + TQString prefix = locateLocal("socket", "tdelauncher"); KTempFile domainname(prefix, TQString::fromLatin1(".slave-socket")); if (domainname.status() != 0) { // Sever error! - tqDebug("KLauncher: Fatal error, can't create tempfile!"); + tqDebug("TDELauncher: Fatal error, can't create tempfile!"); ::exit(1); } mPoolSocketName = domainname.name(); @@ -194,9 +194,9 @@ KLauncher::KLauncher(int _tdeinitSocket, bool new_startup) domainname.close(); domainname.unlink(); #endif - mPoolSocket = new KServerSocket(static_cast<const char*>(TQFile::encodeName(mPoolSocketName))); - connect(mPoolSocket, TQT_SIGNAL(accepted( KSocket *)), - TQT_SLOT(acceptSlave(KSocket *))); + mPoolSocket = new TDEServerSocket(static_cast<const char*>(TQFile::encodeName(mPoolSocketName))); + connect(mPoolSocket, TQT_SIGNAL(accepted( TDESocket *)), + TQT_SLOT(acceptSlave(TDESocket *))); connect(&mTimer, TQT_SIGNAL(timeout()), TQT_SLOT(idleTimeout())); @@ -218,18 +218,18 @@ KLauncher::KLauncher(int _tdeinitSocket, bool new_startup) mSlaveValgrindSkin = getenv("TDE_SLAVE_VALGRIND_SKIN"); tqWarning("Klauncher running slaves through valgrind for slaves of protocol '%s'", mSlaveValgrind.data()); } - klauncher_header request_header; + tdelauncher_header request_header; request_header.cmd = LAUNCHER_OK; request_header.arg_length = 0; write(tdeinitSocket, &request_header, sizeof(request_header)); } -KLauncher::~KLauncher() +TDELauncher::~TDELauncher() { close(); } -void KLauncher::close() +void TDELauncher::close() { if (!mPoolSocketName.isEmpty()) { @@ -244,15 +244,15 @@ void KLauncher::close() } void -KLauncher::destruct(int exit_code) +TDELauncher::destruct(int exit_code) { - if (kapp) ((KLauncher*)kapp)->close(); + if (kapp) ((TDELauncher*)kapp)->close(); // We don't delete kapp here, that's intentional. ::exit(exit_code); } bool -KLauncher::process(const TQCString &fun, const TQByteArray &data, +TDELauncher::process(const TQCString &fun, const TQByteArray &data, TQCString &replyType, TQByteArray &replyData) { if ((fun == "exec_blind(TQCString,TQValueList<TQCString>)") @@ -267,7 +267,7 @@ KLauncher::process(const TQCString &fun, const TQByteArray &data, stream >> name >> arg_list; if( fun == "exec_blind(TQCString,TQValueList<TQCString>,TQValueList<TQCString>,TQCString)" ) stream >> envs >> startup_id; - kdDebug(7016) << "KLauncher: Got exec_blind('" << name << "', ...)" << endl; + kdDebug(7016) << "TDELauncher: Got exec_blind('" << name << "', ...)" << endl; exec_blind( name, arg_list, envs, startup_id); return true; } @@ -315,29 +315,29 @@ KLauncher::process(const TQCString &fun, const TQByteArray &data, bool finished; if (strncmp(fun, "start_service_by_name(", 22) == 0) { - kdDebug(7016) << "KLauncher: Got start_service_by_name('" << serviceName << "', ...)" << endl; + kdDebug(7016) << "TDELauncher: Got start_service_by_name('" << serviceName << "', ...)" << endl; finished = start_service_by_name(serviceName, urls, envs, startup_id, bNoWait); } else if (strncmp(fun, "start_service_by_desktop_path(", 30) == 0) { - kdDebug(7016) << "KLauncher: Got start_service_by_desktop_path('" << serviceName << "', ...)" << endl; + kdDebug(7016) << "TDELauncher: Got start_service_by_desktop_path('" << serviceName << "', ...)" << endl; finished = start_service_by_desktop_path(serviceName, urls, envs, startup_id, bNoWait); } else if (strncmp(fun, "start_service_by_desktop_name(", 30) == 0) { - kdDebug(7016) << "KLauncher: Got start_service_by_desktop_name('" << serviceName << "', ...)" << endl; + kdDebug(7016) << "TDELauncher: Got start_service_by_desktop_name('" << serviceName << "', ...)" << endl; finished = start_service_by_desktop_name(serviceName, urls, envs, startup_id, bNoWait ); } else if ((fun == "tdeinit_exec(TQString,TQStringList)") || (fun == "tdeinit_exec(TQString,TQStringList,TQValueList<TQCString>)") || (fun == "tdeinit_exec(TQString,TQStringList,TQValueList<TQCString>,TQCString)")) { - kdDebug(7016) << "KLauncher: Got tdeinit_exec('" << serviceName << "', ...)" << endl; + kdDebug(7016) << "TDELauncher: Got tdeinit_exec('" << serviceName << "', ...)" << endl; finished = tdeinit_exec(serviceName, urls, envs, startup_id, false); } else { - kdDebug(7016) << "KLauncher: Got tdeinit_exec_wait('" << serviceName << "', ...)" << endl; + kdDebug(7016) << "TDELauncher: Got tdeinit_exec_wait('" << serviceName << "', ...)" << endl; finished = tdeinit_exec(serviceName, urls, envs, startup_id, true); } if (!finished) @@ -396,8 +396,8 @@ KLauncher::process(const TQCString &fun, const TQByteArray &data, } else if (fun == "reparseConfiguration()") { - KGlobal::config()->reparseConfiguration(); - kdDebug(7016) << "KLauncher::process : reparseConfiguration" << endl; + TDEGlobal::config()->reparseConfiguration(); + kdDebug(7016) << "TDELauncher::process : reparseConfiguration" << endl; KProtocolManager::reparseConfiguration(); IdleSlave *slave; for(slave = mSlaveList.first(); slave; slave = mSlaveList.next()) @@ -409,8 +409,8 @@ KLauncher::process(const TQCString &fun, const TQByteArray &data, { ::signal( SIGHUP, SIG_IGN); ::signal( SIGTERM, SIG_IGN); - kdDebug() << "KLauncher::process ---> terminateKDE" << endl; - klauncher_header request_header; + kdDebug() << "TDELauncher::process ---> terminateKDE" << endl; + tdelauncher_header request_header; request_header.cmd = LAUNCHER_TERMINATE_KDE; request_header.arg_length = 0; write(tdeinitSocket, &request_header, sizeof(request_header)); @@ -418,14 +418,14 @@ KLauncher::process(const TQCString &fun, const TQByteArray &data, } else if (fun == "autoStart()") { - kdDebug() << "KLauncher::process ---> autoStart" << endl; + kdDebug() << "TDELauncher::process ---> autoStart" << endl; autoStart(1); replyType = "void"; return true; } else if (fun == "autoStart(int)") { - kdDebug() << "KLauncher::process ---> autoStart(int)" << endl; + kdDebug() << "TDELauncher::process ---> autoStart(int)" << endl; TQDataStream stream(data, IO_ReadOnly); int phase; stream >> phase; @@ -443,15 +443,15 @@ KLauncher::process(const TQCString &fun, const TQByteArray &data, } QCStringList -KLauncher::interfaces() +TDELauncher::interfaces() { QCStringList ifaces = DCOPObject::interfaces(); - ifaces += "KLauncher"; + ifaces += "TDELauncher"; return ifaces; } QCStringList -KLauncher::functions() +TDELauncher::functions() { QCStringList funcs = DCOPObject::functions(); funcs << "void exec_blind(TQCString,TQValueList<TQCString>)"; @@ -480,12 +480,12 @@ KLauncher::functions() return funcs; } -void KLauncher::setLaunchEnv(const TQCString &name, const TQCString &_value) +void TDELauncher::setLaunchEnv(const TQCString &name, const TQCString &_value) { TQCString value(_value); if (value.isNull()) value = ""; - klauncher_header request_header; + tdelauncher_header request_header; TQByteArray requestData(name.length()+value.length()+2); memcpy(requestData.data(), name.data(), name.length()+1); memcpy(requestData.data()+name.length()+1, value.data(), value.length()+1); @@ -522,9 +522,9 @@ read_socket(int sock, char *buffer, int len) void -KLauncher::slotKDEInitData(int) +TDELauncher::slotKDEInitData(int) { - klauncher_header request_header; + tdelauncher_header request_header; TQByteArray requestData; if( dontBlockReading ) { @@ -572,25 +572,25 @@ KLauncher::slotKDEInitData(int) { case KService::DCOP_None: { - lastRequest->status = KLaunchRequest::Running; + lastRequest->status = TDELaunchRequest::Running; break; } case KService::DCOP_Unique: { - lastRequest->status = KLaunchRequest::Launching; + lastRequest->status = TDELaunchRequest::Launching; break; } case KService::DCOP_Wait: { - lastRequest->status = KLaunchRequest::Launching; + lastRequest->status = TDELaunchRequest::Launching; break; } case KService::DCOP_Multi: { - lastRequest->status = KLaunchRequest::Launching; + lastRequest->status = TDELaunchRequest::Launching; break; } } @@ -599,7 +599,7 @@ KLauncher::slotKDEInitData(int) } if (lastRequest && (request_header.cmd == LAUNCHER_ERROR)) { - lastRequest->status = KLaunchRequest::Error; + lastRequest->status = TDELaunchRequest::Error; if (!requestData.isEmpty()) lastRequest->errorMsg = TQString::fromUtf8((char *) requestData.data()); lastRequest = 0; @@ -611,20 +611,20 @@ KLauncher::slotKDEInitData(int) } void -KLauncher::processDied(pid_t pid, long /* exitStatus */) +TDELauncher::processDied(pid_t pid, long /* exitStatus */) { - KLaunchRequest *request = requestList.first(); + TDELaunchRequest *request = requestList.first(); for(; request; request = requestList.next()) { if (request->pid == pid) { if (request->dcop_service_type == KService::DCOP_Wait) - request->status = KLaunchRequest::Done; + request->status = TDELaunchRequest::Done; else if ((request->dcop_service_type == KService::DCOP_Unique) && (dcopClient()->isApplicationRegistered(request->dcop_name))) - request->status = KLaunchRequest::Running; + request->status = TDELaunchRequest::Running; else - request->status = KLaunchRequest::Error; + request->status = TDELaunchRequest::Error; requestDone(request); return; } @@ -632,17 +632,17 @@ KLauncher::processDied(pid_t pid, long /* exitStatus */) } void -KLauncher::slotAppRegistered(const TQCString &appId) +TDELauncher::slotAppRegistered(const TQCString &appId) { const char *cAppId = appId.data(); if (!cAppId) return; - KLaunchRequest *request = requestList.first(); - KLaunchRequest *nextRequest; + TDELaunchRequest *request = requestList.first(); + TDELaunchRequest *nextRequest; for(; request; request = nextRequest) { nextRequest = requestList.next(); - if (request->status != KLaunchRequest::Launching) + if (request->status != TDELaunchRequest::Launching) continue; // For unique services check the requested service name first @@ -650,7 +650,7 @@ KLauncher::slotAppRegistered(const TQCString &appId) ((appId == request->dcop_name) || dcopClient()->isApplicationRegistered(request->dcop_name))) { - request->status = KLaunchRequest::Running; + request->status = TDELaunchRequest::Running; requestDone(request); continue; } @@ -663,7 +663,7 @@ KLauncher::slotAppRegistered(const TQCString &appId) ((cAppId[l] == '\0') || (cAppId[l] == '-'))) { request->dcop_name = appId; - request->status = KLaunchRequest::Running; + request->status = TDELaunchRequest::Running; requestDone(request); continue; } @@ -671,7 +671,7 @@ KLauncher::slotAppRegistered(const TQCString &appId) } void -KLauncher::autoStart(int phase) +TDELauncher::autoStart(int phase) { if( mAutoStart.phase() >= phase ) return; @@ -690,7 +690,7 @@ KLauncher::autoStart(int phase) } void -KLauncher::slotAutoStart() +TDELauncher::slotAutoStart() { KService::Ptr s; do @@ -727,10 +727,10 @@ KLauncher::slotAutoStart() } void -KLauncher::requestDone(KLaunchRequest *request) +TDELauncher::requestDone(TDELaunchRequest *request) { - if ((request->status == KLaunchRequest::Running) || - (request->status == KLaunchRequest::Done)) + if ((request->status == TDELaunchRequest::Running) || + (request->status == TDELaunchRequest::Done)) { DCOPresult.result = 0; DCOPresult.dcopName = request->dcop_name; @@ -758,9 +758,9 @@ KLauncher::requestDone(KLaunchRequest *request) dpy = XOpenDisplay( request->startup_dpy ); if( dpy ) { - KStartupInfoId id; + TDEStartupInfoId id; id.initId( request->startup_id ); - KStartupInfo::sendFinishX( dpy, id ); + TDEStartupInfo::sendFinishX( dpy, id ); if( mCached_dpy != dpy && mCached_dpy != NULL ) XCloseDisplay( mCached_dpy ); mCached_dpy = dpy; @@ -788,11 +788,11 @@ KLauncher::requestDone(KLaunchRequest *request) } void -KLauncher::requestStart(KLaunchRequest *request) +TDELauncher::requestStart(TDELaunchRequest *request) { requestList.append( request ); // Send request to tdeinit. - klauncher_header request_header; + tdelauncher_header request_header; TQByteArray requestData; int length = 0; length += sizeof(long); // Nr of. Args @@ -879,17 +879,17 @@ KLauncher::requestStart(KLaunchRequest *request) } void -KLauncher::exec_blind( const TQCString &name, const TQValueList<TQCString> &arg_list, +TDELauncher::exec_blind( const TQCString &name, const TQValueList<TQCString> &arg_list, const TQValueList<TQCString> &envs, const TQCString& startup_id ) { - KLaunchRequest *request = new KLaunchRequest; + TDELaunchRequest *request = new TDELaunchRequest; request->autoStart = false; request->name = name; request->arg_list = arg_list; request->dcop_name = 0; request->dcop_service_type = KService::DCOP_None; request->pid = 0; - request->status = KLaunchRequest::Launching; + request->status = TDELaunchRequest::Launching; request->transaction = 0; // No confirmation is send request->envs = envs; // Find service, if any - strip path if needed @@ -907,7 +907,7 @@ KLauncher::exec_blind( const TQCString &name, const TQValueList<TQCString> &arg_ bool -KLauncher::start_service_by_name(const TQString &serviceName, const TQStringList &urls, +TDELauncher::start_service_by_name(const TQString &serviceName, const TQStringList &urls, const TQValueList<TQCString> &envs, const TQCString& startup_id, bool blind) { KService::Ptr service = 0; @@ -924,7 +924,7 @@ KLauncher::start_service_by_name(const TQString &serviceName, const TQStringList } bool -KLauncher::start_service_by_desktop_path(const TQString &serviceName, const TQStringList &urls, +TDELauncher::start_service_by_desktop_path(const TQString &serviceName, const TQStringList &urls, const TQValueList<TQCString> &envs, const TQCString& startup_id, bool blind) { KService::Ptr service = 0; @@ -949,7 +949,7 @@ KLauncher::start_service_by_desktop_path(const TQString &serviceName, const TQSt } bool -KLauncher::start_service_by_desktop_name(const TQString &serviceName, const TQStringList &urls, +TDELauncher::start_service_by_desktop_name(const TQString &serviceName, const TQStringList &urls, const TQValueList<TQCString> &envs, const TQCString& startup_id, bool blind) { KService::Ptr service = 0; @@ -966,7 +966,7 @@ KLauncher::start_service_by_desktop_name(const TQString &serviceName, const TQSt } bool -KLauncher::start_service(KService::Ptr service, const TQStringList &_urls, +TDELauncher::start_service(KService::Ptr service, const TQStringList &_urls, const TQValueList<TQCString> &envs, const TQCString& startup_id, bool blind, bool autoStart) { TQStringList urls = _urls; @@ -977,7 +977,7 @@ KLauncher::start_service(KService::Ptr service, const TQStringList &_urls, cancel_service_startup_info( NULL, startup_id, envs ); // cancel it if any return false; } - KLaunchRequest *request = new KLaunchRequest; + TDELaunchRequest *request = new TDELaunchRequest; request->autoStart = autoStart; if ((urls.count() > 1) && !service->allowMultipleFiles()) @@ -1047,11 +1047,11 @@ KLauncher::start_service(KService::Ptr service, const TQStringList &_urls, } void -KLauncher::send_service_startup_info( KLaunchRequest *request, KService::Ptr service, const TQCString& startup_id, +TDELauncher::send_service_startup_info( TDELaunchRequest *request, KService::Ptr service, const TQCString& startup_id, const TQValueList<TQCString> &envs ) { #if defined Q_WS_X11 && ! defined K_WS_QTONLY -//#ifdef Q_WS_X11 // KStartup* isn't implemented for Qt/Embedded yet +//#ifdef Q_WS_X11 // TDEStartup* isn't implemented for Qt/Embedded yet request->startup_id = "0"; if( startup_id == "0" ) return; @@ -1059,7 +1059,7 @@ KLauncher::send_service_startup_info( KLaunchRequest *request, KService::Ptr ser TQCString wmclass; if( !KRun::checkStartupNotify( TQString::null, service, &silent, &wmclass )) return; - KStartupInfoId id; + TDEStartupInfoId id; id.initId( startup_id ); const char* dpy_str = NULL; for( TQValueList<TQCString>::ConstIterator it = envs.begin(); @@ -1082,16 +1082,16 @@ KLauncher::send_service_startup_info( KLaunchRequest *request, KService::Ptr ser request->startup_dpy = dpy_str; - KStartupInfoData data; + TDEStartupInfoData data; data.setName( service->name()); data.setIcon( service->icon()); data.setDescription( i18n( "Launching %1" ).arg( service->name())); if( !wmclass.isEmpty()) data.setWMClass( wmclass ); if( silent ) - data.setSilent( KStartupInfoData::Yes ); + data.setSilent( TDEStartupInfoData::Yes ); // the rest will be sent by tdeinit - KStartupInfo::sendStartupX( dpy, id, data ); + TDEStartupInfo::sendStartupX( dpy, id, data ); if( mCached_dpy != dpy && mCached_dpy != NULL ) XCloseDisplay( mCached_dpy ); mCached_dpy = dpy; @@ -1102,11 +1102,11 @@ KLauncher::send_service_startup_info( KLaunchRequest *request, KService::Ptr ser } void -KLauncher::cancel_service_startup_info( KLaunchRequest* request, const TQCString& startup_id, +TDELauncher::cancel_service_startup_info( TDELaunchRequest* request, const TQCString& startup_id, const TQValueList<TQCString> &envs ) { #if defined Q_WS_X11 && ! defined K_WS_QTONLY -//#ifdef Q_WS_X11 // KStartup* isn't implemented for Qt/Embedded yet +//#ifdef Q_WS_X11 // TDEStartup* isn't implemented for Qt/Embedded yet if( request != NULL ) request->startup_id = "0"; if( !startup_id.isEmpty() && startup_id != "0" ) @@ -1125,9 +1125,9 @@ KLauncher::cancel_service_startup_info( KLaunchRequest* request, const TQCString dpy = XOpenDisplay( dpy_str ); if( dpy == NULL ) return; - KStartupInfoId id; + TDEStartupInfoId id; id.initId( startup_id ); - KStartupInfo::sendFinishX( dpy, id ); + TDEStartupInfo::sendFinishX( dpy, id ); if( mCached_dpy != dpy && mCached_dpy != NULL ) XCloseDisplay( mCached_dpy ); mCached_dpy = dpy; @@ -1136,10 +1136,10 @@ KLauncher::cancel_service_startup_info( KLaunchRequest* request, const TQCString } bool -KLauncher::tdeinit_exec(const TQString &app, const TQStringList &args, +TDELauncher::tdeinit_exec(const TQString &app, const TQStringList &args, const TQValueList<TQCString> &envs, TQCString startup_id, bool wait) { - KLaunchRequest *request = new KLaunchRequest; + TDELaunchRequest *request = new TDELaunchRequest; request->autoStart = false; for(TQStringList::ConstIterator it = args.begin(); @@ -1162,7 +1162,7 @@ KLauncher::tdeinit_exec(const TQString &app, const TQStringList &args, request->startup_id = startup_id; #endif request->envs = envs; - if( app != "kbuildsycoca" ) // avoid stupid loop + if( app != "tdebuildsycoca" ) // avoid stupid loop { // Find service, if any - strip path if needed KService::Ptr service = KService::serviceByDesktopName( app.mid( app.findRev( '/' ) + 1 )); @@ -1178,7 +1178,7 @@ KLauncher::tdeinit_exec(const TQString &app, const TQStringList &args, } void -KLauncher::queueRequest(KLaunchRequest *request) +TDELauncher::queueRequest(TDELaunchRequest *request) { requestQueue.append( request ); if (!bProcessingQueue) @@ -1189,14 +1189,14 @@ KLauncher::queueRequest(KLaunchRequest *request) } void -KLauncher::slotDequeue() +TDELauncher::slotDequeue() { do { - KLaunchRequest *request = requestQueue.take(0); + TDELaunchRequest *request = requestQueue.take(0); // process request - request->status = KLaunchRequest::Launching; + request->status = TDELaunchRequest::Launching; requestStart(request); - if (request->status != KLaunchRequest::Launching) + if (request->status != TDELaunchRequest::Launching) { // Request handled. requestDone( request ); @@ -1207,7 +1207,7 @@ KLauncher::slotDequeue() } void -KLauncher::createArgs( KLaunchRequest *request, const KService::Ptr service , +TDELauncher::createArgs( TDELaunchRequest *request, const KService::Ptr service , const TQStringList &urls) { TQStringList params = KRun::processDesktopExec(*service, urls, false); @@ -1223,7 +1223,7 @@ KLauncher::createArgs( KLaunchRequest *request, const KService::Ptr service , ///// IO-Slave functions pid_t -KLauncher::requestHoldSlave(const KURL &url, const TQString &app_socket) +TDELauncher::requestHoldSlave(const KURL &url, const TQString &app_socket) { IdleSlave *slave; for(slave = mSlaveList.first(); slave; slave = mSlaveList.next()) @@ -1242,7 +1242,7 @@ KLauncher::requestHoldSlave(const KURL &url, const TQString &app_socket) pid_t -KLauncher::requestSlave(const TQString &protocol, +TDELauncher::requestSlave(const TQString &protocol, const TQString &host, const TQString &app_socket, TQString &error) @@ -1283,7 +1283,7 @@ KLauncher::requestSlave(const TQString &protocol, return 0; } - TQCString name = _name.latin1(); // ex: "kio_ftp" + TQCString name = _name.latin1(); // ex: "tdeio_ftp" TQCString arg1 = protocol.latin1(); TQCString arg2 = TQFile::encodeName(mPoolSocketName); TQCString arg3 = TQFile::encodeName(app_socket); @@ -1292,10 +1292,10 @@ KLauncher::requestSlave(const TQString &protocol, arg_list.append(arg2); arg_list.append(arg3); -// kdDebug(7016) << "KLauncher: launching new slave " << _name << " with protocol=" << protocol << endl; +// kdDebug(7016) << "TDELauncher: launching new slave " << _name << " with protocol=" << protocol << endl; if (mSlaveDebug == arg1) { - klauncher_header request_header; + tdelauncher_header request_header; request_header.cmd = LAUNCHER_DEBUG_WAIT; request_header.arg_length = 0; write(tdeinitSocket, &request_header, sizeof(request_header)); @@ -1303,7 +1303,7 @@ KLauncher::requestSlave(const TQString &protocol, if (mSlaveValgrind == arg1) { arg_list.prepend(TQFile::encodeName(KLibLoader::findLibrary(name))); - arg_list.prepend(TQFile::encodeName(locate("exe", "kioslave"))); + arg_list.prepend(TQFile::encodeName(locate("exe", "tdeioslave"))); name = "valgrind"; if (!mSlaveValgrindSkin.isEmpty()) { arg_list.prepend(TQCString("--tool=") + mSlaveValgrindSkin); @@ -1311,7 +1311,7 @@ KLauncher::requestSlave(const TQString &protocol, arg_list.prepend("--tool=memcheck"); } - KLaunchRequest *request = new KLaunchRequest; + TDELaunchRequest *request = new TDELaunchRequest; request->autoStart = false; request->name = name; request->arg_list = arg_list; @@ -1321,7 +1321,7 @@ KLauncher::requestSlave(const TQString &protocol, #ifdef Q_WS_X11 request->startup_id = "0"; #endif - request->status = KLaunchRequest::Launching; + request->status = TDELaunchRequest::Launching; request->transaction = 0; // No confirmation is send requestStart(request); pid_t pid = request->pid; @@ -1338,7 +1338,7 @@ KLauncher::requestSlave(const TQString &protocol, } void -KLauncher::waitForSlave(pid_t pid) +TDELauncher::waitForSlave(pid_t pid) { IdleSlave *slave; for(slave = mSlaveList.first(); slave; slave = mSlaveList.next()) @@ -1353,7 +1353,7 @@ KLauncher::waitForSlave(pid_t pid) } void -KLauncher::acceptSlave(KSocket *slaveSocket) +TDELauncher::acceptSlave(TDESocket *slaveSocket) { IdleSlave *slave = new IdleSlave(slaveSocket); // Send it a SLAVE_STATUS command. @@ -1368,7 +1368,7 @@ KLauncher::acceptSlave(KSocket *slaveSocket) } void -KLauncher::slotSlaveStatus(IdleSlave *slave) +TDELauncher::slotSlaveStatus(IdleSlave *slave) { SlaveWaitRequest *waitRequest = mSlaveWaitRequest.first(); while(waitRequest) @@ -1390,7 +1390,7 @@ KLauncher::slotSlaveStatus(IdleSlave *slave) } void -KLauncher::slotSlaveGone() +TDELauncher::slotSlaveGone() { IdleSlave *slave = (IdleSlave *) sender(); mSlaveList.removeRef(slave); @@ -1401,7 +1401,7 @@ KLauncher::slotSlaveGone() } void -KLauncher::idleTimeout() +TDELauncher::idleTimeout() { bool keepOneFileSlave=true; time_t now = time(0); @@ -1418,4 +1418,4 @@ KLauncher::idleTimeout() } } -#include "klauncher.moc" +#include "tdelauncher.moc" diff --git a/kinit/klauncher.h b/kinit/tdelauncher.h index 763d20e53..791958980 100644 --- a/kinit/klauncher.h +++ b/kinit/tdelauncher.h @@ -30,7 +30,7 @@ #include <tqtimer.h> #include <dcopclient.h> -#include <kio/connection.h> +#include <tdeio/connection.h> #include <ksock.h> #include <kurl.h> #include <kuniqueapplication.h> @@ -43,7 +43,7 @@ class IdleSlave : public TQObject { Q_OBJECT public: - IdleSlave(KSocket *socket); + IdleSlave(TDESocket *socket); bool match( const TQString &protocol, const TQString &host, bool connected); void connect( const TQString &app_socket); pid_t pid() const { return mPid;} @@ -59,7 +59,7 @@ protected slots: void gotInput(); protected: - KIO::Connection mConn; + TDEIO::Connection mConn; TQString mProtocol; TQString mHost; bool mConnected; @@ -76,7 +76,7 @@ public: DCOPClientTransaction *transaction; }; -class KLaunchRequest +class TDELaunchRequest { public: TQCString name; @@ -105,14 +105,14 @@ struct serviceResult pid_t pid; }; -class KLauncher : public KApplication, public DCOPObject +class TDELauncher : public TDEApplication, public DCOPObject { Q_OBJECT public: - KLauncher(int _tdeinitSocket, bool new_startup); + TDELauncher(int _tdeinitSocket, bool new_startup); - ~KLauncher(); + ~TDELauncher(); void close(); static void destruct(int exit_code); // exit! @@ -126,8 +126,8 @@ public: protected: void processDied(pid_t pid, long exitStatus); - void requestStart(KLaunchRequest *request); - void requestDone(KLaunchRequest *request); + void requestStart(TDELaunchRequest *request); + void requestDone(TDELaunchRequest *request); void setLaunchEnv(const TQCString &name, const TQCString &value); void exec_blind(const TQCString &name, const TQValueList<TQCString> &arg_list, @@ -148,7 +148,7 @@ protected: void autoStart(int phase); - void createArgs( KLaunchRequest *request, const KService::Ptr service, + void createArgs( TDELaunchRequest *request, const KService::Ptr service, const TQStringList &url); pid_t requestHoldSlave(const KURL &url, const TQString &app_socket); @@ -156,11 +156,11 @@ protected: const TQString &app_socket, TQString &error); - void queueRequest(KLaunchRequest *); + void queueRequest(TDELaunchRequest *); - void send_service_startup_info( KLaunchRequest *request, KService::Ptr service, const TQCString& startup_id, + void send_service_startup_info( TDELaunchRequest *request, KService::Ptr service, const TQCString& startup_id, const TQValueList<TQCString> &envs ); - void cancel_service_startup_info( KLaunchRequest *request, const TQCString& startup_id, + void cancel_service_startup_info( TDELaunchRequest *request, const TQCString& startup_id, const TQValueList<TQCString> &envs ); public slots: @@ -169,20 +169,20 @@ public slots: void slotKDEInitData(int); void slotAppRegistered(const TQCString &appId); void slotSlaveStatus(IdleSlave *); - void acceptSlave( KSocket *); + void acceptSlave( TDESocket *); void slotSlaveGone(); void idleTimeout(); protected: - TQPtrList<KLaunchRequest> requestList; // Requests being handled - TQPtrList<KLaunchRequest> requestQueue; // Requests waiting to being handled + TQPtrList<TDELaunchRequest> requestList; // Requests being handled + TQPtrList<TDELaunchRequest> requestQueue; // Requests waiting to being handled int tdeinitSocket; TQSocketNotifier *tdeinitNotifier; serviceResult DCOPresult; - KLaunchRequest *lastRequest; + TDELaunchRequest *lastRequest; TQPtrList<SlaveWaitRequest> mSlaveWaitRequest; TQString mPoolSocketName; - KServerSocket *mPoolSocket; + TDEServerSocket *mPoolSocket; TQPtrList<IdleSlave> mSlaveList; TQTimer mTimer; TQTimer mAutoTimer; diff --git a/kinit/klauncher_cmds.h b/kinit/tdelauncher_cmds.h index 54b13f45a..5763e5a38 100644 --- a/kinit/klauncher_cmds.h +++ b/kinit/tdelauncher_cmds.h @@ -24,7 +24,7 @@ typedef struct { long cmd; long arg_length; -} klauncher_header; +} tdelauncher_header; /* Launcher commands: */ diff --git a/kinit/klauncher_main.cpp b/kinit/tdelauncher_main.cpp index 0842bc2c2..747050668 100644 --- a/kinit/klauncher_main.cpp +++ b/kinit/tdelauncher_main.cpp @@ -22,32 +22,32 @@ #include <unistd.h> #include <fcntl.h> -#include "kapplication.h" -#include "klauncher.h" -#include "kcmdlineargs.h" +#include "tdeapplication.h" +#include "tdelauncher.h" +#include "tdecmdlineargs.h" #include "kcrash.h" #include "kdebug.h" #include <stdio.h> #include <stdlib.h> #include <signal.h> #include <tqcstring.h> -#include <klocale.h> +#include <tdelocale.h> -#include "klauncher_cmds.h" +#include "tdelauncher_cmds.h" static void sig_handler(int sig_num) { // No recursion signal( SIGHUP, SIG_IGN); signal( SIGTERM, SIG_IGN); - fprintf(stderr, "[klauncher] Exiting on signal %d\n", sig_num); - KLauncher::destruct(255); + fprintf(stderr, "[tdelauncher] Exiting on signal %d\n", sig_num); + TDELauncher::destruct(255); } -static KCmdLineOptions options[] = +static TDECmdLineOptions options[] = { { "new-startup", "Internal", 0 }, - KCmdLineLastOption + TDECmdLineLastOption }; extern "C" KDE_EXPORT int kdemain( int argc, char**argv ) @@ -55,34 +55,34 @@ extern "C" KDE_EXPORT int kdemain( int argc, char**argv ) // Started via tdeinit. if (fcntl(LAUNCHER_FD, F_GETFD) == -1) { - fprintf(stderr, "%s", i18n("[klauncher] This program is not supposed to be started manually.\n" - "[klauncher] It is started automatically by tdeinit.\n").local8Bit().data()); + fprintf(stderr, "%s", i18n("[tdelauncher] This program is not supposed to be started manually.\n" + "[tdelauncher] It is started automatically by tdeinit.\n").local8Bit().data()); return 1; } - TQCString cname = KApplication::launcher(); + TQCString cname = TDEApplication::launcher(); char *name = cname.data(); - KCmdLineArgs::init(argc, argv, name, "KLauncher", "A service launcher.", + TDECmdLineArgs::init(argc, argv, name, "TDELauncher", "A service launcher.", "v1.0"); - KLauncher::addCmdLineOptions(); - KCmdLineArgs::addCmdLineOptions( options ); + TDELauncher::addCmdLineOptions(); + TDECmdLineArgs::addCmdLineOptions( options ); // WABA: Make sure not to enable session management. putenv(strdup("SESSION_MANAGER=")); // Allow the locale to initialize properly - KLocale::setMainCatalogue("tdelibs"); + TDELocale::setMainCatalogue("tdelibs"); - KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); int maxTry = 3; while(true) { - TQCString dcopName = KApplication::dcopClient()->registerAs(name, false); + TQCString dcopName = TDEApplication::dcopClient()->registerAs(name, false); if (dcopName.isEmpty()) { - kdWarning() << "[klauncher] DCOP communication problem!" << endl; + kdWarning() << "[tdelauncher] DCOP communication problem!" << endl; return 1; } if (dcopName == cname) @@ -90,22 +90,22 @@ extern "C" KDE_EXPORT int kdemain( int argc, char**argv ) if (--maxTry == 0) { - kdWarning() << "[klauncher] Another instance of klauncher is already running!" << endl; + kdWarning() << "[tdelauncher] Another instance of tdelauncher is already running!" << endl; return 1; } // Wait a bit... - kdWarning() << "[klauncher] Waiting for already running klauncher to exit." << endl; + kdWarning() << "[tdelauncher] Waiting for already running tdelauncher to exit." << endl; sleep(1); // Try again... } - KLauncher *launcher = new KLauncher(LAUNCHER_FD, args->isSet("new-startup")); + TDELauncher *launcher = new TDELauncher(LAUNCHER_FD, args->isSet("new-startup")); launcher->dcopClient()->setDefaultObject( name ); launcher->dcopClient()->setDaemonMode( true ); - KCrash::setEmergencySaveFunction(sig_handler); + TDECrash::setEmergencySaveFunction(sig_handler); signal( SIGHUP, sig_handler); signal( SIGPIPE, SIG_IGN); signal( SIGTERM, sig_handler); diff --git a/kinit/kstartupconfig.cpp b/kinit/tdestartupconfig.cpp index 3204d6f7d..373ac6787 100644 --- a/kinit/kstartupconfig.cpp +++ b/kinit/tdestartupconfig.cpp @@ -42,10 +42,10 @@ It is not possible to specify default values, but since the configuration option are processed in the order they are specified this can be solved by first specifying a group and then all the entries that need default values. -When a kconf_update script is used to update such option, kstartupconfig is run -before kconf_update and therefore cannot see the change in time. To avoid this -problem, together with the kconf_update script also the matching global config -file should be updated (any change, kstartupconfig will see the timestamp change). +When a tdeconf_update script is used to update such option, tdestartupconfig is run +before tdeconf_update and therefore cannot see the change in time. To avoid this +problem, together with the tdeconf_update script also the matching global config +file should be updated (any change, tdestartupconfig will see the timestamp change). Note that the kdeglobals config file is not used as a depedendency for other config files. @@ -58,7 +58,7 @@ followed by paths of all files that are relevant to the option. Non-existent fil have '!' prepended (for the case they'll be later created), the list of files is terminated by line containing '*'. If the timestamps of all relevant files are older than the timestamp of the startupconfigfile file, there's no need to update anything. -Otherwise kdostartupconfig is launched to create or update all the necessary files +Otherwise tdedostartupconfig is launched to create or update all the necessary files (which already requires loading KDE libraries, but this case should be rare). */ @@ -90,7 +90,7 @@ int main() strlcat( filename, "/share/config/startupconfig", 1024 ); if( access( filename, R_OK ) != 0 ) { - int ret = system( "kdostartupconfig" ); + int ret = system( "tdedostartupconfig" ); return WEXITSTATUS( ret ); } strlcpy( filename, tdehome, 1024 ); @@ -98,14 +98,14 @@ int main() struct stat st; if( stat( filename, &st ) != 0 ) { - int ret = system( "kdostartupconfig" ); + int ret = system( "tdedostartupconfig" ); return WEXITSTATUS( ret ); } time_t config_time = st.st_mtime; FILE* config = fopen( filename, "r" ); if( config == NULL ) { - int ret = system( "kdostartupconfig" ); + int ret = system( "tdedostartupconfig" ); return WEXITSTATUS( ret ); } strlcpy( filename, tdehome, 1024 ); @@ -169,7 +169,7 @@ int main() fclose( config ); if( need_update ) { - int ret = system( "kdostartupconfig" ); + int ret = system( "tdedostartupconfig" ); return WEXITSTATUS( ret ); } return 0; diff --git a/kinit/tests/Makefile.am b/kinit/tests/Makefile.am index 909e7c14b..e1157bf72 100644 --- a/kinit/tests/Makefile.am +++ b/kinit/tests/Makefile.am @@ -3,8 +3,8 @@ INCLUDES= -I$(srcdir)/../.. $(all_includes) ####### Files -check_PROGRAMS = klaunchertest +check_PROGRAMS = tdelaunchertest -klaunchertest_SOURCES = klaunchertest.cpp -klaunchertest_LDADD = $(LIB_KIO) +tdelaunchertest_SOURCES = tdelaunchertest.cpp +tdelaunchertest_LDADD = $(LIB_KIO) diff --git a/kinit/tests/klaunchertest.cpp b/kinit/tests/tdelaunchertest.cpp index f246e7086..07eaf21f7 100644 --- a/kinit/tests/klaunchertest.cpp +++ b/kinit/tests/tdelaunchertest.cpp @@ -19,7 +19,7 @@ */ #include <tqstring.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <dcopclient.h> #include <stdio.h> #include <tqvaluelist.h> @@ -28,9 +28,9 @@ int main(int argc, char *argv[]) { - KApplication::tdeinitExec("konsole"); + TDEApplication::tdeinitExec("konsole"); - KApplication k(argc, argv, "klaunchertest"); + TDEApplication k(argc, argv, "tdelaunchertest"); kapp->dcopClient()->registerAs( kapp->name()) ; @@ -38,13 +38,13 @@ int main(int argc, char *argv[]) TQString error; TQCString dcopService; int pid; - int result = KApplication::startServiceByDesktopName( + int result = TDEApplication::startServiceByDesktopName( TQString::fromLatin1("konsole"), TQString::null, &error, &dcopService, &pid ); printf("Result = %d, error = \"%s\", dcopService = \"%s\", pid = %d\n", result, error.ascii(), dcopService.data(), pid); - result = KApplication::startServiceByDesktopName( + result = TDEApplication::startServiceByDesktopName( TQString::fromLatin1("konqueror"), TQString::null, &error, &dcopService, &pid ); printf("Result = %d, error = \"%s\", dcopService = \"%s\", pid = %d\n", diff --git a/kinit/wrapper.c b/kinit/wrapper.c index 36a75d46b..565c9a152 100644 --- a/kinit/wrapper.c +++ b/kinit/wrapper.c @@ -21,7 +21,7 @@ #include <config.h> -#include "klauncher_cmds.h" +#include "tdelauncher_cmds.h" #include <sys/types.h> #include <sys/param.h> @@ -310,7 +310,7 @@ int main(int argc, char **argv) int kwrapper = 0; long arg_count; long env_count; - klauncher_header header; + tdelauncher_header header; char *start, *p, *buffer; char cwd[8192]; const char *tty = NULL; |