[-]
[+]
|
Changed |
kactivities.spec
|
|
[-]
[+]
|
Added |
kactivities-5.10.0.tar.xz/.arcconfig
^
|
@@ -0,0 +1,4 @@
+{
+ "project.name" : "KActivities",
+ "phabricator.uri" : "https://phabricator.kde.org/"
+}
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/CMakeLists.txt
^
|
@@ -33,7 +33,7 @@
set (KACTIVITIES_CURRENT_ROOT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
# Extra CMake stuff
-find_package (ECM 5.9.0 REQUIRED NO_MODULE)
+find_package (ECM 5.10.0 REQUIRED NO_MODULE)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include (KDEInstallDirs)
@@ -47,8 +47,8 @@
find_package (Qt5 REQUIRED NO_MODULE COMPONENTS Core DBus)
# KDE Frameworks
-set(KF5_VERSION "5.9.0") # handled by release scripts
-set(KF5_DEP_VERSION "5.9.0") # handled by release scripts
+set(KF5_VERSION "5.10.0") # handled by release scripts
+set(KF5_DEP_VERSION "5.10.0") # handled by release scripts
find_package (KF5DBusAddons ${KF5_DEP_VERSION} CONFIG REQUIRED)
find_package (KF5I18n ${KF5_DEP_VERSION} CONFIG REQUIRED)
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/imports/CMakeLists.txt
^
|
@@ -4,7 +4,7 @@
find_package (ECM 0.0.8 REQUIRED NO_MODULE)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
-find_package (Qt5 REQUIRED NO_MODULE COMPONENTS Sql Gui Widgets Qml Sql)
+find_package (Qt5 REQUIRED NO_MODULE COMPONENTS Sql Gui Widgets Qml Quick Sql)
find_package (KF5DBusAddons ${KF5_DEP_VERSION} CONFIG REQUIRED)
find_package (KF5I18n ${KF5_DEP_VERSION} CONFIG REQUIRED)
find_package (KF5Config ${KF5_DEP_VERSION} CONFIG REQUIRED)
@@ -17,6 +17,7 @@
activitymodel.cpp
activityinfo.cpp
resourcemodel.cpp
+ resourceinstance.cpp
${KACTIVITIES_CURRENT_ROOT_SOURCE_DIR}/src/utils/dbusfuture_p.cpp
)
@@ -29,6 +30,7 @@
Qt5::DBus
Qt5::Gui
Qt5::Qml
+ Qt5::Quick
Qt5::Sql
KF5::I18n
KF5::DBusAddons
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/imports/activitiesextensionplugin.cpp
^
|
@@ -24,6 +24,7 @@
#include "activitymodel.h"
#include "activityinfo.h"
#include "resourcemodel.h"
+#include "resourceinstance.h"
#include <QDebug>
@@ -39,5 +40,6 @@
qmlRegisterType<KActivities::Imports::ActivityModel>(uri, 0, 1, "ActivityModel");
qmlRegisterType<KActivities::Imports::ActivityInfo>(uri, 0, 1, "ActivityInfo");
qmlRegisterType<KActivities::Imports::ResourceModel>(uri, 0, 1, "ResourceModel");
+ qmlRegisterType<KActivities::Imports::ResourceInstance>(uri, 0, 1, "ResourceInstance");
}
|
[-]
[+]
|
Added |
kactivities-5.10.0.tar.xz/src/imports/resourceinstance.cpp
^
|
@@ -0,0 +1,140 @@
+/***************************************************************************
+ * Copyright 2011-2015 Marco Martin <mart@kde.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU Library General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
+ ***************************************************************************/
+
+#include "resourceinstance.h"
+
+#include <QQuickWindow>
+#include <QTimer>
+
+#include <KActivities/ResourceInstance>
+#include <QDebug>
+
+namespace KActivities {
+namespace Imports {
+
+ResourceInstance::ResourceInstance(QQuickItem *parent)
+ : QQuickItem(parent)
+{
+ m_syncTimer = new QTimer(this);
+ m_syncTimer->setSingleShot(true);
+ connect(m_syncTimer, SIGNAL(timeout()), this, SLOT(syncWid()));
+}
+
+ResourceInstance::~ResourceInstance()
+{
+}
+
+void ResourceInstance::syncWid()
+{
+ QWindow *w = window();
+ if (!w) {
+ return;
+ }
+
+ WId wid = w->winId();
+ if (!m_resourceInstance || m_resourceInstance->winId() != wid) {
+ // qDebug() << "Creating a new instance of the resource" << m_uri << "window id" << wid;
+ m_resourceInstance.reset(new KActivities::ResourceInstance(wid, m_uri, m_mimetype, m_title));
+ } else {
+
+ if (m_uri.scheme().startsWith(QLatin1String("http")) && !m_uri.hasQuery() && m_uri.path().endsWith('/')) {
+ const QString &oldPath = m_uri.path();
+ m_uri.setPath(oldPath.left(oldPath.length() - 1));
+
+ // qDebug() << "Old and new path" << oldPath << m_uri;
+
+ } else {
+ m_resourceInstance->setUri(m_uri);
+ }
+
+ // qDebug() << "Setting" << m_uri << m_mimetype << "to window" << wid;
+
+ m_resourceInstance->setMimetype(m_mimetype);
+ m_resourceInstance->setTitle(m_title);
+ }
+}
+
+QUrl ResourceInstance::uri() const
+{
+ return m_uri;
+}
+
+void ResourceInstance::setUri(const QUrl &uri)
+{
+ if (m_uri == uri) {
+ return;
+ }
+
+ m_uri = uri;
+ m_syncTimer->start(100);
+}
+
+QString ResourceInstance::mimetype() const
+{
+ return m_mimetype;
+}
+
+void ResourceInstance::setMimetype(const QString &mimetype)
+{
+ if (m_mimetype == mimetype) {
+ return;
+ }
+ m_mimetype = mimetype;
+ m_syncTimer->start(100);
+}
+
+QString ResourceInstance::title() const
+{
+ return m_title;
+}
+
+void ResourceInstance::setTitle(const QString &title)
+{
+ if (m_title == title) {
+ return;
+ }
+ m_title = title;
+ m_syncTimer->start(100);
+}
+
+void ResourceInstance::notifyModified()
+{
+ //ensure the resource instance exists
+ syncWid();
+ m_resourceInstance->notifyModified();
+}
+
+void ResourceInstance::notifyFocusedIn()
+{
+ //ensure the resource instance exists
+ syncWid();
+ m_resourceInstance->notifyFocusedIn();
+}
+
+void ResourceInstance::notifyFocusedOut()
+{
+ //ensure the resource instance exists
+ syncWid();
+ m_resourceInstance->notifyFocusedOut();
+}
+
+}
+}
+
+
|
[-]
[+]
|
Added |
kactivities-5.10.0.tar.xz/src/imports/resourceinstance.h
^
|
@@ -0,0 +1,100 @@
+/***************************************************************************
+ * Copyright 2011-2015 Marco Martin <mart@kde.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU Library General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
+ ***************************************************************************/
+#ifndef RESOURCEINSTANCE_H
+#define RESOURCEINSTANCE_H
+
+//Qt
+#include <QQuickItem>
+#include <QUrl>
+
+// STL
+#include <memory>
+
+namespace KActivities {
+class ResourceInstance;
+}
+
+class QTimer;
+
+
+namespace KActivities {
+namespace Imports {
+
+class ResourceInstance : public QQuickItem
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QUrl uri READ uri WRITE setUri NOTIFY uriChanged)
+ Q_PROPERTY(QString mimetype READ mimetype WRITE setMimetype NOTIFY mimetypeChanged)
+ Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
+
+public:
+ ResourceInstance(QQuickItem *parent = 0);
+ ~ResourceInstance();
+
+ QUrl uri() const;
+ void setUri(const QUrl &uri);
+
+ QString mimetype() const;
+ void setMimetype(const QString &mimetype);
+
+ QString title() const;
+ void setTitle(const QString &title);
+
+protected Q_SLOTS:
+ void syncWid();
+
+Q_SIGNALS:
+ void uriChanged();
+ void mimetypeChanged();
+ void titleChanged();
+
+public Q_SLOTS:
+ /**
+ * Call this method to notify the system that you modified
+ * (the contents of) the resource
+ */
+ void notifyModified();
+
+ /**
+ * Call this method to notify the system that the resource
+ * has the focus in your application
+ * @note You only need to call this in MDI applications
+ */
+ void notifyFocusedIn();
+
+ /**
+ * Call this method to notify the system that the resource
+ * lost the focus in your application
+ * @note You only need to call this in MDI applications
+ */
+ void notifyFocusedOut();
+
+private:
+ std::unique_ptr<KActivities::ResourceInstance> m_resourceInstance;
+ QUrl m_uri;
+ QString m_mimetype;
+ QString m_title;
+ QTimer *m_syncTimer;
+};
+
+}
+}
+
+#endif
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/lib/stats/cleaning.h
^
|
@@ -31,10 +31,10 @@
/**
* Forget the resource(s) for the specified activity and agent
*/
-void forgetResource(Terms::Activity activity, Terms::Agent agent,
+void KACTIVITIESSTATS_EXPORT forgetResource(Terms::Activity activity, Terms::Agent agent,
const QString &resource);
-enum TimeUnit {
+enum KACTIVITIESSTATS_EXPORT TimeUnit {
Hours,
Days,
Months
@@ -43,14 +43,14 @@
/**
* Forget recent stats for the specified activity and time
*/
-void forgetRecentStats(Terms::Activity activity, int count, TimeUnit what);
+void KACTIVITIESSTATS_EXPORT forgetRecentStats(Terms::Activity activity, int count, TimeUnit what);
/**
* Forget events that are older than the specified number of months
*/
-void forgetEarlierStats(Terms::Activity activity, int months);
+void KACTIVITIESSTATS_EXPORT forgetEarlierStats(Terms::Activity activity, int months);
-void forgetResources(const Query &query);
+void KACTIVITIESSTATS_EXPORT forgetResources(const Query &query);
} // namespace Stats
} // namespace Experimental
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/lib/stats/resultset.cpp
^
|
@@ -202,6 +202,13 @@
return "resource GLOB '" + urlFilter + "'";
}
+ QString mimetypeClause(const QString &mimetype) const
+ {
+ if (mimetype == "*") return "1";
+
+ return "mimetype GLOB '" + mimetype + "'";
+ }
+
/**
* Transforms the input list's elements with the f member method,
* and returns the resulting list
@@ -235,6 +242,7 @@
" , rl.usedActivity as activity \n"
" , rl.initiatingAgent as agent \n"
" , COALESCE(ri.title, rl.targettedResource) as title \n"
+ " , ri.mimetype as mimetype \n"
"FROM \n"
" ResourceLink rl \n"
@@ -251,6 +259,7 @@
" ($agentsFilter) \n"
" AND ($activitiesFilter) \n"
" AND ($urlFilter)\n"
+ " AND ($mimetypeFilter)\n"
"GROUP BY resource, title \n"
"ORDER BY $orderingColumn resource ASC\n";
@@ -277,6 +286,10 @@
QStringList urlFilter = transformedList(
queryDefinition.urlFilters(), &Private::urlFilterClause);
+ // WHERE clause for filtering on resource mime
+ QStringList mimetypeFilter = transformedList(
+ queryDefinition.types(), &Private::mimetypeClause);
+
auto query = _query;
return
@@ -285,6 +298,7 @@
.replace("$agentsFilter", agentsFilter.join(" OR "))
.replace("$activitiesFilter", activitiesFilter.join(" OR "))
.replace("$urlFilter", urlFilter.join(" OR "))
+ .replace("$mimetypeFilter", mimetypeFilter.join(" OR "))
;
}
@@ -302,6 +316,7 @@
" , rsc.usedActivity as activity \n"
" , rsc.initiatingAgent as agent \n"
" , COALESCE(ri.title, rsc.targettedResource) as title \n"
+ " , ri.mimetype as mimetype \n"
"FROM \n"
" ResourceScoreCache rsc \n"
@@ -313,6 +328,7 @@
" ($agentsFilter) \n"
" AND ($activitiesFilter) \n"
" AND ($urlFilter)\n"
+ " AND ($mimetypeFilter)\n"
"GROUP BY resource, title \n"
"ORDER BY $orderingColumn resource ASC\n";
@@ -339,6 +355,10 @@
QStringList urlFilter = transformedList(
queryDefinition.urlFilters(), &Private::urlFilterClause);
+ // WHERE clause for filtering on resource mime
+ QStringList mimetypeFilter = transformedList(
+ queryDefinition.types(), &Private::mimetypeClause);
+
auto query = _query;
return kamd::utils::debug_and_return("Query: ",
@@ -347,6 +367,7 @@
.replace("$agentsFilter", agentsFilter.join(" OR "))
.replace("$activitiesFilter", activitiesFilter.join(" OR "))
.replace("$urlFilter", urlFilter.join(" OR "))
+ .replace("$mimetypeFilter", mimetypeFilter.join(" OR "))
);
}
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/service/Application.cpp
^
|
@@ -54,6 +54,7 @@
#include "Activities.h"
#include "Resources.h"
#include "Features.h"
+#include "Config.h"
#include "Plugin.h"
#include "Debug.h"
#include "common/dbus/common.h"
@@ -138,7 +139,7 @@
Application *Application::Private::s_instance = Q_NULLPTR;
Application::Application(int &argc, char **argv)
- : QCoreApplication(argc, argv)
+ : QGuiApplication(argc, argv)
{
}
@@ -156,6 +157,7 @@
d->resources = runInQThread<Resources>();
d->activities = runInQThread<Activities>();
d->features = runInQThread<Features>();
+ /* d->config */ new Config(this); // this does not need a separate thread
QMetaObject::invokeMethod(this, "loadPlugins", Qt::QueuedConnection);
@@ -203,7 +205,7 @@
using namespace std::placeholders;
const auto pluginsDir(QLatin1String(KAMD_PLUGIN_DIR));
- QCoreApplication::addLibraryPath(pluginsDir);
+ QGuiApplication::addLibraryPath(pluginsDir);
const auto config
= KSharedConfig::openConfig(QStringLiteral("kactivitymanagerdrc"))
@@ -269,7 +271,7 @@
void Application::quit()
{
- QCoreApplication::quit();
+ QGuiApplication::quit();
}
#include "../lib/core/version.h"
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/service/Application.h
^
|
@@ -21,7 +21,7 @@
#define APPLICATION_H
// Qt
-#include <QCoreApplication>
+#include <QGuiApplication>
// Utils
#include <utils/d_ptr.h>
@@ -33,8 +33,10 @@
/**
* Main application object
+ * This can *not* be a QCoreApplication because
+ * we need KWindowSystem events.
*/
-class Application : public QCoreApplication {
+class Application : public QGuiApplication {
Q_OBJECT
public:
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/service/CMakeLists.txt
^
|
@@ -37,6 +37,7 @@
Activities.cpp
Resources.cpp
Features.cpp
+ Config.cpp
${plugin_implementation_SRCS}
|
[-]
[+]
|
Added |
kactivities-5.10.0.tar.xz/src/service/Config.cpp
^
|
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2015 Ivan Cukic <ivan.cukic(at)kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * or (at your option) any later version, as published by the Free
+ * Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <Config.h>
+
+#include <functional>
+
+#include <QStandardPaths>
+#include <QDebug>
+
+#include <KDirWatch>
+
+#include <utils/d_ptr_implementation.h>
+
+class Config::Private {
+public:
+ Private(Config *parent)
+ : q(parent)
+ , mainConfigFile(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)
+ + QStringLiteral("/kactivitymanagerdrc"))
+ , pluginConfigFile(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)
+ + QStringLiteral("/kactivitymanagerd-pluginsrc"))
+ {
+ using namespace std::placeholders;
+
+ watcher.addFile(mainConfigFile);
+ watcher.addFile(pluginConfigFile);
+
+ QObject::connect(
+ &watcher, &KDirWatch::created,
+ q, std::bind(&Private::configFileChanged, this, _1));
+ QObject::connect(
+ &watcher, &KDirWatch::dirty,
+ q, std::bind(&Private::configFileChanged, this, _1));
+ }
+
+ void configFileChanged(const QString &file)
+ {
+ if (file == pluginConfigFile) {
+ emit q->pluginConfigChanged();
+ } else {
+ emit q->mainConfigChanged();
+ }
+ }
+
+ KDirWatch watcher;
+
+private:
+ Config * const q;
+
+ const QString mainConfigFile;
+ const QString pluginConfigFile;
+};
+
+Config::Config(QObject *parent)
+ : Module("config", parent)
+ , d(this)
+{
+}
+
+Config::~Config()
+{
+}
+
+
|
[-]
[+]
|
Added |
kactivities-5.10.0.tar.xz/src/service/Config.h
^
|
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2015 Ivan Cukic <ivan.cukic(at)kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * or (at your option) any later version, as published by the Free
+ * Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#include <Module.h>
+
+class Config : public Module {
+ Q_OBJECT
+
+public:
+ Config(QObject *parent = Q_NULLPTR);
+ virtual ~Config();
+
+Q_SIGNALS:
+ void pluginConfigChanged();
+ void mainConfigChanged();
+
+private:
+ D_PTR;
+};
+
+#endif // CONFIG_H
+
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/service/Resources.cpp
^
|
@@ -268,10 +268,10 @@
KDBusConnectionPool::threadConnection().registerObject(
KAMD_DBUS_OBJECT_PATH(Resources), this);
- d->connect(KWindowSystem::self(), SIGNAL(windowRemoved(WId)),
- SLOT(windowClosed(WId)));
- d->connect(KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)),
- SLOT(activeWindowChanged(WId)));
+ connect(KWindowSystem::self(), &KWindowSystem::windowRemoved,
+ d.operator->(), &Resources::Private::windowClosed);
+ connect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged,
+ d.operator->(), &Resources::Private::activeWindowChanged);
}
Resources::~Resources()
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/service/files/kactivitymanagerd.desktop
^
|
@@ -60,7 +60,7 @@
Name[zh_TW]=活動管理員
Comment=The activity management backend
-Comment[ar]=سَنَد إدارة الأنشطة
+Comment[ar]=سند إدارة الأنشطة
Comment[bs]=Pozadina za upravljanje aktivnostima
Comment[ca]=El dorsal pel gestor d'activitats
Comment[ca@valencia]=Dorsal de gestió d'activitats
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/service/plugins/activitytemplates/kactivitymanagerd-plugin-activitytemplates.desktop
^
|
@@ -45,6 +45,7 @@
Comment[ar]=دعم إنشاء قوالب أنشطة
Comment[ca]=Suport per a la creació d'activitats amb plantilles
Comment[ca@valencia]=Suport per a la creació d'activitats aplantillades
+Comment[cs]=Podpora pro vytváření aktivit podle šablon
Comment[da]=Understøttelse af oprettelse af aktiviteter efter skabeloner
Comment[de]=Unterstützung für das Erstellen von Vorlagen für Aktivitäten
Comment[en_GB]=Support for creating templated activities
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/service/plugins/eventspy/kactivitymanagerd-plugin-eventspy.desktop
^
|
@@ -1,12 +1,17 @@
[Desktop Entry]
Name=Event Spy
Name[ca]=Espia l'esdeveniment
+Name[cs]=Špeh událostí
+Name[da]=Hændelsesspion
Name[de]=Ereignisüberwachung
Name[en_GB]=Event Spy
Name[es]=Espía de eventos
Name[fi]=Tapahtumavakooja
Name[gl]=Espía de eventos
Name[he]=מרגל אירועים
+Name[it]=Indicatore degli eventi
+Name[ko]=이벤트 첩자
+Name[nb]=Hendelsesovervåker
Name[nl]=Gebeurtenisspion
Name[pl]=Szpieg wydarzeń
Name[pt]=Monitor de Eventos
@@ -14,16 +19,26 @@
Name[ru]=Монитор событий
Name[sk]=Špión udalostí
Name[sl]=Nadzor dogodkov
+Name[sr]=Шпијун догађаја
+Name[sr@ijekavian]=Шпијун догађаја
+Name[sr@ijekavianlatin]=Špijun događaja
+Name[sr@latin]=Špijun događaja
Name[sv]=Händelseövervakare
Name[uk]=Журнал подій
Name[x-test]=xxEvent Spyxx
+Name[zh_CN]=事件间谍
Comment=Collects events from applications that support recent documents specification
Comment[ca]=Recull els esdeveniments de les aplicacions que admeten l'especificació dels documents recents
+Comment[cs]=Sbírá z aplikací události jenž podporují určení nedávných dokumentů
+Comment[da]=Indsamler hændelser fra programmer som understøtter specifikationen for nylige dokumenter
Comment[en_GB]=Collects events from applications that support recent documents specification
Comment[es]=Recopila eventos de aplicaciones que incorporan la especificación de documentos recientes
Comment[fi]=Kerää tapahtumia sovelluksilta, jotka tukevat viimeaikaisten tiedostojen määrittelyä
Comment[gl]=Recolle eventos dos programas compatíbeis coa especificación de documentos recentes.
Comment[he]=אוסף אירועים מאת יישומים שתומכים בתקן של מסמכים אחרונים
+Comment[it]=Raccoglie eventi dalle applicazioni che supportano la specifica dei documenti recenti
+Comment[ko]=최근 문서 규격을 지원하는 프로그램의 이벤트 수집
+Comment[nb]=Samler hendelser fra programmer som støtter spesifikasjon for nylig brukte dokumenter
Comment[nl]=Verzamelt gebeurtenissen uit toepassingen die recente documentspecificaties ondersteunen
Comment[pl]=Gromadzi wydarzenia z aplikacji, które spełniają wymogi ostatnich dokumentów
Comment[pt]=Recolhe eventos das aplicações que suportam a especificação dos documentos recentes
@@ -31,9 +46,14 @@
Comment[ru]=Собирает от поддерживаемых приложений события о последних открытых документах
Comment[sk]=Zbiera udalosti z aplikácií, ktoré podporujú špecifikáciu nedávnych dokumentov
Comment[sl]=Zbira dogodke iz programov, ki podpirajo določitev nedavnih dokumentov
+Comment[sr]=Сакупља догађаје из програма који подржавају спецификацију недавних докумената
+Comment[sr@ijekavian]=Сакупља догађаје из програма који подржавају спецификацију недавних докумената
+Comment[sr@ijekavianlatin]=Sakuplja događaje iz programa koji podržavaju specifikaciju nedavnih dokumenata
+Comment[sr@latin]=Sakuplja događaje iz programa koji podržavaju specifikaciju nedavnih dokumenata
Comment[sv]=Samlar in händelser från program som stöder senare dokumentspecifikationer
Comment[uk]=Збирає записи подій від програм, у яких реалізовано специфікацію нещодавніх документів
Comment[x-test]=xxCollects events from applications that support recent documents specificationxx
+Comment[zh_CN]=从支持最近文档标准的应用程序收集事件
Type=Service
Icon=preferences-system
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/service/plugins/globalshortcuts/kactivitymanagerd-plugin-globalshortcuts.desktop
^
|
@@ -50,7 +50,7 @@
Name[zh_CN]=全局快捷键
Name[zh_TW]=全域捷徑
Comment=Adds global keyboard shortcuts for activity switching
-Comment[ar]=يضيف اختصارات لوحة المفاتيح العموميّة لتبديل النشاط
+Comment[ar]=يضيف اختصارات لوحة المفاتيح العموميّة لتبديل النّشاط
Comment[bs]=Dodaje globalne kratice tastature za prebacivanje aktivnosti
Comment[ca]=Afegeix dreceres de teclat globals per canviar d'activitat
Comment[ca@valencia]=Afig les dreceres de teclat globals per canvi d'activitats
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/service/plugins/sqlite/StatsPlugin.cpp
^
|
@@ -53,7 +53,6 @@
: Plugin(parent)
, m_activities(Q_NULLPTR)
, m_resources(Q_NULLPTR)
- , m_configWatcher(Q_NULLPTR)
, m_resourceLinking(new ResourceLinking(this))
{
Q_UNUSED(args)
@@ -83,6 +82,9 @@
connect(m_resources, SIGNAL(RegisteredResourceTitle(QString, QString)),
this, SLOT(saveResourceTitle(QString, QString)));
+ connect(modules[QStringLiteral("config")], SIGNAL(pluginConfigChanged()),
+ this, SLOT(loadConfiguration()));
+
loadConfiguration();
return true;
@@ -96,20 +98,6 @@
= QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)
+ QStringLiteral("kactivitymanagerd-pluginsrc");
- if (m_configWatcher) {
- // When saving a config file, KConfig deletes the old,
- // and creates the new one, so the watcher stops watching
- m_configWatcher->addPath(configFile);
-
- } else {
- m_configWatcher = new QFileSystemWatcher(QStringList{configFile}, this);
-
- connect(m_configWatcher, SIGNAL(fileChanged(QString)),
- this, SLOT(loadConfiguration()));
- connect(m_activities, SIGNAL(CurrentActivityChanged(QString)),
- this, SLOT(loadConfiguration()));
- }
-
m_blockedByDefault = config().readEntry("blocked-by-default", false);
m_blockAll = false;
m_whatToRemember = (WhatToRemember)config().readEntry("what-to-remember",
@@ -129,6 +117,20 @@
// TODO: Event cleanup should be also done from time to time,
// not only on startup
DeleteEarlierStats(QString(), config().readEntry("keep-history-for", 0));
+
+ // Loading URL filters
+ m_urlFilters.clear();
+
+ auto filters = config().readEntry("url-filters",
+ QStringList() << "about:*" // Ignore about: stuff
+ << "*/.*" // Ignore hidden files
+ << "/" // Ignore root
+ << "/tmp/*" // Ignore everything in /tmp
+ );
+
+ for (const auto& filter: filters) {
+ m_urlFilters << QRegExp(filter, Qt::CaseInsensitive, QRegExp::WildcardUnix);
+ }
}
void StatsPlugin::openResourceEvent(const QString &usedActivity,
@@ -318,9 +320,14 @@
bool StatsPlugin::acceptedEvent(const Event &event)
{
+ using std::bind;
+ using std::any_of;
+ using namespace std::placeholders;
+
return !(
event.uri.isEmpty() ||
- event.uri.startsWith(QStringLiteral("about")) ||
+ any_of(m_urlFilters.cbegin(), m_urlFilters.cend(),
+ bind(&QRegExp::exactMatch, _1, event.uri)) ||
// if blocked by default, the list contains allowed applications
// ignore event if the list doesn't contain the application
@@ -355,13 +362,15 @@
return;
}
- DATABASE_TRANSACTION(resourcesDatabase());
+ const auto &eventsToProcess =
+ events | transformed(&StatsPlugin::validateEvent, this)
+ | filtered(&StatsPlugin::acceptedEvent, this);
- for (auto event : events | transformed(&StatsPlugin::validateEvent, this)
- | filtered(&StatsPlugin::acceptedEvent, this)
- ) {
+ if (eventsToProcess.begin() == eventsToProcess.end()) return;
+
+ DATABASE_TRANSACTION(resourcesDatabase());
- validateEvent(event);
+ for (auto event : eventsToProcess) {
switch (event.type) {
case Event::Accessed:
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/service/plugins/sqlite/StatsPlugin.h
^
|
@@ -121,9 +121,9 @@
QObject *m_activities;
QObject *m_resources;
- QFileSystemWatcher *m_configWatcher;
boost::container::flat_set<QString> m_apps;
+ QList<QRegExp> m_urlFilters;
std::unique_ptr<QSqlQuery> openResourceEventQuery;
std::unique_ptr<QSqlQuery> closeResourceEventQuery;
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/service/plugins/virtualdesktopswitch/kactivitymanagerd-plugin-virtualdesktopswitch.desktop
^
|
@@ -50,7 +50,7 @@
Name[zh_CN]=虚拟桌面切换器
Name[zh_TW]=虛擬桌面切換器
Comment=When switching to an activity, opens the virtual desktop last used with that activity
-Comment[ar]=عند التّبديل إلى نشاط ما، يَفتَح آخر سطح مكتب وهميّ مُستخدَم بِذلك النّشاط
+Comment[ar]=عند التّبديل إلى نشاط ما، يفتح آخر سطح مكتب وهميّ مُستخدم بذلك النّشاط
Comment[bs]=Pri prebacivanju na aktivnost, otvara vitruelni deskstop koji je zadnji korišten s tom aktivnošću
Comment[ca]=En canviar a una activitat, obre el darrer escriptori virtual utilitzat amb aquesta activitat
Comment[ca@valencia]=En canviar a una activitat, obri el darrer escriptori virtual utilitzat amb esta activitat
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/src/workspace/fileitemplugin/kactivitymanagerd_fileitem_linking_plugin.desktop
^
|
@@ -5,6 +5,7 @@
Name[bs]=Datoteka dodatka za povezivanje na aktivnost
Name[ca]=Connector per enllaçar fitxers amb activitats
Name[ca@valencia]=Fitxer a connector d'enllaç d'activitat
+Name[cs]=MOdul propojující soubor do činnosti
Name[da]=Fil til plugin til aktivitetslinking
Name[de]=Modul für die Verknüpfung von Dateien zu Aktivitäten
Name[el]=Αρχείο σε πρόσθετο σύνδεσης δραστηριοτήτων
|
[-]
[+]
|
Changed |
kactivities-5.10.0.tar.xz/tests/CMakeLists.txt
^
|
@@ -4,4 +4,6 @@
add_subdirectory(stats/model)
endif ()
+add_subdirectory(slc-interface)
+
|
[-]
[+]
|
Added |
kactivities-5.10.0.tar.xz/tests/slc-interface
^
|
+(directory)
|
[-]
[+]
|
Added |
kactivities-5.10.0.tar.xz/tests/slc-interface/CMakeLists.txt
^
|
@@ -0,0 +1,47 @@
+# vim:set softtabstop=3 shiftwidth=3 tabstop=3 expandtab:
+project (KActivitiesSLCTestApp)
+
+find_package (Qt5 REQUIRED NO_MODULE COMPONENTS Core Gui Widgets)
+
+include_directories (
+ ${KACTIVITIES_CURRENT_ROOT_SOURCE_DIR}/src/lib/core/
+ ${KACTIVITIES_CURRENT_ROOT_SOURCE_DIR}/src/
+ ${KACTIVITIES_CURRENT_ROOT_SOURCE_DIR}/autotests/
+ ${CMAKE_BINARY_DIR}/src/lib/core/
+ )
+
+set (
+ KActivitiesSLCTestApp_SRCS
+ window.cpp
+ main.cpp
+ )
+
+qt5_add_dbus_interface (
+ KActivitiesSLCTestApp_SRCS
+
+ ${KACTIVITIES_CURRENT_ROOT_SOURCE_DIR}/src/service/plugins/slc/org.kde.ActivityManager.SLC.xml
+ slc_interface
+ )
+
+qt5_wrap_ui(
+ KActivitiesSLCTestApp_SRCS
+ window.ui
+ )
+
+if (NOT WIN32)
+
+ add_executable (
+ KActivitiesSLCTestApp
+ ${KActivitiesSLCTestApp_SRCS}
+ )
+
+ target_link_libraries (
+ KActivitiesSLCTestApp
+ Qt5::Core
+ Qt5::Gui
+ Qt5::Widgets
+ Qt5::DBus
+ KF5::Activities
+ )
+
+endif ()
|
[-]
[+]
|
Added |
kactivities-5.10.0.tar.xz/tests/slc-interface/main.cpp
^
|
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2015 Ivan Cukic <ivan.cukic(at)kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * or (at your option) any later version, as published by the Free
+ * Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <QApplication>
+#include "window.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ Window w;
+ w.show();
+
+ // ResultSet results(UsedResources | Agent{"gvim"});
+ //
+ // int count = 20;
+ // for (const auto& result: results) {
+ // qDebug() << "Result:" << result.title << result.resource;
+ // if (count -- == 0) break;
+ // }
+ //
+ // ResultModel model(UsedResources | Agent{"gvim"});
+ // model.setItemCountLimit(50);
+ //
+ // QListView view;
+ // view.setModel(&model);
+ //
+ // view.show();
+
+ return app.exec();
+}
+
|
[-]
[+]
|
Added |
kactivities-5.10.0.tar.xz/tests/slc-interface/window.cpp
^
|
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2015 Ivan Cukic <ivan.cukic(at)kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * or (at your option) any later version, as published by the Free
+ * Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "window.h"
+
+#include "ui_window.h"
+
+#include <QDBusConnection>
+
+Window::Window()
+ : ui(new Ui::MainWindow())
+ , slc(new org::kde::ActivityManager::SLC(
+ "org.kde.ActivityManager",
+ "/SLC",
+ QDBusConnection::sessionBus(),
+ this))
+{
+ ui->setupUi(this);
+
+ connect(slc, &org::kde::ActivityManager::SLC::focusChanged,
+ this, &Window::focusChanged);
+}
+
+Window::~Window()
+{
+ delete ui;
+}
+
+void Window::focusChanged(const QString &uri, const QString &mimetype,
+ const QString &title)
+{
+ ui->textCurrentResource->setText(uri);
+
+}
+
|
[-]
[+]
|
Added |
kactivities-5.10.0.tar.xz/tests/slc-interface/window.h
^
|
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2015 Ivan Cukic <ivan.cukic(at)kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * or (at your option) any later version, as published by the Free
+ * Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#pragma once
+
+#include <QMainWindow>
+#include "slc_interface.h"
+
+namespace Ui {
+ class MainWindow;
+}
+
+class Window: public QMainWindow {
+ Q_OBJECT
+
+public:
+ Window();
+ ~Window();
+
+private Q_SLOTS:
+ void focusChanged(const QString &uri, const QString &mimetype, const QString &title);
+
+private:
+ Ui::MainWindow *ui;
+ org::kde::ActivityManager::SLC *slc;
+};
+
|
[-]
[+]
|
Added |
kactivities-5.10.0.tar.xz/tests/slc-interface/window.ui
^
|
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>474</width>
+ <height>74</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>MainWindow</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="icon">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>64</width>
+ <height>64</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="labelCurrentResource">
+ <property name="text">
+ <string>Resource</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLabel" name="textCurrentResource">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="labelCurrentResourceTitle">
+ <property name="text">
+ <string>Title</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="textCurrentResourceTitle">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="labelCurrentResourceMimetype">
+ <property name="text">
+ <string>Mimetype</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLabel" name="textCurrentResourceMimetype">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
|
[-]
[+]
|
Changed |
kactivities.yaml
^
|
@@ -1,5 +1,5 @@
Name : kactivities
-Version : 5.9.0
+Version : 5.10.0
Release : 2
Group : System/Base
License : GPLv2+
|