#include <Nepomuk/Types/Property>
#include <Nepomuk/Variant>
+#include <QTime>
+
struct KNepomukRolesProviderSingleton
{
KNepomukRolesProvider instance;
} else if (role == "orientation") {
const QString orientation = orientationFromValue(value.toInt());
values.insert(role, orientation);
+ } else if (role == "duration") {
+ const QString duration = durationFromValue(value.toInt());
+ values.insert(role, duration);
} else if (value.isResource()) {
const Nepomuk::Resource resource = value.toResource();
values.insert(role, resource.genericLabel());
return string;
}
+QString KNepomukRolesProvider::durationFromValue(int value) const
+{
+ QTime duration;
+ duration = duration.addMSecs(value);
+ return duration.toString("hh:mm:ss");
+}
+
*/
QString orientationFromValue(int value) const;
+ /**
+ * @return Duration in the format HH::MM::SS for the value given
+ * in milliseconds.
+ */
+ QString durationFromValue(int value) const;
+
private:
QSet<QByteArray> m_roles;
QHash<QUrl, QByteArray> m_roleForUri;