Use tdeApp

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/9/head
Michele Calgaro 7 months ago
parent 7d033d1ca0
commit d05b646280
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -45,8 +45,8 @@ static void sighandler(int sig)
} }
tqDebug("%s", i18n("Caught signal %1. Cleaning up.").arg(sig).local8Bit().data()); tqDebug("%s", i18n("Caught signal %1. Cleaning up.").arg(sig).local8Bit().data());
((TDEDocker*)TDEApplication::kApplication())->trayLabelMgr()->undockAll(); ((TDEDocker*)tdeApp)->trayLabelMgr()->undockAll();
TDEApplication::kApplication()->quit(); tdeApp->quit();
} }
static const TDECmdLineOptions options[] = static const TDECmdLineOptions options[] =

@ -50,9 +50,9 @@ TDEDocker::TDEDocker()
// Required so that the saved config is correctly loaded // Required so that the saved config is correctly loaded
// (see TrayLabelMgr::doRestoreSession() for usage) // (see TrayLabelMgr::doRestoreSession() for usage)
if (TDEApplication::kApplication()->isRestored()) if (tdeApp->isRestored())
{ {
TDEApplication::kApplication()->sessionConfig(); tdeApp->sessionConfig();
} }
} }

@ -67,7 +67,7 @@ void TrayLabelMgr::startup(void)
* stdout is a tty) OR if we are getting restored, wait for WAIT_TIME until * stdout is a tty) OR if we are getting restored, wait for WAIT_TIME until
* the system tray shows up (before informing the user) * the system tray shows up (before informing the user)
*/ */
static bool do_wait = !isatty(fileno(stdout)) || TDEApplication::kApplication()->isRestored(); static bool do_wait = !isatty(fileno(stdout)) || tdeApp->isRestored();
SysTrayState state = sysTrayStatus(TQPaintDevice::x11AppDisplay()); SysTrayState state = sysTrayStatus(TQPaintDevice::x11AppDisplay());
@ -84,7 +84,7 @@ void TrayLabelMgr::startup(void)
state == SysTrayAbsent ? i18n("No system tray found") : i18n("System tray appears to be hidden"), state == SysTrayAbsent ? i18n("No system tray found") : i18n("System tray appears to be hidden"),
i18n("TDEDocker")) == KMessageBox::Cancel) i18n("TDEDocker")) == KMessageBox::Cancel)
{ {
TDEApplication::kApplication()->quit(); tdeApp->quit();
return; return;
} }
} }
@ -92,7 +92,7 @@ void TrayLabelMgr::startup(void)
// Things are fine or user with OK with the state of system tray // Things are fine or user with OK with the state of system tray
mReady = true; mReady = true;
bool ok = false; bool ok = false;
if (TDEApplication::kApplication()->isRestored()) if (tdeApp->isRestored())
{ {
restoreSession(); restoreSession();
ok = true; ok = true;
@ -110,7 +110,7 @@ void TrayLabelMgr::startup(void)
} }
if (!ok) if (!ok)
{ {
TDEApplication::kApplication()->quit(); tdeApp->quit();
} }
} }
@ -426,7 +426,7 @@ TQTrayLabel *TrayLabelMgr::dockApplication(char *argv[])
{ {
tqDebug("%s", i18n("Failed to exec [%1]: %2").arg(argv[0]).arg(strerror(errno)).local8Bit().data()); tqDebug("%s", i18n("Failed to exec [%1]: %2").arg(argv[0]).arg(strerror(errno)).local8Bit().data());
// Exit the forked process only. // Exit the forked process only.
// Using TDEApplication::kApplication()->quit() crashes the parent application. // Using tdeApp->quit() crashes the parent application.
exit(0); exit(0);
return NULL; return NULL;
} }
@ -447,7 +447,7 @@ TQTrayLabel *TrayLabelMgr::dockApplication(char *argv[])
} }
TQTrayLabel *label = new TQTrayLabel(cmd_line, pid); TQTrayLabel *label = new TQTrayLabel(cmd_line, pid);
TDEApplication::kApplication()->syncX(); tdeApp->syncX();
write(filedes[1], buf, sizeof(buf)); write(filedes[1], buf, sizeof(buf));
close(filedes[0]); close(filedes[0]);
close(filedes[1]); close(filedes[1]);
@ -479,7 +479,7 @@ void TrayLabelMgr::trayLabelDestroyed(TQObject *t)
mTrayLabels.removeRef((TQTrayLabel*)t); mTrayLabels.removeRef((TQTrayLabel*)t);
if (mTrayLabels.isEmpty()) if (mTrayLabels.isEmpty())
{ {
TDEApplication::kApplication()->quit(); tdeApp->quit();
} }
else if (reconnect) else if (reconnect)
{ {
@ -526,7 +526,7 @@ void TrayLabelMgr::doRestoreSession()
{ {
TRACE("Restoring session"); TRACE("Restoring session");
TDEConfig *config = TDEApplication::kApplication()->sessionConfig(); TDEConfig *config = tdeApp->sessionConfig();
if (config->hasGroup("General")) if (config->hasGroup("General"))
{ {
config->setGroup("General"); config->setGroup("General");
@ -554,7 +554,7 @@ void TrayLabelMgr::doRestoreSession()
// Exit if no application could be restored // Exit if no application could be restored
if (mTrayLabels.isEmpty()) if (mTrayLabels.isEmpty())
{ {
TDEApplication::kApplication()->quit(); tdeApp->quit();
} }
} }
@ -564,7 +564,7 @@ bool TrayLabelMgr::saveState(TQSessionManager &sm)
int i = 0; int i = 0;
TQTrayLabel *t; TQTrayLabel *t;
TDEConfig *config = TDEApplication::kApplication()->sessionConfig(); TDEConfig *config = tdeApp->sessionConfig();
TQPtrListIterator<TQTrayLabel> it(mTrayLabels); TQPtrListIterator<TQTrayLabel> it(mTrayLabels);
for (it.toFirst(); it.current(); ++it) for (it.toFirst(); it.current(); ++it)
{ {

Loading…
Cancel
Save