mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kio: drop KFileItem metadata related getter and setter
first thing first - KFileMetaInfo does not support non-local files and KFileItem is ment to be wrapper for both local and (most importantly) remote (including virtual KIO) files. KIO::UDSEntry does not carry metadata either so having a metadata getter and setter in KFileItem is simply redundant, both are not tested and used only by plasma folderview applet (see kde-workspace/plasma/applets/folderview/tooltipwidget.cpp) Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
382fd80484
commit
a487c9edc6
3 changed files with 1 additions and 43 deletions
|
@ -21,6 +21,7 @@
|
|||
#define KFILEMETADATAMODEL_H
|
||||
|
||||
#include <kfileitem.h>
|
||||
#include <kfilemetainfo.h>
|
||||
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QObject>
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include <QtDBus/QDBusReply>
|
||||
|
||||
#include <kdebug.h>
|
||||
#include <kfilemetainfo.h>
|
||||
#include <kglobal.h>
|
||||
#include <kiconloader.h>
|
||||
#include <klocale.h>
|
||||
|
@ -204,7 +203,6 @@ public:
|
|||
// For special case like link to dirs over FTP
|
||||
QString m_guessedMimeType;
|
||||
mutable QString m_access;
|
||||
mutable KFileMetaInfo m_metaInfo;
|
||||
|
||||
enum { NumFlags = KFileItem::CreationTime + 1 };
|
||||
mutable KDateTime m_time[3];
|
||||
|
@ -213,7 +211,6 @@ public:
|
|||
void KFileItemPrivate::init()
|
||||
{
|
||||
m_access.clear();
|
||||
// metaInfo = KFileMetaInfo();
|
||||
|
||||
// determine mode and/or permissions if unknown
|
||||
// TODO: delay this until requested
|
||||
|
@ -522,7 +519,6 @@ void KFileItem::refresh()
|
|||
|
||||
d->m_fileMode = KFileItem::Unknown;
|
||||
d->m_permissions = KFileItem::Unknown;
|
||||
d->m_metaInfo = KFileMetaInfo();
|
||||
d->m_hidden = KFileItemPrivate::Auto;
|
||||
refreshMimeType();
|
||||
|
||||
|
@ -1222,29 +1218,6 @@ QString KFileItem::timeString( FileTimes which ) const
|
|||
return KGlobal::locale()->formatDateTime( d->time(which) );
|
||||
}
|
||||
|
||||
|
||||
void KFileItem::setMetaInfo( const KFileMetaInfo & info ) const
|
||||
{
|
||||
if (!d)
|
||||
return;
|
||||
|
||||
d->m_metaInfo = info;
|
||||
}
|
||||
|
||||
KFileMetaInfo KFileItem::metaInfo(bool autoget) const
|
||||
{
|
||||
if (!d)
|
||||
return KFileMetaInfo();
|
||||
|
||||
if (isFile() && autoget && !d->m_metaInfo.isValid())
|
||||
{
|
||||
KUrl url(mostLocalUrl());
|
||||
d->m_metaInfo = KFileMetaInfo(url.toLocalFile());
|
||||
}
|
||||
return d->m_metaInfo;
|
||||
}
|
||||
|
||||
|
||||
KUrl KFileItem::mostLocalUrl(bool &local) const
|
||||
{
|
||||
if (!d)
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include <kurl.h>
|
||||
#include <kacl.h>
|
||||
#include <kmimetype.h>
|
||||
#include <kfilemetainfo.h>
|
||||
#include <kdatetime.h>
|
||||
|
||||
class KFileItemPrivate;
|
||||
|
@ -475,21 +474,6 @@ public:
|
|||
*/
|
||||
operator QVariant() const;
|
||||
|
||||
/**
|
||||
* Sets the metainfo of this item to @p info.
|
||||
*
|
||||
* Made const to avoid deep copy.
|
||||
* @param info the new meta info
|
||||
*/
|
||||
void setMetaInfo( const KFileMetaInfo & info ) const;
|
||||
|
||||
/**
|
||||
* Returns the metainfo of this item.
|
||||
*
|
||||
* @param autoget if true, the metainfo will automatically be created
|
||||
*/
|
||||
KFileMetaInfo metaInfo(bool autoget = true) const;
|
||||
|
||||
/**
|
||||
* Tries to give a local URL for this file item if possible.
|
||||
* The given boolean indicates if the returned url is local or not.
|
||||
|
|
Loading…
Add table
Reference in a new issue