Commit decb298c authored by Laurent Montel's avatar Laurent Montel 😁

Remove not used resources

parent ea7ebab3
......@@ -102,9 +102,7 @@ endif()
add_subdirectory( shared )
add_subdirectory( birthdays )
add_subdirectory( mixedmaildir )
add_subdirectory( mailtransport_dummy )
add_subdirectory( mbox )
add_subdirectory( nntp )
add_subdirectory( vcarddir )
add_subdirectory( icaldir )
add_subdirectory( vcard )
......
add_definitions(-DTRANSLATION_DOMAIN=\"akonadi_mailtransport_resource\")
set( mtdummyresource_SRCS
configdialog.cpp
mtdummyresource.cpp
)
install( FILES mtdummyresource.desktop DESTINATION "${CMAKE_INSTALL_PREFIX}/share/akonadi/agents" )
ki18n_wrap_ui(mtdummyresource_SRCS settings.ui)
kconfig_add_kcfg_files(mtdummyresource_SRCS settings.kcfgc)
kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/mtdummyresource.kcfg org.kde.Akonadi.MailTransportDummy.Settings)
qt5_add_dbus_adaptor(mtdummyresource_SRCS
${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.MailTransportDummy.Settings.xml settings.h Settings
)
add_executable(akonadi_mailtransport_dummy_resource ${mtdummyresource_SRCS})
target_link_libraries(akonadi_mailtransport_dummy_resource KF5::AkonadiCore KF5::AkonadiWidgets KF5::AkonadiAgentBase)
install(TARGETS akonadi_mailtransport_dummy_resource ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
#! /usr/bin/env bash
$EXTRACTRC *.ui *.kcfg >> rc.cpp
$XGETTEXT *.cpp -o $podir/akonadi_mailtransport_resource.pot
/*
Copyright 2008 Ingo Klöcker <kloecker@kde.org>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#include "configdialog.h"
#include "settings.h"
#include <Collection>
#include <CollectionRequester>
#include <QDebug>
#include <QVBoxLayout>
#include <QPushButton>
#include <QDialogButtonBox>
using namespace Akonadi;
ConfigDialog::ConfigDialog(QWidget *parent) :
QDialog(parent)
{
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
ui.setupUi(mainWidget);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
mOkButton = buttonBox->button(QDialogButtonBox::Ok);
mOkButton->setDefault(true);
mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &ConfigDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &ConfigDialog::reject);
mainLayout->addWidget(buttonBox);
ui.sink->setMimeTypeFilter(QStringList() << QLatin1String("message/rfc822"));
ui.sink->setAccessRightsFilter(Akonadi::Collection::CanCreateItem);
// Don't bother fetching the collection. Will have an empty name :-/
ui.sink->setCollection(Collection(Settings::self()->sink()));
ui.sink->changeCollectionDialogOptions(Akonadi::CollectionDialog::AllowToCreateNewChildCollection);
qDebug() << "Sink from settings" << Settings::self()->sink();
connect(mOkButton, &QPushButton::clicked, this, &ConfigDialog::save);
connect(ui.sink, &Akonadi::CollectionRequester::collectionChanged, this, &ConfigDialog::slotCollectionChanged);
mOkButton->setEnabled(false);
}
void ConfigDialog::slotCollectionChanged(const Akonadi::Collection &col)
{
mOkButton->setEnabled(col.isValid());
}
void ConfigDialog::save()
{
qDebug() << "Sink changed to" << ui.sink->collection().id();
Settings::self()->setSink(ui.sink->collection().id());
Settings::self()->save();
}
/*
Copyright 2009 Constantin Berzan <exit3219@gmail.com>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#ifndef CONFIGDIALOG_H
#define CONFIGDIALOG_H
#include <QDialog>
#include "ui_settings.h"
class QPushButton;
class ConfigDialog : public QDialog
{
Q_OBJECT
public:
ConfigDialog(QWidget *parent = Q_NULLPTR);
private slots:
void save();
void slotCollectionChanged(const Akonadi::Collection &);
private:
Ui::ConfigDialog ui;
QPushButton *mOkButton;
};
#endif
/*
Copyright 2009 Constantin Berzan <exit3219@gmail.com>
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2 of the License or
( at your option ) version 3 or, at the discretion of KDE e.V.
( which shall act as a proxy as in section 14 of the GPLv3 ), any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "mtdummyresource.h"
#include "configdialog.h"
#include "settings.h"
#include "settingsadaptor.h"
#include <KWindowSystem>
#include <QtDBus/QDBusConnection>
#include <ItemCopyJob>
#include <QDebug>
using namespace Akonadi;
MTDummyResource::MTDummyResource(const QString &id)
: ResourceBase(id)
{
new SettingsAdaptor(Settings::self());
QDBusConnection::sessionBus().registerObject(QLatin1String("/Settings"),
Settings::self(), QDBusConnection::ExportAdaptors);
currentlySending = -1;
}
MTDummyResource::~MTDummyResource()
{
}
void MTDummyResource::retrieveCollections()
{
// we have no collections of our own
collectionsRetrieved(Collection::List());
}
void MTDummyResource::retrieveItems(const Akonadi::Collection &collection)
{
Q_UNUSED(collection);
// we have no collections of our own
Q_ASSERT(false);
}
bool MTDummyResource::retrieveItem(const Akonadi::Item &item, const QSet<QByteArray> &parts)
{
Q_UNUSED(item);
Q_UNUSED(parts);
// we have no collections of our own
Q_ASSERT(false);
return false;
}
void MTDummyResource::aboutToQuit()
{
}
void MTDummyResource::configure(WId windowId)
{
ConfigDialog dlg;
if (windowId) {
KWindowSystem::setMainWindow(&dlg, windowId);
}
if (dlg.exec()) {
emit configurationDialogAccepted();
} else {
emit configurationDialogRejected();
}
}
void MTDummyResource::sendItem(const Item &message)
{
qDebug() << "id" << message.id();
Q_ASSERT(currentlySending == -1);
currentlySending = message.id();
ItemCopyJob *job = new ItemCopyJob(message, Collection(Settings::self()->sink()));
connect(job, &ItemCopyJob::result, this, &MTDummyResource::jobResult);
}
void MTDummyResource::jobResult(KJob *job)
{
if (job->error()) {
itemSent(Item(currentlySending), TransportFailed, job->errorString());
} else {
itemSent(Item(currentlySending), TransportSucceeded);
}
currentlySending = -1;
}
AKONADI_RESOURCE_MAIN(MTDummyResource)
[Desktop Entry]
Name=Dummy MailTransport Resource
Name[bs]=Vještački resurs za transport maila
Name[ca]=Recurs de transport de correu simulat
Name[ca@valencia]=Recurs de transport de correu simulat
Name[da]=MailTransport-ressource (attrap)
Name[de]=Dummy MailTransport-Ressource
Name[el]=Εικονικός πόρος MailTransport
Name[en_GB]=Dummy MailTransport Resource
Name[es]=Recurso de transporte de correo vacío para pruebas
Name[et]=Kirjade edastamine libaressurss
Name[fi]=Tyhjä MailTransport-resurssi
Name[fr]=Ressource de test pour le transport de courriers électroniques
Name[gl]=Recurso de transporte de correo parvo
Name[hu]=Üres levéltovábbító erőforrás
Name[ia]=Ressource de Dummy MailTransport
Name[it]=Risorsa MailTransport fittizia
Name[kk]=Сынақ MailTransport ресурсы
Name[km]=ធនធាន MailTransport សម្រាប់​អ្នក​មិន​ចេះ
Name[ko]=더미 MailTransport 자원
Name[lt]=Fiktyvus pašto transporto resursus
Name[lv]=MailTransport resursa imitācija
Name[nb]=Attrapp-ressurs for e-posttransport
Name[nds]=Platzholl-Nettpostöverdreegmetoden-Ressource
Name[nl]=Dummy e-mailtransporthulpmiddel
Name[nn]=Testressurs for e-posttransport
Name[pl]=Prosty zasób metody przekazywania poczty
Name[pt]=Recurso de Transporte de Correio para Testes
Name[pt_BR]=Recurso de transporte de e-mails para testes
Name[ru]=Фиктивный источник данных почтового транспорта
Name[sk]=Prázdny zdroj prenosu pošty
Name[sl]=Lažen vir MailTransport
Name[sr]=Лажни ресурс поштанског транспорта
Name[sr@ijekavian]=Лажни ресурс поштанског транспорта
Name[sr@ijekavianlatin]=Lažni resurs poštanskog transporta
Name[sr@latin]=Lažni resurs poštanskog transporta
Name[sv]=E-postsändningsresurs för test
Name[tr]=Boş MailTransport Kaynağı
Name[uk]=Тестовий ресурс MailTransport
Name[x-test]=xxDummy MailTransport Resourcexx
Name[zh_CN]=虚拟邮件传输资源
Name[zh_TW]=空白郵件傳輸資源
Comment=Dummy Resource implementing mail transport interface
Comment[bs]=Vještački resurs implementira sučelje mail transporta
Comment[ca]=Implementació de recurs simulat d'interfície de transport de correu
Comment[ca@valencia]=Implementació de recurs simulat d'interfície de transport de correu
Comment[da]=Attrap-ressource der implementerer mail-transport-grænseflade
Comment[de]=Dummy-Ressource, die die Mail-Transport-Schnittstelle implementiert
Comment[el]=Εικονικός πόρος που υλοποιεί την διεπαφή mail transport
Comment[en_GB]=Dummy Resource implementing mail transport interface
Comment[es]=Recurso vacío que implementa una interfaz de transporte de correo
Comment[et]=Kirjade edastamise liidese libaressurss
Comment[fi]=Tyhjä postinvälitysliitännän toteuttava resurssi
Comment[fr]=Ressource de test implémentant l'interface de transport de courriers électroniques
Comment[gl]=Recurso parvo que aporta a interface de transporte de correo
Comment[hu]=A levéltovábbító interfészt implementáló üres erőforrás
Comment[ia]=Inferfacie pro facer possibile transporto de posta como Dummy Resource
Comment[it]=Risorsa fittizia che implementa l'interfaccia di trasporto della posta
Comment[kk]=Пошта тасымалдау интерфейсінің сынақ MailTransport ресурсы
Comment[km]=ចំណុច​ប្រទាក់​បញ្ជូន​សំបុត្រ​ដោយ​អនុវត្ត​ធនធាន​ពី​ដំបូង
Comment[ko]=메일 전송 인터페이스를 구현하는 더미 자원
Comment[lt]=Fiktyvus resursas, įgyvendinantis pašto transporto sąsają
Comment[lv]=Resursa imitācija, kas realizē pasta transporta saskarni
Comment[nb]=Attrappressurs som implementerer grensesnitt for e-posttransport
Comment[nds]=Platzhollressource mit inbuut Nettpostöverdreegmetood-Koppelsteed
Comment[nl]=Dummy hulpmiddel die een e-mailtransportinterface implementeert
Comment[nn]=Testressurs som tek i bruk eit grensesnitt for e-posttransport
Comment[pl]=Prosty zasób implementujący interfejs do przekazywania poczty
Comment[pt]=Uma interface de transporte de correio que implementa um recurso de testes
Comment[pt_BR]=Interface de transporte de e-mails que implementa um recurso de testes
Comment[ru]="Фиктивный источник данных, реализующий интерфейс почтового транспорта"
Comment[sk]=Prázdny zdroj implementujúci rozhranie prenosu pošty
Comment[sl]=Lažen vir z izvedbo vmesnika za prenos pošte
Comment[sr]=Лажни ресурс који изводи сучеље мрежног транспорта
Comment[sr@ijekavian]=Лажни ресурс који изводи сучеље мрежног транспорта
Comment[sr@ijekavianlatin]=Lažni resurs koji izvodi sučelje mrežnog transporta
Comment[sr@latin]=Lažni resurs koji izvodi sučelje mrežnog transporta
Comment[sv]=Testresurs som implementerar gränssnitt för e-postöverföring
Comment[tr]=Posta nakletme arayüzünü gerçekleyen boş kaynak
Comment[uk]="Тестовий ресурс, що реалізує інтерфейс пересилання пошти"
Comment[x-test]=xxDummy Resource implementing mail transport interfacexx
Comment[zh_CN]=实现了邮件传输接口的虚拟资源
Comment[zh_TW]=空白資源,用於實作郵件傳輸介面
Type=AkonadiResource
Exec=akonadi_mailtransport_dummy_resource
Icon=message-rfc822
X-Akonadi-MimeTypes=message/rfc822
X-Akonadi-Capabilities=Resource,MailTransport
X-Akonadi-Identifier=akonadi_mailtransport_dummy_resource
/*
Copyright 2009 Constantin Berzan <exit3219@gmail.com>
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2 of the License or
( at your option ) version 3 or, at the discretion of KDE e.V.
( which shall act as a proxy as in section 14 of the GPLv3 ), any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef MTDUMMYRESOURCE_H
#define MTDUMMYRESOURCE_H
#include <Item>
#include <ResourceBase>
#include <TransportResourceBase>
class MTDummyResource : public Akonadi::ResourceBase, public Akonadi::TransportResourceBase
{
Q_OBJECT
public:
explicit MTDummyResource(const QString &id);
~MTDummyResource();
public:
void configure(WId windowId) Q_DECL_OVERRIDE;
/* reimpl from ResourceBase::Transport */
void sendItem(const Akonadi::Item &message) Q_DECL_OVERRIDE;
protected Q_SLOTS:
void retrieveCollections() Q_DECL_OVERRIDE;
void retrieveItems(const Akonadi::Collection &col) Q_DECL_OVERRIDE;
bool retrieveItem(const Akonadi::Item &item, const QSet<QByteArray> &parts) Q_DECL_OVERRIDE;
protected:
void aboutToQuit() Q_DECL_OVERRIDE;
private Q_SLOTS:
void jobResult(KJob *job);
private:
Akonadi::Item::Id currentlySending;
};
#endif
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:kcfg="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile/>
<group name="General">
<entry name="Sink" type="LongLong">
<label>Collection to dump sent mail into.</label>
<default>-1</default>
</entry>
</group>
</kcfg>
File=mtdummyresource.kcfg
ClassName=Settings
Mutators=true
ItemAccessors=true
SetUserTexts=true
Singleton=true
#IncludeFiles=
GlobalEnums=true
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<author>Till Adam &lt;adam@kde.org&gt;</author>
<class>ConfigDialog</class>
<widget class="QWidget" name="ConfigDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>250</height>
</rect>
</property>
<property name="windowTitle">
<string>Mail Dispatcher Agent Settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Select the collection to dump sent messages to:</string>
</property>
</widget>
</item>
<item>
<widget class="Akonadi::CollectionRequester" name="sink">
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Akonadi::CollectionRequester</class>
<extends>QFrame</extends>
<header>collectionrequester.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
add_definitions(-DTRANSLATION_DOMAIN=\"akonadi_nntp_resource\")
remove_definitions(-DQT_NO_CAST_FROM_BYTEARRAY)
set( nntpresource_SRCS
nntpcollectionattribute.cpp
nntpresource.cpp
configdialog.cpp
settings.cpp
)
install( FILES nntpresource.desktop DESTINATION "${CMAKE_INSTALL_PREFIX}/share/akonadi/agents" )
kcfg_generate_dbus_interface( ${CMAKE_CURRENT_SOURCE_DIR}/nntpresource.kcfg org.kde.Akonadi.NNTP.Settings )
qt5_add_dbus_adaptor( nntpresource_SRCS
${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.NNTP.Settings.xml settings.h Settings
)
ki18n_wrap_ui(nntpresource_SRCS configdialog.ui)
kconfig_add_kcfg_files(nntpresource_SRCS settingsbase.kcfgc)
add_executable(akonadi_nntp_resource ${nntpresource_SRCS})
if( APPLE )
set_target_properties(akonadi_nntp_resource PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/../Info.plist.template)
set_target_properties(akonadi_nntp_resource PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "org.kde.Akonadi.NNTP")
set_target_properties(akonadi_nntp_resource PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "KDE Akonadi NNTP Resource")
endif ()
target_link_libraries(akonadi_nntp_resource KF5::AkonadiCore KF5::AkonadiMime KF5::KIOCore KF5::Mime KF5::AkonadiAgentBase)
install(TARGETS akonadi_nntp_resource ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
#! /usr/bin/env bash
$EXTRACTRC `find . -name \*.ui` `find . -name \*.kcfg` >> rc.cpp || exit 11
$XGETTEXT *.cpp -o $podir/akonadi_nntp_resource.pot
/*
Copyright (c) 2008 Volker Krause <vkrause@kde.org>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#include "configdialog.h"
#include "settings.h"
#include <kconfigdialogmanager.h>
#include <KLocalizedString>
#include <QVBoxLayout>
#include <QDialogButtonBox>
ConfigDialog::ConfigDialog(QWidget *parent) :
QDialog(parent)
{
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
ui.setupUi(mainWidget);
mManager = new KConfigDialogManager(this, Settings::self());
mManager->updateWidgets();
ui.password->setText(Settings::self()->password());
ui.kcfg_MaxDownload->setSuffix(ki18np(" article", " articles"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &ConfigDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &ConfigDialog::reject);
mainLayout->addWidget(buttonBox);
connect(okButton, &QPushButton::clicked, this, &ConfigDialog::save);
}
void ConfigDialog::save()
{
if (ui.kcfg_StorePassword->isChecked()) {
Settings::self()->setPassword(ui.password->text());
}
mManager->updateSettings();
}
/*
Copyright (c) 2008 Volker Krause <vkrause@kde.org>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public