Commit 4627bed7 authored by Nicolás Alvarez's avatar Nicolás Alvarez

Initial import from the monolithic kdepim.

This is the beginning of revision history for this module. If you
want to look at revision history older than this, please refer to the
techbase wiki for how to use Git history grafting. At the time of
writing, this wiki is located here:

http://community.kde.org/Frameworks/GitOldHistory

If you have already performed the grafting and you don't see any
history beyond this commit, try running "git log" with the "--follow"
argument.

Branched from the monolithic repo, kdepim master branch, at commit
d0009536f24e8c7f4cc32a70936f5c25194e9a6f
parents
cmake_minimum_required(VERSION 2.8.12)
project(MailImporter)
if(${CMAKE_SOURCE_DIR} STREQUAL ${MailImporter_SOURCE_DIR})
# ECM setup
find_package(ECM 5.16.0 CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
set(LIBRARY_NAMELINK)
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
set(KF5_VERSION "5.16.0")
set(KDEPIMLIBS_LIB_VERSION "5.1.42")
set(KDEPIM_LIB_VERSION "5.1.42")
set(QT_REQUIRED_VERSION "5.4.0")
set(KMIME_LIB_VERSION "4.87.0")
find_package(KF5Akonadi ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test UiTools Xml)
find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Archive ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Libkdepim ${KDEPIM_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiContact ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX MAILIMPORTER
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/mailimporter_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterConfigVersion.cmake"
SOVERSION 5
)
########### Targets ###########
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
remove_definitions( -DQT_NO_CAST_FROM_BYTEARRAY )
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5MailImporter")
ecm_configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/KF5MailImporterConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterConfig.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
install(EXPORT KF5MailImporterTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5MailImporterTargets.cmake NAMESPACE KF5::)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/mailimporter_version.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
else()
ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX MAILIMPORTER
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/mailimporter_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterConfigVersion.cmake"
SOVERSION 5
)
endif()
add_definitions(-DTRANSLATION_DOMAIN=\"libmailimporter\")
add_subdirectory(src)
if (BUILD_TESTING)
add_subdirectory(autotests)
endif()
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/KF5MailImporterTargets.cmake")
macro(add_mailimporter_unittest _source)
ecm_add_test(${_source}
NAME_PREFIX "mailimporter-"
LINK_LIBRARIES KF5::MailImporter KF5::AkonadiCore Qt5::Test Qt5::Core Qt5::Gui
)
endmacro ()
add_mailimporter_unittest(filterthunderbirdtest.cpp)
add_mailimporter_unittest(filtericedovetest.cpp)
add_mailimporter_unittest(filterclawsmailtest.cpp)
add_mailimporter_unittest(filtersylpheedtest.cpp)
/*
Copyright (c) 2015 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, version 2, 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 "filterclawsmailtest.h"
#include <qtest.h>
FilterClawsMailTest::FilterClawsMailTest(QObject *parent)
: QObject(parent)
{
}
FilterClawsMailTest::~FilterClawsMailTest()
{
}
QTEST_MAIN(FilterClawsMailTest)
/*
Copyright (c) 2015 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, version 2, 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 FILTERCLAWSMAILTEST_H
#define FILTERCLAWSMAILTEST_H
#include <QObject>
class FilterClawsMailTest : public QObject
{
Q_OBJECT
public:
explicit FilterClawsMailTest(QObject *parent = Q_NULLPTR);
~FilterClawsMailTest();
};
#endif // FILTERCLAWSMAILTEST_H
/*
Copyright (c) 2015 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, version 2, 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 "filtericedovetest.h"
#include "mailimporter/filtericedove.h"
#include <qtest.h>
class FilterIcecoveAbstract : public MailImporter::FilterIcedove
{
public:
FilterIcecoveAbstract()
{
}
QString settingsPath()
{
return MailImporter::FilterIcedove::settingsPath();
}
};
FilterIcedoveTest::FilterIcedoveTest(QObject *parent)
: QObject(parent)
{
}
FilterIcedoveTest::~FilterIcedoveTest()
{
}
void FilterIcedoveTest::shouldHaveDefaultSettingsPath()
{
FilterIcecoveAbstract filter;
QCOMPARE(filter.settingsPath(), MailImporter::FilterIcedove::defaultSettingsPath());
}
QTEST_MAIN(FilterIcedoveTest)
/*
Copyright (c) 2015 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, version 2, 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 FILTERICEDOVETEST_H
#define FILTERICEDOVETEST_H
#include <QObject>
class FilterIcedoveTest : public QObject
{
Q_OBJECT
public:
explicit FilterIcedoveTest(QObject *parent = Q_NULLPTR);
~FilterIcedoveTest();
private Q_SLOTS:
void shouldHaveDefaultSettingsPath();
};
#endif // FILTERICEDOVETEST_H
/*
Copyright (c) 2015 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, version 2, 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 "filtersylpheedtest.h"
#include <qtest.h>
FilterSylpheedTest::FilterSylpheedTest(QObject *parent)
: QObject(parent)
{
}
FilterSylpheedTest::~FilterSylpheedTest()
{
}
QTEST_MAIN(FilterSylpheedTest)
/*
Copyright (c) 2015 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, version 2, 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 FILTERSYLPHEEDTEST_H
#define FILTERSYLPHEEDTEST_H
#include <QObject>
class FilterSylpheedTest : public QObject
{
Q_OBJECT
public:
explicit FilterSylpheedTest(QObject *parent = Q_NULLPTR);
~FilterSylpheedTest();
};
#endif // FILTERSYLPHEEDTEST_H
/*
Copyright (c) 2015 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, version 2, 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 "filterthunderbirdtest.h"
#include "mailimporter/filterthunderbird.h"
#include <qtest.h>
class FilterThunderBirdAbstract : public MailImporter::FilterThunderbird
{
public:
FilterThunderBirdAbstract()
{
}
QString settingsPath()
{
return MailImporter::FilterThunderbird::settingsPath();
}
};
FilterThunderBirdTest::FilterThunderBirdTest(QObject *parent)
: QObject(parent)
{
}
FilterThunderBirdTest::~FilterThunderBirdTest()
{
}
void FilterThunderBirdTest::shouldHaveDefaultSettingsPath()
{
FilterThunderBirdAbstract filter;
QCOMPARE(filter.settingsPath(), MailImporter::FilterThunderbird::defaultSettingsPath());
}
QTEST_MAIN(FilterThunderBirdTest)
/*
Copyright (c) 2015 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, version 2, 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 FILTERTHUNDERBIRDTEST_H
#define FILTERTHUNDERBIRDTEST_H
#include <QObject>
class FilterThunderBirdTest : public QObject
{
Q_OBJECT
public:
explicit FilterThunderBirdTest(QObject *parent = Q_NULLPTR);
~FilterThunderBirdTest();
private Q_SLOTS:
void shouldHaveDefaultSettingsPath();
};
#endif // FILTERTHUNDERBIRDTEST_H
This diff is collapsed.
These files came from mbx2mbox by David Coppit (david@coppit.org, http://coppit.org/)
set(libmailimporter_SRCS
importmailswidget.cpp
filterinfogui.cpp
filterinfo.cpp
filters.cpp
filteroe.cpp
filterpmail.cpp
filterplain.cpp
filtermbox.cpp
filterevolution.cpp
filtermailapp.cpp
filterevolution_v2.cpp
filterevolution_v3.cpp
filteropera.cpp
filterthunderbird.cpp
filterkmail_maildir.cpp
filtersylpheed.cpp
filterclawsmail.cpp
filterthebat.cpp
filterlnotes.cpp
filterkmailarchive.cpp
filtermailmangzip.cpp
filtericedove.cpp
filterbalsa.cpp
selectthunderbirdprofilewidget.cpp
othermailerutil.cpp
)
ki18n_wrap_ui(libmailimporter_SRCS ui/importmailswidget.ui ui/selectthunderbirdprofilewidget.ui)
ecm_qt_declare_logging_category(libmailimporter_SRCS HEADER mailimporter_debug.h IDENTIFIER MAILIMPORTER_LOG CATEGORY_NAME log_mailimporter)
add_library(KF5MailImporter ${libmailimporter_SRCS})
generate_export_header( KF5MailImporter BASE_NAME mailimporter)
add_library(KF5::MailImporter ALIAS KF5MailImporter)
target_include_directories(KF5MailImporter INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/MailImporter/;${KDE_INSTALL_INCLUDEDIR_KF5}/mailimporter>")
target_include_directories(KF5MailImporter PUBLIC "$<BUILD_INTERFACE:${MailImporter_SOURCE_DIR}/src;${MailImporter_BINARY_DIR}/src;>")
target_link_libraries(KF5MailImporter
PUBLIC
KF5::Mime
PRIVATE
KF5::AkonadiCore
KF5::AkonadiMime
KF5::Libkdepim
KF5::Archive
KF5::I18n
KF5::ConfigCore
Qt5::Xml
Qt5::Widgets
)
set_target_properties(KF5MailImporter PROPERTIES
VERSION ${MAILIMPORTER_VERSION_STRING}
SOVERSION ${MAILIMPORTER_SOVERSION}
EXPORT_NAME MailImporter
)
install(TARGETS
KF5MailImporter
EXPORT KF5MailImporterTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS} ${LIBRARY_NAMELINK}
)
ecm_generate_headers(MailImporter_CamelCase_HEADERS
HEADER_NAMES
FilterClawsMail
FilterBalsa
FilterSylpheed
FilterTheBat
FilterEvolution
FilterInfoGui
FilterThunderbird
FilterEvolution_v2
FilterEvolution_v3
FilterMailApp
FilterMailmanGzip
FilterPlain
FilterPMail
FilterMBox
FilterOpera
FilterLNotes
FilterOE
FilterKMail_maildir
FilterKMailArchive
FilterIcedove
OtherMailerUtil
ImportMailsWidget
MailImporter_Utils
Filters
FilterInfo
REQUIRED_HEADERS MailImporter_HEADERS
PREFIX MailImporter
)
ecm_generate_pri_file(BASE_NAME MailImporter
LIB_NAME KF5MailImpoter
DEPS "Mime" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/MailImporter
)
if(${CMAKE_SOURCE_DIR} STREQUAL ${MailImporter_SOURCE_DIR})
install(FILES
${MailImporter_CamelCase_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/MailImporter
COMPONENT Devel
)
install(FILES
${MailImporter_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/mailimporter_export.h
${MailImporter_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/mailimporter
COMPONENT Devel
)
install(FILES
${PRI_FILENAME}
DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
endif()
#! /bin/sh
$EXTRACTRC `find . -name '*.ui'` >> rc.cpp || exit 11
$XGETTEXT *.cpp -o $podir/libmailimporter.pot
rm -f rc.cpp
/*
Copyright (c) 2012-2015 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, version 2, 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 "filterbalsa.h"
#include <KLocalizedString>
#include <qfiledialog.h>
#include <QPointer>
using namespace MailImporter;
class MailImporter::FilterBalsaPrivate
{
public:
FilterBalsaPrivate()
: mImportDirDone(0),
mTotalDir(0)
{
}
int mImportDirDone;
int mTotalDir;
};
/** Default constructor. */
FilterBalsa::FilterBalsa()
: Filter(i18n("Import Balsa Local Mails and Folder Structure"),
QStringLiteral("Laurent Montel"),
i18n("<p><b>Balsa import filter</b></p>"
"<p>Select the base directory of your local Balsa mailfolder (usually ~/mail/).</p>"
"<p>Since it is possible to recreate the folder structure, the folders "
"will be stored under: \"Balsa-Import\".</p>")),
d(new MailImporter::FilterBalsaPrivate)
{
}
/** Destructor. */
FilterBalsa::~FilterBalsa()
{
delete d;
}