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

List:       kde-panel-devel
Subject:    Re: how to use the cache-to-disk feature in Wallpaper
From:       Benoit Jacob <jacob.benoit.1 () gmail ! com>
Date:       2009-04-13 14:26:02
Message-ID: d9f848520904130726u2c6760dftc57c3e531f3ace92 () mail ! gmail ! com
[Download RAW message or body]

oops, sent too fast. sorry for the spam.

It remains that my way of triggering save() was "kquitapp plasma". So
in every case, my problem arises when Mandelbrot is about to be
destroyed.

2009/4/13 Benoit Jacob <jacob.benoit.1@gmail.com>:
> By the way the committed code does this from save(), not from the
> destructor, so this wasn't where to look for an explanation.
>
> Cheers,
> Benoit
>
> 2009/4/13 Benoit Jacob <jacob.benoit.1@gmail.com>:
>> this is now committed, as a testcase...
>>
>> Example of console output:
>>
>> plasma-desktop(7077) Mandelbrot::updateCache: remove  "mandelbrot-157422800"
>>
>> Corresponding to this code:
>>
>> // remove old image from cache
>> kDebug() << "remove " << m_cacheKey;
>> insertIntoCache(m_cacheKey, QImage());
>>
>> Yet the file still exists:
>>
>> bjacob@kiwi:~/.kde/cache-kiwi/plasma-wallpapers> ls
>> home  mandelbrot-157422800.png  mandelbrot-72259600.png  usr
>>
>>
>> Cheers,
>> Benoit
>>
>> 2009/4/13 Benoit Jacob <jacob.benoit.1@gmail.com>:
>>> I have a problem, I wonder if I'm hitting a bug.
>>>
>>> It seems as if insertIntoCache(key, QImage()) does not do anything
>>> when it is called from ~Mandelbrot(). The expected behavior was to
>>> remove the image corresponding to 'key' from the cache.
>>>
>>> I have really checked that the key is correct and that
>>> isUsingDiskCache() returns true. Looking at the source code in
>>> wallpaper.cpp, I can't see anything else to check...
>>>
>>> When I used to call  insertIntoCache(key, QImage()) from a slot
>>> connected to a QTimer, it did work. So there seems to be something
>>> specific to calling it from the destructor.
>>>
>>> Cheers,
>>> Benoit
>>>
>>> 2009/4/12 Benoit Jacob <jacob.benoit.1@gmail.com>:
>>>> 2009/4/12 Aaron J. Seigo <aseigo@kde.org>:
>>>>> if you have 3 containments with the same image as the wallpaper, it shouldn't
>>>>> create three cache files on disk. so there is no real mapping from cache file
>>>>> to containment; there is a mapping of sorts between wallpaper plugins and the
>>>>> cache file they are using ...
>>>>
>>>> ah, right, i hadn't thought of this.
>>>>
>>>> For the rest, I agree, and I don't see any good solution...
>>>>
>>>> The main reason for stale cached images will probably be if plasma
>>>> crashes (which is bound to happen as any binary plugin may crash
>>>> plasma). Maybe then one could say that, when plasma starts for the
>>>> first time after a crash, it prunes its cache (like removing the
>>>> oldest files until the cache size is under a certain limit, as you
>>>> suggested).
>>>>
>>>> Cheers,
>>>> Benoit
>>>>
>>>
>>
>
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

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

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