[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: handling a failed loading of images
From:       Thomas Zander <zander () kde ! org>
Date:       2009-09-01 6:23:24
Message-ID: 200909010823.26406.zander () kde ! org
[Download RAW message or body]

Well spotted omission in the imageData concept!
Thanks for investigating.

On Tuesday 1. September 2009 07.58.01 Jos van den Oever wrote:
>  What I would like to
> know is how to tell the caller of KoImageCollection::createImageData to
> tell that the image is bad. Do you mean an invalid IoImageData object
> should be passed (instead of e.g. a NULL pointer)? That is a solution.

Yes, return a KoImageData that returns false on isValid would likely work 
best.

Second usecase; KoStore based create method is used and the data it points 
to is not something Qt can read into a QImage.
As we don't parse the imagedata from a kostore until it is used, and just 
copy the data we have no way of knowing that the data is unreadable right 
now.
The behavior should be similar between those two usecases.

> Then how to inform the caller what the nature of the error is? (Bad data
> or bad disk).

I guess we could add an error() method on KoImageData. See QFile::error()

-- 
Thomas Zander
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic