On Thursday, 2012-08-16, Milian Wolff wrote:
> Hey there,
> 
> where should an app store it's cache data? I see that KStandardDirs notes
> "cache", but how would one actually use that?
> 
> I.e. if I want to write a file to the app's cache dir, I need a path to
> said dir. ::findDirs would not return anything for these tests:
> 
>   qDebug() << KGlobal::dirs()->findDirs("cache", "kdevelop");
>   qDebug() << KGlobal::dirs()->findDirs("cache", "kdevelop/foo/bar");
>   qDebug() << KGlobal::dirs()->findDirs("data", "kdevelop/foo/bar");
> 
> Apparently, only existing directories are returned (if I create e.g.
> ~/.kde/cache-$host/kdevelop the first call will return the path to that
> folder).
> 
> So how do I figure out the recommended path for cache data? Should I use
> KStandardDirs::resourceDirs("cache") and pick the first item in the
> returned list? Could more than one directory be returned?

Try KStandardDirs::saveLocation()

Cheers,
Kevin

-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring

Attachment: signature.asc
Description: This is a digitally signed message part.

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to