[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: new_kcm_code: kdelibs/kcmshell
From: Frans Englich <frans.englich () telia ! com>
Date: 2004-11-25 19:38:12
Message-ID: 20041125193812.45FF31CF3F () office ! kde ! org
[Download RAW message or body]
CVS commit by englich:
A slight refactoring, and keep debug statements for a bug which turned out to not even be in kcmshell.
M +23 -9 main.cpp 1.75.2.9
--- kdelibs/kcmshell/main.cpp #1.75.2.8:1.75.2.9
@@ -113,9 +113,11 @@ static KService::Ptr locateModule(const
bool KCMShell::isRunning()
{
- if (dcopClient()->appId() == m_dcopName)
+ if( dcopClient()->appId() == m_dcopName )
return false; // We are the one and only.
- dcopClient()->attach(); // Reregister as anonymous
+ kdDebug(780) << "kcmshell with modules '" <<
+ m_dcopName << "' is already running." << endl;
+ dcopClient()->attach(); // Reregister as anonymous
dcopClient()->setNotifications(true);
@@ -127,5 +129,8 @@ bool KCMShell::isRunning()
if (!dcopClient()->call(m_dcopName, "dialog", "activate(QCString)",
data, replyType, replyData))
+ {
+ kdDebug(780) << "Calling DCOP function dialog::activate() failed." << endl;
return false; // Error, we have to do it ourselves.
+ }
return true;
@@ -141,4 +146,6 @@ KCMShellMultiDialog::KCMShellMultiDialog
void KCMShellMultiDialog::activate( QCString asn_id )
{
+ kdDebug() << k_funcinfo << endl;
+
KStartupInfo::setNewStartupId( this, asn_id );
}
@@ -157,4 +164,6 @@ void KCMShell::setDCOPName(const QCStrin
void KCMShell::waitForExit()
{
+ kdDebug(780) << k_funcinfo << endl;
+
connect(dcopClient(), SIGNAL(applicationRemoved(const QCString&)),
SLOT( appExit(const QCString&) ));
@@ -164,6 +173,11 @@ void KCMShell::waitForExit()
void KCMShell::appExit(const QCString &appId)
{
+ kdDebug(780) << k_funcinfo << endl;
+
if( appId == m_dcopName )
+ {
+ kdDebug(780) << "'" << appId << "' closed, dereferencing." << endl;
deref();
+ }
}
@@ -258,5 +272,4 @@ extern "C" KDE_EXPORT int kdemain(int _a
if( app.isRunning() )
{
- kdDebug(780) << "kcmshell with modules '" << dcopName << "' is already running." << endl;
app.waitForExit();
return 0;
@@ -278,8 +291,9 @@ extern "C" KDE_EXPORT int kdemain(int _a
if( idValid )
{
- KCModuleProxy module( modules.first()->desktopEntryName() );
- QXEmbed::embedClientIntoWindow( &module, id);
- module.show();
+ KCModuleProxy *module = new KCModuleProxy( modules.first()->desktopEntryName() );
+ module->realModule();
+ QXEmbed::embedClientIntoWindow( module, id);
app.exec();
+ delete module;
}
else
@@ -291,4 +305,7 @@ extern "C" KDE_EXPORT int kdemain(int _a
i18n("Configure - %1").arg(kapp->caption()), 0, "", true );
+ for (KService::List::ConstIterator it = modules.begin(); it != modules.end(); ++it)
+ dlg->addModule(KCModuleInfo(*it));
+
if ( args->isSet( "embed" ))
{
@@ -306,7 +323,4 @@ extern "C" KDE_EXPORT int kdemain(int _a
else
{
- for (KService::List::ConstIterator it = modules.begin(); it != modules.end(); ++it)
- dlg->addModule(KCModuleInfo(*it));
-
if (kapp->iconName() != kapp->name())
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic