Commit 5856497d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Merge remote-tracking branch 'origin/Applications/17.04'

parents c069e8ab 008f7164
......@@ -79,7 +79,7 @@ void AbstractImporter::initializeFilter(MailImporter::Filter &filter)
bool AbstractImporter::addFilters(const QString &filterPath, MailCommon::FilterImporterExporter::FilterType type)
{
if (QFile(filterPath).exists()) {
if (QFileInfo::exists(filterPath)) {
bool canceled = false;
MailCommon::FilterImporterExporter importer(mImportWizard);
QList<MailCommon::MailFilter *> listFilter = importer.importFilters(canceled, type, filterPath);
......
......@@ -81,7 +81,7 @@ bool ClawsMailImportData::importAddressBook()
bool ClawsMailImportData::importSettings()
{
const QString accountFile = mPath + QLatin1String("accountrc");
if (QFile(accountFile).exists()) {
if (QFileInfo::exists(accountFile)) {
ClawsMailSettings account(mImportWizard);
account.importSettings(accountFile, mPath);
} else {
......
......@@ -29,7 +29,7 @@
#include "importwizard_debug.h"
#include <KConfig>
#include <KConfigGroup>
#include <QFile>
#include <QFileInfo>
#include <QRegularExpression>
......@@ -48,7 +48,7 @@ void ClawsMailSettings::importSettings(const QString &filename, const QString &p
bool checkMailOnStartup = true;
int intervalCheckMail = -1;
const QString clawsmailrc = path + QLatin1String("/clawsrc");
if (QFile(clawsmailrc).exists()) {
if (QFileInfo::exists(clawsmailrc)) {
KConfig configCommon(clawsmailrc);
if (configCommon.hasGroup("Common")) {
KConfigGroup common = configCommon.group("Common");
......
......@@ -59,11 +59,11 @@ QString Evolutionv3ImportData::name() const
bool Evolutionv3ImportData::importSettings()
{
const QString accountFile = QDir::homePath() + QLatin1String("/.gconf/apps/evolution/mail/%gconf.xml");
if (QFile(accountFile).exists()) {
if (QFileInfo::exists(accountFile)) {
EvolutionSettings account(mImportWizard);
account.loadAccount(accountFile);
const QString ldapFile = QDir::homePath() + QLatin1String("/.gconf/apps/evolution/addressbook/%gconf.xml");
if (QFile(ldapFile).exists()) {
if (QFileInfo::exists(ldapFile)) {
account.loadLdap(ldapFile);
}
} else {
......@@ -104,7 +104,7 @@ bool Evolutionv3ImportData::importAddressBook()
bool Evolutionv3ImportData::importCalendar()
{
const QString calendarFile = QDir::homePath() + QLatin1String("/.gconf/apps/evolution/calendar/%gconf.xml");
if (QFile(calendarFile).exists()) {
if (QFileInfo::exists(calendarFile)) {
EvolutionCalendar calendar(mImportWizard);
calendar.loadCalendar(calendarFile);
} else {
......
......@@ -75,7 +75,7 @@ QString IcedoveImportData::name() const
bool IcedoveImportData::importSettings()
{
const QString accountFile = mPath + defaultProfile() + QLatin1String("/prefs.js");
if (QFile(accountFile).exists()) {
if (QFileInfo::exists(accountFile)) {
ThunderbirdSettings account(accountFile, mImportWizard);
account.importSettings();
} else {
......@@ -118,7 +118,7 @@ bool IcedoveImportData::importFilters()
bool foundFilterFile = false;
for (const QString &file : subDirMail) {
const QString filterFile(subMailPath + QLatin1Char('/') + file + QLatin1String("/msgFilterRules.dat"));
if (QFile(filterFile).exists()) {
if (QFileInfo::exists(filterFile)) {
foundFilterFile = true;
const bool added = addFilters(filterFile, MailCommon::FilterImporterExporter::ThunderBirdFilter);
if (!filtersAdded && added) {
......
......@@ -40,7 +40,7 @@ OperaSettings::OperaSettings(const QString &filename, ImportWizard *parent)
void OperaSettings::importSettings()
{
if (QFile(mFileName).exists()) {
if (QFileInfo::exists(mFileName)) {
KConfig config(mFileName);
KConfigGroup grp = config.group(QStringLiteral("Accounts"));
readGlobalAccount(grp);
......
......@@ -29,6 +29,7 @@
#include <KConfig>
#include <KConfigGroup>
#include <QFile>
#include <QFileInfo>
#include <QRegularExpression>
PMailSettings::PMailSettings(const QString &filename, ImportWizard *parent)
......@@ -40,7 +41,7 @@ PMailSettings::PMailSettings(const QString &filename, ImportWizard *parent)
void PMailSettings::importSettings()
{
if (QFile(mFileName).exists()) {
if (QFileInfo::exists(mFileName)) {
KConfig config(mFileName);
const QStringList accountList = config.groupList().filter(QRegularExpression(QStringLiteral("WinPMail Identity - *")));
......
......@@ -57,7 +57,7 @@ QString SylpheedImportData::name() const
bool SylpheedImportData::importSettings()
{
const QString accountFile = mPath + QLatin1String("/accountrc");
if (QFile(accountFile).exists()) {
if (QFileInfo::exists(accountFile)) {
SylpheedSettings account(mImportWizard);
account.importSettings(accountFile, mPath);
} else {
......
......@@ -21,6 +21,7 @@
#include "sylpheedsettingsutils.h"
#include <mailtransport/transportmanager.h>
#include "MailCommon/MailUtil"
#include <QFileInfo>
#include <KIdentityManagement/kidentitymanagement/identity.h>
#include <KIdentityManagement/kidentitymanagement/signature.h>
......@@ -47,7 +48,7 @@ void SylpheedSettings::importSettings(const QString &filename, const QString &pa
bool checkMailOnStartup = true;
int intervalCheckMail = -1;
const QString sylpheedrc = path + QLatin1String("/sylpheedrc");
if (QFile(sylpheedrc).exists()) {
if (QFileInfo::exists(sylpheedrc)) {
KConfig configCommon(sylpheedrc);
if (configCommon.hasGroup("Common")) {
KConfigGroup common = configCommon.group("Common");
......
......@@ -74,7 +74,7 @@ QString ThunderbirdImportData::name() const
bool ThunderbirdImportData::importSettings()
{
const QString accountFile = mPath + defaultProfile() + QLatin1String("/prefs.js");
if (QFile(accountFile).exists()) {
if (QFileInfo::exists(accountFile)) {
ThunderbirdSettings account(accountFile, mImportWizard);
account.importSettings();
} else {
......@@ -117,7 +117,7 @@ bool ThunderbirdImportData::importFilters()
bool foundFilterFile = false;
for (const QString &file : subDirMail) {
const QString filterFile(subMailPath + QLatin1Char('/') + file + QLatin1String("/msgFilterRules.dat"));
if (QFile(filterFile).exists()) {
if (QFileInfo::exists(filterFile)) {
foundFilterFile = true;
const bool added = addFilters(filterFile, MailCommon::FilterImporterExporter::ThunderBirdFilter);
if (!filtersAdded && added) {
......
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