diff --git a/src/service/plugins/gtk-eventspy/GtkEventSpy.h b/src/service/plugins/gtk-eventspy/GtkEventSpy.h --- a/src/service/plugins/gtk-eventspy/GtkEventSpy.h +++ b/src/service/plugins/gtk-eventspy/GtkEventSpy.h @@ -38,7 +38,7 @@ private Q_SLOTS: void fileUpdated(const QString &file); - void addDocument(const QUrl &url, const QString &application); + void addDocument(const QUrl &url, const QString &application, const QString &mimetype); private: QObject *m_resources; diff --git a/src/service/plugins/gtk-eventspy/GtkEventSpy.cpp b/src/service/plugins/gtk-eventspy/GtkEventSpy.cpp --- a/src/service/plugins/gtk-eventspy/GtkEventSpy.cpp +++ b/src/service/plugins/gtk-eventspy/GtkEventSpy.cpp @@ -65,6 +65,7 @@ QDateTime added; QDateTime modified; QDateTime visited; + QString mimetype; QList applications; QString latestApplication() const; @@ -149,6 +150,8 @@ app.modified = QDateTime::fromString(attributes.value("modified"), Qt::ISODate); current.applications.append(app); + } else if (qName == QStringLiteral("mime:mime-type")) { + current.mimetype = attributes.value("type"); } return true; } @@ -194,14 +197,14 @@ for (const Bookmark &mark : bookmarks) { if (mark.added > m_lastUpdate || mark.modified > m_lastUpdate || mark.visited > m_lastUpdate) { - addDocument(mark.href, mark.latestApplication()); + addDocument(mark.href, mark.latestApplication(), mark.mimetype); } } m_lastUpdate = QDateTime::currentDateTime(); } -void GtkEventSpyPlugin::addDocument(const QUrl &url, const QString &application) +void GtkEventSpyPlugin::addDocument(const QUrl &url, const QString &application, const QString &mimetype) { const QString name = url.fileName(); @@ -212,6 +215,12 @@ Q_ARG(QString, url.toString()), // URI Q_ARG(uint, 0) // Event Activities::Accessed ); + + Plugin::invoke( + m_resources, "RegisteredResourceMimetype", + Q_ARG(QString, url.toString()), // uri + Q_ARG(QString, mimetype) // mimetype + ); } GtkEventSpyPlugin::~GtkEventSpyPlugin()