From kde-core-devel Mon Oct 28 23:00:37 2002 From: Stephan Kulow Date: Mon, 28 Oct 2002 23:00:37 +0000 To: kde-core-devel Subject: Re: disabling kio_devices X-MARC-Message: https://marc.info/?l=kde-core-devel&m=103584612520209 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_VGcv9m63aNi4Nh3" --Boundary-00=_VGcv9m63aNi4Nh3 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Montag, 28. Oktober 2002 14:44, Stephan Kulow wrote: > Hi! > > devices:/ has one critical bug open for over three weeks now > without any progress and it's not a one line fix, but from what > I would say a design flaw: > http://bugs.kde.org/show_bug.cgi?id=48923 > > David and I think, kio_devices should be disabled completly for > the 3.1 release (including the kcontrol part of it) if that bug > can't be fixed til we tag RC1 (which is about to be impossible > as it's tonight). > > I will do that tonight unless Joseph can come up with a solution > quickly. The solution to return desktop files from devices:/ is already > prepared in the sources, but has never been implemented ;( OK, please check the attached patch. It disallows the move of trash and delete for protocols that do not support deleting. Greetings, Stephan --Boundary-00=_VGcv9m63aNi4Nh3 Content-Type: text/x-diff; charset="iso-8859-1"; name="patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch" Index: konq_operations.cc =================================================================== RCS file: /home/kde/kdebase/libkonq/konq_operations.cc,v retrieving revision 1.103 diff -u -p -u -r1.103 konq_operations.cc --- konq_operations.cc 2002/09/27 18:04:04 1.103 +++ konq_operations.cc 2002/10/28 22:57:43 @@ -191,8 +191,18 @@ void KonqOperations::copy( QWidget * par (void) new KonqCommandRecorder( method==MOVE?KonqCommand::MOVE:KonqCommand::LINK, selectedURLs, destUrl, job ); }; -void KonqOperations::_del( int method, const KURL::List & selectedURLs, int confirmation ) +void KonqOperations::_del( int method, const KURL::List & _selectedURLs, int confirmation ) { + KURL::List selectedURLs; + for (KURL::List::ConstIterator it = _selectedURLs.begin(); it != _selectedURLs.end(); ++it) + if (KProtocolInfo::supportsDeleting(*it)) + selectedURLs.append(*it); + if (selectedURLs.isEmpty()) { + delete this; + return; + } + m_method = method; if ( confirmation == SKIP_CONFIRMATION || askDeleteConfirmation( selectedURLs, confirmation ) ) { @@ -536,8 +546,16 @@ void KonqOperations::asyncDrop( const KF void KonqOperations::doFileCopy() { assert(m_info); // setDropInfo - and asyncDrop - should have been called before asyncDrop - KURL::List lst = m_info->lst; + KURL::List lst; QDropEvent::Action action = m_info->action; + + for (KURL::List::Iterator it = m_info->lst.begin(); it != m_info->lst.end(); ++it) + if ( KProtocolInfo::supportsDeleting( *it ) ) + lst.append(*it); + + if (lst.isEmpty()) + return; + if ( m_destURL.path( 1 ) == KGlobalSettings::trashPath() ) { if ( askDeleteConfirmation( lst, DEFAULT_CONFIRMATION ) ) --Boundary-00=_VGcv9m63aNi4Nh3--