Nepomuk-Core
#include <resourcedata.h>
Public Member Functions | |
ResourceData (const QUrl &uri, const QUrl &kickOffUri, const QUrl &type_, ResourceManagerPrivate *rm) | |
~ResourceData () | |
void | addProperty (const QUrl &uri, const Variant &value) |
QHash< QUrl, Variant > | allProperties () |
int | cnt () const |
bool | deref (Nepomuk2::Resource *res) |
void | determineUri () |
bool | exists () |
bool | hasProperty (const QUrl &uri) |
bool | hasProperty (const QUrl &p, const Variant &v) |
void | invalidateCache () |
bool | isFile () |
bool | isValid () const |
bool | load () |
QDebug | operator<< (QDebug dbg) const |
bool | operator== (const ResourceData &other) const |
Variant | property (const QUrl &uri) |
void | propertyAdded (const Types::Property &prop, const QVariant &value) |
void | propertyRemoved (const Types::Property &prop, const QVariant &value) |
bool | ref (Nepomuk2::Resource *res) |
void | remove (bool recursive=true) |
void | removeProperty (const QUrl &uri) |
void | resetAll () |
QList< Resource * > | resources () const |
ResourceManagerPrivate * | rm () const |
void | setProperty (const QUrl &uri, const Variant &value) |
void | setWatchEnabled (bool status) |
bool | store () |
QUrl | type () |
void | updateKickOffLists (const QUrl &uri, const Variant &oldvariant, const Variant &newvariant) |
QUrl | uri () const |
bool | watchEnabled () |
Detailed Description
Definition at line 42 of file resourcedata.h.
Constructor & Destructor Documentation
|
explicit |
Definition at line 64 of file resourcedata.cpp.
Nepomuk2::ResourceData::~ResourceData | ( | ) |
Definition at line 105 of file resourcedata.cpp.
Member Function Documentation
void Nepomuk2::ResourceData::addProperty | ( | const QUrl & | uri, |
const Variant & | value | ||
) |
Definition at line 446 of file resourcedata.cpp.
QHash< QUrl, Nepomuk2::Variant > Nepomuk2::ResourceData::allProperties | ( | ) |
Definition at line 195 of file resourcedata.cpp.
|
inline |
Definition at line 65 of file resourcedata.h.
|
inline |
Definition at line 54 of file resourcedata.h.
void Nepomuk2::ResourceData::determineUri | ( | ) |
Searches for the resource in the Nepomuk store using m_kickoffId and m_kickoffUri.
This will either get the actual resource URI from the database and add m_data into ResourceManagerPrivate::m_initializedData or it will find another ResourceData instance in m_initializedData which represents the same resource. The ResourceData that should be used is set in all the associated resources.
Definition at line 580 of file resourcedata.cpp.
bool Nepomuk2::ResourceData::exists | ( | ) |
This method only works with a proper URI, i.e.
it does not work on non-initialized resources that only know their kickoffUriOrId
Definition at line 560 of file resourcedata.cpp.
bool Nepomuk2::ResourceData::hasProperty | ( | const QUrl & | uri | ) |
Definition at line 206 of file resourcedata.cpp.
bool Nepomuk2::ResourceData::hasProperty | ( | const QUrl & | p, |
const Variant & | v | ||
) |
Definition at line 220 of file resourcedata.cpp.
void Nepomuk2::ResourceData::invalidateCache | ( | ) |
Definition at line 680 of file resourcedata.cpp.
bool Nepomuk2::ResourceData::isFile | ( | ) |
Tries to determine if this resource represents a file by examining the type and the uri.
Definition at line 111 of file resourcedata.cpp.
bool Nepomuk2::ResourceData::isValid | ( | ) | const |
Definition at line 574 of file resourcedata.cpp.
bool Nepomuk2::ResourceData::load | ( | ) |
Definition at line 347 of file resourcedata.cpp.
QDebug Nepomuk2::ResourceData::operator<< | ( | QDebug | dbg | ) | const |
Definition at line 699 of file resourcedata.cpp.
bool Nepomuk2::ResourceData::operator== | ( | const ResourceData & | other | ) | const |
Compares the properties of two ResourceData objects taking into account the Deleted flag.
Definition at line 687 of file resourcedata.cpp.
Nepomuk2::Variant Nepomuk2::ResourceData::property | ( | const QUrl & | uri | ) |
Definition at line 240 of file resourcedata.cpp.
void Nepomuk2::ResourceData::propertyAdded | ( | const Types::Property & | prop, |
const QVariant & | value | ||
) |
Definition at line 804 of file resourcedata.cpp.
void Nepomuk2::ResourceData::propertyRemoved | ( | const Types::Property & | prop, |
const QVariant & | value | ||
) |
Called by ResourceManager (with the RM mutex locked)
Definition at line 768 of file resourcedata.cpp.
|
inline |
Definition at line 48 of file resourcedata.h.
void Nepomuk2::ResourceData::remove | ( | bool | recursive = true | ) |
Remove this resource data from the store completely.
- Parameters
-
recursive If true all statements that contain this resource as an object will be removed, too.
Definition at line 532 of file resourcedata.cpp.
void Nepomuk2::ResourceData::removeProperty | ( | const QUrl & | uri | ) |
Definition at line 499 of file resourcedata.cpp.
void Nepomuk2::ResourceData::resetAll | ( | ) |
Will reset this instance to 0 as if constructed without parameters Used by remove() and deleteData()
Definition at line 164 of file resourcedata.cpp.
|
inline |
Definition at line 60 of file resourcedata.h.
|
inline |
Definition at line 154 of file resourcedata.h.
void Nepomuk2::ResourceData::setProperty | ( | const QUrl & | uri, |
const Variant & | value | ||
) |
Set a property.
The property will directly be saved to the RDF store. Calls store to make sure this resource and property resources are properly stored.
Definition at line 389 of file resourcedata.cpp.
void Nepomuk2::ResourceData::setWatchEnabled | ( | bool | status | ) |
Definition at line 815 of file resourcedata.cpp.
bool Nepomuk2::ResourceData::store | ( | ) |
Makes sure the resource is present in the RDF store.
This means that if it does not exist the type and the identifier (if one has been used to create the instance) are stored.
This is also the only place where a new URI is generated via ResourceManager::generateUniqueUri() in case m_uri is empty.
- See also
- exists, setProperty
Definition at line 259 of file resourcedata.cpp.
QUrl Nepomuk2::ResourceData::type | ( | ) |
- Returns
- The main type of the resource. ResourceData tries hard to make this the most important type, i.e. that which is furthest down the hierachy.
Definition at line 128 of file resourcedata.cpp.
void Nepomuk2::ResourceData::updateKickOffLists | ( | const QUrl & | uri, |
const Variant & | oldvariant, | ||
const Variant & | newvariant | ||
) |
Updates ResourceManagerPrivate's list.
Definition at line 741 of file resourcedata.cpp.
QUrl Nepomuk2::ResourceData::uri | ( | ) | const |
The URI of the resource.
This might be empty if the resource was not synced yet.
Definition at line 121 of file resourcedata.cpp.
bool Nepomuk2::ResourceData::watchEnabled | ( | ) |
Definition at line 827 of file resourcedata.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.