1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
Index: kio/kio/kfileitem.cpp
===================================================================
--- kio/kio/kfileitem.cpp (revision 1110210)
+++ kio/kio/kfileitem.cpp (revision 1110211)
@@ -1217,13 +1217,13 @@
d->m_metaInfo = info;
}
-KFileMetaInfo KFileItem::metaInfo(bool autoget, int) const
+KFileMetaInfo KFileItem::metaInfo(bool autoget, int what) const
{
if ((isRegularFile() || isDir()) && autoget && !d->m_metaInfo.isValid())
{
bool isLocalUrl;
KUrl url(mostLocalUrl(isLocalUrl));
- d->m_metaInfo = KFileMetaInfo(url);//, mimetype() );
+ d->m_metaInfo = KFileMetaInfo(url.toLocalFile(), mimetype(), (KFileMetaInfo::What)what);
}
return d->m_metaInfo;
}
Index: kio/kio/kfileitem.h
===================================================================
--- kio/kio/kfileitem.h (revision 1110210)
+++ kio/kio/kfileitem.h (revision 1110211)
@@ -550,11 +550,14 @@
/**
* Returns the metainfo of this item.
+ *
+ * (since 4.4.3) By default it uses the KFileMetaInfo::ContentInfo | KFileMetaInfo::TechnicalInfo.
+ * If you need more information, create your own KFileMetaInfo object and set it using setMetaInfo()
* @param autoget if true, the metainfo will automatically be created
- * @param what ignored
+ * @param what how much metainfo you need to retrieve from the file (KFileMetaInfo::WhatFlag)
*/
KFileMetaInfo metaInfo(bool autoget = true,
- int what = KFileMetaInfo::Fastest) const;
+ int what = KFileMetaInfo::ContentInfo | KFileMetaInfo::TechnicalInfo) const;
/**
* @deprecated simply use '='
Index: kio/kfile/kmetaprops.cpp
===================================================================
--- kio/kfile/kmetaprops.cpp (revision 1110210)
+++ kio/kfile/kmetaprops.cpp (revision 1110211)
@@ -63,7 +63,8 @@
d->m_info = fileitem.metaInfo();
if (!d->m_info.isValid())
{
- d->m_info = KFileMetaInfo(properties->kurl().path(KUrl::RemoveTrailingSlash));
+ d->m_info = KFileMetaInfo(properties->kurl().path(KUrl::RemoveTrailingSlash), QString(),
+ KFileMetaInfo::ContentInfo | KFileMetaInfo::TechnicalInfo);
fileitem.setMetaInfo(d->m_info);
}
|