--Boundary-00=_/Ilv9rNmztrDkov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi! The patch I sent tonight hinders kdesktop to even try to delete devices:/ items, but still if an application tries KIO::del("devices:/cdrom") it will get deleted. The attached patch checks in CopyJob and DeleteJob if the protocol supports deleting and doesn't even stat then. The problem is that devices:/ (and lan:/ from what I heard) redirect URLs to protocols that _can_ delete, so if you delete these meta URLs you end up deleting something real - and this is at least confusing (and as this dangerous) Greetings, Stephan --Boundary-00=_/Ilv9rNmztrDkov Content-Type: text/x-diff; charset="us-ascii"; name="kio_job.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kio_job.patch" Index: job.cpp =================================================================== RCS file: /home/kde/kdelibs/kio/kio/job.cpp,v retrieving revision 1.329 diff -u -3 -p -u -r1.329 job.cpp --- job.cpp 2002/10/15 10:43:23 1.329 +++ job.cpp 2002/10/29 09:13:33 @@ -2048,6 +2048,14 @@ void CopyJob::statNextSrc() } else { + // if the file system doesn't support deleting, we do not even stat + if (m_mode == Move && !KProtocolInfo::supportsDeleting(m_currentSrcURL)) { + // the connected slotResult is supposed to get the next in the list + m_error = KIO::ERR_UNSUPPORTED_ACTION; + m_errorText = m_currentSrcURL.url(); + emitResult(); + return; + } // Stat the next src url Job * job = KIO::stat( m_currentSrcURL, true, 2, false ); //kdDebug(7007) << "KIO::stat on " << (*it).prettyURL() << endl; @@ -3085,6 +3093,15 @@ void DeleteJob::statNextSrc() if ( m_currentStat != m_srcList.end() ) { m_currentURL = (*m_currentStat); + + // if the file system doesn't support deleting, we do not even stat + if (!KProtocolInfo::supportsDeleting(m_currentURL)) { + // the connected slotResult is supposed to get the next in the list + m_error = KIO::ERR_UNSUPPORTED_ACTION; + m_errorText = m_currentURL.url(); + emitResult(); + return; + } // Stat it state = STATE_STATING; KIO::SimpleJob * job = KIO::stat( m_currentURL, true, 1, false ); --Boundary-00=_/Ilv9rNmztrDkov--