Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c26f12e6 authored by Michael Pyne's avatar Michael Pyne

cache: Port completely off of FileHandleHash.

Since Cache no longer also acts as a collection of FileHandles there's
no need for FileHandleHash. Get rid of it, replace its one use by the
equivalent data structure within CollectionList.
parent 629f9dc9
......@@ -3,8 +3,8 @@
copyright : (C) 2002 - 2004 by Scott Wheeler
email : wheeler@kde.org
copyright : (C) 2008 by Michael Pyne
email : michael.pyne@kdemail.net
copyright : (C) 2008, 2013 by Michael Pyne
email : mpyne@kde.org
***************************************************************************/
/***************************************************************************
......@@ -291,10 +291,10 @@ bool Cache::cacheFileExists() // static
}
////////////////////////////////////////////////////////////////////////////////
// protected methods
// private methods
////////////////////////////////////////////////////////////////////////////////
Cache::Cache() : FileHandleHash()
Cache::Cache()
{
}
......
......@@ -2,6 +2,9 @@
begin : Sat Sep 7 2002
copyright : (C) 2002 - 2004 by Scott Wheeler
email : wheeler@kde.org
copyright : (C) 2008, 2013 by Michael Pyne
email : mpyne@kde.org
***************************************************************************/
/***************************************************************************
......@@ -13,17 +16,16 @@
* *
***************************************************************************/
#ifndef CACHE_H
#define CACHE_H
#ifndef JUK_CACHE_H
#define JUK_CACHE_H
#include <QtCore/QDataStream>
#include <QtCore/QFile>
#include <QtCore/QBuffer>
#include "stringhash.h"
class Playlist;
class PlaylistCollection;
class FileHandle;
template<class T>
class QList;
......@@ -49,7 +51,7 @@ private:
};
class Cache : public FileHandleHash
class Cache
{
public:
static Cache *instance();
......@@ -76,7 +78,8 @@ public:
*/
static const int playlistItemsCacheVersion;
protected:
private:
// private to force access through instance()
Cache();
private:
......
......@@ -1867,9 +1867,10 @@ void Playlist::addFile(const QString &file, FileHandleList &files, bool importPl
// Our biggest thing that we're fighting during startup is too many stats
// of files. Make sure that we don't do one here if it's not needed.
FileHandle cached = Cache::instance()->value(file);
const CollectionListItem *item = CollectionList::instance()->lookup(file);
if(!cached.isNull()) {
if(item && !item->file().isNull()) {
FileHandle cached(item->file());
cached.tag();
files.append(cached);
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment