diff --git a/COPYING b/COPYING index 723a6a6f..8a507e5f 100644 --- a/COPYING +++ b/COPYING @@ -1,22 +1,22 @@ - Zanshin Todo, + Zanshin Tasks, A Getting Things Done application which aims at getting your mind like water ============================================================================== Copyright (C) 2008-2009 Kevin Ottens Copyright (C) 2008-2009 Mario Bensi 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. The license texts for both the GPLv2 and GPLv3 are provided with this source code release in the files "gpl-2.0.txt" and "gpl-3.0.txt". diff --git a/src/akonadi/akonadistoragesettings.cpp b/src/akonadi/akonadistoragesettings.cpp index a866539d..eaa362f6 100644 --- a/src/akonadi/akonadistoragesettings.cpp +++ b/src/akonadi/akonadistoragesettings.cpp @@ -1,76 +1,76 @@ -/* This file is part of Zanshin Todo. +/* This file is part of Zanshin Copyright 2012 Christian Mollekopf 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "akonadistoragesettings.h" #include #include using namespace Akonadi; StorageSettings::StorageSettings() : QObject() { } StorageSettings &StorageSettings::instance() { static StorageSettings i; return i; } Collection StorageSettings::defaultNoteCollection() { KConfigGroup config(KSharedConfig::openConfig(), "General"); Collection::Id id = config.readEntry("defaultNoteCollection", -1); return Collection(id); } Collection StorageSettings::defaultTaskCollection() { KConfigGroup config(KSharedConfig::openConfig(), "General"); Collection::Id id = config.readEntry("defaultCollection", -1); return Collection(id); } void StorageSettings::setDefaultNoteCollection(const Collection &collection) { if (defaultNoteCollection() == collection) return; KConfigGroup config(KSharedConfig::openConfig(), "General"); config.writeEntry("defaultNoteCollection", QString::number(collection.id())); config.sync(); emit defaultNoteCollectionChanged(collection); } void StorageSettings::setDefaultTaskCollection(const Collection &collection) { if (defaultTaskCollection() == collection) return; KConfigGroup config(KSharedConfig::openConfig(), "General"); config.writeEntry("defaultCollection", QString::number(collection.id())); config.sync(); emit defaultTaskCollectionChanged(collection); } diff --git a/src/akonadi/akonadistoragesettings.h b/src/akonadi/akonadistoragesettings.h index 93d70ea9..c930898c 100644 --- a/src/akonadi/akonadistoragesettings.h +++ b/src/akonadi/akonadistoragesettings.h @@ -1,56 +1,56 @@ -/* This file is part of Zanshin Todo. +/* This file is part of Zanshin Copyright 2012 Christian Mollekopf Copyright 2014 Kevin Ottens 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef AKONADI_STORAGESETTINGS_H #define AKONADI_STORAGESETTINGS_H #include namespace Akonadi { class StorageSettings : public QObject { Q_OBJECT private: StorageSettings(); public: static StorageSettings &instance(); Akonadi::Collection defaultNoteCollection(); Akonadi::Collection defaultTaskCollection(); public slots: void setDefaultNoteCollection(const Akonadi::Collection &collection); void setDefaultTaskCollection(const Akonadi::Collection &collection); signals: void defaultNoteCollectionChanged(const Akonadi::Collection &collection); void defaultTaskCollectionChanged(const Akonadi::Collection &collection); }; } #endif // AKONADI_STORAGESETTINGS_H diff --git a/src/appversion.h b/src/appversion.h index 859935ff..19f051b3 100644 --- a/src/appversion.h +++ b/src/appversion.h @@ -1,30 +1,30 @@ -/* This file is part of Zanshin Todo +/* This file is part of Zanshin Copyright 2016 Kevin Ottens 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef APPVERSION_H #define APPVERSION_H #define APPLICATION_VERSION "0.4.1" #endif diff --git a/src/zanshin/app/aboutdata.cpp b/src/zanshin/app/aboutdata.cpp index aa1898ee..ff9de215 100644 --- a/src/zanshin/app/aboutdata.cpp +++ b/src/zanshin/app/aboutdata.cpp @@ -1,50 +1,50 @@ /* This file is part of Zanshin Copyright 2011-2014 Kevin Ottens 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "aboutdata.h" #include "../../appversion.h" #include KAboutData App::getAboutData() { KAboutData about(QStringLiteral("zanshin"), - QObject::tr("Zanshin Todo"), QStringLiteral(APPLICATION_VERSION), + QObject::tr("Zanshin Tasks"), QStringLiteral(APPLICATION_VERSION), QObject::tr("A Getting Things Done application which aims at getting your mind like water"), KAboutLicense::GPL_V3, QObject::tr("Copyright 2008-2016, Kevin Ottens ")); about.addAuthor(QObject::tr("Kevin Ottens"), QObject::tr("Lead Developer"), QStringLiteral("ervin@kde.org")); about.addAuthor(QObject::tr("Mario Bensi"), QObject::tr("Developer"), QStringLiteral("nef@ipsquad.net")); about.addAuthor(QObject::tr("Franck Arrecot"), QObject::tr("Developer"), QStringLiteral("franck.arrecot@gmail.com")); return about; } diff --git a/src/zanshin/app/dependencies.h b/src/zanshin/app/dependencies.h index a245bf6b..e9683c86 100644 --- a/src/zanshin/app/dependencies.h +++ b/src/zanshin/app/dependencies.h @@ -1,33 +1,33 @@ -/* This file is part of Zanshin Todo. +/* This file is part of Zanshin Copyright 2014 Kevin Ottens 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef APP_DEPENDENCIES_H #define APP_DEPENDENCIES_H namespace App { void initializeDependencies(); } #endif diff --git a/src/zanshin/kontact/kontact_plugin.cpp b/src/zanshin/kontact/kontact_plugin.cpp index a9bd9a53..b03d9674 100644 --- a/src/zanshin/kontact/kontact_plugin.cpp +++ b/src/zanshin/kontact/kontact_plugin.cpp @@ -1,41 +1,41 @@ -/* This file is part of Zanshin Todo. +/* This file is part of Zanshin Copyright 2011 Kevin Ottens 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "kontact_plugin.h" #include EXPORT_KONTACT_PLUGIN(Plugin, zanshin) Plugin::Plugin(KontactInterface::Core *core, const QVariantList&) : KontactInterface::Plugin(core, core, "zanshin") { setComponentName(QStringLiteral("zanshin"), QStringLiteral("zanshin")); } KParts::ReadOnlyPart *Plugin::createPart() { return loadPart(); } #include "kontact_plugin.moc" diff --git a/src/zanshin/kontact/kontact_plugin.h b/src/zanshin/kontact/kontact_plugin.h index c29ae03e..8b84d426 100644 --- a/src/zanshin/kontact/kontact_plugin.h +++ b/src/zanshin/kontact/kontact_plugin.h @@ -1,43 +1,43 @@ -/* This file is part of Zanshin Todo. +/* This file is part of Zanshin Copyright 2011 Kevin Ottens 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef ZANSHIN_KONTACT_PLUGIN_H #define ZANSHIN_KONTACT_PLUGIN_H #include class Plugin : public KontactInterface::Plugin { Q_OBJECT public: Plugin(KontactInterface::Core *core, const QVariantList &); int weight() const Q_DECL_OVERRIDE { return 449; } protected: KParts::ReadOnlyPart *createPart() Q_DECL_OVERRIDE; }; #endif diff --git a/src/zanshin/kontact/part.cpp b/src/zanshin/kontact/part.cpp index 0296852a..37f6bb13 100644 --- a/src/zanshin/kontact/part.cpp +++ b/src/zanshin/kontact/part.cpp @@ -1,92 +1,92 @@ -/* This file is part of Zanshin Todo. +/* This file is part of Zanshin Copyright 2011 Kevin Ottens 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "part.h" #include #include #include #include #include #include #include "../app/aboutdata.h" #include "../app/dependencies.h" #include "presentation/taskapplicationmodel.h" #include "widgets/taskapplicationcomponents.h" #include "widgets/availablepagesview.h" #include "widgets/availablesourcesview.h" #include "widgets/editorview.h" #include "widgets/pageview.h" #include "utils/dependencymanager.h" K_PLUGIN_FACTORY(PartFactory, registerPlugin();) Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &) : KParts::ReadOnlyPart(parent) { App::initializeDependencies(); setComponentName(QStringLiteral("zanshin"), QStringLiteral("zanshin")); auto splitter = new QSplitter(parentWidget); auto sidebar = new QSplitter(Qt::Vertical, parentWidget); auto components = new Widgets::TaskApplicationComponents(parentWidget); components->setModel(Presentation::TaskApplicationModel::Ptr::create()); sidebar->addWidget(components->availablePagesView()); sidebar->addWidget(components->availableSourcesView()); splitter->addWidget(sidebar); splitter->addWidget(components->pageView()); splitter->addWidget(components->editorView()); setWidget(splitter); auto actions = components->globalActions(); auto ac = actionCollection(); for (auto it = actions.constBegin(); it != actions.constEnd(); ++it) { auto shortcut = it.value()->shortcut(); if (!shortcut.isEmpty()) { ac->setDefaultShortcut(it.value(), shortcut); } ac->addAction(it.key(), it.value()); } setXMLFile(QStringLiteral("zanshin_part.rc"), true); } Part::~Part() { } bool Part::openFile() { return false; } #include "part.moc" diff --git a/src/zanshin/kontact/part.h b/src/zanshin/kontact/part.h index c3e5c024..1c838a31 100644 --- a/src/zanshin/kontact/part.h +++ b/src/zanshin/kontact/part.h @@ -1,42 +1,42 @@ -/* This file is part of Zanshin Todo. +/* This file is part of Zanshin Copyright 2011 Kevin Ottens 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef ZANSHIN_PART_H #define ZANSHIN_PART_H #include class Part : public KParts::ReadOnlyPart { Q_OBJECT public: Part(QWidget *parentWidget, QObject *parent, const QVariantList &); ~Part(); protected: virtual bool openFile() Q_DECL_OVERRIDE; }; #endif diff --git a/src/zanshin/kontact/zanshin_plugin.desktop b/src/zanshin/kontact/zanshin_plugin.desktop index 5af55bb7..a9623c85 100644 --- a/src/zanshin/kontact/zanshin_plugin.desktop +++ b/src/zanshin/kontact/zanshin_plugin.desktop @@ -1,75 +1,75 @@ [Desktop Entry] Type=Service Icon=zanshin X-KDE-ServiceTypes=Kontact/Plugin,KPluginInfo X-KDE-Library=kontact_zanshinplugin X-KDE-KontactPluginVersion=10 X-KDE-KontactPartLibraryName=zanshin_part X-KDE-KontactPartExecutableName=zanshin X-KDE-KontactPartLoadOnStart=false X-KDE-KontactPluginHasSummary=false X-KDE-PluginInfo-Name=kontact_zanshinplugin X-KDE-PluginInfo-Version=0.1 X-KDE-PluginInfo-License=GPL X-KDE-PluginInfo-EnabledByDefault=true X-KDE-PluginInfo-AllowEmptySettings=true Comment=Kontact Zanshin Plugin Comment[bs]=Kontact Zanshin priključaka Comment[ca]=Connector del Zanshin pel Kontact Comment[ca@valencia]=Connector del Zanshin pel Kontact Comment[da]=Zanshin-plugin til Kontact Comment[de]=Zanshin-Modul für Kontakt Comment[en_GB]=Kontact Zanshin Plugin Comment[es]=Complemento Kontact para Zanshin Comment[et]=Kontacti Zanshini plugin Comment[fi]=Kontactin Zanshin-osa Comment[fr]=Module externe Zanshin pour Kontact Comment[ga]=Breiseán Zanshin le haghaidh Kontact Comment[gl]=Complemento de Zanshin para Kontact Comment[hu]=Kontact Zanshin-bővítmény Comment[it]=Estensione per Kontact di Zanshin Comment[km]=កម្មវិធី​ជំនួយ​របស់ Kontact Zanshin Comment[mr]=कॉन्टॅक्ट झान्शिन प्लगइन Comment[nl]=Kontact-plugin voor Zanshin Comment[pl]=Wtyczka kontaktów Zanshin Comment[pt]='Plugin' do Zanshin para o Kontact Comment[pt_BR]=Plugin do Zanshin para o Kontact Comment[ru]=Модуль Zanshin для Kontact Comment[sk]=Kontact Zanshin Plugin Comment[sv]=Zanshin-insticksprogram för Kontact Comment[tr]=Kontact ZANSHIN Eklentisi Comment[uk]=Додаток Zanshin до Kontact Comment[x-test]=xxKontact Zanshin Pluginxx Comment[zh_CN]=Kontact Zanshin 插件 -Name=Todo Lists +Name=Task Lists Name[bs]=Lista zadataka za uraditi Name[ca]=Llistes de pendents Name[ca@valencia]=Llistes de pendents Name[da]=Gøremålslister Name[de]=Aufgabenlisten Name[en_GB]=Todo Lists Name[es]=Lista de tareas Name[et]=Ülesannete nimekirjad Name[fi]=Tehtäväluettelot Name[fr]=Listes de tâches à faire Name[ga]=Liosta Tascanna Name[gl]=Listas de tarefas Name[hu]=Tennivaló listák Name[it]=Elenchi delle cose da fare Name[km]=បញ្ជី​ការងារ​ត្រូវ​ធ្វើ Name[mr]=कार्य याद्या Name[nl]=Takenlijsten Name[pl]=Spis zadań Name[pt]=Listas de Itens Por-Fazer Name[pt_BR]=Listas de tarefas Name[ru]=Списки дел Name[sk]=Zoznamy úloh Name[sl]=Seznami opravil Name[sv]=Uppgiftslistor Name[tr]=Yapılacaklar Listesi Name[uk]=Списки завдань Name[x-test]=xxTodo Listsxx Name[zh_CN]=待办事项列表 diff --git a/src/zanshin/runner/plasma-runner-zanshin.desktop b/src/zanshin/runner/plasma-runner-zanshin.desktop index fb40fd7f..b13f9503 100644 --- a/src/zanshin/runner/plasma-runner-zanshin.desktop +++ b/src/zanshin/runner/plasma-runner-zanshin.desktop @@ -1,67 +1,67 @@ [Desktop Entry] -Name=Zanshin Todo +Name=Zanshin Tasks Name[bs]=Zanshin zadaci Name[ca]=Pendent del Zanshin Name[ca@valencia]=Pendent del Zanshin Name[da]=Zanshin gøremål Name[de]=Zanshin-Aufgaben Name[en_GB]=Zanshin Todo Name[es]=Tareas pendientes de Zanshin Name[et]=Zanshini ülesanded Name[fi]=Zanshin-tehtävät Name[fr]=Tâche Zanshin Name[ga]=Tascanna Zanshin Name[gl]=Tarefas pendentes Zanshin Name[hu]=Zanshin tennivaló Name[it]=Cose da fare Zanshin Name[km]=ការ​ងារ​ត្រូវ​ធ្វើ​របស់ Zanshin Name[mr]=झान्शिन कार्य Name[nl]=Zanshin taken Name[pl]=Zadania Zanshin Name[pt]=Itens Por-Fazer Zanshin Name[pt_BR]=Lista de tarefas Zanshin Name[ru]=Органайзер Zanshin Name[sk]=Úloha Zanshin Name[sv]=Zanshin uppgifter Name[tr]=Zanshin Yapılacaklar Name[uk]=Завдання Zanshin Name[x-test]=xxZanshin Todoxx Name[zh_CN]=Zanshin 待办事项 Comment=Add tasks to your todo list Comment[bs]=Dodaj zadatke u listu za uraditi Comment[ca]=Afegeix tasques a la vostra llista de pendents Comment[ca@valencia]=Afig tasques a la vostra llista de pendents Comment[da]=Tilføjer opgaver til din gøremålsliste Comment[de]=Aufgaben zu Ihrer Aufgabenliste hinzufügen Comment[en_GB]=Add tasks to your todo list Comment[es]=Añadir tareas a su lista de pendientes Comment[et]=Ülesannete lisamine sinu ülesannete nimekirja. Comment[fi]=Lisää tehtäviä tehtäväluetteloosi Comment[fr]=Ajoute des tâches à votre liste de tâches à faire Comment[ga]=Cuir tascanna le do liosta Comment[gl]=Engade tarefas á lista das pendentes Comment[hu]=Feladatok hozzáadása a tennivaló listához Comment[it]=Aggiungi attività alla lista delle tue cose da fare Comment[km]=បន្ថែម​ភារកិច្ច​ទៅ​​ក្នុង​បញ្ជី​ការងារ​ត្រូវ​ធ្វើ​របស់​អ្នក Comment[mr]=तुमच्या कार्य यादीत कार्ये जोडा Comment[nl]=Voeg taken toe aan uw lijst met taken Comment[pl]=Dodaj zadania do swojego spisu zadań Comment[pt]=Adicionar tarefas à sua lista de itens por-fazer Comment[pt_BR]=Adicionar tarefas à sua lista Comment[ru]=Добавление задач в ваш список дел Comment[sk]=Pridať úlohy do vášho zoznamu úloh Comment[sl]=Dodaj opravila v seznam opravil Comment[sv]=Lägg till uppgifter i uppgiftslistan Comment[tr]=Yapılacaklar listenize görev ekler Comment[uk]=Додавання завдань до вашого списку Comment[x-test]=xxAdd tasks to your todo listxx Comment[zh_CN]=添加任务到您的待办事项 X-KDE-ServiceTypes=Plasma/Runner Type=Service Icon=zanshin X-KDE-Library=krunner_zanshin X-KDE-PluginInfo-Author=Zanshin Team X-KDE-PluginInfo-Name=org.kde.zanshin X-KDE-PluginInfo-Version=1.0 X-KDE-PluginInfo-License=LGPL X-KDE-PluginInfo-EnabledByDefault=true diff --git a/src/zanshin/runner/zanshinrunner.cpp b/src/zanshin/runner/zanshinrunner.cpp index 6c3229de..1573bb89 100644 --- a/src/zanshin/runner/zanshinrunner.cpp +++ b/src/zanshin/runner/zanshinrunner.cpp @@ -1,99 +1,99 @@ -/* This file is part of Zanshin Todo. +/* This file is part of Zanshin Copyright 2011 Kevin Ottens Copyright 2014 Mario Bensi 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "zanshinrunner.h" #include "domain/task.h" #include "akonadi/akonaditaskrepository.h" #include "akonadi/akonadiserializer.h" #include "akonadi/akonadistorage.h" #include #include K_EXPORT_PLASMA_RUNNER(zanshin, ZanshinRunner) Domain::TaskRepository::Ptr createTaskRepository() { using namespace Akonadi; auto repository = new TaskRepository(StorageInterface::Ptr(new Storage), SerializerInterface::Ptr(new Serializer), MessagingInterface::Ptr()); return Domain::TaskRepository::Ptr(repository); } ZanshinRunner::ZanshinRunner(QObject *parent, const QVariantList &args) : Plasma::AbstractRunner(parent, args), m_taskRepository(createTaskRepository()) { setObjectName(QStringLiteral("Zanshin")); setIgnoredTypes(Plasma::RunnerContext::Directory | Plasma::RunnerContext::File | Plasma::RunnerContext::NetworkLocation | Plasma::RunnerContext::Help); } ZanshinRunner::~ZanshinRunner() { } void ZanshinRunner::match(Plasma::RunnerContext &context) { const QString command = context.query().trimmed(); if (!command.startsWith(QStringLiteral("todo:"), Qt::CaseInsensitive)) { return; } const QString summary = command.mid(5).trimmed(); if (summary.isEmpty()) { return; } QList matches; Plasma::QueryMatch match(this); match.setData(summary); match.setType(Plasma::QueryMatch::ExactMatch); match.setIcon(QIcon::fromTheme(QStringLiteral("zanshin"))); match.setText(tr("Add \"%1\" to your todo list").arg(summary)); match.setRelevance(1.0); matches << match; context.addMatches(matches); } void ZanshinRunner::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) { Q_UNUSED(context) KConfig::setMainConfigName("zanshinrc"); auto task = Domain::Task::Ptr::create(); task->setTitle(match.data().toString()); m_taskRepository->create(task); KConfig::setMainConfigName(QString()); } #include "zanshinrunner.moc" diff --git a/src/zanshin/runner/zanshinrunner.h b/src/zanshin/runner/zanshinrunner.h index a561e964..8c6b8371 100644 --- a/src/zanshin/runner/zanshinrunner.h +++ b/src/zanshin/runner/zanshinrunner.h @@ -1,47 +1,47 @@ -/* This file is part of Zanshin Todo. +/* This file is part of Zanshin Copyright 2011 Kevin Ottens Copyright 2014 Mario Bensi 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef ZANSHINRUNNER_H #define ZANSHINRUNNER_H #include #include "domain/taskrepository.h" class ZanshinRunner : public Plasma::AbstractRunner { Q_OBJECT public: ZanshinRunner(QObject *parent, const QVariantList &args); ~ZanshinRunner(); void match(Plasma::RunnerContext &context); void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &action); private: Domain::TaskRepository::Ptr m_taskRepository; }; #endif