Mailinglist Archive: yast-commit (1056 mails)

< Previous Next >
[yast-commit] r44224 - in /branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings: kcmoduleproxy.cpp kcmoduleproxy.h kcmultiwidget.cpp
  • From: tgoettlicher@xxxxxxxxxxxxxxxx
  • Date: Thu, 07 Feb 2008 10:08:52 -0000
  • Message-id: <20080207100853.18D8924897@xxxxxxxxxxxxxxxx>
Author: tgoettlicher
Date: Thu Feb 7 11:08:52 2008
New Revision: 44224

URL: http://svn.opensuse.org/viewcvs/yast?rev=44224&view=rev
Log:
remove kde deps

Modified:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleproxy.cpp
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleproxy.h
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmultiwidget.cpp

Modified:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleproxy.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleproxy.cpp?rev=44224&r1=44223&r2=44224&view=diff
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleproxy.cpp
(original)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleproxy.cpp
Thu Feb 7 11:08:52 2008
@@ -35,22 +35,22 @@

#include <QtDBus/QtDBus>

-#include <kapplication.h>
-#include <kaboutdata.h>
-#include <kcmodule.h>
-#include <kcmoduleinfo.h>
+//#include <kapplication.h>
+//#include <kaboutdata.h>
+//#include <kcmodule.h>
+//#include <kcmoduleinfo.h>

//#include <kdebug.h>
#include <iostream>
-#include <kdialog.h>
-#include <klocale.h>
+//#include <kdialog.h>
+//#include <klocale.h>
#include "yservice.h"
-#include <kstandarddirs.h>
-#include <kuser.h>
+//#include <kstandarddirs.h>
+//#include <kuser.h>

-#include <kvbox.h>
+//#include <kvbox.h>

-#include <kcmoduleloader.h>
+#include "kcmoduleloader.h"

#ifdef tg
#include "ksettingswidgetadaptor.h"
@@ -91,89 +91,6 @@

void KCModuleProxyPrivate::loadModule()
{
- if( !topLayout )
- {
- topLayout = new QVBoxLayout( parent );
- topLayout->setMargin( 0 );
- topLayout->setSpacing( 0 );
-
- QString name = modInfo.handle();
- dbusPath = QLatin1String("/internal/KSettingsWidget/") + name;
- dbusService =
QLatin1String("org.kde.internal.KSettingsWidget-") + name;
- }
-
- if( QDBusConnection::sessionBus().registerService( dbusService ) ||
bogusOccupier )
- { /* We got the name we requested, because no one was before us,
- * or, it was an random application which had picked that name */
-
- kcm = KCModuleLoader::loadModule( modInfo,
KCModuleLoader::Inline, parent, args );
-
- QObject::connect(kcm, SIGNAL(changed(bool)), parent,
SLOT(_k_moduleChanged(bool)));
- QObject::connect(kcm, SIGNAL(destroyed()), parent,
SLOT(_k_moduleDestroyed()));
- QObject::connect( kcm, SIGNAL(quickHelpChanged()), parent,
SIGNAL(quickHelpChanged()) );
- parent->setWhatsThis( kcm->quickHelp() );
-
- if ( kcm->layout() ) {
- kcm->layout()->setMargin( 0 );
- }
- topLayout->addWidget( kcm );
-#ifdef tg
- if( !modInfo.handle().isEmpty() )
- QDBusConnection::sessionBus().registerObject(dbusPath,
new KSettingsWidgetAdaptor(parent), QDBusConnection::ExportAllSlots);
-#endif
-
- if ( !rootInfo && /* If it's not already done */
- kcm->useRootOnlyMessage() && /* kcm wants root
message */
- !KUser().isSuperUser() ) /* Not necessary if
we're root */
- {
- rootInfo = new QLabel( parent );
- topLayout->insertWidget( 0, rootInfo );
-
- rootInfo->setFrameShape( QFrame::Box );
- rootInfo->setFrameShadow( QFrame::Raised );
-
- const QString message = kcm->rootOnlyMessage();
- if( message.isEmpty() )
- rootInfo->setText( i18n(
- "<b>Changes in this section requires
root access.</b><br />"
- "On applying your changes you will
have to supply your root "
- "password." ) );
- else
- rootInfo->setText(message);
-
- rootInfo->setWhatsThis( i18n(
- "This section requires special permissions,
probably "
- "for system-wide changes; therefore, it is "
- "required that you provide the root password
to be "
- "able to change the module's properties. If "
- "you cannot provide the password, the changes
of the "
- "module cannot be saved " ) );
- }
- }
- else
- {
- std::cout << "Module already loaded, loading KCMError" <<
std::endl;
-
- /* Figure out the name of where the module is already loaded */
- QDBusInterface proxy( dbusService, dbusPath,
"org.kde.internal.KSettingsWidget" );
- QDBusReply<QString> reply = proxy.call("applicationName");
-
- if( reply.isValid() )
- {
- QObject::connect(
QDBusConnection::sessionBus().interface(),
SIGNAL(serviceOwnerChanged(QString,QString,QString)),
- parent, SLOT(_k_ownerChanged(QString,QString,QString)));
- kcm = KCModuleLoader::reportError(
KCModuleLoader::Inline,
- i18nc( "Argument is application name",
"This configuration section is "
- "already opened in %1" ,
reply.value() ), " ", parent );
- topLayout->addWidget( kcm );
- }
- else
- {
- std::cout << "Calling KCModuleProxy's DBus interface
for fetching the name failed." << std::endl;
- bogusOccupier = true;
- loadModule();
- }
- }
}

void KCModuleProxyPrivate::_k_ownerChanged(const QString &service, const
QString &oldOwner, const QString &)
@@ -220,7 +137,7 @@
delete d->kcm;
d->kcm = 0;

- kapp->syncX();
+//tg kapp->syncX();
}

void KCModuleProxyPrivate::_k_moduleChanged(bool c)

Modified:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleproxy.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleproxy.h?rev=44224&r1=44223&r2=44224&view=diff
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleproxy.h
(original)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmoduleproxy.h
Thu Feb 7 11:08:52 2008
@@ -24,7 +24,7 @@
#include <QtGui/QImage>
#include <QtCore/QStringList>

-#include <kcmodule.h>
+#include "kcmodule.h"
#include "yservice.h"
//#include <kutils_export.h>


Modified:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmultiwidget.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmultiwidget.cpp?rev=44224&r1=44223&r2=44224&view=diff
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmultiwidget.cpp
(original)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmultiwidget.cpp
Thu Feb 7 11:08:52 2008
@@ -27,16 +27,16 @@
#include <QProcess>
#include <QScrollArea>

-#include <kdebug.h>
-#include <kiconloader.h>
-#include <klibloader.h>
-#include <klocale.h>
-#include <kmessagebox.h>
-#include <krun.h>
-#include <kstandardguiitem.h>
-#include <kuser.h>
-#include <kauthorized.h>
-#include <ktoolinvocation.h>
+//#include <kdebug.h>
+//#include <kiconloader.h>
+//#include <klibloader.h>
+//#include <klocale.h>
+//#include <kmessagebox.h>
+//#include <krun.h>
+//#include <kstandardguiitem.h>
+//#include <kuser.h>
+//#include <kauthorized.h>
+//#include <ktoolinvocation.h>

#include "kcmoduleloader.h"
#include "kcmoduleproxy.h"
@@ -70,6 +70,8 @@
void KCMultiWidget::InitKIconDialog(const QString& caption,
Qt::WindowModality modality)
{
+#ifdef tg
+
setCaption(caption);
setButtons(KDialog::Help |
KDialog::Default |
@@ -82,6 +84,7 @@
setButtonGuiItem(KDialog::User1, KStandardGuiItem::close());

setWindowModality(modality);
+#endif
}

inline void KCMultiWidget::init()
@@ -151,7 +154,7 @@
}
foreach( const QString &it, updatedModules )
{
- kDebug() << it << " " << ( it );
+// kDebug() << it << " " << ( it );
emit configCommitted( it.toLatin1() );
}
emit configCommitted();
@@ -171,6 +174,7 @@

void KCMultiWidget::slotHelp()
{
+#ifdef tg
QString docPath = currentModule()->moduleInfo().docPath();

KUrl url( KUrl("help:/"), docPath );
@@ -180,6 +184,7 @@
} else {
KToolInvocation::invokeBrowser( url.url() );
}
+#endif
}

// Close button
@@ -189,7 +194,7 @@

void KCMultiWidget::clientChanged(bool state)
{
- kDebug( 710 ) << state;
+ //kDebug( 710 ) << state;
foreach( const CreatedModule &it, m_modules )
if( it.kcm->changed() ) {
enableButton( Apply, true );
@@ -203,14 +208,16 @@
void KCMultiWidget::addModule(const KCModuleInfo& moduleinfo)
{
if( !moduleinfo.service() ) {
- kWarning() << "ModuleInfo has no associated YService" ;
+ //kWarning() << "ModuleInfo has no associated YService" ;
return;
}

+#ifdef tg
if ( !KAuthorized::authorizeControlModule( moduleinfo.service()->menuId()
)) {
- kWarning() << "Not authorised to load module" ;
+ //kWarning() << "Not authorised to load module" ;
return;
}
+#endif

if(moduleinfo.service()->noDisplay()) {
return;
@@ -224,7 +231,7 @@
// removeAllModules
module = m_orphanModules[ moduleinfo.service() ];
m_orphanModules.remove( moduleinfo.service() );
- kDebug( 710 ) << "Use KCModule from the list of orphans for " <<
+// kDebug( 710 ) << "Use KCModule from the list of orphans for " <<
moduleinfo.moduleName() << ": " << module << endl;

if( module->changed() ) {
@@ -299,6 +306,7 @@

void KCMultiWidget::applyOrRevert(KCModuleProxy * module)
{
+#ifdef tg
if( !module || !module->changed() )
return;

@@ -314,6 +322,7 @@
module->load();
clientChanged( false );
}
+#endif
}

void KCMultiWidget::slotAboutToShow(KPageWidgetItem* current, KPageWidgetItem*
before)

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages