undeprecated PredicateProperties as an alternative to nepomuk

This commit is contained in:
Ivailo Monev 2014-12-07 23:35:01 +00:00
parent 0efeec57ab
commit 80ce862656
2 changed files with 1 additions and 15 deletions

View file

@ -28,9 +28,7 @@ class PredicateProperties::Private : public QSharedData {
public: public:
static const QString nullString; static const QString nullString;
static const QStringList nullStringList; static const QStringList nullStringList;
#ifndef KDE_NO_DEPRECATED
static const PredicateProperties nullPP; static const PredicateProperties nullPP;
#endif
PredicateProperties parent; PredicateProperties parent;
QString key; QString key;
QString name; QString name;
@ -39,18 +37,14 @@ public:
}; };
const QString PredicateProperties::Private::nullString; const QString PredicateProperties::Private::nullString;
const QStringList PredicateProperties::Private::nullStringList; const QStringList PredicateProperties::Private::nullStringList;
#ifndef KDE_NO_DEPRECATED
const PredicateProperties PredicateProperties::Private::nullPP; const PredicateProperties PredicateProperties::Private::nullPP;
#endif
#ifndef KDE_NO_DEPRECATED
PredicateProperties::PredicateProperties(const QString& predicate) { PredicateProperties::PredicateProperties(const QString& predicate) {
if (!predicate.isEmpty()) { if (!predicate.isEmpty()) {
d = new Private(); d = new Private();
d->key = predicate; d->key = predicate;
} }
} }
#endif
PredicateProperties::PredicateProperties(const PredicateProperties& pp) PredicateProperties::PredicateProperties(const PredicateProperties& pp)
: d(pp.d) { : d(pp.d) {
} }
@ -96,11 +90,7 @@ PredicateProperties::createValidator() const {
} }
const PredicateProperties& const PredicateProperties&
PredicateProperties::parent() const { PredicateProperties::parent() const {
#ifndef KDE_NO_DEPRECATED
return ( d) ? d->parent :Private::nullPP; return ( d) ? d->parent :Private::nullPP;
#else
return d->parent;
#endif
} }
bool bool
PredicateProperties::isValid() const { PredicateProperties::isValid() const {

View file

@ -30,15 +30,11 @@ class QValidator;
* It is identified by URI and it defines the type of the relationship. * It is identified by URI and it defines the type of the relationship.
* For file metadata, a predicate can be seen as a fieldname. * For file metadata, a predicate can be seen as a fieldname.
* It has a data type, a description, a short id, a cardinality * It has a data type, a description, a short id, a cardinality
*
* @deprecated use Nepomuk::Types::Property instead
**/ **/
class KIO_EXPORT PredicateProperties { class KIO_EXPORT PredicateProperties {
friend class PredicatePropertyProvider; friend class PredicatePropertyProvider;
public: public:
#ifndef KDE_NO_DEPRECATED PredicateProperties(const QString& predicate = QString());
KDE_DEPRECATED PredicateProperties(const QString& predicate = QString());
#endif
PredicateProperties(const PredicateProperties& p); PredicateProperties(const PredicateProperties& p);
~PredicateProperties(); ~PredicateProperties();
const PredicateProperties& operator=(const PredicateProperties& p); const PredicateProperties& operator=(const PredicateProperties& p);