Extending KCModuleProxy

Frans Englich frans.englich at telia.com
Mon Mar 15 01:13:08 GMT 2004



Attached patch tries to port the KCMultiDialog to the new KCModuleProxy. The 
dialog should work out of the box with the KCModuleProxy, unfortunately that 
is not the case, the problem discussed below. (of course, root support needs 
patching)

I get a crash on this:
void KCMultiDialog::slotAboutToShow(QWidget *page)
{
    kdDebug( 710 ) << k_funcinfo << endl;
    // honor KCModule::buttons
    QObject * obj = page->child( 0, "KCModuleProxy" );
    if( ! obj )
        return;
    d->currentModule = 
( KCModuleProxy* )obj->qt_cast( "KCModuleProxy" ); //<--crash


And with my crippled c++/qt knowledge I can't tell why that does not work nor 
what possible changes have broken it.
Why doesn't the code read "d->currentModule = (KCModuleProxy *) page;"? (but 
that crashes just as fine)


Further, I have some miscellaneous questions:

* My patch contains the following section:

@ -63,16 +75,17 @@ KCMultiDialog::KCMultiDialog( int dialog
         const KGuiItem &user3, int buttonMask, const QString &caption,
         QWidget *parent, const char *name, bool modal )
     : KDialogBase( dialogFace, caption, buttonMask | Help | Default | Cancel 
|
-            Apply | Ok | User1, Ok, parent, name, modal, true,
-            KGuiItem( i18n( "&Reset" ), "undo" ), user2, user3 )
-    , dialogface( dialogFace )
+            Apply | Ok | User1 | User2 | User3, Ok, parent, name, modal, 
true,
+            KStdGuiItem::reset(), KStdGuiItem::adminMode(), user3 )
+    , dialogface( dialogFace ), d( new KCMultiDialogPrivate() )

I've ran out of custom buttons in kdialogbase :) Three is allowed. reset() and 
adminMode() is needed for internal purposes and the user is allowed to pass 
two - that's four in total. Any ideas what to do in this situation?


* What does the @internal doxygen tag mean in KDE context?

* $KDEDIRS is preferred in front of $KDEDIR, AFAICT. Will KDEDIR be deprecated 
for KDE4?

* Is $KDETMP fully supported and an "official" feature?


Cheers,

		Frans


-------------- next part --------------
A non-text attachment was scrubbed...
Name: kcmultidialog.diff
Type: text/x-diff
Size: 6542 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040315/5ca11b61/attachment.diff>


More information about the kde-core-devel mailing list