kio: deal with TODO related to file meta information

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-08-01 22:33:21 +03:00
parent 598b8fae19
commit 7bf83bb532
3 changed files with 14 additions and 13 deletions

View file

@ -83,7 +83,7 @@ void KFileMetaDataProvider::Private::readMetadata()
kWarning() << "the API does not handle multile URLs metadata";
}
const QString path = m_urls.first().toLocalFile();
KFileMetaInfo metaInfo(path, KFileMetaInfo::Fastest);
KFileMetaInfo metaInfo(path, KFileMetaInfo::TechnicalInfo);
const QHash<QString, KFileMetaInfoItem> metaInfoItems = metaInfo.items();
foreach (const KFileMetaInfoItem& metaInfoItem, metaInfoItems) {
const QString uriString = metaInfoItem.name();

View file

@ -322,8 +322,15 @@ public:
}
bool useFactory(Strigi::StreamAnalyzerFactory* factory) const {
Q_UNUSED(factory);
// TODO: filter factories based on m_indexDetail
if ((m_indexDetail & KFileMetaInfo::ContentInfo) == 0 && factory) {
if (qstrcmp(factory->name(), "CppLineAnalyzer") == 0) {
return false;
} else if (qstrcmp(factory->name(), "TxtLineAnalyzer") == 0) {
return false;
} else if (qstrcmp(factory->name(), "TextEndAnalyzer") == 0) {
return false;
}
}
return true;
}

View file

@ -61,22 +61,16 @@ public:
* parameters to constructors.
*/
enum What {
Fastest = 0x1, /**< do the fastest possible read and omit all items
that might need a significantly longer time
than the others */
TechnicalInfo = 0x2, /**< extract technical details about the file, like
TechnicalInfo = 0x1, /** extract technical details about the file, like
e.g. play time, resolution or a compressioni
type */
ContentInfo = 0x4, /**< read information about the content of the file
ContentInfo = 0x2, /** read information about the content of the file
like comments or id3 tags */
ExternalSources = 0x8, /**<read external metadata sources such as
ExternalSources = 0x4, /** read external metadata sources such as
filesystem based extended attributes if
they are supported for the filesystem;
RDF storages etc */
Thumbnail = 0x10, /**< only read the file's thumbnail, if it contains
one */
LinkedData = 0x40, //< extract linked/related files like html links, source #include etc
Everything = Fastest | TechnicalInfo | ContentInfo | ExternalSources | Thumbnail | LinkedData ///< read everything, even if it might take a while
Everything = TechnicalInfo | ContentInfo | ExternalSources // read everything, even if it might take a while
};
Q_DECLARE_FLAGS(WhatFlags, What)