mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 10:52: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
|
#define KFILEMETADATAMODEL_H
|
||||||
|
|
||||||
#include <kfileitem.h>
|
#include <kfileitem.h>
|
||||||
|
#include <kfilemetainfo.h>
|
||||||
|
|
||||||
#include <QtCore/QHash>
|
#include <QtCore/QHash>
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
#include <QtDBus/QDBusReply>
|
#include <QtDBus/QDBusReply>
|
||||||
|
|
||||||
#include <kdebug.h>
|
#include <kdebug.h>
|
||||||
#include <kfilemetainfo.h>
|
|
||||||
#include <kglobal.h>
|
#include <kglobal.h>
|
||||||
#include <kiconloader.h>
|
#include <kiconloader.h>
|
||||||
#include <klocale.h>
|
#include <klocale.h>
|
||||||
|
@ -204,7 +203,6 @@ public:
|
||||||
// For special case like link to dirs over FTP
|
// For special case like link to dirs over FTP
|
||||||
QString m_guessedMimeType;
|
QString m_guessedMimeType;
|
||||||
mutable QString m_access;
|
mutable QString m_access;
|
||||||
mutable KFileMetaInfo m_metaInfo;
|
|
||||||
|
|
||||||
enum { NumFlags = KFileItem::CreationTime + 1 };
|
enum { NumFlags = KFileItem::CreationTime + 1 };
|
||||||
mutable KDateTime m_time[3];
|
mutable KDateTime m_time[3];
|
||||||
|
@ -213,7 +211,6 @@ public:
|
||||||
void KFileItemPrivate::init()
|
void KFileItemPrivate::init()
|
||||||
{
|
{
|
||||||
m_access.clear();
|
m_access.clear();
|
||||||
// metaInfo = KFileMetaInfo();
|
|
||||||
|
|
||||||
// determine mode and/or permissions if unknown
|
// determine mode and/or permissions if unknown
|
||||||
// TODO: delay this until requested
|
// TODO: delay this until requested
|
||||||
|
@ -522,7 +519,6 @@ void KFileItem::refresh()
|
||||||
|
|
||||||
d->m_fileMode = KFileItem::Unknown;
|
d->m_fileMode = KFileItem::Unknown;
|
||||||
d->m_permissions = KFileItem::Unknown;
|
d->m_permissions = KFileItem::Unknown;
|
||||||
d->m_metaInfo = KFileMetaInfo();
|
|
||||||
d->m_hidden = KFileItemPrivate::Auto;
|
d->m_hidden = KFileItemPrivate::Auto;
|
||||||
refreshMimeType();
|
refreshMimeType();
|
||||||
|
|
||||||
|
@ -1222,29 +1218,6 @@ QString KFileItem::timeString( FileTimes which ) const
|
||||||
return KGlobal::locale()->formatDateTime( d->time(which) );
|
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
|
KUrl KFileItem::mostLocalUrl(bool &local) const
|
||||||
{
|
{
|
||||||
if (!d)
|
if (!d)
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
#include <kurl.h>
|
#include <kurl.h>
|
||||||
#include <kacl.h>
|
#include <kacl.h>
|
||||||
#include <kmimetype.h>
|
#include <kmimetype.h>
|
||||||
#include <kfilemetainfo.h>
|
|
||||||
#include <kdatetime.h>
|
#include <kdatetime.h>
|
||||||
|
|
||||||
class KFileItemPrivate;
|
class KFileItemPrivate;
|
||||||
|
@ -475,21 +474,6 @@ public:
|
||||||
*/
|
*/
|
||||||
operator QVariant() const;
|
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.
|
* Tries to give a local URL for this file item if possible.
|
||||||
* The given boolean indicates if the returned url is local or not.
|
* The given boolean indicates if the returned url is local or not.
|
||||||
|
|
Loading…
Add table
Reference in a new issue