UndoCache disk space issues

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

UndoCache disk space issues

Martin Klapetek
Hi,

I've got some ideas about UndoCache. When digiKam crashes in image editor (maybe even in other cases), the cache for undo stays on the disk and it's never deleted. I've got almost 1 GB of wasted space by UndoCache. I propose for digiKam to check the cache dir when starting and delete all the unneeded files there. 

Next thing is, that when you don't have enough free space, UndoCache silently stops working, because it can't cache the data, but the user has no idea and clicking 'Undo' makes the current image disappear (and making DImgInterface::d->image NULL). Then hitting 'Redo' has of course the same effect, cause nothing is cached so there's nothing to display. Therefore I think, that some sort of free space checking should be implemented in UndoCache and the user should be warned by KDialog about not being able to use Undo/Redo features because of lack of free space. And maybe even disable the Undo/Redo in this case. 

What do you think?

Thanks,
Martin

_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: UndoCache disk space issues

Michael G. Hansen
On 08/15/2010 07:33 PM, Martin Klapetek wrote:
> Hi,
>
> I've got some ideas about UndoCache. When digiKam crashes in image editor
> (maybe even in other cases), the cache for undo stays on the disk and it's
> never deleted. I've got almost 1 GB of wasted space by UndoCache. I propose
> for digiKam to check the cache dir when starting and delete all the unneeded
> files there.

Would it be possible to instead re-load the undo cache and continue
editing the picture? If we want to delete it, we need to make sure that
it's not actually in use by another instance of digikam, possibly
running on another x server and another dbus session.

Michael
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: UndoCache disk space issues

Bugzilla from andi.clemens@gmx.net
This is the issue: You don't know if another instance of digiKam is running.
In the past I also just wanted to remove the undo-cache, but other running
instances were effected.
But due to time limitations I never thought of a good solution.
Maybe you can come up with something useful ;-)

Andi Clemens
-----------------
www.digikam.org

On Sunday 15 August 2010 23:56:54 Michael G. Hansen wrote:

> On 08/15/2010 07:33 PM, Martin Klapetek wrote:
> > Hi,
> >
> > I've got some ideas about UndoCache. When digiKam crashes in image editor
> > (maybe even in other cases), the cache for undo stays on the disk and
> > it's never deleted. I've got almost 1 GB of wasted space by UndoCache. I
> > propose for digiKam to check the cache dir when starting and delete all
> > the unneeded files there.
>
> Would it be possible to instead re-load the undo cache and continue
> editing the picture? If we want to delete it, we need to make sure that
> it's not actually in use by another instance of digikam, possibly
> running on another x server and another dbus session.
>
> Michael
> _______________________________________________
> Digikam-devel mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/digikam-devel
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: UndoCache disk space issues

Martin Klapetek

On Mon, Aug 16, 2010 at 07:30, Andi Clemens <[hidden email]> wrote:
This is the issue: You don't know if another instance of digiKam is running.
In the past I also just wanted to remove the undo-cache, but other running
instances were effected.

The cache file is in format "undocache-PID-n.bin" where the n is INT and probably means number of the cache file for the given PID. So if we know PID which created the cache, we should be able to just find out, if there is such process running, no? And if no, then delete it.

On Sunday 15 August 2010 23:56:54 Michael G. Hansen wrote:
>
> Would it be possible to instead re-load the undo cache and continue
> editing the picture?

Hmm...the cache itself is quite useless, it's only the image data for fast image switching with undo/redo, but it doesn't contain the actual info about the undo/redo operations, opened file etc. So the file is useless for new running instance.

Martin Klapetek 

_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: UndoCache disk space issues

Gilles Caulier-4
2010/8/16 Martin Klapetek <[hidden email]>:

>
> On Mon, Aug 16, 2010 at 07:30, Andi Clemens <[hidden email]> wrote:
>>
>> This is the issue: You don't know if another instance of digiKam is
>> running.
>> In the past I also just wanted to remove the undo-cache, but other running
>> instances were effected.
>
> The cache file is in format "undocache-PID-n.bin" where the n is INT and
> probably means number of the cache file for the given PID. So if we know PID
> which created the cache, we should be able to just find out, if there is
> such process running, no? And if no, then delete it.

yes, it can be do like this. to get current process info, it's easy :

http://lxr.kde.org/source/extragear/graphics/digikam/utilities/cameragui/cameracontroller.cpp#507

... using getpid() from #include <unistd.h> which work also under win32

>>
>> On Sunday 15 August 2010 23:56:54 Michael G. Hansen wrote:
>> >
>> > Would it be possible to instead re-load the undo cache and continue
>> > editing the picture?
>
> Hmm...the cache itself is quite useless, it's only the image data for fast
> image switching with undo/redo, but it doesn't contain the actual info about
> the undo/redo operations, opened file etc. So the file is useless for new
> running instance.

this can be hosted in bin data as metadata using XML format

Gilles
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel