[Digikam-devel] problem with the kio

Tom Albers tomalbers at kde.nl
Sat Aug 27 22:58:19 BST 2005


Op donderdag 25 augustus 2005 02:53, schreef Renchi Raju:
> On 8/24/05, Tom Albers <tomalbers at kde.nl> wrote:
> > when i have a folder which is readonly and trying to move an item to
> > another folder, i get (a bit cryptic) warning that that is not possible.
> >
> > It enters the routine at line +/- 812 of digikamalbums.cpp from the kio:
> >
> >         if (( errno == EACCES ) || (errno == EPERM))
> >         {
> >             error( KIO::ERR_ACCESS_DENIED, dst.url() );
> >         }
> >
> > Which points to the dst.url(), but the problem lies in the src.url(), so
> > the warning should say that. How can we change that to prevent users
> > (like me) spending four hours tracking down the problem (like me).  I
> > guess it should enter the ERR_CANNOT_DELETE, but it doesn't ;-)
>
> Not sure what your question really is? If bugs were always very easy
> to fix, then there most software would be flawless :).
>
> In the above case, the problem occurred with the renaming of the src
> url to the dst url. According to the documentation of rename, if the
> eacces or eperm errno is set, then its either src or dst. Now, the
> kio::error with key identifier doesn't provide for both src and
> destination urls to be represented in the string. We can always
> override the default to compose a string on our own after checking
> permissions for both src and dst.

Thanks, done so. 

I tried to find out with a st_mode & S_IWUSR, but that tells only if the user 
can write it, the write bit could be set in the folder or by IWOTH, so I used 
QFileInfo::isWritable, this is maybe a bit more expensive, but returns a more 
accurate answer. 

Tom
-- 
http://www.kde.nl | http://www.digikam.org |irc: toma | toma at jabber.kovoks.nl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1930 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/digikam-devel/attachments/20050827/6b6fb650/attachment.bin>


More information about the Digikam-devel mailing list