• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KIO

  • sources
  • kde-4.12
  • kdelibs
  • kio
  • kio
kfilemetainfoitem.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2 
3  Copyright (c) 2007 Jos van den Oever <jos@vandenoever.info>
4  2010 Sebastian Trueg <trueg@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License (LGPL) as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #include "kfilemetainfoitem.h"
23 #include "kfilemetainfoitem_p.h"
24 #include <config-nepomuk.h>
25 
26 KFileMetaInfoItem::KFileMetaInfoItem() : d(new KFileMetaInfoItemPrivate()) {
27 }
28 
29 KFileMetaInfoItem::KFileMetaInfoItem(const KFileMetaInfoItem& item) : d(item.d) {
30 }
31 KFileMetaInfoItem::KFileMetaInfoItem(const QString& pp,
32  const QVariant& v, KFileWritePlugin* w, bool e)
33  : d(new KFileMetaInfoItemPrivate()) {
34 #ifndef KDE_NO_DEPRECATED
35  d->pp = pp;
36 #else
37 #ifndef KIO_NO_NEPOMUK
38  d->pp = QUrl(pp);
39 #endif
40 #endif
41  d->value = v;
42  d->writer = w;
43  d->embedded = e;
44  d->modified = false;
45 }
46 KFileMetaInfoItem::~KFileMetaInfoItem() {
47 }
48 const KFileMetaInfoItem&
49 KFileMetaInfoItem::operator=(const KFileMetaInfoItem& item) {
50  d = item.d;
51  return item;
52 }
53 const QString&
54 KFileMetaInfoItem::name() const {
55 #ifndef KDE_NO_DEPRECATED
56  return d->pp.name();
57 #else
58  #ifndef KIO_NO_NEPOMUK
59  return d->pp.name();
60  #else
61  return QString::null;
62  #endif
63 #endif
64 }
65 const QVariant&
66 KFileMetaInfoItem::value() const {
67  return d->value;
68 }
69 bool
70 KFileMetaInfoItem::setValue(const QVariant& value) {
71  bool changed = d->value != value;
72  d->value = value;
73  d->modified |= changed;
74  return changed;
75 }
76 bool
77 KFileMetaInfoItem::addValue(const QVariant& value) {
78  QVariant& v = d->value;
79  if (v.type() == QVariant::List) {
80  QVariantList vl = v.toList();
81  vl.append(value);
82  d->value = vl;
83  }
84  return false;
85 }
86 bool
87 KFileMetaInfoItem::isModified() const {
88  return d->modified;
89 }
90 bool
91 KFileMetaInfoItem::isRemoved() const {
92  return d->modified && d->value.isNull();
93 }
94 bool
95 KFileMetaInfoItem::isValid() const {
96  return true;
97 }
98 bool
99 KFileMetaInfoItem::isSkipped() const {
100  // ########## TODO implement (vandenoever)
101  return false;
102 }
103 #ifndef KDE_NO_DEPRECATED
104 const PredicateProperties&
105 KFileMetaInfoItem::properties() const {
106  return d->pp;
107 }
108 #endif
109 bool
110 KFileMetaInfoItem::isEditable() const {
111  return d->writer != 0;
112 }
113 QString
114 KFileMetaInfoItem::suffix() const {
115  // ########## TODO implement (vandenoever)
116  return QString();
117 }
118 
119 QString
120 KFileMetaInfoItem::prefix() const {
121  // ########## TODO implement (vandenoever)
122  return QString();
123 }
QVariant
PredicateProperties
A predicate is part of the RDF trinity: subject, predicate, object.
Definition: predicateproperties.h:36
KFileMetaInfoItem
Definition: kfilemetainfoitem.h:34
KFileMetaInfoItem::setValue
bool setValue(const QVariant &value)
Set the value of this field.
Definition: kfilemetainfoitem.cpp:70
kfilemetainfoitem_p.h
QUrl
QString
KFileMetaInfoItemPrivate
Definition: kfilemetainfoitem_p.h:40
KFileMetaInfoItem::operator=
const KFileMetaInfoItem & operator=(const KFileMetaInfoItem &item)
Copy operator.
Definition: kfilemetainfoitem.cpp:49
KFileMetaInfoItem::properties
const PredicateProperties & properties() const
Retrieve the properties of this field type.
Definition: kfilemetainfoitem.cpp:105
KFileMetaInfoItem::isRemoved
bool isRemoved() const
Has this value been removed, e.g with setValue(QVariant())
Definition: kfilemetainfoitem.cpp:91
KFileMetaInfoItem::suffix
QString suffix() const
This method returns a translated suffix to be displayed after the value.
Definition: kfilemetainfoitem.cpp:114
KFileMetaInfoItem::addValue
bool addValue(const QVariant &)
Append a value to the properties in this file.
Definition: kfilemetainfoitem.cpp:77
KFileMetaInfoItem::isEditable
bool isEditable() const
Can this item be edited.
Definition: kfilemetainfoitem.cpp:110
kfilemetainfoitem.h
KFileMetaInfoItem::isValid
bool isValid() const
Is this a valid item.
Definition: kfilemetainfoitem.cpp:95
KFileMetaInfoItem::prefix
QString prefix() const
This method returns a translated prefix to be displayed before the value.
Definition: kfilemetainfoitem.cpp:120
KFileMetaInfoItem::KFileMetaInfoItem
KFileMetaInfoItem()
Default constructor.
Definition: kfilemetainfoitem.cpp:26
KFileMetaInfoItem::name
const QString & name() const
Localized name of the predicate.
Definition: kfilemetainfoitem.cpp:54
KFileMetaInfoItem::isSkipped
bool isSkipped() const
Has this value been skipped by analyzer due to performance or other considerations.
Definition: kfilemetainfoitem.cpp:99
KFileMetaInfoItem::~KFileMetaInfoItem
~KFileMetaInfoItem()
Destructor.
Definition: kfilemetainfoitem.cpp:46
KFileMetaInfoItem::isModified
bool isModified() const
Can this item be removed.
Definition: kfilemetainfoitem.cpp:87
KFileWritePlugin
Definition: kfilewriteplugin.h:28
KFileMetaInfoItem::value
const QVariant & value() const
Retrieve the current value of this item.
Definition: kfilemetainfoitem.cpp:66
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal