[-]
[+]
|
Changed |
_service:tar_git:kactivities.spec
|
|
[-]
[+]
|
Deleted |
_service:tar_git:kactivities-5.1.0.tar.xz/upstream/Mainpage.dox
^
|
@@ -1,17 +0,0 @@
-/** @mainpage KActivities
-
-@authors
-See the copyright notices on the individual files.
-
-@maintainers
-See the MAINTAINER file
-
-@licenses
-@lgpl
-
-*/
-
-// DOXYGEN_SET_PROJECT_NAME = KActivities
-// DOXYGEN_SET_RECURSIVE = YES
-// DOXYGEN_EXCLUDE_PATTERNS = *_p.h */private/* */tests/* */service/* */scripts/* */workspace/*
-// vim:ts=4:sw=4:expandtab:filetype=doxygen
|
[-]
[+]
|
Deleted |
_service:tar_git:kactivities-5.1.0.tar.xz/upstream/src/service/plugins/activityranking/ActivityData.cpp
^
|
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2011, 2012 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 "ActivityData.h"
-
-#include <QDBusMetaType>
-
-class ActivityDataStaticInit {
-public:
- ActivityDataStaticInit()
- {
- qDBusRegisterMetaType<ActivityData>();
- qDBusRegisterMetaType<QList<ActivityData>>();
- }
-
- static ActivityDataStaticInit _instance;
-};
-
-ActivityDataStaticInit ActivityDataStaticInit::_instance;
-
-ActivityData::ActivityData()
-{
-}
-
-ActivityData::ActivityData(const ActivityData &source)
- : score(source.score)
- , id(source.id)
-{
-}
-
-ActivityData &ActivityData::operator=(const ActivityData &source)
-{
- if (&source != this) {
- score = source.score;
- id = source.id;
- }
-
- return *this;
-}
-
-QDBusArgument &operator<<(QDBusArgument &arg, const ActivityData r)
-{
- arg.beginStructure();
-
- arg << r.id;
- arg << r.score;
-
- arg.endStructure();
-
- return arg;
-}
-
-const QDBusArgument &operator>>(const QDBusArgument &arg, ActivityData &r)
-{
- arg.beginStructure();
-
- arg >> r.id;
- arg >> r.score;
-
- arg.endStructure();
-
- return arg;
-}
-
-QDebug operator<<(QDebug dbg, const ActivityData &r)
-{
- dbg << "ActivityData(" << r.score << r.id << ")";
- return dbg.space();
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:kactivities-5.1.0.tar.xz/upstream/src/service/plugins/activityranking/ActivityData.h
^
|
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2011, 2012 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 PLUGINS_ACTIVITY_RANKING_ACTIVITY_DATA_H
-#define PLUGINS_ACTIVITY_RANKING_ACTIVITY_DATA_H
-
-#include <QString>
-#include <QtDBus/QDBusArgument>
-#include <Debug.h>
-
-class ActivityData {
-public:
- ActivityData();
- ActivityData(const ActivityData &source);
- ActivityData &operator=(const ActivityData &source);
-
- double score;
- QString id;
-};
-
-typedef QList<ActivityData> ActivityDataList;
-Q_DECLARE_METATYPE(ActivityData)
-Q_DECLARE_METATYPE(ActivityDataList)
-
-QDBusArgument &operator<<(QDBusArgument &arg, const ActivityData);
-const QDBusArgument &operator>>(const QDBusArgument &arg, ActivityData &rec);
-
-QDebug operator<<(QDebug dbg, const ActivityData &r);
-
-#endif // PLUGINS_ACTIVITY_RANKING_ACTIVITY_DATA_H
|
[-]
[+]
|
Deleted |
_service:tar_git:kactivities-5.1.0.tar.xz/upstream/src/service/plugins/activityranking/ActivityRanking.cpp
^
|
@@ -1,566 +0,0 @@
-/*
- * Copyright (C) 2011, 2012 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 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ActivityRanking.h"
-#include "activityrankingadaptor.h"
-
-#include <QDBusConnection>
-
-#include <QSqlDatabase>
-#include <QSqlDriver>
-#include <QSqlQuery>
-#include <QSqlError>
-#include <QSqlRecord>
-#include <QSqlTableModel>
-
-#include <KStandardDirs>
-#include <kdbusconnectionpool.h>
-
-#include "Plugin.h"
-#include "Location.h"
-#include "Debug.h"
-
-#include <utils/for_each_assoc.h>
-#include <utils/d_ptr_implementation.h>
-
-#define PRINT_LAST_ERROR(A) \
- if (A.lastError().isValid()) \
- qDebug() << "DATABASE ERROR" << A.lastError();
-
-class ActivityRanking::Private {
-public:
- QSqlDatabase database;
-
- QSqlRecord currentActivityRecord;
- QString activity;
- QString lastLocation;
- qint64 activityStart;
-
- void processActivityInterval(const QString &activity, const QString &location, qint64 start, qint64 end);
- void processWeekData(const QString &activity, const QString &location, qint64 start, qint64 end);
- void processMonthData(const QString &activity, const QString &location, qint64 start, qint64 end);
-
- void closeDanglingActivityRecords();
- void ensureMonthScoreExists(const QString &activity, int year, int month, const QString &location);
- void ensureWeekScoreExists(const QString &activity, int year, int week, const QString &location);
-
- QMap<QString, qreal> topActivitiesFor(const QDateTime &time, const QString &location);
-
- static QString insertSchemaInfo;
- static QString closeActivityInterval;
- static QString insertActivityInterval;
-
- static QString insertWeekScore;
- static QString selectWeekScore;
-
- static QString insertMonthScore;
- static QString selectMonthScore;
-
- static QString selectScore;
-};
-
-QString ActivityRanking::Private::insertSchemaInfo = "INSERT INTO schemaInfo VALUES ('%1', '%2')";
-QString ActivityRanking::Private::closeActivityInterval = "UPDATE ActivityEvents SET end = %1 WHERE activity = '%2' AND end IS NULL";
-QString ActivityRanking::Private::insertActivityInterval = "INSERT INTO ActivityEvents VALUES('%1', '%2', %3, NULL)";
-
-// For the average and dispersion
-// select activity, start - (select max(start) from ActivityEvents as ae where ae.start < a.start) as diff from ActivityEvents as a
-// QString ActivityRanking::Private::selectDanglingActivities = "SELECT * FROM ActivityEvents WHERE end IS NULL ORDER BY start";
-
-QString ActivityRanking::Private::insertWeekScore = "INSERT INTO WeekScores (activity, year, week, location) VALUES('%1', %2, %3, '%4')";
-
-QString ActivityRanking::Private::selectWeekScore = "SELECT * FROM WeekScores WHERE activity = '%1' AND year = %2 AND week = %3 AND location = '%4'";
-
-QString ActivityRanking::Private::insertMonthScore = "INSERT INTO MonthScores (activity, year, month, location) VALUES('%1', %2, %3, '%4')";
-
-QString ActivityRanking::Private::selectMonthScore = "SELECT * FROM MonthScores WHERE activity = '%1' AND year = %2 AND month = %3 AND location = '%4'";
-
-// Not using "ORDER BY sumscore DESC" because in topActivitiesFor we return the result of this query in a QMap, which reorders
-// the entries by its key (activity id).
-QString ActivityRanking::Private::selectScore = "SELECT week.activity, week.score + month.score as sumscore "
- "FROM "
- "(SELECT activity, location, SUM(s%1%2) as score FROM WeekScores GROUP BY activity) AS week, "
- "(SELECT activity, location, SUM(s%3) as score FROM MonthScores GROUP BY activity) AS month "
- "WHERE week.activity = month.activity AND week.location = '%4' AND month.location = '%4'";
-
-void ActivityRanking::Private::ensureWeekScoreExists(const QString &activity, int year, int week, const QString &location)
-{
- // If it fails, it means we already have it, ignore the error
- database.exec(
- insertWeekScore
- .arg(activity)
- .arg(year)
- .arg(week)
- .arg(location));
- PRINT_LAST_ERROR(database);
-}
-
-void ActivityRanking::Private::ensureMonthScoreExists(const QString &activity, int year, int month, const QString &location)
-{
- // If it fails, it means we already have it, ignore the error
- database.exec(
- insertMonthScore
- .arg(activity)
- .arg(year)
- .arg(month)
- .arg(location));
- PRINT_LAST_ERROR(database);
-}
-
-void ActivityRanking::Private::processActivityInterval(const QString &activity, const QString &location, qint64 start, qint64 end)
-{
- // qDebug() << activity << location << start << end;
-
- if (activity.isEmpty()) {
- // qDebug() << "empty activity id. Not processing.";
- return;
- }
-
- // Processing the per-week data
- processWeekData(activity, location, start, end);
-
- // Processing the month data
- processMonthData(activity, location, start, end);
-}
-
-void ActivityRanking::Private::processWeekData(const QString &activity, const QString &location, qint64 start, qint64 end)
-{
- const auto startDateTime = QDateTime::fromMSecsSinceEpoch(start);
- const auto endDateTime = QDateTime::fromMSecsSinceEpoch(end);
-
-#define fordate(What, Start, End) \
- for (int What = Start.date().What(); What <= End.date().What(); What++)
-
- // This can be a bit more efficient
- fordate(year, startDateTime, endDateTime)
- {
- fordate(weekNumber, startDateTime, endDateTime)
- {
- // qDebug() << activity << year << weekNumber;
-
- ensureWeekScoreExists(activity, year, weekNumber, location);
-
- const auto weekStartDateTime = QDateTime(QDate(year, 1, 1).addDays((weekNumber - 1) * 7));
- const auto weekStart = weekStartDateTime.toMSecsSinceEpoch();
- const auto weekEnd = weekStartDateTime.addDays(7).toMSecsSinceEpoch();
-
- const auto currentStart = QDateTime::fromMSecsSinceEpoch(qMax(weekStart, start));
- const auto currentEnd = QDateTime::fromMSecsSinceEpoch(qMin(weekEnd, end));
-
- auto query = database.exec(
- selectWeekScore
- .arg(activity)
- .arg(year)
- .arg(weekNumber)
- .arg(location));
- PRINT_LAST_ERROR(database);
-
- if (query.next()) {
- auto record = query.record();
- const auto iFirstColumn = record.indexOf("s00");
-
-#define SEGMENTS 8
-
- for (int day = currentStart.date().dayOfWeek(); day <= currentEnd.date().dayOfWeek(); day++) {
-
- const auto startSegment = floor(currentStart.time().hour() / 3.0);
- const auto endSegment = ceil(currentEnd.time().hour() / 3.0);
-
- for (int segment = 0; segment < SEGMENTS; segment++) {
- const auto index = iFirstColumn + SEGMENTS * (day - 1) + segment;
-
- // Setting the 1.0 value for the active segments
- if (startSegment <= segment && segment <= endSegment) {
- record.setValue(index, 1.0);
- }
-
- // Setting the .33 for the whole day
- else if (record.value(index).toDouble() < .33) {
- record.setValue(index, .33);
- }
- }
-
- // Setting the .67 for the edge stuff
-
- if (startSegment > 1) {
|
[-]
[+]
|
Deleted |
_service:tar_git:kactivities-5.1.0.tar.xz/upstream/src/service/plugins/activityranking/ActivityRanking.h
^
|
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2011, 2012 Ivan Cukic <ivan.cukic@kde.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef PLUGINS_ACTIVITY_RANKING_ACTIVITY_RANKING_THREAD_H
-#define PLUGINS_ACTIVITY_RANKING_ACTIVITY_RANKING_THREAD_H
-
-#include <QObject>
-#include <QList>
-#include <QString>
-
-#include "ActivityData.h"
-
-#include <utils/d_ptr.h>
-
-class ActivityRanking : public QObject {
- Q_OBJECT
- Q_CLASSINFO("D-Bus Interface", "org.kde.ActivityManager.ActivityRanking")
-
-public:
- explicit ActivityRanking(QObject *parent = Q_NULLPTR);
- ~ActivityRanking();
-
- void init(QObject *activities);
-
-public Q_SLOTS:
- /**
- * Lists top activities based on score calculation described in scoring.pdf.
- * All scores are related to the current location
- *
- * @return list of activities ids.
- */
- QStringList topActivities();
-
- /**
- * @return list of activities data with their rank in the context of the current location.
- */
- QList<ActivityData> activities();
-
-Q_SIGNALS:
- void rankingChanged(const QStringList &topActivities, const ActivityDataList &activities);
-
-protected:
- void initDatabaseSchema();
-
-private Q_SLOTS:
- void activityChanged(const QString &activity);
- void locationChanged(const QString &location);
-
-private:
- D_PTR;
-};
-
-#endif // PLUGINS_ACTIVITY_RANKING_ACTIVITY_RANKING_THREAD_H
|
[-]
[+]
|
Deleted |
_service:tar_git:kactivities-5.1.0.tar.xz/upstream/src/service/plugins/activityranking/ActivityRankingPlugin.cpp
^
|
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2011, 2012 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 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ActivityRankingPlugin.h"
-#include "ActivityRanking.h"
-
-#include <QThread>
-
-#include <memory>
-
-#include <utils/d_ptr_implementation.h>
-
-class ActivityRankingPlugin::Private {
-public:
- ActivityRanking *ranking;
- QThread *rankingThread;
-};
-
-ActivityRankingPlugin::ActivityRankingPlugin(QObject *parent, const QVariantList &args)
- : Plugin(parent)
-{
- Q_UNUSED(args)
-}
-
-bool ActivityRankingPlugin::init(const QHash<QString, QObject *> &modules)
-{
- d->ranking = new ActivityRanking();
- d->ranking->init(modules["activities"]);
-
- class Thread : public QThread {
- public:
- Thread(ActivityRanking *ptr = Q_NULLPTR)
- : QThread()
- , object(ptr)
- {
- }
-
- void run() Q_DECL_OVERRIDE
- {
- std::unique_ptr<ActivityRanking> o(object);
- exec();
- }
-
- private:
- ActivityRanking *object;
-
- } *thread = new Thread(d->ranking);
-
- d->rankingThread = thread;
- d->ranking->moveToThread(thread);
- thread->start();
-
- return true;
-}
-
-ActivityRankingPlugin::~ActivityRankingPlugin()
-{
- d->rankingThread->exit();
- d->rankingThread->wait();
-}
-
-KAMD_EXPORT_PLUGIN(ActivityRankingPlugin, "activitymanger_plugin_activityranking")
-
-#include "ActivityRankingPlugin.moc"
|
[-]
[+]
|
Deleted |
_service:tar_git:kactivities-5.1.0.tar.xz/upstream/src/service/plugins/activityranking/ActivityRankingPlugin.h
^
|
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2011, 2012 Ivan Cukic <ivan.cukic@kde.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef PLUGINS_ACTIVITY_RANKING_ACTIVITY_RANKING_PLUGIN_H
-#define PLUGINS_ACTIVITY_RANKING_ACTIVITY_RANKING_PLUGIN_H
-
-#include <Plugin.h>
-
-#include <utils/d_ptr.h>
-
-class ActivityRankingPlugin : public Plugin {
- Q_OBJECT
-
-public:
- explicit ActivityRankingPlugin(QObject *parent = Q_NULLPTR, const QVariantList &args = QVariantList());
- ~ActivityRankingPlugin();
-
- virtual bool init(const QHash<QString, QObject *> &modules) Q_DECL_OVERRIDE;
-
-private:
- D_PTR;
-};
-
-#endif // PLUGINS_ACTIVITY_RANKING_ACTIVITY_RANKING_PLUGIN_H
|
[-]
[+]
|
Deleted |
_service:tar_git:kactivities-5.1.0.tar.xz/upstream/src/service/plugins/activityranking/CMakeLists.txt
^
|
@@ -1,44 +0,0 @@
-# vim:set softtabstop=3 shiftwidth=3 tabstop=3 expandtab:
-
-project (activitymanager-plugin-activityranking)
-
-include_directories (
- ${CMAKE_SOURCE_DIR}/src
- ${CMAKE_BINARY_DIR}/src
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/../..
- ${CMAKE_CURRENT_BINARY_DIR}
- )
-
-set (
- activityranking_SRCS
- ActivityRanking.cpp
- ActivityRankingPlugin.cpp
- ActivityData.cpp
- Location.cpp
- ${plugin_implementation_SRCS}
- )
-
-qt4_add_dbus_adaptor (
- activityranking_SRCS org.kde.ActivityManager.ActivityRanking.xml
- ActivityRanking.h ActivityRanking
- )
-
-qt4_add_dbus_interface (
- activityranking_SRCS org.kde.LocationManager.xml
- LocationManagerInterface
- )
-
-add_library (
- kactivitymanagerd_plugin_activityranking SHARED
- ${activityranking_SRCS}
- )
-
-target_link_libraries (
- kactivitymanagerd_plugin_activityranking
- ${QT_QTSQL_LIBRARIES}
- )
-
-install (TARGETS kactivitymanagerd_plugin_activityranking DESTINATION ${KAMD_PLUGIN_DIR})
-# install (FILES kactivitymanagerd-plugin-activityranking.desktop DESTINATION ${SERVICES_INSTALL_DIR})
-
|
[-]
[+]
|
Deleted |
_service:tar_git:kactivities-5.1.0.tar.xz/upstream/src/service/plugins/activityranking/Location.cpp
^
|
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2012 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 "Location.h"
-#include "LocationManagerInterface.h"
-
-#include <QDBusServiceWatcher>
-
-#include <kdbusconnectionpool.h>
-
-#include <Debug.h>
-#include <config-features.h>
-#include <utils/d_ptr_implementation.h>
-
-#define LOCATION_MANAGER_SERVICE \
- "org.kde.LocationManager"
-#define LOCATION_MANAGER_OBJECT \
- "/LocationManager"
-
-class Location::Private {
-public:
- Private()
- : manager(Q_NULLPTR)
- {
- }
-
- ~Private()
- {
- delete manager;
- }
-
- org::kde::LocationManager *manager;
- QString current;
- QDBusServiceWatcher *watcher;
-
- static Location *s_instance;
-};
-
-Location *Location::Private::s_instance = Q_NULLPTR;
-
-Location::Location(QObject *parent)
- : QObject(parent)
- , d()
-{
- d->watcher = new QDBusServiceWatcher(
- LOCATION_MANAGER_SERVICE,
- KDBusConnectionPool::threadConnection(),
- QDBusServiceWatcher::WatchForRegistration
- | QDBusServiceWatcher::WatchForUnregistration,
- this);
-
- connect(d->watcher, SIGNAL(serviceRegistered(QString)),
- this, SLOT(enable()));
- connect(d->watcher, SIGNAL(serviceUnregistered(QString)),
- this, SLOT(disable()));
-
- if (KDBusConnectionPool::threadConnection().interface()->isServiceRegistered(LOCATION_MANAGER_SERVICE)) {
- enable();
- }
-}
-
-Location::~Location()
-{
-}
-
-QString Location::current() const
-{
- return d->current;
-}
-
-Location *Location::self(QObject *parent)
-{
- if (!Private::s_instance) {
- Private::s_instance = new Location(parent);
- }
-
- return Private::s_instance;
-}
-
-void Location::disable()
-{
- d->current.clear();
- delete d->manager;
-}
-
-void Location::enable()
-{
- d->manager = new org::kde::LocationManager(
- LOCATION_MANAGER_SERVICE,
- LOCATION_MANAGER_OBJECT,
- KDBusConnectionPool::threadConnection());
-
- connect(d->manager, SIGNAL(currentLocationChanged(QString, QString)),
- this, SLOT(setCurrent(QString)));
-
- d->current = d->manager->currentLocationId();
-}
-
-void Location::setCurrent(const QString &location)
-{
- d->current = location;
- emit currentChanged(location);
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:kactivities-5.1.0.tar.xz/upstream/src/service/plugins/activityranking/Location.h
^
|
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2012 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 PLUGINS_ACTIVITY_RANKING_LOCATION_H
-#define PLUGINS_ACTIVITY_RANKING_LOCATION_H
-
-#include <QObject>
-#include <QString>
-
-#include <utils/d_ptr.h>
-
-/**
- * Location
- */
-class Location : public QObject {
- Q_OBJECT
-
-public:
- static Location *self(QObject *parent);
-
- virtual ~Location();
-
-Q_SIGNALS:
- void currentChanged(const QString &location);
-
-public:
- QString current() const;
-
-protected Q_SLOTS:
- void enable();
- void disable();
- void setCurrent(const QString &location);
-
-private:
- Location(QObject *parent);
-
- D_PTR;
-};
-
-#endif // PLUGINS_ACTIVITY_RANKING_LOCATION_H
|
[-]
[+]
|
Deleted |
_service:tar_git:kactivities-5.1.0.tar.xz/upstream/src/service/plugins/activityranking/kactivitymanagerd-plugin-activityranking.desktop
^
|
@@ -1,109 +0,0 @@
-[Desktop Entry]
-Name=Activity ranking
-Name[bs]=Rangiranje aktivnosti
-Name[ca]=Ordenació de les activitats
-Name[ca@valencia]=Ordenació d'activitats
-Name[cs]=Hodnocení aktivit
-Name[da]=Aktivitetsrangering
-Name[de]=Aktivitätenbewertung
-Name[el]=Αξιολόγηση δραστηριοτήτων
-Name[en_GB]=Activity ranking
-Name[es]=Puntuación de las actividades
-Name[et]=Tegevuste hindamine
-Name[eu]=Jardueren sailkapena
-Name[fi]=Aktiviteettien luokittaminen
-Name[fr]=Classement d'activités
-Name[gl]=Clasificación das actividades
-Name[he]=דירוג פעילות
-Name[hu]=Aktivitásértékelő
-Name[ia]=Classifica de activitate
-Name[it]=Classificazione delle attività
-Name[kk]=Белсенділікті бағалау
-Name[km]=កម្មវិធីជំនួយកំណត់ជួរសកម្មភាព
-Name[ko]=활동 랭킹
-Name[lt]=Veiklos vertinimas
-Name[mr]=कार्यपध्दती गुणवत्ताश्रेणी
-Name[nb]=Aktivitetsrangering
-Name[nds]=Aktiviteten-Beweerten
-Name[nl]=Activiteitenwaardering
-Name[pa]=ਐਕਟਵਿਟੀ ਰੈਕਿੰਗ
-Name[pl]=Ranking działań
-Name[pt]=Classificação da actividade
-Name[pt_BR]=Classificação de atividades
-Name[ro]=Evaluarea activităților
-Name[ru]=Рейтинг комнат
-Name[sk]=Hodnotenie aktivít
-Name[sl]=Razvrščanje dejavnosti
-Name[sr]=Рангирање активности
-Name[sr@ijekavian]=Рангирање активности
-Name[sr@ijekavianlatin]=Rangiranje aktivnosti
-Name[sr@latin]=Rangiranje aktivnosti
-Name[sv]=Aktivitetsrankning
-Name[tg]=Баҳодиҳии фаъолият
-Name[tr]=Etkinlik sıralaması
-Name[ug]=پائالىيەت قاتارى
-Name[uk]=Оцінювання просторів дій
-Name[x-test]=xxActivity rankingxx
-Name[zh_CN]=活动评分
-Name[zh_TW]=活動排序
-Comment=Plugin to rank activities based on usage
-Comment[ar]=ملحقة لِتقييم الأنشطة بناءً على استخدامها
-Comment[bs]=Dodatak za rangiranje aktivnosti prema njihovoj uoptrebi
-Comment[ca]=Connector per ordenar les activitats segons l'ús
-Comment[ca@valencia]=Connector per ordenar les activitats segons l'ús
-Comment[cs]=Modul pro hodnocení aktivit dle jejich používání
-Comment[da]=Plugin til at rangere aktiviteter baseret på brug
-Comment[de]=Modul, das Aktivitäten anhand der Benutzung bewertet
-Comment[el]=Πρόσθετο για την αξιολόγηση δραστηριοτήτων με βάση τη χρήση
-Comment[en_GB]=Plugin to rank activities based on usage
-Comment[es]=Complemento para puntuar actividades basado en su uso
-Comment[et]=Plugin tegevuste hindamiseks kasutuse põhjal
-Comment[eu]=Jarduerak erabileraren arabera sailkatzeko plugina
-Comment[fi]=Liitännäinen aktiviteettien luokittamiseen käytön mukaan
-Comment[fr]=Module externe pour classer les activités en fonction de leur utilisation
-Comment[gl]=Un complemento para clasificar as actividades segundo o uso
-Comment[he]=תוסיף לדירוג פעילויות בהתאם לשימוש
-Comment[hu]=Bővítmény aktivitások értékeléséhez a használat alapján
-Comment[ia]=Plugin pro classificar activitates per lor usage
-Comment[it]=Estensione per classificare le attività a seconda dell'uso
-Comment[kk]=Белсенділікті пайдалану негізінде бағалау плагині
-Comment[km]=កម្មវិធីជំនួយត្រូវកំណត់ជួរសកម្មភាពមានមូលដ្ឋានលើការប្រើប្រាស់
-Comment[ko]=활동 사용량에 따라 별점을 매기는 플러그인
-Comment[lt]=Priedas vertinti veiklas pagal naudojimą
-Comment[mr]=वापरानुसार कार्यपध्दतींना श्रेणी देणारे प्लगइन
-Comment[nb]=Programtillegg som rangerer aktiviteter etter bruk
-Comment[nds]=Moduul för't Beweerten vun Aktiviteten na ehr Bruuk
-Comment[nl]=Plug-in om activiteiten te waarderen gebaseerd op gebruik
-Comment[pl]=Wtyczka do oceny działań w oparciu o użycie
-Comment[pt]='Plugin' de classificação das actividades com base na utilização
-Comment[pt_BR]=Plugin para classificação das atividades com base na utilização
-Comment[ro]=Extensie pentru evaluarea activităților în funcție de utilizarea acestora
-Comment[ru]=Модуль для определения рейтинга комнат по их использованию
-Comment[sk]=Plugin na hodnotenie aktivít založený na použití
-Comment[sl]=Vstavek za razvrstitev dejavnosti glede na uporabo
-Comment[sr]=Прикључак за рангирање активности на основу употребе
-Comment[sr@ijekavian]=Прикључак за рангирање активности на основу употребе
-Comment[sr@ijekavianlatin]=Priključak za rangiranje aktivnosti na osnovu upotrebe
-Comment[sr@latin]=Priključak za rangiranje aktivnosti na osnovu upotrebe
-Comment[sv]=Insticksprogram för rankning av aktiviteter baserat på användning
-Comment[tr]=Etkinlikleri kullanımlarına göre sıralama eklentisi
-Comment[ug]=پائالىيەت قاتارى ئاساسىدا ئىشلىتىدىغان قىستۇرما
-Comment[uk]=Додаток для оцінювання просторів дій на основі даних щодо використання
-Comment[x-test]=xxPlugin to rank activities based on usagexx
-Comment[zh_CN]=根据使用情况对活动评分的插件
-Comment[zh_TW]=以用量來排序活動的外掛程式
-Type=Service
-Icon=flag
-
-X-KDE-ServiceTypes=ActivityManager/Plugin
-X-KDE-Library=kactivitymanagerd_plugin_activityranking
-X-KDE-PluginInfo-Author=Ivan Cukic
-X-KDE-PluginInfo-Email=ivan.cukic@kde.org
-X-KDE-PluginInfo-Name=org.kde.ActivityManager.ActivityRanking
-X-KDE-PluginInfo-Version=1.0
-X-KDE-PluginInfo-Website=http://plasma.kde.org/
-X-KDE-PluginInfo-Category=
-X-KDE-PluginInfo-Depends=
-X-KDE-PluginInfo-License=GPL
-X-KDE-PluginInfo-EnabledByDefault=true
-
|
[-]
[+]
|
Deleted |
_service:tar_git:kactivities-5.1.0.tar.xz/upstream/src/service/plugins/activityranking/org.kde.ActivityManager.ActivityRanking.xml
^
|
@@ -1,23 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node>
- <interface name="org.kde.ActivityManager.ActivityRanking">
-
- <method name="topActivities">
- <arg type="as" direction="out" />
- </method>
-
- <method name="activities">
- <arg type="a(sd)" direction="out" />
- <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="ActivityDataList" />
- <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="ActivityDataList" />
- </method>
-
- <signal name="rankingChanged">
- <arg name="topActivities" type="as" direction="out" />
- <arg name="activities" type="a(sd)" direction="out" />
- <annotation name="com.trolltech.QtDBus.QtTypeName.In1" value="ActivityDataList" />
- <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="ActivityDataList" />
- </signal>
-
- </interface>
-</node>
|
[-]
[+]
|
Deleted |
_service:tar_git:kactivities-5.1.0.tar.xz/upstream/src/service/plugins/activityranking/org.kde.LocationManager.xml
^
|
@@ -1,28 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node>
- <interface name="org.kde.LocationManager">
- <signal name="currentLocationChanged">
- <arg name="locationId" type="s" direction="out"/>
- <arg name="name" type="s" direction="out"/>
- </signal>
- <method name="knownLocations">
- <arg type="as" direction="out"/>
- </method>
- <method name="addLocation">
- <arg type="s" direction="out"/>
- <arg name="name" type="s" direction="in"/>
- </method>
- <method name="setCurrentLocation">
- <arg type="s" direction="out"/>
- <arg name="locationId" type="s" direction="in"/>
- </method>
- <method name="resetCurrentLocation">
- </method>
- <method name="currentLocationId">
- <arg type="s" direction="out"/>
- </method>
- <method name="currentLocationName">
- <arg type="s" direction="out"/>
- </method>
- </interface>
-</node>
|
[-]
[+]
|
Deleted |
_service:tar_git:kactivities-5.1.0.tar.xz/upstream/src/utils/find_if_assoc.h
^
|
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2012 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 Lesser 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 Lesser General Public License for more details
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the
- * Free Software Foundation,3 Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef UTILS_FIND_IF_ASSOC_H
-#define UTILS_FIND_IF_ASSOC_H
-
-#include <kactivities-features.h>
-
-/********************************************************************
- * Associative container's find_if (for hash, map, and similar ) *
- ********************************************************************/
-
-namespace kamd {
-namespace utils {
-
-namespace details {
-
-// Iterator Functions
-
-template <typename Iterator, typename Function>
-Function qt_find_if_assoc(Iterator start, Iterator end, Function f)
-{
- for (; start != end; ++start) {
- if (f(start.key(), start.value())) {
- break;
- }
- }
-
- return f;
-}
-
-template <typename Iterator, typename Function>
-Function stl_find_if_assoc(Iterator start, Iterator end, Function f)
-{
- for (; start != end; ++start) {
- if (f(start->first, start->second)) {
- break;
- }
- }
-
- return f;
-}
-
-// Container functions
-
-template <typename Container, typename Function>
-Function _find_if_assoc_helper_container(const Container &c, Function f,
- decltype(&Container::constBegin) *)
-{
- return qt_find_if_assoc(c.constBegin(), c.constEnd(), f);
-}
-
-template <typename Container, typename Function>
-Function _find_if_assoc_helper_container(const Container &c, Function f,
- decltype(&Container::cbegin) *)
-{
- return stl_find_if_assoc(c.cbegin(), c.cend(), f);
-}
-
-} // namespace details
-
-template <typename Container, typename Function>
-Function find_if_assoc(const Container &c, Function f)
-{
- return details::_find_if_assoc_helper_container
- <Container, Function>(c, f, Q_NULLPTR);
-}
-
-} // namespace utils
-} // namespace kamd
-
-#endif // UTILS_FIND_IF_ASSOC_H
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/.gitignore
^
|
@@ -11,3 +11,4 @@
.clang_complete
kactivities.kdev4
compile_commands.json
+/apidocs
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/CMakeLists.txt
^
|
@@ -15,7 +15,7 @@
endif ()
# Extra CMake stuff
-find_package (ECM 1.1.0 REQUIRED NO_MODULE)
+find_package (ECM 1.2.0 REQUIRED NO_MODULE)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(KDEInstallDirs)
@@ -29,8 +29,8 @@
find_package (Qt5 REQUIRED NO_MODULE COMPONENTS Core DBus)
# KDE Frameworks
-set(KF5_VERSION "5.1.0") # handled by release scripts
-set(KF5_DEP_VERSION "5.1.0") # handled by release scripts
+set(KF5_VERSION "5.3.0") # handled by release scripts
+set(KF5_DEP_VERSION "5.2.0") # handled by release scripts
find_package (KF5DBusAddons ${KF5_DEP_VERSION} CONFIG REQUIRED)
find_package (KF5I18n ${KF5_DEP_VERSION} CONFIG REQUIRED)
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/README.md
^
|
@@ -1,18 +1,31 @@
# KActivities
-Core components for the KDE's Activities Activity Manager
## Introduction
-System service to manage user's activities, track the usage patterns etc.
-KActivities library
-API for using and interacting with the Activity Manager as a consumer,
-application adding information to them or as an activity manager.
-Workspace
-Plugins for KDE workspace to easier integrate activities (KIO, etc.)
+When a user is interacting with a computer, there are three main areas of
+contextual information that may affect the behaviour of the system: who the user
+is, where they are, and what they are doing.
-## Links
-
-- Wiki: <http://community.kde.org/Plasma/Activities>
-- Mailing list: <https://mail.kde.org/mailman/listinfo/plasma-devel>
-- IRC channel: #plasma on Freenode
-- Git repository: <https://projects.kde.org/projects/kde/kdelibs/kactivities/repository>
+*Activities* deal with the last one. An activity might be "developing a KDE
+application", "studying 19th century art", "composing music" or "watching funny
+videos". Each of these activites may involve multiple applications, and a single
+application may be used in multiple activities (for example, most activities are
+likely to involve using a web browser, but different activities will probably
+involve different websites).
+
+KActivities provides the infrastructure needed to manage a user's activites,
+allowing them to switch between tasks, and for applications to update their
+state to match the user's current activity. This includes a daemon, a library
+for interacting with that daemon, and plugins for integration with other
+frameworks.
+
+## Usage
+
+Most applications that wish to be activity-aware will want to use
+KActivities::Consumer to keep track of the user's current activity, and
+KActivities::ResourceInstance to notify the activity manager of resources the
+user has accessed (this is not necessary for resources accessed via KIO, as a
+plugin is provided to do that automatically).
+
+The other classes available in the API are primarily intended for use by the
+workspace to allow the user to view and manage available activities.
|
[-]
[+]
|
Added |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/docs/Doxyfile.local
^
|
@@ -0,0 +1 @@
+EXCLUDE_PATTERNS += */service/* */scripts/* */workspace/*
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/metainfo.yaml
^
|
@@ -8,3 +8,7 @@
portingAid: false
deprecated: false
release: true
+libraries:
+ - qmake: KActivities
+ cmake: "KF5::Activities"
+cmakename: KF5Activities
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/CMakeLists.txt
^
|
@@ -101,7 +101,7 @@
add_subdirectory (service)
# No point in having workspace addons without the service
- # add_subdirectory (workspace)
+ add_subdirectory (workspace)
endif ()
|
[-]
[+]
|
Added |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/common/database/Database.cpp
^
|
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2014 Ivan Cukic <ivan.cukic@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License or (at your option) version 3 or any later version
+ * accepted by the membership of KDE e.V. (or its successor approved
+ * by the membership of KDE e.V.), which shall act as a proxy
+ * defined in Section 14 of version 3 of the license.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Database.h"
+
+#include <utils/d_ptr_implementation.h>
+
+#include <QStandardPaths>
+#include <QSqlDatabase>
+#include <QSqlQuery>
+#include <QSqlField>
+#include <QSqlError>
+#include <QSqlDriver>
+#include <QThread>
+
+#include <memory>
+#include <mutex>
+#include <map>
+
+class Database::Private {
+public:
+ QSqlDatabase database;
+};
+
+namespace {
+ std::mutex databases_mutex;
+ std::map<Qt::HANDLE, std::weak_ptr<Database>> databases;
+};
+
+std::shared_ptr<Database> Database::instance(Source source)
+{
+ Q_UNUSED(source) // for the time being
+
+ Qt::HANDLE thread = QThread::currentThreadId();
+ std::lock_guard<std::mutex> lock(databases_mutex);
+
+ auto search = databases.find(thread);
+ if (search != databases.end()) {
+ auto ptr = search->second.lock();
+
+ if (ptr) {
+ return std::move(ptr);
+ }
+ }
+
+ auto ptr = std::make_shared<Database>();
+
+ ptr->d->database = QSqlDatabase::addDatabase(
+ "QSQLITE",
+ "kactivities_db_resources_" + QString::number((quintptr)thread));
+ ptr->d->database.setConnectOptions("QSQLITE_OPEN_READONLY");
+
+ ptr->d->database.setDatabaseName(
+ QStandardPaths::writableLocation(
+ QStandardPaths::GenericDataLocation)
+ + QStringLiteral("/kactivitymanagerd/resources/database"));
+
+ if (!ptr->d->database.open()) {
+ ptr.reset();
+ } else {
+ databases[thread] = ptr;
+ }
+
+ return std::move(ptr);
+}
+
+Database::Database()
+{
+
+}
+
+
+Database::~Database()
+{
+}
+
+QSqlQuery Database::query() const
+{
+ return QSqlQuery(d->database);
+}
+
+QSqlQuery Database::query(const QString &query) const
+{
+ return QSqlQuery(query, d->database);
+}
+
+
|
[-]
[+]
|
Added |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/common/database/Database.h
^
|
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2014 Ivan Cukic <ivan.cukic@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License or (at your option) version 3 or any later version
+ * accepted by the membership of KDE e.V. (or its successor approved
+ * by the membership of KDE e.V.), which shall act as a proxy
+ * defined in Section 14 of version 3 of the license.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef COMMON_DATABASE_H
+#define COMMON_DATABASE_H
+
+#include <utils/d_ptr.h>
+#include <memory>
+#include <QSqlQuery>
+
+class Database {
+public:
+ enum Source {
+ ResourcesDatabase
+ };
+
+ static
+ std::shared_ptr<Database> instance(Source source);
+
+ QSqlQuery query(const QString &query) const;
+ QSqlQuery query() const;
+
+ ~Database();
+ Database();
+
+private:
+ D_PTR;
+};
+
+#endif // COMMON_DATABASE_H
+
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/common/dbus/org.kde.ActivityManager.ResourcesLinking.xml
^
|
@@ -8,8 +8,8 @@
<arg name="activity" type="s" direction="in"/>
</method>
<method name="LinkResourceToActivity">
+ <arg name="agent" type="s" direction="in"/>
<arg name="resource" type="s" direction="in"/>
- <arg name="activity" type="s" direction="in"/>
</method>
<method name="UnlinkResourceFromActivity">
@@ -18,8 +18,8 @@
<arg name="activity" type="s" direction="in"/>
</method>
<method name="UnlinkResourceFromActivity">
+ <arg name="agent" type="s" direction="in"/>
<arg name="resource" type="s" direction="in"/>
- <arg name="activity" type="s" direction="in"/>
</method>
<method name="IsResourceLinkedToActivity">
@@ -29,8 +29,8 @@
<arg type="b" direction="out"/>
</method>
<method name="IsResourceLinkedToActivity">
+ <arg name="agent" type="s" direction="in"/>
<arg name="resource" type="s" direction="in"/>
- <arg name="activity" type="s" direction="in"/>
<arg type="b" direction="out"/>
</method>
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/imports/resourcemodel.cpp
^
|
@@ -98,13 +98,13 @@
: QSortFilterProxyModel(parent)
, m_shownActivities(QStringLiteral(":current"))
, m_shownAgents(QStringLiteral(":current"))
- , m_sorting{"/media/ivan/documents"}
, m_defaultItemsLoaded(false)
, m_linker(LinkerService::self())
, m_config(KSharedConfig::openConfig("kactivitymanagerd-resourcelinkingrc")
->group("Order"))
{
// TODO: What to do if the file does not exist?
+ // qDebug() << "Creating a resource model instance";
const QString databaseDir
= QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
@@ -131,10 +131,13 @@
if (m_database.isValid()) return true;
if (!QFile(m_databaseFile).exists()) return false;
+ // TODO: Database connection naming could be smarter (thread-id-based,
+ // reusing connections...?)
m_database = QSqlDatabase::addDatabase(
QStringLiteral("QSQLITE"),
- QStringLiteral("kactivities_db_resources"));
+ QStringLiteral("kactivities_db_resources_") + QString::number((quintptr)this));
+ // qDebug() << "Database file is: " << m_databaseFile;
m_database.setDatabaseName(m_databaseFile);
m_database.open();
@@ -373,7 +376,7 @@
}
void ResourceModel::linkResourceToActivity(const QString &agent,
- const QString &resource,
+ const QString &_resource,
const QString &activity,
const QJSValue &callback) const
{
@@ -382,6 +385,8 @@
return;
}
+ auto resource = validateResource(_resource);
+
// qDebug() << "ResourceModel: Linking resource to activity: --------------------------------------------------\n"
// << "ResourceModel: Resource: " << resource << "\n"
// << "ResourceModel: Agents: " << agent << "\n"
@@ -422,10 +427,12 @@
}
void ResourceModel::unlinkResourceFromActivity(const QStringList &agents,
- const QString &resource,
+ const QString &_resource,
const QStringList &activities,
const QJSValue &callback)
{
+ auto resource = validateResource(_resource);
+
// qDebug() << "ResourceModel: Unlinking resource from activity: ----------------------------------------------\n"
// << "ResourceModel: Resource: " << resource << "\n"
// << "ResourceModel: Agents: " << agents << "\n"
@@ -473,11 +480,13 @@
}
bool ResourceModel::isResourceLinkedToActivity(const QStringList &agents,
- const QString &resource,
+ const QString &_resource,
const QStringList &activities)
{
if (!m_database.isValid()) return false;
+ auto resource = validateResource(_resource);
+
// qDebug() << "ResourceModel: Testing whether the resource is linked to activity: ----------------------------\n"
// << "ResourceModel: Resource: " << resource << "\n"
// << "ResourceModel: Agents: " << agents << "\n"
@@ -492,8 +501,13 @@
query.exec();
auto result = query.next();
+
// qDebug() << "Query: " << query.lastQuery();
- // qDebug() << "Error: " << query.lastError();
+ //
+ // if (query.lastError().isValid()) {
+ // qDebug() << "Error: " << query.lastError();
+ // }
+ //
// qDebug() << "Result: " << result;
return result;
@@ -535,6 +549,8 @@
if (matchingActivity != m_shownActivities.end()
&& matchingAgent != m_shownAgents.end()) {
+ // TODO: This might be smarter possibly, but might collide
+ // with the sql model
reloadData();
}
}
@@ -552,8 +568,7 @@
m_sorting = resources;
m_config.writeEntry(m_shownAgents.first(), m_sorting);
m_config.sync();
- // qDebug() << "Order" << m_sorting;
- reloadData();
+ invalidate();
}
void ResourceModel::move(int sourceItem, int destinationItem)
@@ -627,7 +642,7 @@
QString ResourceModel::resourceAt(int row) const
{
- return data(index(row, 0), ResourceRole).toString();
+ return validateResource(data(index(row, 0), ResourceRole).toString());
}
void ResourceModel::loadDefaultsIfNeeded() const
@@ -655,21 +670,27 @@
QString configGroup = args.takeLast();
QString configFile = args.join("/");
- qDebug() << "Config"
- << configFile << " "
- << configGroup << " "
- << configField << " ";
+ // qDebug() << "Config"
+ // << configFile << " "
+ // << configGroup << " "
+ // << configField << " ";
QStringList items = KSharedConfig::openConfig(configFile)
->group(configGroup)
.readEntry(configField, QStringList());
for (const auto& item: items) {
- qDebug() << "Adding: " << item;
+ // qDebug() << "Adding: " << item;
linkResourceToActivity(item, ":global", QJSValue());
}
}
+QString ResourceModel::validateResource(const QString &resource) const
+{
+ return resource.startsWith(QStringLiteral("file://")) ?
+ QUrl(resource).toLocalFile() : resource;
+}
+
} // namespace Models
} // namespace KActivities
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/imports/resourcemodel.h
^
|
@@ -195,6 +195,7 @@
mutable bool m_defaultItemsLoaded;
void reloadData();
+ QString validateResource(const QString &resource) const;
class LinkerService;
std::shared_ptr<LinkerService> m_linker;
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/lib/core/info.cpp
^
|
@@ -187,34 +187,6 @@
return info ? info->icon : QString();
}
-// QFuture<void> Info::linkResource(const QString &resourceUri)
-// {
-// // Manager::resourcesLinking()->LinkResourceToActivity(resourceUri, d->id);
-// return Manager::isServiceRunning() ?
-// DBusFuture::asyncCall<void>(
-// Manager::resourcesLinking(), QStringLiteral("LinkResourceToActivity"), resourceUri, d->id)
-// :
-// DBusFuture::fromVoid();
-// }
-//
-// QFuture<void> Info::unlinkResource(const QString &resourceUri)
-// {
-// // Manager::resourcesLinking()->UnlinkResourceFromActivity(resourceUri, d->id);
-// return Manager::isServiceRunning() ?
-// DBusFuture::asyncCall<void>(
-// Manager::resourcesLinking(), QStringLiteral("UnlinkResourceFromActivity"), resourceUri, d->id)
-// :
-// DBusFuture::fromVoid();
-// }
-//
-// QFuture<bool> Info::isResourceLinked(const QString &resourceUri)
-// {
-// // return Manager::resourcesLinking()->IsResourceLinkedToActivity(resourceUri, d->id);
-// return DBusFuture::asyncCall<bool>(
-// Manager::resourcesLinking(),
-// QStringLiteral("IsResourceLinkedToActivity"), resourceUri, d->id);
-// }
-
} // namespace KActivities
#include "moc_info.cpp"
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/lib/core/manager_p.cpp
^
|
@@ -34,7 +34,7 @@
#define ACTIVITY_MANAGER_DBUS_PATH \
QStringLiteral("org.kde.ActivityManager")
#define ACTIVITY_MANAGER_DBUS_OBJECT(A) \
- QStringLiteral("/ActivityManager" A)
+ QLatin1String("/ActivityManager" A)
Manager::Manager()
: QObject()
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/Activities.cpp
^
|
@@ -38,7 +38,6 @@
// Utils
#include <utils/d_ptr_implementation.h>
-#include <utils/find_if_assoc.h>
#include <utils/range.h>
// Local
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/Application.cpp
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010, 2011, 2012 Ivan Cukic <ivan.cukic(at)kde.org>
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014 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,
@@ -39,15 +39,18 @@
#include <ksharedconfig.h>
#include <kdbusconnectionpool.h>
#include <kdbusservice.h>
+#include <kplugintrader.h>
// Boost and utils
#include <boost/range/adaptor/filtered.hpp>
+#include <boost/range/adaptor/transformed.hpp>
#include <utils/d_ptr_implementation.h>
// System
#include <signal.h>
#include <stdlib.h>
#include <memory>
+#include <functional>
// Local
#include "Activities.h"
@@ -104,9 +107,24 @@
}
static inline bool isPluginEnabled(const KConfigGroup &config,
- const QString &plugin)
+ QExplicitlySharedDataPointer<KService> plugin)
+ // const QExplicitlySharedDataPointer<KService> &plugin)
{
- return config.readEntry(plugin, true);
+ const auto pluginName
+ = plugin->property("X-KDE-PluginInfo-Name",
+ QVariant::String).toString();
+ // qDebug() << "Plugin Name is " << pluginName;
+
+ if (pluginName == "org.kde.ActivityManager.ResourceScoring") {
+ // SQLite plugin is necessary for the proper workspace behaviour
+ return true;
+
+ } else {
+ return config.readEntry(
+ pluginName + "Enabled",
+ plugin->property("X-KDE-PluginInfo-EnabledByDefault",
+ QVariant::Bool).toBool());
+ }
}
Resources *resources;
@@ -151,69 +169,33 @@
using namespace boost::adaptors;
using namespace std::placeholders;
- // TODO: Return the plugin system
- // TODO: Properly load plugins when KF5::KService becomes more stable
-
- const QDir pluginsDir(QStringLiteral(KAMD_INSTALL_PREFIX "/" KAMD_PLUGIN_DIR));
- const auto plugins = pluginsDir.entryList(QStringList{ QStringLiteral("kactivitymanagerd*.so") }, QDir::Files);
- const auto config = KSharedConfig::openConfig(QStringLiteral("kactivitymanagerdrc"))->group("Plugins");
-
- const auto availablePlugins = plugins
- | filtered(std::bind(Private::isPluginEnabled, config, _1));
+ const auto pluginsDir(QLatin1String(KAMD_INSTALL_PREFIX "/" KAMD_PLUGIN_DIR));
+ QCoreApplication::addLibraryPath(pluginsDir);
- for (const auto &plugin: availablePlugins) {
- QPluginLoader loader(pluginsDir.absoluteFilePath(plugin));
- // qDebug() << pluginsDir.absoluteFilePath(plugin);
-
- auto pluginInstance = dynamic_cast<Plugin *>(loader.instance());
+ const auto config
+ = KSharedConfig::openConfig(QStringLiteral("kactivitymanagerdrc"))
+ ->group("Plugins");
+ const auto allOffers
+ = KServiceTypeTrader::self()->query("ActivityManager/Plugin");
+
+ const auto filteredOffers = allOffers
+ | filtered(std::bind(Private::isPluginEnabled, config, _1));
+
+ for (const auto &offer : filteredOffers) {
+ QString error;
+ auto pluginInstance = dynamic_cast<Plugin*>(
+ offer->createInstance<QObject>(this, {}, &error)
+ );
if (pluginInstance) {
pluginInstance->init(Module::get());
- qCDebug(KAMD_LOG_APPLICATION) << "[ OK ] loaded: " << plugin;
+ qCDebug(KAMD_LOG_APPLICATION) << "[ OK ] loaded: " << offer->name();
} else {
- qCWarning(KAMD_LOG_APPLICATION) << "[ FAILED ] loading: " << plugin
- << loader.errorString();
+ qCWarning(KAMD_LOG_APPLICATION) << "[ FAILED ] loading: " << offer->name() << error;
// TODO: Show a notification
}
}
-
- // const auto offers = KServiceTypeTrader::self()->query(QStringLiteral("ActivityManager/Plugin"));
-
- // for (const auto &service: offers) {
- // if (!disabledPlugins.contains(service->library())) {
- // disabledPlugins.append(
- // service->property("X-ActivityManager-PluginOverrides", QVariant::StringList).toStringList()
- // );
- // }
- // }
-
- // qCDebug(KAMD_APPLICATION) << "These are the disabled plugins:" << disabledPlugins;
-
- // // Loading plugins and initializing them
- // for (const auto &service: offers) {
- // if (disabledPlugins.contains(service->library()) ||
- // disabledPlugins.contains(service->property("X-KDE-PluginInfo-Name").toString() + "Enabled")) {
- // continue;
- // }
-
- // const auto factory = KPluginLoader(service->library()).factory();
-
- // if (!factory) {
- // continue;
- // }
-
- // const auto plugin = factory->create < Plugin > (this);
-
- // if (plugin) {
- // qCDebug(KAMD_APPLICATION) << "Got the plugin: " << service->library();
- // d->plugins << plugin;
- // }
- // }
-
- // for (Plugin * plugin: d->plugins) {
- // plugin->init(Module::get());
- // }
}
Application::~Application()
@@ -352,7 +334,7 @@
QProcess::startDetached(
KAMD_INSTALL_PREFIX "/bin/kactivitymanagerd",
- {"start-daemon"}
+ QStringList{"start-daemon"}
);
return application.exec();
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/CMakeLists.txt
^
|
@@ -13,6 +13,9 @@
find_package (KF5I18n ${KF5_DEP_VERSION} CONFIG REQUIRED)
find_package (KF5Service ${KF5_DEP_VERSION} CONFIG REQUIRED)
find_package (KF5WindowSystem ${KF5_DEP_VERSION} CONFIG REQUIRED)
+find_package (KF5GlobalAccel ${KF5_DEP_VERSION} CONFIG REQUIRED)
+find_package (KF5XmlGui ${KF5_DEP_VERSION} CONFIG REQUIRED)
+find_package (KF5KIO ${KF5_DEP_VERSION} CONFIG REQUIRED)
# Standard stuff
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/Plugin.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011, 2012 Ivan Cukic <ivan.cukic(at)kde.org>
+ * Copyright (C) 2011, 2012, 2013, 2014 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,
@@ -25,7 +25,7 @@
#include <QMetaObject>
// KDE
-// #include <KPluginFactory>
+#include <kpluginfactory.h>
#include <kconfiggroup.h>
// Utils
@@ -35,10 +35,8 @@
#include "Event.h"
#include "Module.h"
-
-#define KAMD_EXPORT_PLUGIN(ClassName, AboutData) \
- K_PLUGIN_FACTORY(ClassName##Factory, registerPlugin<ClassName>();) \
- K_EXPORT_PLUGIN(ClassName##Factory(AboutData))
+#define KAMD_EXPORT_PLUGIN(libname, classname, jsonFile) \
+ K_PLUGIN_FACTORY_WITH_JSON(factory, jsonFile, registerPlugin<classname>();)
/**
*
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/common.h
^
|
@@ -19,8 +19,10 @@
#define ACTIVITY_MANAGER_SERVICE \
QStringLiteral("org.kde.ActivityManager")
+
+// can't use string literal concatenation in QStringLiteral in MSVC
#define ACTIVITY_MANAGER_OBJECT_TYPE(A) \
- QStringLiteral(ACTIVITY_MANAGER_SERVICE #A)
+ QLatin1String(ACTIVITY_MANAGER_SERVICE #A)
#define ACTIVITY_MANAGER_OBJECT_PATH(A) \
- QStringLiteral("/ActivityManager/" #A)
+ QLatin1String("/ActivityManager/" #A)
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/CMakeLists.txt
^
|
@@ -3,7 +3,5 @@
add_subdirectory (slc)
add_subdirectory (sqlite)
add_subdirectory (activitytemplates)
-
-# add_subdirectory (globalshortcuts)
-# add_subdirectory (virtualdesktopswitch)
-# macro_optional_add_subdirectory (activityranking)
+add_subdirectory (virtualdesktopswitch)
+add_subdirectory (globalshortcuts)
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/activitytemplates/CMakeLists.txt
^
|
@@ -28,6 +28,7 @@
Qt5::DBus
KF5::ConfigCore
KF5::DBusAddons
+ KF5::CoreAddons
)
set_target_properties(
@@ -35,6 +36,11 @@
PROPERTIES PREFIX ""
)
+kservice_desktop_to_json(
+ kactivitymanagerd_plugin_activitytemplates
+ kactivitymanagerd-plugin-activitytemplates.desktop
+ )
+
install (TARGETS kactivitymanagerd_plugin_activitytemplates DESTINATION ${KAMD_PLUGIN_DIR})
-# install (FILES kactivitymanagerd-plugin-activitytemplates.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+install (FILES kactivitymanagerd-plugin-activitytemplates.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/activitytemplates/TemplatesPlugin.cpp
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Ivan Cukic <ivan.cukic@kde.org>
+ * Copyright (C) 2012, 2013, 2014 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 as
@@ -22,6 +22,9 @@
#include <QStringList>
#include <QString>
+KAMD_EXPORT_PLUGIN(templatesplugin, TemplatesPlugin, "kactivitymanagerd-plugin-activitytemplates.json")
+
+
TemplatesPlugin::TemplatesPlugin(QObject *parent, const QVariantList &args)
: Plugin(parent)
{
@@ -90,4 +93,5 @@
}
-// KAMD_EXPORT_PLUGIN(TemplatesPlugin, "kactivitymanagerd_plugin_activitytemplates")
+#include "TemplatesPlugin.moc"
+
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/activitytemplates/TemplatesPlugin.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Ivan Cukic <ivan.cukic@kde.org>
+ * Copyright (C) 2012, 2013, 2014 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 as
@@ -26,7 +26,7 @@
class TemplatesPlugin : public Plugin {
Q_OBJECT
// Q_CLASSINFO("D-Bus Interface", "org.kde.ActivityManager.SLC")
- Q_PLUGIN_METADATA(IID "org.kde.ActivityManager.plugins.activitytemplates")
+ // Q_PLUGIN_METADATA(IID "org.kde.ActivityManager.plugins.activitytemplates")
public:
TemplatesPlugin(QObject *parent = Q_NULLPTR,
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/activitytemplates/kactivitymanagerd-plugin-activitytemplates.desktop
^
|
@@ -10,6 +10,7 @@
Name[fi]=Aktiviteettimallit
Name[fr]=Modèles d'activité
Name[gl]=Modelos de actividade
+Name[hu]=Aktivitássablonok
Name[ia]=Patronos de Activitate
Name[ko]=활동 템플릿
Name[nb]=Film-maler
@@ -19,6 +20,7 @@
Name[pl]=Szablony działań
Name[pt]=Modelos de Actividades
Name[pt_BR]=Modelos de atividades
+Name[ro]=Șabloane de activități
Name[ru]=Шаблоны комнат
Name[sk]=Šablóny aktivít
Name[sl]=Predloge dejavnosti
@@ -42,6 +44,7 @@
Comment[fi]=Tuki aktiviteettimallien tekemiseen
Comment[fr]=Prise en charge de la création d'activités par modèles
Comment[gl]=Permite a creación de modelos de actividades
+Comment[hu]=Támogatás sablonból létrehozott aktivitásokhoz
Comment[ia]=Supporto pro crear activitates de forma de patrono
Comment[ko]=템플릿이 있는 활동 생성 지원
Comment[nb]=Støtte for å opprette aktiviteter fra maler
@@ -50,6 +53,7 @@
Comment[pl]=Obsługa tworzenia szablonowych działań
Comment[pt]=Suporte para criar actividades em modelos
Comment[pt_BR]=Suporte para criação de atividades em modelos
+Comment[ro]=Suport pentru crearea activităților cu șablon
Comment[ru]=Поддержка создания шаблонов комнат
Comment[sk]=Podpora pre vytváranie šablónovaných aktivít
Comment[sl]=Podpora za ustvarjanje predlog dejavnosti
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/globalshortcuts/CMakeLists.txt
^
|
@@ -25,6 +25,18 @@
target_link_libraries (
kactivitymanagerd_plugin_globalshortcuts
Qt5::Core
+ Qt5::DBus
+ Qt5::Widgets
+ KF5::ConfigCore
+ KF5::GlobalAccel
+ KF5::I18n
+ KF5::XmlGui
+ KF5::CoreAddons
+ )
+
+kservice_desktop_to_json(
+ kactivitymanagerd_plugin_globalshortcuts
+ kactivitymanagerd-plugin-globalshortcuts.desktop
)
set_target_properties(
@@ -33,5 +45,5 @@
)
install (TARGETS kactivitymanagerd_plugin_globalshortcuts DESTINATION ${KAMD_PLUGIN_DIR})
-# install (FILES kactivitymanagerd-plugin-globalshortcuts.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+install (FILES kactivitymanagerd-plugin-globalshortcuts.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/globalshortcuts/GlobalShortcutsPlugin.cpp
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Ivan Cukic <ivan.cukic@kde.org>
+ * Copyright (C) 2012, 2013, 2014 Ivan Cukic <ivan.cukic(at)kde.org>
* Copyright (C) 2012 Makis Marimpis <makhsm@gmail.com>
*
* This program is free software; you can redistribute it and/or
@@ -21,11 +21,14 @@
#include <QStringList>
#include <QString>
#include <QSignalMapper>
+#include <QAction>
-#include <KAction>
#include <KActionCollection>
+#include <KGlobalAccel>
#include <KLocalizedString>
+KAMD_EXPORT_PLUGIN(globalshortcutsplugin, GlobalShortcutsPlugin, "kactivitymanagerd-plugin-globalshortcuts.json")
+
const auto objectNamePattern = QStringLiteral("switch-to-activity-%1");
const auto objectNamePatternLength = objectNamePattern.length() - 2;
@@ -47,37 +50,39 @@
{
m_activitiesService = modules["activities"];
- const auto activitiesList = Plugin::callOn<QStringList, Qt::DirectConnection>(m_activitiesService, "ListActivities", "QStringList");
+ m_activitiesList = Plugin::callOn<QStringList, Qt::DirectConnection>(
+ m_activitiesService, "ListActivities", "QStringList");
- for (const auto &activity: activitiesList) {
+ for (const auto &activity: m_activitiesList) {
activityAdded(activity);
}
- connect(
- m_signalMapper, SIGNAL(mapped(QString)),
- m_activitiesService, SLOT(SetCurrentActivity(QString)),
- Qt::QueuedConnection);
+ connect(m_signalMapper, SIGNAL(mapped(QString)),
+ m_activitiesService, SLOT(SetCurrentActivity(QString)),
+ Qt::QueuedConnection);
+ connect(m_activitiesService, SIGNAL(ActivityAdded(QString)),
+ this, SLOT(activityAdded(QString)));
+ connect(m_activitiesService, SIGNAL(ActivityRemoved(QString)),
+ this, SLOT(activityRemoved(QString)));
m_actionCollection->readSettings();
- for (const auto &action: m_actionCollection->actions()) {
- if (!activitiesList.contains(action->objectName().mid(objectNamePatternLength))) {
- m_actionCollection->removeAction(action);
- }
- }
-
- m_actionCollection->writeSettings();
+ activityRemoved();
return true;
}
void GlobalShortcutsPlugin::activityAdded(const QString &activity)
{
+ if (!m_activitiesList.contains(activity)) {
+ m_activitiesList << activity;
+ }
+
const auto action = m_actionCollection->addAction(
objectNamePattern.arg(activity));
action->setText(i18nc("@action", "Switch to activity \"%1\"", activityName(activity)));
- action->setGlobalShortcut(KShortcut());
+ KGlobalAccel::self()->setGlobalShortcut(action, QList<QKeySequence>{});
connect(action, SIGNAL(triggered()), m_signalMapper, SLOT(map()));
m_signalMapper->setMapping(action, activity);
@@ -85,10 +90,21 @@
m_actionCollection->writeSettings();
}
-void GlobalShortcutsPlugin::activityRemoved(const QString &activity)
+QString GlobalShortcutsPlugin::activityForAction(QAction *action) const
{
+ return action->objectName().mid(objectNamePatternLength);
+}
+
+void GlobalShortcutsPlugin::activityRemoved(const QString &deletedActivity)
+{
+ m_activitiesList.removeAll(deletedActivity);
+
+ // Removing all shortcuts that refer to an unknown activity
for (const auto &action: m_actionCollection->actions()) {
- if (activity == action->objectName().mid(objectNamePatternLength)) {
+ const auto actionActivity = activityForAction(action);
+ if ((deletedActivity.isEmpty() && !m_activitiesList.contains(actionActivity))
+ || deletedActivity == actionActivity) {
+ KGlobalAccel::self()->removeAllShortcuts(action);
m_actionCollection->removeAction(action);
}
}
@@ -99,8 +115,9 @@
void GlobalShortcutsPlugin::activityChanged(const QString &activity)
{
for (const auto &action: m_actionCollection->actions()) {
- if (activity == action->objectName().mid(objectNamePatternLength)) {
- action->setText(i18nc("@action", "Switch to activity \"%1\"", activityName(activity)));
+ if (activity == activityForAction(action)) {
+ action->setText(i18nc("@action", "Switch to activity \"%1\"",
+ activityName(activity)));
}
}
}
@@ -112,4 +129,5 @@
Q_ARG(QString, activity));
}
-KAMD_EXPORT_PLUGIN(GlobalShortcutsPlugin, "kactivitymanagerd_plugin_globalshortcuts")
+#include "GlobalShortcutsPlugin.moc"
+
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/globalshortcuts/GlobalShortcutsPlugin.h
^
|
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2012 Makis Marimpis <makhsm@gmail.com>
- * Copyright (C) 2012 Ivan Cukic <ivan.cukic@kde.org>
+ * Copyright (C) 2012, 2013, 2014 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 as
@@ -23,26 +23,30 @@
class QSignalMapper;
class KActionCollection;
+class QAction;
class GlobalShortcutsPlugin : public Plugin {
Q_OBJECT
+ // Q_PLUGIN_METADATA(IID "org.kde.ActivityManager.plugins.globalshortcutsplugin")
public:
- GlobalShortcutsPlugin(QObject *parent, const QVariantList &args);
+ GlobalShortcutsPlugin(QObject *parent = Q_NULLPTR, const QVariantList &args = QVariantList());
virtual ~GlobalShortcutsPlugin();
virtual bool init(const QHash<QString, QObject *> &modules) Q_DECL_OVERRIDE;
private Q_SLOTS:
void activityAdded(const QString &activity);
- void activityRemoved(const QString &activity);
+ void activityRemoved(const QString &activity = QString());
void activityChanged(const QString &activity);
private:
inline QString activityName(const QString &activity) const;
+ inline QString activityForAction(QAction *action) const;
QObject *m_activitiesService;
QSignalMapper *m_signalMapper;
+ QStringList m_activitiesList;
KActionCollection *m_actionCollection;
};
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/globalshortcuts/kactivitymanagerd-plugin-globalshortcuts.desktop
^
|
@@ -107,5 +107,5 @@
X-KDE-PluginInfo-Category=
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
-X-KDE-PluginInfo-EnabledByDefault=true
+X-KDE-PluginInfo-EnabledByDefault=false
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/slc/CMakeLists.txt
^
|
@@ -35,6 +35,12 @@
Qt5::DBus
KF5::ConfigCore
KF5::DBusAddons
+ KF5::CoreAddons
+ )
+
+kservice_desktop_to_json(
+ kactivitymanagerd_plugin_slc
+ kactivitymanagerd-plugin-slc.desktop
)
set_target_properties(
@@ -43,5 +49,5 @@
)
install (TARGETS kactivitymanagerd_plugin_slc DESTINATION ${KAMD_PLUGIN_DIR})
-# install (FILES kactivitymanagerd-plugin-slc.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+install (FILES kactivitymanagerd-plugin-slc.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/slc/SlcPlugin.cpp
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011, 2012 Ivan Cukic ivan.cukic(at)kde.org
+ * Copyright (C) 2011, 2012, 2013, 2014 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 as
@@ -27,6 +27,7 @@
// Local
#include "slcadaptor.h"
+KAMD_EXPORT_PLUGIN(slcplugin, SlcPlugin, "kactivitymanagerd-plugin-slc.json")
SlcPlugin::SlcPlugin(QObject *parent, const QVariantList &args)
: Plugin(parent)
@@ -118,4 +119,5 @@
return true;
}
-// KAMD_EXPORT_PLUGIN(SlcPlugin, "activitymanger_plugin_slc")
+#include "SlcPlugin.moc"
+
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/slc/SlcPlugin.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011, 2012 Ivan Cukic <ivan.cukic@kde.org>
+ * Copyright (C) 2011, 2012, 2013, 2014 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 as
@@ -23,8 +23,7 @@
class SlcPlugin : public Plugin {
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.ActivityManager.SLC")
- // Q_PLUGIN_METADATA(IID "org.kde.ActivityManager.plugins.slc" FILE "activitymanager-plugin-slc.json")
- Q_PLUGIN_METADATA(IID "org.kde.ActivityManager.plugins.slc")
+ // Q_PLUGIN_METADATA(IID "org.kde.ActivityManager.plugins.slc")
public:
explicit SlcPlugin(QObject *parent = Q_NULLPTR, const QVariantList &args = QVariantList());
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/sqlite/CMakeLists.txt
^
|
@@ -32,7 +32,7 @@
)
add_library (
- kactivitymanagerd_plugin_sqlite SHARED
+ kactivitymanagerd_plugin_sqlite MODULE
${sqliteplugin_SRCS}
)
@@ -41,8 +41,15 @@
Qt5::Core
Qt5::Sql
KF5::ConfigCore
+ KF5::KIOCore
KF5::DBusAddons
KF5::CoreAddons
+ KF5::Activities
+ )
+
+kservice_desktop_to_json(
+ kactivitymanagerd_plugin_sqlite
+ kactivitymanagerd-plugin-sqlite.desktop
)
set_target_properties(
@@ -51,5 +58,5 @@
)
install (TARGETS kactivitymanagerd_plugin_sqlite DESTINATION ${KAMD_PLUGIN_DIR})
-# install (FILES kactivitymanagerd-plugin-sqlite.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+install (FILES kactivitymanagerd-plugin-sqlite.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/sqlite/ResourceLinking.cpp
^
|
@@ -28,6 +28,7 @@
// KDE
#include <kconfig.h>
#include <kdbusconnectionpool.h>
+#include <kdirnotify.h>
// Boost
#include <boost/range/algorithm/binary_search.hpp>
@@ -47,6 +48,12 @@
KDBusConnectionPool::threadConnection().registerObject(
QStringLiteral("/ActivityManager/Resources/Linking"), this);
+ connect(&m_activities, &KActivities::Consumer::currentActivityChanged,
+ this, &ResourceLinking::onCurrentActivityChanged);
+ connect(&m_activities, &KActivities::Consumer::activityAdded,
+ this, &ResourceLinking::onActivityAdded);
+ connect(&m_activities, &KActivities::Consumer::activityRemoved,
+ this, &ResourceLinking::onActivityRemoved);
}
void ResourceLinking::LinkResourceToActivity(QString initiatingAgent,
@@ -54,8 +61,8 @@
QString usedActivity)
{
if (!validateArguments(initiatingAgent, targettedResource, usedActivity)) {
- qDebug() << "Invalid arguments" << initiatingAgent << targettedResource
- << usedActivity;
+ qWarning() << "Invalid arguments" << initiatingAgent
+ << targettedResource << usedActivity;
return;
}
@@ -76,6 +83,18 @@
":targettedResource" , targettedResource
);
+ if (!usedActivity.isEmpty()) {
+ // qDebug() << "Sending link event added: activities:/" << usedActivity;
+ org::kde::KDirNotify::emitFilesAdded(QStringLiteral("activities:/")
+ + usedActivity);
+
+ if (usedActivity == m_activities.currentActivity()) {
+ // qDebug() << "Sending link event added: activities:/current";
+ org::kde::KDirNotify::emitFilesAdded(
+ QStringLiteral("activities:/current"));
+ }
+ }
+
emit ResourceLinkedToActivity(initiatingAgent, targettedResource,
usedActivity);
}
@@ -85,8 +104,8 @@
QString usedActivity)
{
if (!validateArguments(initiatingAgent, targettedResource, usedActivity)) {
- qDebug() << "Invalid arguments" << initiatingAgent << targettedResource
- << usedActivity;
+ qWarning() << "Invalid arguments" << initiatingAgent
+ << targettedResource << usedActivity;
return;
}
@@ -105,6 +124,22 @@
":targettedResource" , targettedResource
);
+ if (!usedActivity.isEmpty()) {
+ // auto mangled = QString::fromUtf8(QUrl::toPercentEncoding(targettedResource));
+ auto mangled = QString::fromLatin1(targettedResource.toUtf8().toBase64(
+ QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals));
+
+ // qDebug() << "Sending link event removed: activities:/" << usedActivity << '/' << mangled;
+ org::kde::KDirNotify::emitFilesRemoved(
+ { QStringLiteral("activities:/") + usedActivity + '/' + mangled });
+
+ if (usedActivity == m_activities.currentActivity()) {
+ // qDebug() << "Sending link event removed: activities:/current/" << mangled;
+ org::kde::KDirNotify::emitFilesRemoved({
+ QStringLiteral("activities:/current/") + mangled});
+ }
+ }
+
emit ResourceUnlinkedFromActivity(initiatingAgent, targettedResource,
usedActivity);
}
@@ -171,3 +206,29 @@
return true;
}
+
+void ResourceLinking::onActivityAdded(const QString &activity)
+{
+ // Notify KIO
+ // qDebug() << "Added: activities:/ (" << activity << ")";
+ org::kde::KDirNotify::emitFilesAdded(QStringLiteral("activities:/"));
+}
+
+void ResourceLinking::onActivityRemoved(const QString &activity)
+{
+ // Notify KIO
+ // qDebug() << "Removed: activities:/" << activity;
+ org::kde::KDirNotify::emitFilesRemoved(
+ { QStringLiteral("activities:/") + activity });
+
+ // Remove statistics for the activity
+}
+
+void ResourceLinking::onCurrentActivityChanged(const QString &activity)
+{
+ // Notify KIO
+ // qDebug() << "Changed: activities:/current -> " << activity;
+ org::kde::KDirNotify::emitFilesAdded(
+ { QStringLiteral("activities:/current") });
+}
+
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/sqlite/ResourceLinking.h
^
|
@@ -25,6 +25,9 @@
#include <memory>
#include <boost/container/flat_set.hpp>
+// KDE
+#include <lib/core/consumer.h>
+
// Local
#include <Plugin.h>
@@ -66,6 +69,7 @@
QString targettedResource,
QString usedActivity = QString());
+
Q_SIGNALS:
void ResourceLinkedToActivity(const QString &initiatingAgent,
const QString &targettedResource,
@@ -74,6 +78,11 @@
const QString &targettedResource,
const QString &usedActivity);
+private Q_SLOTS:
+ void onActivityAdded(const QString &activity);
+ void onActivityRemoved(const QString &activity);
+ void onCurrentActivityChanged(const QString &activity);
+
private:
bool validateArguments(QString &initiatingAgent, QString &targettedResource,
QString &usedActivity);
@@ -81,6 +90,8 @@
std::unique_ptr<QSqlQuery> linkResourceToActivityQuery;
std::unique_ptr<QSqlQuery> unlinkResourceFromActivityQuery;
std::unique_ptr<QSqlQuery> isResourceLinkedToActivityQuery;
+
+ KActivities::Consumer m_activities;
};
#endif // PLUGINS_SQLITE_RESOURCE_LINKING_H
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/sqlite/StatsPlugin.cpp
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011, 2012 Ivan Cukic <ivan.cukic(at)kde.org>
+ * Copyright (C) 2011, 2012, 2013, 2014 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,
@@ -43,6 +43,7 @@
// #include "scoringadaptor.h"
#include "../../Event.h"
+KAMD_EXPORT_PLUGIN(sqliteplugin, StatsPlugin, "kactivitymanagerd-plugin-sqlite.json")
StatsPlugin *StatsPlugin::s_instance = Q_NULLPTR;
@@ -351,4 +352,5 @@
emit earlierStatsDeleted(activity, months);
}
-// KAMD_EXPORT_PLUGIN(StatsPlugin, "activitymanger_plugin_sqlite")
+#include "StatsPlugin.moc"
+
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/sqlite/StatsPlugin.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011, 2012 Ivan Cukic <ivan.cukic@kde.org>
+ * Copyright (C) 2011, 2012, 2013, 2014 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 as
@@ -30,6 +30,7 @@
class QSqlQuery;
class QFileSystemWatcher;
+class ResourceLinking;
/**
* Communication with the outer world.
@@ -40,7 +41,7 @@
class StatsPlugin : public Plugin {
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.ActivityManager.Resources.Scoring")
- Q_PLUGIN_METADATA(IID "org.kde.ActivityManager.plugins.sqlite")
+ // Q_PLUGIN_METADATA(IID "org.kde.ActivityManager.plugins.sqlite")
public:
explicit StatsPlugin(QObject *parent = Q_NULLPTR,
@@ -111,7 +112,7 @@
bool m_blockAll : 1;
WhatToRemember m_whatToRemember : 2;
- QObject *m_resourceLinking;
+ ResourceLinking *m_resourceLinking;
static StatsPlugin *s_instance;
};
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/sqlite/kactivitymanagerd-plugin-sqlite.desktop
^
|
@@ -96,7 +96,7 @@
Icon=server-database
X-KDE-ServiceTypes=ActivityManager/Plugin
-X-KDE-Library=kactivitymanager_plugin_sqlite
+X-KDE-Library=kactivitymanagerd_plugin_sqlite
X-KDE-PluginInfo-Author=Ivan Cukic
X-KDE-PluginInfo-Email=ivan.cukic@kde.org
X-KDE-PluginInfo-Name=org.kde.ActivityManager.ResourceScoring
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/virtualdesktopswitch/CMakeLists.txt
^
|
@@ -25,13 +25,23 @@
target_link_libraries (
kactivitymanagerd_plugin_virtualdesktopswitch
Qt5::Core
+ Qt5::DBus
+ KF5::ConfigCore
+ KF5::WindowSystem
+ KF5::CoreAddons
)
+kservice_desktop_to_json(
+ kactivitymanagerd_plugin_virtualdesktopswitch
+ kactivitymanagerd-plugin-virtualdesktopswitch.desktop
+ )
+
+
set_target_properties(
kactivitymanagerd_plugin_virtualdesktopswitch
PROPERTIES PREFIX ""
)
install (TARGETS kactivitymanagerd_plugin_virtualdesktopswitch DESTINATION ${KAMD_PLUGIN_DIR})
-# install (FILES kactivitymanagerd-plugin-virtualdesktopswitch.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+install (FILES kactivitymanagerd-plugin-virtualdesktopswitch.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/virtualdesktopswitch/VirtualDesktopSwitchPlugin.cpp
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Ivan Cukic <ivan.cukic@kde.org>
+ * Copyright (C) 2012, 2013, 2014 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 as
@@ -20,7 +20,9 @@
#include <QString>
#include <Debug.h>
-// #include <KWindowSystem>
+#include <kwindowsystem.h>
+
+KAMD_EXPORT_PLUGIN(virtualdesktopswitchplugin, VirtualDesktopSwitchPlugin, "kactivitymanagerd-plugin-virtualdesktopswitch.json")
const auto configPattern = QStringLiteral("desktop-for-%1");
@@ -76,4 +78,5 @@
config().sync();
}
-KAMD_EXPORT_PLUGIN(VirtualDesktopSwitchPlugin, "activitymanger_plugin_virtualdesktopswitch")
+#include "VirtualDesktopSwitchPlugin.moc"
+
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/virtualdesktopswitch/VirtualDesktopSwitchPlugin.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Ivan Cukic <ivan.cukic@kde.org>
+ * Copyright (C) 2012, 2013, 2014 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 as
@@ -20,13 +20,12 @@
#include <Plugin.h>
-#include <utils/override.h>
-
class VirtualDesktopSwitchPlugin : public Plugin {
Q_OBJECT
+ // Q_PLUGIN_METADATA(IID "org.kde.ActivityManager.plugins.virtualdesktopswitch")
public:
- VirtualDesktopSwitchPlugin(QObject *parent, const QVariantList &args);
+ VirtualDesktopSwitchPlugin(QObject *parent = Q_NULLPTR, const QVariantList &args = QVariantList());
virtual ~VirtualDesktopSwitchPlugin();
virtual bool init(const QHash<QString, QObject *> &modules) Q_DECL_OVERRIDE;
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/service/plugins/virtualdesktopswitch/kactivitymanagerd-plugin-virtualdesktopswitch.desktop
^
|
@@ -106,5 +106,5 @@
X-KDE-PluginInfo-Category=
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
-X-KDE-PluginInfo-EnabledByDefault=true
+X-KDE-PluginInfo-EnabledByDefault=false
|
[-]
[+]
|
Added |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/src/common/database/Database.cpp
^
|
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2014 Ivan Cukic <ivan.cukic@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License or (at your option) version 3 or any later version
+ * accepted by the membership of KDE e.V. (or its successor approved
+ * by the membership of KDE e.V.), which shall act as a proxy
+ * defined in Section 14 of version 3 of the license.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Database.h"
+
+#include <utils/d_ptr_implementation.h>
+
+#include <QStandardPaths>
+#include <QSqlDatabase>
+#include <QSqlQuery>
+#include <QSqlField>
+#include <QSqlError>
+#include <QSqlDriver>
+#include <QThread>
+
+#include <memory>
+#include <mutex>
+#include <map>
+
+class Database::Private {
+public:
+ QSqlDatabase database;
+};
+
+namespace {
+ std::mutex databases_mutex;
+ std::map<Qt::HANDLE, std::weak_ptr<Database>> databases;
+};
+
+std::shared_ptr<Database> Database::instance(Source source)
+{
+ Q_UNUSED(source) // for the time being
+
+ Qt::HANDLE thread = QThread::currentThreadId();
+ std::lock_guard<std::mutex> lock(databases_mutex);
+
+ auto search = databases.find(thread);
+ if (search != databases.end()) {
+ auto ptr = search->second.lock();
+
+ if (ptr) {
+ return std::move(ptr);
+ }
+ }
+
+ auto ptr = std::make_shared<Database>();
+
+ ptr->d->database = QSqlDatabase::addDatabase(
+ "QSQLITE",
+ "kactivities_db_resources_" + QString::number((quintptr)thread));
+ ptr->d->database.setConnectOptions("QSQLITE_OPEN_READONLY");
+
+ ptr->d->database.setDatabaseName(
+ QStandardPaths::writableLocation(
+ QStandardPaths::GenericDataLocation)
+ + QStringLiteral("/kactivitymanagerd/resources/database"));
+
+ if (!ptr->d->database.open()) {
+ ptr.reset();
+ } else {
+ databases[thread] = ptr;
+ }
+
+ return std::move(ptr);
+}
+
+Database::Database()
+{
+
+}
+
+
+Database::~Database()
+{
+}
+
+QSqlQuery Database::query() const
+{
+ return QSqlQuery(d->database);
+}
+
+QSqlQuery Database::query(const QString &query) const
+{
+ return QSqlQuery(query, d->database);
+}
+
+
|
[-]
[+]
|
Added |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/src/common/database/Database.h
^
|
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2014 Ivan Cukic <ivan.cukic@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License or (at your option) version 3 or any later version
+ * accepted by the membership of KDE e.V. (or its successor approved
+ * by the membership of KDE e.V.), which shall act as a proxy
+ * defined in Section 14 of version 3 of the license.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef COMMON_DATABASE_H
+#define COMMON_DATABASE_H
+
+#include <utils/d_ptr.h>
+#include <memory>
+#include <QSqlQuery>
+
+class Database {
+public:
+ enum Source {
+ ResourcesDatabase
+ };
+
+ static
+ std::shared_ptr<Database> instance(Source source);
+
+ QSqlQuery query(const QString &query) const;
+ QSqlQuery query() const;
+
+ ~Database();
+ Database();
+
+private:
+ D_PTR;
+};
+
+#endif // COMMON_DATABASE_H
+
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/workspace/CMakeLists.txt
^
|
@@ -1,19 +1,8 @@
# vim:set softtabstop=3 shiftwidth=3 tabstop=3 expandtab:
-set (sdo_SRCS "")
-
-# C++11
-
add_subdirectory (fileitemplugin)
add_subdirectory (kio)
find_package(KF5Declarative)
+add_subdirectory (settings)
-macro_log_feature (
- KDeclarative_FOUND "libkdeclarative" "KDE Declarative (QML) support from kdelibs is needed for the settings module" "http://www.kde.org"
- TRUE "" ""
- )
-
-if (KDeclarative_FOUND)
- add_subdirectory (settings)
-endif ()
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/workspace/fileitemplugin/CMakeLists.txt
^
|
@@ -1,24 +1,37 @@
# vim:set softtabstop=3 shiftwidth=3 tabstop=3 expandtab:
+find_package(KF5 REQUIRED COMPONENTS KIO)
+find_package (Qt5 REQUIRED NO_MODULE COMPONENTS Sql)
+
include_directories (
${CMAKE_SOURCE_DIR}/src
${CMAKE_BINARY_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
- ${KDE4_INCLUDES}
)
-
set (kactivitymanagerd_fileitem_linking_plugin_SRCS
FileItemLinkingPlugin.cpp
+ ${CMAKE_SOURCE_DIR}/src/utils/qsqlquery.cpp
+ )
+
+add_library (
+ kactivitymanagerd_fileitem_linking_plugin MODULE
+ ${kactivitymanagerd_fileitem_linking_plugin_SRCS}
)
-kde4_add_plugin (kactivitymanagerd_fileitem_linking_plugin ${kactivitymanagerd_fileitem_linking_plugin_SRCS})
+kservice_desktop_to_json(
+ kactivitymanagerd_fileitem_linking_plugin
+ kactivitymanagerd_fileitem_linking_plugin.desktop
+ )
target_link_libraries (
kactivitymanagerd_fileitem_linking_plugin
- ${KDE4_KIO_LIBS}
- kactivities
+ Qt5::Core
+ Qt5::Sql
+ KF5::KIOFileWidgets
+ KF5::I18n
+ KF5::Activities
)
install (TARGETS kactivitymanagerd_fileitem_linking_plugin DESTINATION ${PLUGIN_INSTALL_DIR})
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/workspace/fileitemplugin/FileItemLinkingPlugin.cpp
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Ivan Cukic <ivan.cukic(at)kde.org>
+ * Copyright (C) 2012, 2013, 2014 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,
@@ -21,12 +21,50 @@
#include "FileItemLinkingPlugin_p.h"
#include <kfileitemlistproperties.h>
+#include <utils/d_ptr_implementation.h>
+#include <utils/qsqlquery.h>
#include <QMenu>
#include <QCursor>
+#include <QDebug>
+#include <QFileInfo>
+#include <QSqlDatabase>
+#include <QSqlQuery>
+#include <QSqlField>
+#include <QSqlError>
+#include <QSqlDriver>
+#include <QStandardPaths>
+#include <QDBusInterface>
+#include <QDBusPendingCall>
-#include <KLocale>
#include <KPluginFactory>
+#include <KLocalizedString>
+
+K_PLUGIN_FACTORY_WITH_JSON(ActivityLinkingFileItemActionFactory,
+ "kactivitymanagerd_fileitem_linking_plugin.json",
+ registerPlugin<FileItemLinkingPlugin>();)
+
+
+FileItemLinkingPlugin::Private::Private()
+ : shouldLoad(false)
+{
+ connect(&activities, &KActivities::Consumer::serviceStatusChanged,
+ this, &Private::activitiesServiceStatusChanged);
+}
+
+void FileItemLinkingPlugin::Private::activitiesServiceStatusChanged(
+ KActivities::Consumer::ServiceStatus status)
+{
+ if (status != KActivities::Consumer::Unknown) {
+ loadAllActions();
+ }
+}
+
+void FileItemLinkingPlugin::Private::rootActionHovered()
+{
+ shouldLoad = true;
+ loadAllActions();
+}
void FileItemLinkingPlugin::Private::actionTriggered()
{
@@ -39,216 +77,253 @@
bool link = action->property("link").toBool();
QString activity = action->property("activity").toString();
- foreach(const KUrl & item, items)
+ QDBusInterface service("org.kde.ActivityManager",
+ "/ActivityManager/Resources/Linking",
+ "org.kde.ActivityManager.ResourcesLinking");
+
+ foreach (const auto &item, items.urlList())
{
if (link) {
- activities.linkResourceToActivity(item, activity);
+ service.asyncCall("LinkResourceToActivity", QString(),
+ item.toLocalFile(), activity);
} else {
- activities.unlinkResourceFromActivity(item, activity);
- }
- }
-}
-
-void FileItemLinkingPlugin::Private::addAction(
- const QString &activity,
- bool link,
- const QString &title,
- const QString &icon)
-{
- QAction *action = rootMenu->addAction(
- title.isEmpty() ? KActivities::Info::name(activity) : title);
+ service.asyncCall("UnlinkResourceFromActivity", QString(),
+ item.toLocalFile(), activity);
- if (!icon.isEmpty()) {
- action->setIcon(QIcon::fromTheme(icon));
+ }
}
-
- action->setProperty("activity", activity);
- action->setProperty("link", link);
-
- connect(action, SIGNAL(triggered()),
- this, SLOT(actionTriggered()));
-
- action->setVisible(false);
-}
-
-void FileItemLinkingPlugin::Private::addSeparator(
- const QString &title)
-{
- QAction *separator = rootMenu->addSeparator();
- separator->setText(title);
- separator->setVisible(false);
}
FileItemLinkingPlugin::FileItemLinkingPlugin(QObject *parent, const QVariantList &)
: KAbstractFileItemActionPlugin(parent)
- , d(new Private())
{
}
FileItemLinkingPlugin::~FileItemLinkingPlugin()
{
- if (!d->thread) {
- delete d;
- }
+ d->setActions({});
}
-QList<QAction *> FileItemLinkingPlugin::actions(const KFileItemListProperties &fileItemInfos, QWidget *parentWidget)
+QAction *FileItemLinkingPlugin::Private::basicAction(QWidget *parentWidget)
{
- QAction *root = new QAction(QIcon::fromTheme("preferences-activities"), i18n("Activities..."), parentWidget);
+ root = new QAction(QIcon::fromTheme("preferences-activities"),
+ i18n("Activities"), parentWidget);
+
+ rootMenu = new QMenu();
+ rootMenu->addAction(new QAction(i18n("Loading..."), this));
+
+ connect(root, &QAction::hovered,
+ this, &Private::rootActionHovered);
- connect(root, SIGNAL(triggered()),
- d, SLOT(showActions()));
- d->items = fileItemInfos.urlList();
+ root->setMenu(rootMenu);
- return QList<QAction *>() << root;
+ return root;
}
-void FileItemLinkingPlugin::Private::showActions()
+QList<QAction *> FileItemLinkingPlugin::actions(const KFileItemListProperties &fileItemInfos, QWidget *parentWidget)
{
- thread = new FileItemLinkingPluginLoader(this, items);
+ d->items = fileItemInfos;
- connect(thread, SIGNAL(finished()),
- thread, SLOT(deleteLater()));
+ return { d->basicAction(parentWidget) };
+}
- connect(thread, SIGNAL(requestAction(QString, bool, QString, QString)),
- this, SLOT(addAction(QString, bool, QString, QString)),
- Qt::QueuedConnection);
- connect(thread, SIGNAL(requestSeparator(QString)),
- this, SLOT(addSeparator(QString)),
- Qt::QueuedConnection);
- connect(thread, SIGNAL(finishedLoading()),
- this, SLOT(finishedLoading()),
- Qt::QueuedConnection);
+void FileItemLinkingPlugin::Private::loadAllActions()
+{
+ if (!shouldLoad
+ || activities.serviceStatus() == KActivities::Consumer::Unknown) {
+ return;
+ }
- rootMenu = new QMenu();
+ if (activities.serviceStatus() == KActivities::Consumer::NotRunning) {
+ setActions({ new QAction(
+ i18n("The Activity Manager is not running"), Q_NULLPTR) });
- rootMenu->addAction("Loading...");
+ } else {
+ auto loader = new FileItemLinkingPluginActionLoader(items);
- rootMenu->popup(QCursor::pos());
+ static FileItemLinkingPluginActionStaticInit init;
- connect(rootMenu, SIGNAL(aboutToHide()),
- this, SLOT(deleteLater()));
+ connect(loader, &FileItemLinkingPluginActionLoader::result,
+ this, &Private::setActions);
- thread->start();
+ loader->start();
+ }
}
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/workspace/fileitemplugin/FileItemLinkingPlugin.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Ivan Cukic <ivan.cukic(at)kde.org>
+ * Copyright (C) 2012, 2013, 2014 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,
@@ -20,26 +20,27 @@
#ifndef FILE_ITEM_LINKING_PLUGIN_H
#define FILE_ITEM_LINKING_PLUGIN_H
-#include <kabstractfileitemactionplugin.h>
+#include <KAbstractFileItemActionPlugin>
#include <QList>
#include <QAction>
#include <QVariant>
+#include <utils/d_ptr.h>
+
/**
* FileItemLinkingPlugin
*/
class FileItemLinkingPlugin : public KAbstractFileItemActionPlugin {
public:
FileItemLinkingPlugin(QObject *parent, const QVariantList &);
- virtual ~FileItemLinkingPlugin();
+ ~FileItemLinkingPlugin();
- virtual QList<QAction *> actions(const KFileItemListProperties &fileItemInfos,
- QWidget *parentWidget);
+ QList<QAction *> actions(const KFileItemListProperties &fileItemInfos,
+ QWidget *parentWidget) Q_DECL_OVERRIDE;
private:
- class Private;
- Private *const d;
+ D_PTR;
};
#endif // FILE_ITEM_LINKING_PLUGIN_H
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/workspace/fileitemplugin/FileItemLinkingPlugin_p.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Ivan Cukic <ivan.cukic(at)kde.org>
+ * Copyright (C) 2012, 2013, 2014 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,
@@ -21,63 +21,67 @@
#define FILE_ITEM_LINKING_PLUGIN_P_H
#include "FileItemLinkingPlugin.h"
-#include <kabstractfileitemactionplugin.h>
#include <QThread>
+#include <QUrl>
-#include <KUrl>
+#include <KFileItemListProperties>
#include "lib/core/consumer.h"
#include "lib/core/info.h"
+typedef QList<QAction *> ActionList;
+
class FileItemLinkingPlugin::Private : public QObject {
Q_OBJECT
public:
- KActivities::Consumer activities;
- KUrl::List items;
+ Private();
+
+ QAction *root;
QMenu *rootMenu;
- QThread *thread;
+ KFileItemListProperties items;
-public Q_SLOTS:
- void actionTriggered();
- void showActions();
+ QAction *basicAction(QWidget *parentWidget);
+
+ KActivities::Consumer activities;
- void addAction(
- const QString &activity,
- bool link,
- const QString &title = QString(),
- const QString &icon = QString());
+public Q_SLOTS:
+ void activitiesServiceStatusChanged(KActivities::Consumer::ServiceStatus status);
+ void rootActionHovered();
+ void setActions(const ActionList &actions);
- void addSeparator(const QString &title);
+ void actionTriggered();
+ void loadAllActions();
- void finishedLoading();
+private:
+ bool shouldLoad : 1;
};
-class FileItemLinkingPluginLoader : public QThread {
+class FileItemLinkingPluginActionLoader: public QThread {
Q_OBJECT
public:
- FileItemLinkingPluginLoader(
- QObject *parent, const KUrl::List &items);
+ FileItemLinkingPluginActionLoader(const KFileItemListProperties &items);
-Q_SIGNALS:
- void requestAction(
- const QString &activity,
- bool link,
- const QString &title = QString(),
- const QString &icon = QString());
+ void run() Q_DECL_OVERRIDE;
- void requestSeparator(const QString &title);
+ QAction *createAction(const QString &activity, bool link,
+ const QString &title = QString(),
+ const QString &icon = QString()) const;
+ QAction *createSeparator(const QString &title) const;
- void finishedLoading();
+Q_SIGNALS:
+ void result(const ActionList &actions);
-protected:
- void run(); //override
+private:
+ KFileItemListProperties items;
+ KActivities::Consumer activities;
+};
+class FileItemLinkingPluginActionStaticInit {
public:
- KActivities::Consumer activities;
- KUrl::List m_items;
+ FileItemLinkingPluginActionStaticInit();
};
#endif // FILE_ITEM_LINKING_PLUGIN_P_H
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/workspace/kio/CMakeLists.txt
^
|
@@ -7,25 +7,31 @@
${CMAKE_BINARY_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
- ${KDE4_INCLUDES}
- ${KDE4_KIO_INCLUDES}
)
+find_package (Qt5 REQUIRED NO_MODULE COMPONENTS Sql)
+find_package(KF5 REQUIRED COMPONENTS KIO I18n)
+
########### next target ###############
set (kio_activities_PART_SRCS
KioActivities.cpp
+ ${CMAKE_SOURCE_DIR}/src/utils/qsqlquery.cpp
+ ${CMAKE_SOURCE_DIR}/src/common/database/Database.cpp
)
-kde4_add_plugin (
- kio_activities
+add_library (
+ kio_activities MODULE
${kio_activities_PART_SRCS}
)
target_link_libraries (
kio_activities
- ${KDE4_KIO_LIBS}
- kactivities
+ Qt5::Sql
+ KF5::KIOCore
+ KF5::DBusAddons
+ KF5::Activities
+ KF5::I18n
)
install (
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/workspace/kio/KioActivities.cpp
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 Ivan Cukic <ivan.cukic@kde.org>
+ * Copyright 2012, 2013, 2014 Ivan Cukic <ivan.cukic@kde.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -20,43 +20,31 @@
#include "KioActivities.h"
-#include <sys/types.h>
-#include <unistd.h>
-
#include <QCoreApplication>
#include <QDebug>
#include <QFile>
#include <QDir>
+#include <QStandardPaths>
+#include <QSqlDatabase>
+#include <QSqlQuery>
+#include <QSqlField>
+#include <QSqlError>
+#include <QSqlDriver>
+#include <QByteArray>
-#include <KFileItem>
-#include <KStandardDirs>
-
-#include <Nepomuk2/ResourceManager>
-#include <Soprano/QueryResultIterator>
-#include <Soprano/Model>
-#include <Soprano/Node>
-
-#include <KUrl>
+#include <KLocalizedString>
#include <KUser>
-#include <KComponentData>
+#include <kio/job.h>
-#include "kao.h"
-
-#include <Nepomuk2/Resource>
-#include <Nepomuk2/Query/Query>
-#include <Nepomuk2/Query/FileQuery>
-#include <Nepomuk2/Query/ResourceTerm>
-#include <Nepomuk2/Query/ComparisonTerm>
+#include <utils/d_ptr_implementation.h>
+#include <utils/qsqlquery.h>
+#include <common/database/Database.h>
#include "lib/core/info.h"
+#include "lib/core/consumer.h"
-#include <Soprano/Vocabulary/NAO>
-
-namespace Nepomuk = Nepomuk2;
-using namespace Soprano::Vocabulary;
-using namespace KDE::Vocabulary;
-using namespace KIO;
+#include <QProcess>
class ActivitiesProtocol::Private {
public:
@@ -65,362 +53,312 @@
{
}
- enum Path {
+ enum PathType {
RootItem,
ActivityRootItem,
- ActivityPathItem,
- PrivateActivityPathItem
+ ActivityPathItem
};
- KActivities::Consumer activities;
- QString activity;
- QString filename;
-
- inline QString realActivityId(const QString &activity) const
+ PathType pathType(const QUrl &url, QString *activity = Q_NULLPTR,
+ QString *filePath = Q_NULLPTR) const
{
- if (activity == "current") {
- return activities.currentActivity();
+ const auto fullPath = url.adjusted(QUrl::StripTrailingSlash).path();
+ const auto path = fullPath.midRef(fullPath.startsWith('/') ? 1 : 0);
+
+ if (activity) {
+ *activity = path.mid(0, path.indexOf("/") - 1).toString();
}
- return activity;
+ if (filePath) {
+ auto strippedPath = path.mid(path.indexOf("/") + 1);
+ auto splitPosition = strippedPath.indexOf("/");
+
+ if (splitPosition == -1) {
+ // if we have only one path segment
+ *filePath = demangledPath(strippedPath.toString());
+
+ } else {
+ // if we have sub-paths
+ auto head = strippedPath.mid(0, splitPosition);
+ auto tail = strippedPath.mid(splitPosition);
+
+ *filePath = demangledPath(head.toString()) + tail.toString();
+ }
+ }
+
+ return path.length() == 0 ? RootItem
+ : path.contains("/") ? ActivityPathItem
+ : ActivityRootItem;
+ }
+
+ void syncActivities(KActivities::Consumer &activities)
+ {
+ // We need to use the consumer in a synchronized way
+ while (activities.serviceStatus() == KActivities::Consumer::Unknown) {
+ QCoreApplication::processEvents();
+ }
}
- KIO::UDSEntry createFolderUDSEntry(const QString &name, const QString &displayName, const QDate &date) const
+ KIO::UDSEntry activityEntry(const QString &activity)
{
KIO::UDSEntry uds;
- QDateTime dt(date, QTime(0, 0, 0));
- uds.insert(KIO::UDSEntry::UDS_NAME, name);
- uds.insert(KIO::UDSEntry::UDS_DISPLAY_NAME, displayName);
+ KActivities::Info activityInfo(activity);
+ uds.insert(KIO::UDSEntry::UDS_NAME, activity);
+ uds.insert(KIO::UDSEntry::UDS_DISPLAY_NAME, activityInfo.name());
+ uds.insert(KIO::UDSEntry::UDS_DISPLAY_TYPE, i18n("Activity"));
+ uds.insert(KIO::UDSEntry::UDS_ICON_NAME, activityInfo.icon());
uds.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
uds.insert(KIO::UDSEntry::UDS_MIME_TYPE, QStringLiteral("inode/directory"));
- uds.insert(KIO::UDSEntry::UDS_MODIFICATION_TIME, dt.toTime_t());
- uds.insert(KIO::UDSEntry::UDS_CREATION_TIME, dt.toTime_t());
- uds.insert(KIO::UDSEntry::UDS_ACCESS, 0700);
+ uds.insert(KIO::UDSEntry::UDS_ACCESS, 0500);
uds.insert(KIO::UDSEntry::UDS_USER, KUser().loginName());
return uds;
}
- KIO::UDSEntry createUDSEntryForUrl(const KUrl &url) const
+ KIO::UDSEntry filesystemEntry(const QString &path)
{
KIO::UDSEntry uds;
+ auto url = QUrl::fromLocalFile(path);
- KFileItem fileItem(KFileItem::Unknown, KFileItem::Unknown, url, false);
+ if (KIO::StatJob* job = KIO::stat(url, KIO::HideProgressInfo)) {
+ QScopedPointer<KIO::StatJob> sp(job);
+ job->setAutoDelete(false);
+ if (job->exec()) {
+ uds = job->statResult();
+ }
+ }
- QByteArray encodedPath = QUrl::toPercentEncoding(url.url());
+ auto mangled = mangledPath(path);
+ // QProcess::execute("kdialog", { "--passivepopup", mangled });
- uds.insert(KIO::UDSEntry::UDS_NAME, QString::fromUtf8(encodedPath));
- uds.insert(KIO::UDSEntry::UDS_DISPLAY_NAME, fileItem.name());
- uds.insert(KIO::UDSEntry::UDS_MIME_TYPE, fileItem.mimetype());
- uds.insert(KIO::UDSEntry::UDS_SIZE, fileItem.size());
- uds.insert(KIO::UDSEntry::UDS_MODIFICATION_TIME, fileItem.time(KFileItem::ModificationTime).toTime_t());
- uds.insert(KIO::UDSEntry::UDS_CREATION_TIME, fileItem.time(KFileItem::CreationTime).toTime_t());
- uds.insert(KIO::UDSEntry::UDS_ACCESS, fileItem.permissions());
- uds.insert(KIO::UDSEntry::UDS_USER, KUser().loginName());
- uds.insert(KIO::UDSEntry::UDS_LOCAL_PATH, url.toLocalFile());
- uds.insert(KIO::UDSEntry::UDS_TARGET_URL, url.prettyUrl());
-
- if (fileItem.isDir()) {
- uds.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
- }
+ uds.insert(KIO::UDSEntry::UDS_NAME, mangled);
+ uds.insert(KIO::UDSEntry::UDS_DISPLAY_NAME, url.fileName());
+ uds.insert(KIO::UDSEntry::UDS_TARGET_URL, url.url());
+ uds.insert(KIO::UDSEntry::UDS_LOCAL_PATH, path);
return uds;
}
- Nepomuk::Query::Query buildQuery(const QString &activity) const
+ QString mangledPath(const QString &path) const
{
- Nepomuk::Resource activityResource(activity, KAO::Activity());
-
- Nepomuk::Query::FileQuery query;
-
- Nepomuk::Query::ComparisonTerm usedActivity(NAO::isRelated(), Nepomuk::Query::ResourceTerm(activityResource));
- usedActivity.setInverted(true);
-
- query.setTerm(usedActivity);
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/workspace/kio/KioActivities.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 Ivan Cukic <ivan.cukic@kde.org>
+ * Copyright 2012, 2013, 2014 Ivan Cukic <ivan.cukic@kde.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -21,81 +21,27 @@
#ifndef KIO_ACTIVITIES_H
#define KIO_ACTIVITIES_H
-#include <kio/forwardingslavebase.h>
+#include <KIO/ForwardingSlaveBase>
-#include <QtCore/QDate>
-
-#include "lib/core/consumer.h"
+#include <utils/d_ptr.h>
class ActivitiesProtocol : public KIO::ForwardingSlaveBase {
Q_OBJECT
public:
ActivitiesProtocol(const QByteArray &poolSocket, const QByteArray &appSocket);
- virtual ~ActivitiesProtocol();
-
- /**
- * List all files and folders tagged with the corresponding tag.
- */
- void listDir(const KUrl &url);
-
- /**
- * Results in the creation of a new tag.
- */
- void mkdir(const KUrl &url, int permissions);
-
- /**
- * Will be forwarded for files.
- */
- void get(const KUrl &url);
-
- /**
- * Not supported.
- */
- void put(const KUrl &url, int permissions, KIO::JobFlags flags);
-
- /**
- * Files and folders can be copied to the virtual folders resulting
- * is assignment of the corresponding tag.
- */
- void copy(const KUrl &src, const KUrl &dest, int permissions, KIO::JobFlags flags);
-
- /**
- * File renaming will be forwarded.
- * Folder renaming results in renaming of the tag.
- */
- void rename(const KUrl &src, const KUrl &dest, KIO::JobFlags flags);
-
- /**
- * File deletion means remocing the tag
- * Folder deletion will result in deletion of the tag.
- */
- void del(const KUrl &url, bool isfile);
-
- /**
- * Files will be forwarded.
- * Folders will be created as virtual folders.
- */
- void mimetype(const KUrl &url);
-
- /**
- * Files will be forwarded.
- * Folders will be created as virtual folders.
- */
- void stat(const KUrl &url);
+ ~ActivitiesProtocol();
protected:
- /**
- * reimplemented from ForwardingSlaveBase
- */
- bool rewriteUrl(const KUrl &url, KUrl &newURL);
-
- void prepareUDSEntry(KIO::UDSEntry &entry,
- bool listing = false) const;
+ bool rewriteUrl(const QUrl &url, QUrl &newUrl) Q_DECL_OVERRIDE;
+ void listDir(const QUrl &url) Q_DECL_OVERRIDE;
+ void prepareUDSEntry(KIO::UDSEntry &entry, bool listing = false) const Q_DECL_OVERRIDE;
+ void stat(const QUrl& url) Q_DECL_OVERRIDE;
+ void mimetype(const QUrl& url) Q_DECL_OVERRIDE;
+ void del(const QUrl& url, bool isfile) Q_DECL_OVERRIDE;
private:
- class Private;
- Private *const d;
+ D_PTR;
};
#endif // KIO_ACTIVITIES_H
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/workspace/settings/BlacklistedApplicationsModel.cpp
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Ivan Cukic <ivan.cukic(at)kde.org>
+ * Copyright (C) 2012, 2013, 2014 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,
@@ -27,7 +27,6 @@
#include <QVariant>
#include <QDebug>
-#include <KStandardDirs>
#include <KService>
#include <KConfig>
#include <KSharedConfig>
@@ -54,17 +53,24 @@
BlacklistedApplicationsModel::BlacklistedApplicationsModel(QObject *parent)
: QAbstractListModel(parent)
{
- QHash<int, QByteArray> roles;
- roles[ApplicationIdRole] = "name";
- roles[Qt::DecorationRole] = "icon";
- roles[Qt::DisplayRole] = "title";
- roles[BlockedApplicationRole] = "blocked";
- setRoleNames(roles);
-
d->enabled = false;
d->pluginConfig = KSharedConfig::openConfig("kactivitymanagerd-pluginsrc");
}
+BlacklistedApplicationsModel::~BlacklistedApplicationsModel()
+{
+}
+
+QHash<int, QByteArray> BlacklistedApplicationsModel::roleNames() const
+{
+ return {
+ { ApplicationIdRole, "name"},
+ { Qt::DecorationRole, "icon"},
+ { Qt::DisplayRole, "title"},
+ { BlockedApplicationRole, "blocked" }
+ };
+}
+
void BlacklistedApplicationsModel::load()
{
// Loading plugin configuration
@@ -77,7 +83,9 @@
// Reading new applications from the database
- const auto path = KStandardDirs::locateLocal("data", "kactivitymanagerd/resources/database", true);
+ const QString path
+ = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
+ + QStringLiteral("/kactivitymanagerd/resources/database");
d->database = QSqlDatabase::addDatabase("QSQLITE", "plugins_sqlite_db_resources");
d->database.setDatabaseName(path);
@@ -87,7 +95,7 @@
return;
}
- auto query = d->database.exec("SELECT DISTINCT(initiatingAgent) FROM kext_ResourceScoreCache ORDER BY initiatingAgent");
+ auto query = d->database.exec("SELECT DISTINCT(initiatingAgent) FROM ResourceScoreCache ORDER BY initiatingAgent");
if (d->applications.length() > 0) {
beginRemoveRows(QModelIndex(), 0, d->applications.length() - 1);
@@ -98,6 +106,8 @@
while (query.next()) {
const auto name = query.value(0).toString();
+ qDebug() << "New name: " << name;
+
if (defaultBlockedValue) {
if (!allowedApplications.contains(name)) {
blockedApplications << name;
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/workspace/settings/BlacklistedApplicationsModel.h
^
|
@@ -34,6 +34,7 @@
public:
BlacklistedApplicationsModel(QObject *parent = Q_NULLPTR);
+ ~BlacklistedApplicationsModel();
enum Roles {
ApplicationIdRole = Qt::UserRole + 1,
@@ -44,6 +45,8 @@
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
+
Q_SIGNALS:
void changed();
void enabledChanged(bool enabled);
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/workspace/settings/CMakeLists.txt
^
|
@@ -1,16 +1,9 @@
# vim:set softtabstop=3 shiftwidth=3 tabstop=3 expandtab:
-
project (KCMActivities)
-include_directories (
- ${CMAKE_SOURCE_DIR}/src
- ${CMAKE_BINARY_DIR}/src
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${KDE4_INCLUDES}
- ${KDECLARATIVE_INCLUDE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/ui/
- )
+find_package (Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Sql Qml DBus)
+find_package (KF5KCMUtils ${KF5_DEP_VERSION} CONFIG REQUIRED)
+find_package (KF5Declarative ${KF5_DEP_VERSION} CONFIG REQUIRED)
set (KAMD_KCM_SRCS
kcm_activities.cpp
@@ -18,21 +11,23 @@
BlacklistedApplicationsModel.cpp
)
-kde4_add_ui_files (
+ki18n_wrap_ui(
KAMD_KCM_SRCS
ui/MainConfigurationWidgetBase.ui
)
-kde4_add_plugin (kcm_activities ${KAMD_KCM_SRCS})
+add_library (kcm_activities MODULE ${KAMD_KCM_SRCS})
target_link_libraries (kcm_activities
- ${KDE4_KDEUI_LIBS}
- ${KDE4_KCMUTILS_LIBS}
- ${QT_QTSQL_LIBRARY}
- ${QT_QTDECLARATIVE_LIBRARY}
- ${QT_QTOPENGL_LIBRARY}
- ${KDECLARATIVE_LIBRARIES}
- ${KDE4_PLASMA_LIBS}
+ Qt5::Quick
+ Qt5::Core
+ Qt5::Sql
+ Qt5::Qml
+ Qt5::DBus
+ KF5::KCMUtils
+ KF5::I18n
+ KF5::Service
+ KF5::Declarative
)
install (TARGETS kcm_activities
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/workspace/settings/MainConfigurationWidget.cpp
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Ivan Cukic <ivan.cukic(at)kde.org>
+ * Copyright (C) 2012, 2013, 2014 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,
@@ -21,13 +21,13 @@
#include <QDebug>
#include <QMenu>
-#include <QDeclarativeContext>
-#include <QDeclarativeEngine>
-#include <QDeclarativeComponent>
+#include <QQmlContext>
+#include <QQmlEngine>
+#include <QQmlComponent>
#include <QDBusInterface>
#include <QDBusPendingCall>
-#include <QGraphicsObject>
+#include <QQuickView>
#include <KLocalizedString>
#include <KAboutData>
@@ -35,17 +35,15 @@
#include <KPluginInfo>
#include <KService>
#include <KServiceTypeTrader>
-#include <kdeclarative.h>
-
-#include <Plasma/PackageStructure>
#include "ui_MainConfigurationWidgetBase.h"
#include "BlacklistedApplicationsModel.h"
#include <utils/d_ptr_implementation.h>
+#include "kactivities-features.h"
+
K_PLUGIN_FACTORY(ActivitiesKCMFactory, registerPlugin<MainConfigurationWidget>();)
-K_EXPORT_PLUGIN(ActivitiesKCMFactory("kcm_activities", "kcm_activities"))
class MainConfigurationWidget::Private : public Ui::MainConfigurationWidgetBase {
public:
@@ -55,24 +53,17 @@
KSharedConfig::Ptr pluginConfig;
KPluginSelector *pluginSelector;
BlacklistedApplicationsModel *blacklistedApplicationsModel;
- KDeclarative kdeclarative;
- Plasma::PackageStructure::Ptr structure;
- QGraphicsObject *viewBlacklistedApplicationsRoot;
+
+ QObject *viewBlacklistedApplicationsRoot;
+ QQuickView *viewBlacklistedApplications;
};
MainConfigurationWidget::MainConfigurationWidget(QWidget *parent, QVariantList args)
- : KCModule(ActivitiesKCMFactory::componentData(), parent)
+ : KCModule(parent, args)
, d()
{
Q_UNUSED(args)
- const auto about = new KAboutData(
- "kio_activities", 0, ki18n("Activities"),
- KDE_VERSION_STRING, KLocalizedString(), KAboutData::License_GPL,
- ki18n("(c) 2012 Ivan Cukic"));
-
- setAboutData(about);
-
d->setupUi(this);
// Plugin selector initialization
@@ -83,24 +74,23 @@
d->mainConfig = KSharedConfig::openConfig("kactivitymanagerdrc");
d->pluginConfig = KSharedConfig::openConfig("kactivitymanagerd-pluginsrc");
+ // Loading the plugin selector
d->pluginSelector = new KPluginSelector(this);
- d->pluginSelector->addPlugins(
- plugins,
- KPluginSelector::ReadConfigFile,
- i18n("Available Features"),
- QString(),
- d->mainConfig);
+ d->pluginSelector->addPlugins(plugins, KPluginSelector::ReadConfigFile,
+ i18n("Available Features"), QString(),
+ d->mainConfig);
d->tabWidget->addTab(d->pluginSelector, i18n("Plugins"));
// Keep history initialization
d->spinKeepHistory->setRange(0, INT_MAX);
-
- d->spinKeepHistory->setSuffix(ki18ncp("unit of time. months to keep the history",
- " month", " months"));
- d->spinKeepHistory->setPrefix(i18nc("for in 'keep history for 5 months'", "for "));
d->spinKeepHistory->setSpecialValueText(i18nc("unlimited number of months", "forever"));
+ // We don't have KSpingBox anymore, lets keep it alive :)
+ connect(d->spinKeepHistory, SIGNAL(valueChanged(int)),
+ this, SLOT(spinKeepHistoryValueChanged(int)));
+ spinKeepHistoryValueChanged(0);
+
// Clear recent history button
auto menu = new QMenu(this);
@@ -125,31 +115,32 @@
d->checkEnableActivities->setVisible(false);
// Blacklist applications
+
d->blacklistedApplicationsModel = new BlacklistedApplicationsModel(this);
- QGraphicsScene *scene = new QGraphicsScene(this);
- d->viewBlacklistedApplications->setScene(scene);
- QDeclarativeEngine *engine = new QDeclarativeEngine(this);
-
- d->kdeclarative.setDeclarativeEngine(engine);
- d->kdeclarative.initialize();
- d->kdeclarative.setupBindings();
- d->structure = Plasma::PackageStructure::load("Plasma/Generic");
-
- engine->rootContext()->setContextProperty("applicationModel", d->blacklistedApplicationsModel);
- QDeclarativeComponent component(engine, QUrl(QString(KAMD_DATA_DIR) + "workspace/settings/BlacklistApplicationView.qml"));
- // qDebug() << "Errors: " << component.errors();
- d->viewBlacklistedApplicationsRoot = qobject_cast<QGraphicsObject *>(component.create());
- d->viewBlacklistedApplicationsRoot->setProperty("width", d->viewBlacklistedApplications->width());
- scene->addItem(d->viewBlacklistedApplicationsRoot);
+ auto layout = new QGridLayout(d->viewBlacklistedApplicationsContainer);
+
+ d->viewBlacklistedApplications = new QQuickView();
+ d->viewBlacklistedApplications->setColor(
+ QGuiApplication::palette().window().color());
+
+ QWidget *container = QWidget::createWindowContainer(
+ d->viewBlacklistedApplications,
+ d->viewBlacklistedApplicationsContainer);
+
- d->viewBlacklistedApplications->installEventFilter(this);
+ container->setFocusPolicy(Qt::TabFocus);
+ d->viewBlacklistedApplications->rootContext()->setContextProperty(
+ "applicationModel", d->blacklistedApplicationsModel);
+ d->viewBlacklistedApplications->setSource(
+ QStringLiteral(KAMD_INSTALL_PREFIX "/" KAMD_DATA_DIR)
+ + "/workspace/settings/BlacklistApplicationView.qml");
+
+ layout->addWidget(container);
// React to changes
- connect(d->checkEnableActivities, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(d->radioRememberAllApplications, SIGNAL(toggled(bool)), this, SLOT(changed()));
- connect(d->radioRememberSpecificApplications, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(d->radioDontRememberApplications, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(d->spinKeepHistory, SIGNAL(valueChanged(int)), this, SLOT(changed()));
connect(d->pluginSelector, SIGNAL(changed(bool)), this, SLOT(changed()));
@@ -157,8 +148,10 @@
connect(d->radioRememberSpecificApplications, SIGNAL(toggled(bool)),
d->blacklistedApplicationsModel, SLOT(setEnabled(bool)));
+
connect(d->radioRememberSpecificApplications, SIGNAL(toggled(bool)),
- d->viewBlacklistedApplications, SLOT(setEnabled(bool)));
+ d->viewBlacklistedApplicationsContainer, SLOT(setEnabled(bool)));
+
connect(d->radioRememberSpecificApplications, SIGNAL(toggled(bool)),
d->checkBlacklistAllNotOnList, SLOT(setEnabled(bool)));
@@ -166,26 +159,11 @@
d->checkBlacklistAllNotOnList->setEnabled(false);
d->blacklistedApplicationsModel->setEnabled(false);
- d->viewBlacklistedApplications->setEnabled(false);
+ d->viewBlacklistedApplicationsContainer->setEnabled(false);
}
-void MainConfigurationWidget::updateLayout()
+MainConfigurationWidget::~MainConfigurationWidget()
{
- d->viewBlacklistedApplicationsRoot->setProperty("width",
- d->viewBlacklistedApplications->width() - 32);
- d->viewBlacklistedApplicationsRoot->setProperty("minimumHeight",
- d->viewBlacklistedApplications->height() - 32);
-}
-
-bool MainConfigurationWidget::eventFilter(QObject *obj, QEvent *event)
-{
- if (obj == d->viewBlacklistedApplications) {
- if (event->type() == QEvent::Resize) {
- updateLayout();
- }
- }
-
- return false;
}
void MainConfigurationWidget::defaults()
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/workspace/settings/MainConfigurationWidget.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Ivan Cukic <ivan.cukic(at)kde.org>
+ * Copyright (C) 2012, 2013, 2014 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,
@@ -23,7 +23,6 @@
#include <KCModule>
#include <KPluginFactory>
-#include <utils/override.h>
#include <utils/d_ptr.h>
/**
@@ -33,6 +32,7 @@
Q_OBJECT
public:
MainConfigurationWidget(QWidget *parent, QVariantList args);
+ ~MainConfigurationWidget();
public Q_SLOTS:
virtual void defaults() Q_DECL_OVERRIDE;
@@ -40,16 +40,13 @@
virtual void save() Q_DECL_OVERRIDE;
private Q_SLOTS:
- void updateLayout();
-
void forget(int count, const QString &what);
void forgetLastHour();
void forgetTwoHours();
void forgetDay();
void forgetAll();
-protected:
- bool eventFilter(QObject *obj, QEvent *event);
+ void spinKeepHistoryValueChanged(int value);
private:
enum WhatToRemember {
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/workspace/settings/qml/BlacklistApplicationView.qml
^
|
@@ -18,103 +18,90 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import QtQuick 1.1
-import org.kde.qtextracomponents 0.1
-import org.kde.plasma.core 0.1 as PlasmaCore
-import org.kde.plasma.components 0.1 as PlasmaComponents
-
-Flow {
- id: main
-
- /* property declarations --------------------------{{{ */
- property int minimumHeight: 100
- /* }}} */
-
- /* signal declarations ----------------------------{{{ */
- /* }}} */
-
- /* JavaScript functions ---------------------------{{{ */
- /* }}} */
-
- /* object properties ------------------------------{{{ */
- spacing: 16
- anchors {
- fill : parent
- rightMargin : 8
- bottomMargin : 8
- leftMargin : 8
- }
+import QtQuick 2.0
+import org.kde.kquickcontrolsaddons 2.0
+import QtQuick.Controls 1.0 as QtControls
+
+QtControls.ScrollView {
+ anchors.fill: parent
- height: Math.max(childrenRect.height, minimumHeight)
+ Flow {
+ id: main
- opacity: if (applicationModel.enabled) {1} else {.3}
- Behavior on opacity { NumberAnimation { duration: 150 } }
- /* }}} */
+ SystemPalette {
+ id: colors
+ }
- /* child objects ----------------------------------{{{ */
- Repeater {
- model: applicationModel
- Column {
- id: item
+ width: parent.parent.width
- property bool blocked: model.blocked
+ property int minimumHeight: 100
- Item {
- id: mainIcon
+ spacing: 16
- width : 64 + 20
- height : 64 + 20
+ height: Math.max(childrenRect.height, minimumHeight)
- QIconItem {
- id: icon
- icon: model.icon
+ opacity: applicationModel.enabled ? 1 : .3
+ Behavior on opacity { NumberAnimation { duration: 150 } }
- anchors.fill : parent
- anchors.margins : 10
+ Repeater {
+ model: applicationModel
+ Column {
+ id: item
- opacity: if (item.blocked) {0.5} else {1.0}
- Behavior on opacity { NumberAnimation { duration: 150 } }
- }
+ property bool blocked: model.blocked
+
+ Item {
+ id: mainIcon
+
+ width : 64 + 20
+ height : 64 + 20
+
+ QIconItem {
+ id: icon
+ icon: model.icon
- QIconItem {
- id: iconNo
- icon: "dialog-cancel"
-
- anchors {
- right : parent.right
- bottom : parent.bottom
+ anchors.fill : parent
+ anchors.margins : 10
+
+ opacity: item.blocked ? 0.5 : 1.0
+ Behavior on opacity { NumberAnimation { duration: 150 } }
}
- width : 48
- height : 48
- opacity : (1 - icon.opacity) * 2
- }
+ QIconItem {
+ id: iconNo
+ icon: "dialog-cancel"
+
+ anchors {
+ right : parent.right
+ bottom : parent.bottom
+ }
+
+ width : 48
+ height : 48
+ opacity : (1 - icon.opacity) * 2
+ }
- MouseArea {
- onClicked: applicationModel.toggleApplicationBlocked(model.index)
- anchors.fill: parent
+ MouseArea {
+ onClicked: applicationModel.toggleApplicationBlocked(model.index)
+ anchors.fill: parent
+ }
}
- }
- Text {
- elide : Text.ElideRight
- width : mainIcon.width
-
- text : model.title;
- opacity : icon.opacity
-
- anchors.margins : 10
- anchors.horizontalCenter : parent.horizontalCenter
- horizontalAlignment : Text.AlignHCenter
+ Text {
+ elide : Text.ElideRight
+ width : mainIcon.width
+
+ text : model.title
+ opacity : icon.opacity
+ color : colors.windowText
+
+ anchors.margins : 10
+ anchors.horizontalCenter : parent.horizontalCenter
+ horizontalAlignment : Text.AlignHCenter
+ }
}
}
}
- /* }}} */
-
- /* states -----------------------------------------{{{ */
- /* }}} */
- /* transitions ------------------------------------{{{ */
- /* }}} */
}
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/src/workspace/settings/ui/MainConfigurationWidgetBase.ui
^
|
@@ -42,7 +42,7 @@
<item>
<widget class="QRadioButton" name="radioRememberAllApplications">
<property name="text">
- <string>For all applications</string>
+ <string>For a&ll applications</string>
</property>
<property name="checked">
<bool>true</bool>
@@ -52,14 +52,14 @@
<item>
<widget class="QRadioButton" name="radioDontRememberApplications">
<property name="text">
- <string>Do not remember</string>
+ <string>&Do not remember</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioRememberSpecificApplications">
<property name="text">
- <string>Only for specific applications</string>
+ <string>O&nly for specific applications</string>
</property>
</widget>
</item>
@@ -92,7 +92,7 @@
</widget>
</item>
<item>
- <widget class="KIntSpinBox" name="spinKeepHistory"/>
+ <widget class="QSpinBox" name="spinKeepHistory"/>
</item>
<item>
<spacer name="horizontalSpacer">
@@ -134,15 +134,20 @@
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
- <property name="margin">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
<number>0</number>
</property>
<item>
- <widget class="QGraphicsView" name="viewBlacklistedApplications">
- <property name="horizontalScrollBarPolicy">
- <enum>Qt::ScrollBarAlwaysOff</enum>
- </property>
- </widget>
+ <widget class="QWidget" name="viewBlacklistedApplicationsContainer" native="true"/>
</item>
<item>
<widget class="QCheckBox" name="checkBlacklistAllNotOnList">
@@ -173,13 +178,6 @@
</item>
</layout>
</widget>
- <customwidgets>
- <customwidget>
- <class>KIntSpinBox</class>
- <extends>QSpinBox</extends>
- <header>knuminput.h</header>
- </customwidget>
- </customwidgets>
<resources/>
<connections>
<connection>
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/tests/imports/org.kde.listactivitiestest/metadata.desktop
^
|
@@ -10,6 +10,7 @@
Name[fi]=Aktiviteettitesti
Name[fr]=Test des activités
Name[gl]=Probas de actividades
+Name[hu]=Aktivitásteszt
Name[ia]=Essayante Activitates
Name[ko]=활동 테스트
Name[nb]=Aktiviteter
@@ -19,6 +20,7 @@
Name[pl]=Wypróbowywanie działań
Name[pt]=Teste das actividades
Name[pt_BR]=Teste de atividades
+Name[ro]=Testare activități
Name[sk]=Testovanie aktivít
Name[sl]=Preizkušanje dejavnosti
Name[sr]=Испробавање активности
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities-5.2.0.tar.xz/upstream/tests/imports/plasma-applet-org.kde.listactivitiestest.desktop
^
|
@@ -9,6 +9,7 @@
Name[fi]=Aktiviteettien listaamistesti
Name[fr]=Test de la liste d'activités
Name[gl]=Proba da lista de actividades
+Name[hu]=Aktivitáslista tesztelése
Name[ia]=Lista essayos de activitates
Name[ko]=활동 목록 테스트
Name[nb]=List aktivitetsstester
@@ -39,6 +40,7 @@
Comment[fi]=Outo, mutta ei kello
Comment[fr]=Étranges, mais ceci n'est pas une horloge
Comment[gl]=Estraño, pero non é un reloxo
+Comment[hu]=Furcsa, de nem egy óra
Comment[ia]=Stranie, ma non un horologio
Comment[ko]=수상하지만 시계는 아님
Comment[nb]=Underlig, men ingen klokke
@@ -48,6 +50,7 @@
Comment[pl]=Dziwne, ale nie Zegar
Comment[pt]=Estranho, Mas Não é um Relógio
Comment[pt_BR]=Estranho, mas não é um relógio
+Comment[ro]=Straniu, dar nu e ceas
Comment[sk]=Zvláštne, ale nie hodiny
Comment[sl]=Nenavadno, ni pa ura
Comment[sr]=Чудно, али није сат
|
[-]
[+]
|
Changed |
_service:tar_git:kactivities.yaml
^
|
@@ -1,5 +1,5 @@
Name : kactivities
-Version : 5.1.0
+Version : 5.2.0
Release : 1
Group : System/Base
License : GPLv2+
|