Commit 6f5e3d5b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

run git clang-format

parent b505ffd8
......@@ -5,8 +5,8 @@
*/
#include "gearyimportdata.h"
#include "gearysettings.h"
#include "gearyaddressbook.h"
#include "gearysettings.h"
#include <MailImporter/FilterInfo>
#include <MailImporter/OtherMailerUtil>
......@@ -70,9 +70,9 @@ bool GearyImportData::importAddressBook()
LibImportWizard::AbstractImporter::TypeSupportedOptions GearyImportData::supportedOption()
{
TypeSupportedOptions options;
//options |=LibImportWizard::AbstractImporter::Mails;
// options |=LibImportWizard::AbstractImporter::Mails;
options |= LibImportWizard::AbstractImporter::Settings;
//options |= LibImportWizard::AbstractImporter::AddressBooks;
// options |= LibImportWizard::AbstractImporter::AddressBooks;
return options;
}
......
......@@ -64,7 +64,7 @@ void GearySettings::readImapAccount()
if (!name.isEmpty()) {
const QString agentIdentifyName = LibImportWizard::AbstractBase::createResource(QStringLiteral("akonadi_imap_resource"), name, newSettings);
//Check by default
// Check by default
addCheckMailOnStartup(agentIdentifyName, true);
}
}
......@@ -90,11 +90,11 @@ void GearySettings::readTransport()
}
if (settings->value(QStringLiteral("smtp_use_imap_credentials"), true).toBool()) {
//TODO store value
// TODO store value
}
//ADD more settings
storeTransport(mt, true); //only one smtp for the moment
// ADD more settings
storeTransport(mt, true); // only one smtp for the moment
}
}
......@@ -121,12 +121,12 @@ void GearySettings::readIdentity()
identity->setSignature(signature);
}
//Implement "nickname=bli@kde.org" ?
// Implement "nickname=bli@kde.org" ?
storeIdentity(identity);
}
}
void GearySettings::readGlobalSettings()
{
//TODO
// TODO
}
......@@ -17,6 +17,7 @@ public:
explicit GearySettings(const QString &filename);
~GearySettings() override;
void importSettings();
private:
void readImapAccount();
void readIdentity();
......
......@@ -5,15 +5,14 @@
*/
#include "mailappimportdata.h"
#include <MailImporter/FilterMailApp>
#include <MailImporter/FilterInfo>
#include <MailImporter/FilterMailApp>
#include <KLocalizedString>
#include <KPluginFactory>
#include <QDir>
K_PLUGIN_FACTORY_WITH_JSON(MailAppImporterFactory, "mailappimporter.json", registerPlugin<MailAppImportData>();
)
K_PLUGIN_FACTORY_WITH_JSON(MailAppImporterFactory, "mailappimporter.json", registerPlugin<MailAppImportData>();)
MailAppImportData::MailAppImportData(QObject *parent, const QList<QVariant> &)
: LibImportWizard::AbstractImporter(parent)
......@@ -28,7 +27,7 @@ MailAppImportData::~MailAppImportData()
bool MailAppImportData::foundMailer() const
{
#ifdef Q_OS_MAC
//TODO find a method to search it. Perhaps look at binary.
// TODO find a method to search it. Perhaps look at binary.
QDir directory(mPath);
if (directory.exists()) {
return true;
......
......@@ -71,10 +71,10 @@ bool NylasMailImportData::importAddressBook()
LibImportWizard::AbstractImporter::TypeSupportedOptions NylasMailImportData::supportedOption()
{
TypeSupportedOptions options;
//options |=LibImportWizard::AbstractImporter::Mails;
//Disable it for the moment
//options |= LibImportWizard::AbstractImporter::Settings;
//options |= LibImportWizard::AbstractImporter::AddressBooks;
// options |=LibImportWizard::AbstractImporter::Mails;
// Disable it for the moment
// options |= LibImportWizard::AbstractImporter::Settings;
// options |= LibImportWizard::AbstractImporter::AddressBooks;
return options;
}
......
......@@ -42,5 +42,5 @@ void NylasMailSettings::readIdentity()
void NylasMailSettings::readGlobalSettings()
{
//TODO
// TODO
}
......@@ -15,6 +15,7 @@ public:
explicit NylasMailSettings(const QString &filename);
~NylasMailSettings() override;
void importSettings();
private:
void readImapAccount();
void readIdentity();
......
......@@ -5,16 +5,15 @@
*/
#include "oeimportdata.h"
#include <MailImporter/FilterOE>
#include <MailImporter/FilterInfo>
#include <MailImporter/FilterOE>
#include <KLocalizedString>
#include <KPluginFactory>
#include <QDir>
K_PLUGIN_FACTORY_WITH_JSON(OEImporterFactory, "oeimporter.json", registerPlugin<OeImportData>();
)
K_PLUGIN_FACTORY_WITH_JSON(OEImporterFactory, "oeimporter.json", registerPlugin<OeImportData>();)
OeImportData::OeImportData(QObject *parent, const QList<QVariant> &)
: LibImportWizard::AbstractImporter(parent)
......@@ -29,7 +28,7 @@ OeImportData::~OeImportData()
bool OeImportData::foundMailer() const
{
#ifdef Q_OS_WIN
//TODO find a method to search it. Perhaps look at binary.
// TODO find a method to search it. Perhaps look at binary.
QDir directory(mPath);
if (directory.exists()) {
return true;
......
......@@ -6,10 +6,10 @@
#include "operaaddressbook.h"
#include <KContacts/Addressee>
#include <QUrl>
#include "operaplugin_debug.h"
#include <KContacts/Addressee>
#include <QFile>
#include <QUrl>
OperaAddressBook::OperaAddressBook(const QString &filename)
: mFileName(filename)
......@@ -35,14 +35,14 @@ void OperaAddressBook::importAddressBook()
} else if (line == QLatin1String("#FOLDER")) {
appendContact(contact);
foundContact = false;
//TODO
// TODO
} else if (foundContact) {
line = line.trimmed();
if (!contact) {
contact = new KContacts::Addressee;
}
if (line.startsWith(QLatin1String("ID"))) {
//Nothing
// Nothing
} else if (line.startsWith(QLatin1String("NAME"))) {
contact->setName(line.remove(QStringLiteral("NAME=")));
} else if (line.startsWith(QLatin1String("URL"))) {
......@@ -56,11 +56,11 @@ void OperaAddressBook::importAddressBook()
} else if (line.startsWith(QLatin1String("FAX"))) {
contact->insertPhoneNumber(KContacts::PhoneNumber(line.remove(QStringLiteral("FAX=")), KContacts::PhoneNumber::Fax));
} else if (line.startsWith(QLatin1String("POSTALADDRESS"))) {
//TODO
// TODO
} else if (line.startsWith(QLatin1String("PICTUREURL"))) {
//TODO
// TODO
} else if (line.startsWith(QLatin1String("ICON"))) {
//TODO
// TODO
} else if (line.startsWith(QLatin1String("SHORT NAME"))) {
contact->setNickName(line.remove(QStringLiteral("SHORT NAME=")));
}
......
......@@ -16,6 +16,7 @@ public:
~OperaAddressBook() override;
void importAddressBook();
private:
void appendContact(KContacts::Addressee *contact);
QString mFileName;
......
......@@ -7,8 +7,8 @@
#include "operaimportdata.h"
#include "operaaddressbook.h"
#include "operasettings.h"
#include <MailImporter/FilterOpera>
#include <MailImporter/FilterInfo>
#include <MailImporter/FilterOpera>
#include <KLocalizedString>
#include <KPluginFactory>
......
......@@ -8,8 +8,8 @@
#include "operaplugin_debug.h"
#include <MailImporter/FilterOpera>
#include <MailTransport/TransportManager>
#include <MailCommon/MailUtil>
#include <MailTransport/TransportManager>
#include <KIdentityManagement/kidentitymanagement/identity.h>
#include <KIdentityManagement/kidentitymanagement/signature.h>
......@@ -63,7 +63,7 @@ void OperaSettings::readAccount(const KConfigGroup &grp)
const bool enableManualCheck = (grp.readEntry(QStringLiteral("Manual Check Enabled"), 0) == 1);
//TODO
// TODO
const bool markAsSeen = (grp.readEntry(QStringLiteral("Mark Read If Seen"), 0) == 1);
Q_UNUSED(markAsSeen)
......@@ -89,7 +89,7 @@ void OperaSettings::readAccount(const KConfigGroup &grp)
const QString agentIdentifyName = LibImportWizard::AbstractBase::createResource(QStringLiteral("akonadi_imap_resource"), name, settings);
addToManualCheck(agentIdentifyName, enableManualCheck);
//We have not settings for it => same than manual check
// We have not settings for it => same than manual check
addCheckMailOnStartup(agentIdentifyName, enableManualCheck);
} else if (incomingProtocol == QLatin1String("POP")) {
settings.insert(QStringLiteral("Host"), serverName);
......@@ -108,16 +108,16 @@ void OperaSettings::readAccount(const KConfigGroup &grp)
if (removeMailFromSever == 1) {
int removeDelay = grp.readEntry(QStringLiteral("Remove From Server Delay"), -1);
if (removeDelay != -1) {
//Opera store delay as second !!! :)
// Opera store delay as second !!! :)
removeDelay = removeDelay / (24 * 60 * 60);
settings.insert(QStringLiteral("LeaveOnServerDays"), removeDelay);
}
} //TODO: else
} // TODO: else
if (port != -1) {
settings.insert(QStringLiteral("Port"), port);
}
//TODO:
// TODO:
const int delay = grp.readEntry(QStringLiteral("Initial Poll Delay"), -1);
Q_UNUSED(delay)
......@@ -133,20 +133,20 @@ void OperaSettings::readAccount(const KConfigGroup &grp)
}
switch (authMethod) {
case 0: //NONE
case 0: // NONE
settings.insert(QStringLiteral("AuthenticationMethod"), MailTransport::Transport::EnumAuthenticationType::ANONYMOUS);
break;
case 1: //Clear Text
settings.insert(QStringLiteral("AuthenticationMethod"), MailTransport::Transport::EnumAuthenticationType::CLEAR); //Verify
case 1: // Clear Text
settings.insert(QStringLiteral("AuthenticationMethod"), MailTransport::Transport::EnumAuthenticationType::CLEAR); // Verify
break;
case 6: //APOP
case 6: // APOP
settings.insert(QStringLiteral("AuthenticationMethod"), MailTransport::Transport::EnumAuthenticationType::APOP);
break;
case 10: //CRAM-MD5
case 10: // CRAM-MD5
settings.insert(QStringLiteral("AuthenticationMethod"), MailTransport::Transport::EnumAuthenticationType::CRAM_MD5);
break;
case 31: //Automatic
settings.insert(QStringLiteral("AuthenticationMethod"), MailTransport::Transport::EnumAuthenticationType::APOP); //TODO: verify
case 31: // Automatic
settings.insert(QStringLiteral("AuthenticationMethod"), MailTransport::Transport::EnumAuthenticationType::APOP); // TODO: verify
break;
default:
qCDebug(OPERAPLUGIN_LOG) << " unknown authentication method :" << authMethod;
......@@ -154,7 +154,7 @@ void OperaSettings::readAccount(const KConfigGroup &grp)
}
const QString agentIdentifyName = LibImportWizard::AbstractBase::createResource(QStringLiteral("akonadi_pop3_resource"), name, settings);
//We have not settings for it => same than manual check
// We have not settings for it => same than manual check
addCheckMailOnStartup(agentIdentifyName, enableManualCheck);
addToManualCheck(agentIdentifyName, enableManualCheck);
} else {
......@@ -185,29 +185,29 @@ void OperaSettings::readTransport(const KConfigGroup &grp)
mt->setUserName(userName);
}
const int outgoingTimeOut = grp.readEntry(QStringLiteral("Outgoing Timeout"), -1); //TODO ?
const int outgoingTimeOut = grp.readEntry(QStringLiteral("Outgoing Timeout"), -1); // TODO ?
Q_UNUSED(outgoingTimeOut)
switch (authMethod) {
case 0: //NONE
case 0: // NONE
break;
case 2: //PLAIN
case 2: // PLAIN
mt->setAuthenticationType(MailTransport::Transport::EnumAuthenticationType::PLAIN);
break;
case 5: //LOGIN
case 5: // LOGIN
mt->setAuthenticationType(MailTransport::Transport::EnumAuthenticationType::LOGIN);
break;
case 10: //CRAM-MD5
case 10: // CRAM-MD5
mt->setAuthenticationType(MailTransport::Transport::EnumAuthenticationType::CRAM_MD5);
break;
case 31: //Automatic
mt->setAuthenticationType(MailTransport::Transport::EnumAuthenticationType::PLAIN); //Don't know... Verify
case 31: // Automatic
mt->setAuthenticationType(MailTransport::Transport::EnumAuthenticationType::PLAIN); // Don't know... Verify
break;
default:
qCDebug(OPERAPLUGIN_LOG) << " authMethod unknown :" << authMethod;
}
//We can't specify a default smtp...
// We can't specify a default smtp...
storeTransport(mt, true);
}
}
......@@ -278,5 +278,5 @@ void OperaSettings::readIdentity(const KConfigGroup &grp)
void OperaSettings::readGlobalAccount(const KConfigGroup &grp)
{
Q_UNUSED(grp)
//TODO
// TODO
}
......@@ -18,6 +18,7 @@ public:
~OperaSettings() override;
void importSettings();
private:
void readAccount(const KConfigGroup &grp);
void readTransport(const KConfigGroup &grp);
......
......@@ -6,15 +6,14 @@
#include "pmailimportdata.h"
#include "pmailsettings.h"
#include <MailImporter/FilterPMail>
#include <MailImporter/FilterInfo>
#include <MailImporter/FilterPMail>
#include <KLocalizedString>
#include <KPluginFactory>
#include <QDir>
K_PLUGIN_FACTORY_WITH_JSON(PMailImporterFactory, "pmailimporter.json", registerPlugin<PMailImportData>();
)
K_PLUGIN_FACTORY_WITH_JSON(PMailImporterFactory, "pmailimporter.json", registerPlugin<PMailImportData>();)
PMailImportData::PMailImportData(QObject *parent, const QList<QVariant> &)
: LibImportWizard::AbstractImporter(parent)
{
......@@ -28,7 +27,7 @@ PMailImportData::~PMailImportData()
bool PMailImportData::foundMailer() const
{
#ifdef Q_OS_WIN
//TODO find a method to search it. Perhaps look at binary.
// TODO find a method to search it. Perhaps look at binary.
QDir directory(mPath);
if (directory.exists()) {
return true;
......@@ -59,7 +58,7 @@ bool PMailImportData::importMails()
bool PMailImportData::importSettings()
{
//TODO verify path
// TODO verify path
const QString settingFile(mPath + QLatin1String("pmail.ini"));
PMailSettings settings(settingFile);
settings.setAbstractDisplayInfo(mAbstractDisplayInfo);
......@@ -71,7 +70,7 @@ LibImportWizard::AbstractImporter::TypeSupportedOptions PMailImportData::support
{
TypeSupportedOptions options;
options |= LibImportWizard::AbstractImporter::Mails;
//options |=LibImportWizard::AbstractImporter::Settings;
// options |=LibImportWizard::AbstractImporter::Settings;
return options;
}
......
......@@ -7,8 +7,8 @@
#include "pmailsettings.h"
#include <ImportWizard/ImportWizardUtil>
#include <MailTransport/TransportManager>
#include <MailCommon/MailUtil>
#include <MailTransport/TransportManager>
#include <KIdentityManagement/kidentitymanagement/identity.h>
#include <KIdentityManagement/kidentitymanagement/signature.h>
......@@ -48,7 +48,7 @@ void PMailSettings::readIdentity(const KConfigGroup &group)
QString personalName;
if (group.hasKey(personalNameStr)) {
personalName = group.readEntry(personalNameStr);
personalName.remove(0, 1); //Remove first space
personalName.remove(0, 1); // Remove first space
}
KIdentityManagement::Identity *newIdentity = createIdentity(personalName);
newIdentity->setFullName(personalName);
......@@ -57,13 +57,13 @@ void PMailSettings::readIdentity(const KConfigGroup &group)
const QString emailStr = QStringLiteral("Internet E-mail Address ");
if (group.hasKey(emailStr)) {
QString email = group.readEntry(emailStr);
email.remove(0, 1); //Remove first space
email.remove(0, 1); // Remove first space
newIdentity->setPrimaryEmailAddress(email);
}
const QString replytoStr = QStringLiteral("Default reply-to address ");
if (group.hasKey(replytoStr)) {
QString reply = group.readEntry(replytoStr);
reply.remove(0, 1); //Remove first space
reply.remove(0, 1); // Remove first space
newIdentity->setReplyToAddr(reply);
}
storeIdentity(newIdentity);
......
......@@ -18,6 +18,7 @@ public:
~PMailSettings() override;
void importSettings();
private:
void readIdentity(const KConfigGroup &group);
QString mFileName;
......
......@@ -5,21 +5,20 @@
*/
#include "thebatimportdata.h"
#include <MailImporter/FilterTheBat>
#include <MailImporter/FilterInfo>
#include <MailImporter/FilterTheBat>
#include <KLocalizedString>
#include <KPluginFactory>
#include <QDir>
K_PLUGIN_FACTORY_WITH_JSON(TheBatImporterFactory, "thebatimporter.json", registerPlugin<TheBatImportData>();
)
K_PLUGIN_FACTORY_WITH_JSON(TheBatImporterFactory, "thebatimporter.json", registerPlugin<TheBatImportData>();)
TheBatImportData::TheBatImportData(QObject *parent, const QList<QVariant> &)
: LibImportWizard::AbstractImporter(parent)
{
//TODO fix it
// TODO fix it
mPath = QDir::homePath();
}
......
......@@ -7,25 +7,25 @@
#include "cryptopageplugin.h"
#include <qplugin.h>
#include <QCheckBox>
#include <QGridLayout>
#include <QGroupBox>
#include <QLabel>
#include <QLayout>
#include <QPushButton>
#include <qplugin.h>
#include <kcontacts/addressee.h>
#include <QComboBox>
#include <QHBoxLayout>
#include <KIconLoader>
#include <KLocalizedString>
#include <QComboBox>
#include <QHBoxLayout>
#include <kcontacts/addressee.h>
#include "gpgme++/data.h"
#include "gpgme++/key.h"
#include <Libkleo/KeyRequester>
#include <Libkleo/Enum>
#include <Libkleo/KeyRequester>
CryptoPagePlugin::CryptoPagePlugin()
{
......@@ -42,7 +42,7 @@ CryptoPagePlugin::CryptoPagePlugin()
uint msgFormat = 1;
for (uint i = 0; i < NumberOfProtocols; ++i) {
auto f = static_cast<Kleo::CryptoMessageFormat>(msgFormat);
mProtocolCB[ i ] = new QCheckBox(Kleo::cryptoMessageFormatToLabel(f), protGB);
mProtocolCB[i] = new QCheckBox(Kleo::cryptoMessageFormatToLabel(f), protGB);
protGBLayout->addWidget(mProtocolCB[i]);
// Iterating over a bitfield means *2 every time
......@@ -79,8 +79,7 @@ CryptoPagePlugin::CryptoPagePlugin()
l->setBuddy(mSignPref);
mSignPref->setEditable(false);
for (unsigned int i = Kleo::UnknownSigningPreference; i < Kleo::MaxSigningPreference; ++i) {
mSignPref->addItem(Kleo::signingPreferenceToLabel(
static_cast<Kleo::SigningPreference>(i)));
mSignPref->addItem(Kleo::signingPreferenceToLabel(static_cast<Kleo::SigningPreference>(i)));
}
boxLayout->addWidget(hbox);
......@@ -97,8 +96,7 @@ CryptoPagePlugin::CryptoPagePlugin()
l->setBuddy(mCryptPref);
mCryptPref->setEditable(false);
for (unsigned int i = Kleo::UnknownPreference; i < Kleo::MaxEncryptionPreference; ++i) {
mCryptPref->addItem(Kleo::encryptionPreferenceToLabel(
static_cast<Kleo::EncryptionPreference>(i)));
mCryptPref->addItem(Kleo::encryptionPreferenceToLabel(static_cast<Kleo::EncryptionPreference>(i)));
}
boxLayout->addWidget(hbox);
box->setLayout(boxLayout);
......@@ -115,7 +113,8 @@ QString CryptoPagePlugin::title() const
void CryptoPagePlugin::loadContact(const KContacts::Addressee &contact)
{
const QStringList protocolPrefs = contact.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("CRYPTOPROTOPREF")).split(QLatin1Char(','), Qt::SkipEmptyParts);
const QStringList protocolPrefs =
contact.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("CRYPTOPROTOPREF")).split(QLatin1Char(','), Qt::SkipEmptyParts);
const uint cryptoFormats = Kleo::stringListToCryptoMessageFormats(protocolPrefs);
uint msgFormat = 1;
......@@ -138,7 +137,7 @@ void CryptoPagePlugin::storeContact(KContacts::Addressee &contact) const
uint cryptoFormats = 0;
uint msgFormat = 1;
for (uint i = 0; i < NumberOfProtocols; ++i, msgFormat *= 2) {
if (mProtocolCB[ i ]->isChecked()) {
if (mProtocolCB[i]->isChecked()) {
cryptoFormats |= msgFormat;
}
}
......@@ -159,7 +158,9 @@ void CryptoPagePlugin::storeContact(KContacts::Addressee &contact) const
const auto encryptPref = static_cast<Kleo::EncryptionPreference>(mCryptPref->currentIndex());
if (encryptPref != Kleo::UnknownPreference) {
contact.insertCustom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("CRYPTOENCRYPTPREF"), QLatin1String(Kleo::encryptionPreferenceToString(encryptPref)));
contact.insertCustom(QStringLiteral("KADDRESSBOOK"),
QStringLiteral("CRYPTOENCRYPTPREF"),
QLatin1String(Kleo::encryptionPreferenceToString(encryptPref)));
} else {
contact.removeCustom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("CRYPTOENCRYPTPREF"));
}
......@@ -184,7 +185,7 @@ void CryptoPagePlugin::setReadOnly(bool readOnly)
{
mReadOnly = readOnly;
for (uint i = 0; i < NumberOfProtocols; ++i) {
mProtocolCB[ i ]->setEnabled(!readOnly);
mProtocolCB[i]->setEnabled(!readOnly);
}
mSignPref->setEnabled(!readOnly);
......
......@@ -10,7 +10,8 @@
#include <ContactEditor/ContactEditorPagePlugin>
namespace Kleo {
namespace Kleo
{
class KeyRequester;
}
......@@ -31,9 +32,7 @@ public: