[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: [PATCH] another patch for the kio_devices problem
From: Stephan Kulow <coolo () kde ! org>
Date: 2002-10-29 9:17:51
[Download RAW message or body]
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
["kio_job.patch" (text/x-diff)]
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 );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic