Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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

Add nylasmaildata

parent 431e81d6
......@@ -87,7 +87,7 @@ set(LIBKSIEVE_LIB_VERSION_LIB "5.6.80")
set(KMAILTRANSPORT_LIB_VERSION "5.6.80")
set(AKONADICONTACT_LIB_VERSION "5.6.80")
set(IMPORTWIZARD_LIB_VERSION "5.6.80")
set(MAILIMPORTER_LIB_VERSION "5.6.80")
set(MAILIMPORTER_LIB_VERSION "5.6.81")
find_package(KF5CalendarUtils ${CALENDAR_UTILS_VERSION} CONFIG REQUIRED)
......
set(nylasmailimporter_SRCS
nylasmailsettings.cpp
nylasmaildata.cpp
)
ecm_qt_declare_logging_category(nylasmailimporter_SRCS HEADER nylasmailplugin_debug.h IDENTIFIER NYLASMAILPLUGIN_LOG CATEGORY_NAME org.kde.pim.importwizard.nylasmailplugin)
......
/*
Copyright (C) 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 "nylasmaildata.h"
#include "nylasmailsettings.h"
#include "mailimporter/filterinfo.h"
#include "mailimporter/othermailerutil.h"
#include "nylasmailplugin_debug.h"
#include <kpluginfactory.h>
#include <QDir>
K_PLUGIN_FACTORY_WITH_JSON(NylasMailImporterFactory, "nylasmailimporter.json", registerPlugin<NylasMailImportData>();
)
NylasMailImportData::NylasMailImportData(QObject *parent, const QList<QVariant> &)
: LibImportWizard::AbstractImporter(parent)
{
mPath = MailImporter::OtherMailerUtil::nylasMailDefaultPath();
}
NylasMailImportData::~NylasMailImportData()
{
}
bool NylasMailImportData::foundMailer() const
{
QDir directory(mPath);
if (directory.exists()) {
return true;
}
return false;
}
QString NylasMailImportData::name() const
{
return QStringLiteral("NylasMail");
}
bool NylasMailImportData::importMails()
{
return false;
}
bool NylasMailImportData::importSettings()
{
/*
QDir directory(mPath);
const QStringList lstDir = directory.entryList(QDir::AllDirs);
qCDebug(NylasMailPLUGIN_LOG) << "Number of directory " << lstDir.count();
const QString configName = QStringLiteral("NylasMail.ini");
for (int i = 0; i < lstDir.count(); ++i) {
const QString fullPath = lstDir.at(i) + QDir::separator() + configName;
if (QFileInfo::exists(fullPath)) {
NylasMailSettings setting(fullPath);
setting.setAbstractDisplayInfo(mAbstractDisplayInfo);
setting.importSettings();
}
}
*/
return true;
}
bool NylasMailImportData::importAddressBook()
{
return false;
}
LibImportWizard::AbstractImporter::TypeSupportedOptions NylasMailImportData::supportedOption()
{
TypeSupportedOptions options;
//options |=LibImportWizard::AbstractImporter::Mails;
options |= LibImportWizard::AbstractImporter::Settings;
//options |= LibImportWizard::AbstractImporter::AddressBooks;
return options;
}
#include "nylasmaildata.moc"
/*
Copyright (C) 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 NylasMailImportData_H
#define NylasMailImportData_H
#include <ImportWizard/AbstractImporter>
class NylasMailImportData : public LibImportWizard::AbstractImporter
{
public:
explicit NylasMailImportData(QObject *parent, const QList<QVariant> & = QList<QVariant>());
~NylasMailImportData();
TypeSupportedOptions supportedOption() override;
bool foundMailer() const override;
bool importMails() override;
bool importSettings() override;
bool importAddressBook() override;
QString name() const override;
};
#endif /* NylasMailImportData_H */
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