diff options
Diffstat (limited to 'kinit/kinit.cpp')
-rw-r--r-- | kinit/kinit.cpp | 98 |
1 files changed, 49 insertions, 49 deletions
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 |