konq delete unification

David Faure faure at kde.org
Tue Jul 15 16:59:30 BST 2003


On Tuesday 15 July 2003 17:55, David Hugh-Jones wrote:
> 
> On Tue, 2003-07-15 at 16:31, David Faure wrote:
> > On Tuesday 15 July 2003 17:34, David Hugh-Jones wrote:
> > > OK, so that will stop getting problems with e.g. shred.
> > > 
> > > But we have new slots (forceDel, forceTrash) that the browser extension
> > > needs to know about, doesn't the BrowserExtension need to know about
> > > them?
> > 
> > Why do you have those slots? What do they do, compared to del and trash?
> > It seems to me that you're putting the logic in the wrong place, but then again
> > I haven't thought about this much.
> 
> Well, that is possible, see earlier discussion. But I have 3 slots:
> forcedel (yes this should just be called del but it's the way I hacked
> it)
> forcetrash (ditto)
> del (does the default delete action, which may or may not involve
> storing a copy in the trash)
> 
> I don't see how to have a "standard delete action" without another slot.
> We can't just use the two old ones and select between them, because
> konq_operations wants to know if we are using the default action.

If you only use del and trash, but add a setUsingStandardDelAction()
or whatever to browserextension, then konq_operations can figure this out,
and there's no need to change the existing slot names (so old views will
still work, they'll simply ignore the fact that we're using the standard action).
It's a bit ugly, admittedly, but it's the most compatible and less intrusive way.

Another way would be that the "are you sure you want to trash this
remote file" confirmation is done by konq_mainwindow, before calling del/trash.
IIRC it can know what are the selected files, at least for KonqDirPart-derived
views: KFileItemList list= static_cast<KonqDirPart *>(m_currentView->part())->selectedFileItems();

-- 
David FAURE, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
Qtella users - stability patches at http://blackie.dk/~dfaure/qtella.html




More information about the kfm-devel mailing list