void KateApp::initKate () { kDebug() << "Setting KATE_PID: '" << getpid() << "'"; ::setenv( "KATE_PID", QString("%1").arg(getpid()).toLatin1(), 1 ); // handle restore different if (isSessionRestored()) { restoreKate (); } else { // let us handle our command line args and co ;) // we can exit here if session chooser decides if (!startupKate ()) { kDebug() << "startupKate returned false"; m_shouldExit = true; return ; } } // application dbus interface QDBusConnection::sessionBus().registerObject( QLatin1String("/MainApplication"), this ); }
KateApp::KateApp (KCmdLineArgs *args) : KApplication () , m_args (args) , m_shouldExit (false) { // Don't handle DCOP requests yet dcopClient()->suspend(); // insert right translations for the katepart KGlobal::locale()->insertCatalogue("katepart"); // some global default Kate::Document::setFileChangedDialogsActivated (true); // application interface m_application = new Kate::Application (this); // doc + project man m_docManager = new KateDocManager (this); // init all normal plugins m_pluginManager = new KatePluginManager (this); // session manager up m_sessionManager = new KateSessionManager (this); // application dcop interface m_obj = new KateAppDCOPIface (this); kdDebug()<<"Setting KATE_PID: '"<<getpid()<<"'"<<endl; ::setenv( "KATE_PID", QString("%1").arg(getpid()).latin1(), 1 ); // handle restore different if (isRestored()) { restoreKate (); } else { // let us handle our command line args and co ;) // we can exit here if session chooser decides if (!startupKate ()) { m_shouldExit = true; return; } } // Ok. We are ready for DCOP requests. dcopClient()->resume(); }