From kde-devel Tue Mar 29 10:05:44 2005 From: David Faure Date: Tue, 29 Mar 2005 10:05:44 +0000 To: kde-devel Subject: Re: KIO::listDir crashes when called from KIO slave Message-Id: <200503291205.44600.faure () kde ! org> X-MARC-Message: https://marc.info/?l=kde-devel&m=111209077628486 On Tuesday 29 March 2005 08:48, Oliver Eichler wrote: > Am Dienstag, 22. März 2005 17:52 schrieben Sie: > > > > Not from a kioslave. It's supposed to be a non-gui program - dialogs are > > for the application side. > > Hm, this seems to be a potential bug. The KIO slave audiocd will request > messageboxes or dialogs when it detects errors or asks to overwrite files. > Using audiocd from another slave will crash this slave in this situation. No... If it detects an error or asks to overwrite files, it in fact simply returns an error code and KIO::CopyJob (the job, in the application side) shows the dialog (in case of overwrite). If that job is itself in a slave, then you can use setInteractive(false) to ensure that it doesn't popup any dialogs - and you can also make sure preconditions are met, like handling "destination exists" before calling your sub-slave. For simple errors it's even simpler, Job doesn't show anything, it's up to the app code (or the slave, in your case) do handle the error. kio_trash is an example of all of this. And for dialogs requested using the SlaveBase interface, the dialogs appear in kio_uiserver so it shouldn't be a problem to do that in a sub-slave. > On the other hand side: Is there any restriction to enable the slave's GUI by > setting the KApplication constructor flag to true? I don't understand the question exactly. It's fine to pass true (non-gui) to KApplication, it's even recommended for slaves. > And while asking silly > question: Is it ok to use KUniqueApplication instead of KApplication? I'd say no. The application (or two of them) might want to launch two instances of the slave. -- David Faure, faure@kde.org, sponsored by Trolltech to work on KDE, Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org). >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<