cache: better implemented changing disk cache folders
Not complete yet, but getting there.
This commit is contained in:
@@ -22,6 +22,10 @@
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
#include "node/output/viewer/viewer.h"
|
||||
#include "project/item/sequence/sequence.h"
|
||||
#include "project/project.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
void PlaybackCache::Invalidate(const TimeRange &r)
|
||||
@@ -190,4 +194,25 @@ void PlaybackCache::RemoveRangeFromJobs(const TimeRange &remove)
|
||||
}
|
||||
}
|
||||
|
||||
QString PlaybackCache::GetCacheDirectory() const
|
||||
{
|
||||
// NOTE: A lot of assumptions in this behavior
|
||||
ViewerOutput* viewer = static_cast<ViewerOutput*>(parent());
|
||||
if (!viewer) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
Sequence* sequence = static_cast<Sequence*>(viewer->parent());
|
||||
if (!sequence) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
Project* project = sequence->project();
|
||||
if (!project) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
return project->cache_path();
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
Reference in New Issue
Block a user