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

Move some plugins here

parent a2e48c62
add_definitions(-DTRANSLATION_DOMAIN=\"importwizard_plugins\")
add_subdirectory(evolutionv1)
add_subdirectory(evolutionv2)
#! /bin/sh
$XGETTEXT `find . -name '*.cpp' -o -name '*.h' | grep -v '/tests/' | grep -v '/autotests/'` -o $podir/importwizard_plugins.pot
set(evolutionv1importer_SRCS
evolutionv1importdata.cpp
)
kcoreaddons_add_plugin(evolutionv1importerplugin JSON evolutionv1importer.json SOURCES
${evolutionv1importer_SRCS} INSTALL_NAMESPACE importwizard)
target_link_libraries(evolutionv1importerplugin
KPim::ImportWizard
KF5::XmlGui
KF5::I18n
KF5::Contacts
KF5::MailImporterAkonadi
KF5::MailTransport
KF5::MailCommon
KF5::IdentityManagement
KF5::MessageViewer
)
/*
Copyright (C) 2012-2017 Montel Laurent <montel@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; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "evolutionv1importdata.h"
#include "mailimporter/filterevolution.h"
#include "mailimporter/filterinfo.h"
#include <KLocalizedString>
#include <kpluginfactory.h>
#include <QDir>
K_PLUGIN_FACTORY_WITH_JSON(Evolutionv1ImporterFactory, "evolutionv1importer.json", registerPlugin<Evolutionv1ImportData>();
)
Evolutionv1ImportData::Evolutionv1ImportData(QObject *parent, const QList<QVariant> &)
: LibImportWizard::AbstractImporter(parent)
{
mPath = MailImporter::FilterEvolution::defaultSettingsPath();
}
Evolutionv1ImportData::~Evolutionv1ImportData()
{
}
bool Evolutionv1ImportData::foundMailer() const
{
QDir directory(mPath);
if (directory.exists()) {
return true;
}
return false;
}
QString Evolutionv1ImportData::name() const
{
return QStringLiteral("Evolution 1.x");
}
bool Evolutionv1ImportData::importMails()
{
MailImporter::FilterEvolution evolution;
initializeFilter(evolution);
evolution.filterInfo()->setStatusMessage(i18n("Import in progress"));
const QString mailsPath = mPath;
QDir directory(mailsPath);
if (directory.exists()) {
evolution.importMails(mailsPath);
} else {
evolution.import();
}
evolution.filterInfo()->setStatusMessage(i18n("Import finished"));
return true;
}
LibImportWizard::AbstractImporter::TypeSupportedOptions Evolutionv1ImportData::supportedOption()
{
TypeSupportedOptions options;
options |= LibImportWizard::AbstractImporter::Mails;
return options;
}
#include "evolutionv1importdata.moc"
/*
Copyright (C) 2012-2017 Montel Laurent <montel@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; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef Evolutionv1ImportData_H
#define Evolutionv1ImportData_H
#include <ImportWizard/AbstractImporter>
class Evolutionv1ImportData : public LibImportWizard::AbstractImporter
{
public:
explicit Evolutionv1ImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~Evolutionv1ImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
bool foundMailer() const Q_DECL_OVERRIDE;
bool importMails() Q_DECL_OVERRIDE;
QString name() const Q_DECL_OVERRIDE;
};
#endif /* Evolutionv1ImportData_H */
{
"KPlugin": {
"Id": "evolution1importer",
"Name": "Evolution1 Importer",
"Name[ca@valencia]": "Importador de l'Evolution1",
"Name[ca]": "Importador de l'Evolution1",
"Name[es]": "Importador Evolution1",
"Name[it]": "Importatore da Evolution1",
"Name[nl]": "Evolution1-importeur",
"Name[pt]": "Importador do Evolution1",
"Name[sk]": "Importér Evolution1",
"Name[sv]": "Evolution1-importverktyg",
"Name[uk]": "Засіб імпортування з Evolution1",
"Name[x-test]": "xxEvolution1 Importerxx",
"ServiceTypes": [
"ImportWizard/PluginMailImporter"
],
"Version": "1.0"
}
}
set(evolutionv2importer_SRCS
evolutionv2importdata.cpp
)
kcoreaddons_add_plugin(evolutionv2importerplugin JSON evolutionv2importer.json SOURCES
${evolutionv2importer_SRCS} INSTALL_NAMESPACE importwizard)
target_link_libraries(evolutionv2importerplugin
KPim::ImportWizard
KF5::XmlGui
KF5::I18n
KF5::Contacts
KF5::MailImporterAkonadi
KF5::MailTransport
KF5::MailCommon
KF5::IdentityManagement
KF5::MessageViewer
)
/*
Copyright (C) 2012-2017 Montel Laurent <montel@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; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "evolutionv2importdata.h"
#include "mailimporter/filterevolution_v2.h"
#include "mailimporter/filterinfo.h"
#include <KLocalizedString>
#include <kpluginfactory.h>
#include <QDir>
K_PLUGIN_FACTORY_WITH_JSON(Evolutionv2ImporterFactory, "evolutionv2importer.json", registerPlugin<Evolutionv2ImportData>();
)
Evolutionv2ImportData::Evolutionv2ImportData(QObject *parent, const QList<QVariant> &)
: LibImportWizard::AbstractImporter(parent)
{
mPath = MailImporter::FilterEvolution_v2::defaultSettingsPath();
}
Evolutionv2ImportData::~Evolutionv2ImportData()
{
}
bool Evolutionv2ImportData::foundMailer() const
{
QDir directory(mPath);
if (directory.exists()) {
return true;
}
return false;
}
QString Evolutionv2ImportData::name() const
{
return QStringLiteral("Evolution 2.x");
}
bool Evolutionv2ImportData::importMails()
{
MailImporter::FilterEvolution_v2 evolution;
initializeFilter(evolution);
evolution.filterInfo()->setStatusMessage(i18n("Import in progress"));
const QString mailsPath = mPath;
QDir directory(mailsPath);
if (directory.exists()) {
evolution.importMails(mailsPath);
} else {
evolution.import();
}
evolution.filterInfo()->setStatusMessage(i18n("Import finished"));
return true;
}
LibImportWizard::AbstractImporter::TypeSupportedOptions Evolutionv2ImportData::supportedOption()
{
TypeSupportedOptions options;
options |= LibImportWizard::AbstractImporter::Mails;
return options;
}
#include "evolutionv2importdata.moc"
/*
Copyright (C) 2012-2017 Montel Laurent <montel@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; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef Evolutionv2ImportData_H
#define Evolutionv2ImportData_H
#include <ImportWizard/AbstractImporter>
class Evolutionv2ImportData : public LibImportWizard::AbstractImporter
{
public:
explicit Evolutionv2ImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~Evolutionv2ImportData();
TypeSupportedOptions supportedOption() Q_DECL_OVERRIDE;
bool foundMailer() const Q_DECL_OVERRIDE;
bool importMails() Q_DECL_OVERRIDE;
QString name() const Q_DECL_OVERRIDE;
};
#endif /* Evolutionv2ImportData_H */
{
"KPlugin": {
"Id": "evolution2importer",
"Name": "Evolution2 Importer",
"Name[ca@valencia]": "Importador de l'Evolution2",
"Name[ca]": "Importador de l'Evolution2",
"Name[es]": "Importador Evolution2",
"Name[it]": "Importatore da Evolution2",
"Name[nl]": "Evolution2-importeur",
"Name[pt]": "Importador do Evolution2",
"Name[sk]": "Importér Evolution2",
"Name[sv]": "Evolution2-importverktyg",
"Name[uk]": "Засіб імпортування з Evolution2",
"Name[x-test]": "xxEvolution2 Importerxx",
"ServiceTypes": [
"ImportWizard/PluginMailImporter"
],
"Version": "1.0"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment