Add a mechanism for extending the file type resolution in JuK using FileRefs.

This is generally much better thought out than the current method of creating
FileRefs using the native mime system and also allows for extension to additional
file formats.


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@437382 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Scott Wheeler
2005-07-21 17:45:23 +00:00
parent 87824b1737
commit ec86c487e8
5 changed files with 84 additions and 20 deletions

View File

@ -39,8 +39,11 @@ public:
}
File *file;
static List<const FileTypeResolver *> fileTypeResolvers;
};
List<const FileRef::FileTypeResolver *> FileRef::FileRefPrivate::fileTypeResolvers;
////////////////////////////////////////////////////////////////////////////////
// public members
////////////////////////////////////////////////////////////////////////////////
@ -92,6 +95,11 @@ bool FileRef::save()
return d->file->save();
}
void FileRef::addFileTypeResolver(const FileTypeResolver *resolver) // static
{
FileRefPrivate::fileTypeResolvers.prepend(resolver);
}
bool FileRef::isNull() const
{
return !d->file || !d->file->isValid();