Commit 1374c2d0 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Astyle kdelibs

parent a5cd282c
......@@ -89,11 +89,11 @@ VCardExportSelectionWidget::VCardExportSelectionWidget(QWidget *parent)
mDisplayNameBox->setToolTip(
i18nc("@info:tooltip", "Export display name as full name"));
mDisplayNameBox->setWhatsThis(
i18nc( "@info:whatsthis",
"Check this box if you want to export the contact's display name "
"in the vCard's full name field. This may be required to get the "
"name shown correctly in GMail or Android." ) );
layout->addWidget( mDisplayNameBox, 5, 0, 1, 2 );
i18nc("@info:whatsthis",
"Check this box if you want to export the contact's display name "
"in the vCard's full name field. This may be required to get the "
"name shown correctly in GMail or Android."));
layout->addWidget(mDisplayNameBox, 5, 0, 1, 2);
readSettings();
}
......@@ -105,15 +105,15 @@ VCardExportSelectionWidget::~VCardExportSelectionWidget()
void VCardExportSelectionWidget::readSettings()
{
KConfig config( QStringLiteral("kaddressbookrc") );
const KConfigGroup group( &config, "XXPortVCard" );
mPrivateBox->setChecked( group.readEntry( "ExportPrivateFields", true ) );
mBusinessBox->setChecked( group.readEntry( "ExportBusinessFields", true ) );
mOtherBox->setChecked( group.readEntry( "ExportOtherFields", true ) );
mEncryptionKeys->setChecked( group.readEntry( "ExportEncryptionKeys", true ) );
mPictureBox->setChecked( group.readEntry( "ExportPictureFields", true ) );
mDisplayNameBox->setChecked( group.readEntry( "ExportDisplayName", false ) );
KConfig config(QStringLiteral("kaddressbookrc"));
const KConfigGroup group(&config, "XXPortVCard");
mPrivateBox->setChecked(group.readEntry("ExportPrivateFields", true));
mBusinessBox->setChecked(group.readEntry("ExportBusinessFields", true));
mOtherBox->setChecked(group.readEntry("ExportOtherFields", true));
mEncryptionKeys->setChecked(group.readEntry("ExportEncryptionKeys", true));
mPictureBox->setChecked(group.readEntry("ExportPictureFields", true));
mDisplayNameBox->setChecked(group.readEntry("ExportDisplayName", false));
}
void VCardExportSelectionWidget::writeSettings()
......
......@@ -1492,7 +1492,7 @@ QString KMComposeWin::replyTo() const
}
#if 0
void KMComposeWin::decryptOrStripOffCleartextSignature( QByteArray &body )
void KMComposeWin::decryptOrStripOffCleartextSignature(QByteArray &body)
{
QList<Kpgp::Block> pgpBlocks;
QList<QByteArray> nonPgpBlocks;
......
......@@ -268,8 +268,7 @@ private:
*/
bool isModified() const;
bool isComposerModified() const;
void changeModifiedState( bool modified );
void changeModifiedState(bool modified);
public Q_SLOTS: // kmkernel, callback
void slotSendNow();
......@@ -560,7 +559,7 @@ private:
* This function is for example used to restore the unencrypted/unsigned
* message text for editting.
*/
static void decryptOrStripOffCleartextSignature( QByteArray & );
static void decryptOrStripOffCleartextSignature(QByteArray &);
#endif
/**
* Send the message.
......
......@@ -1260,12 +1260,12 @@ void KMSetTagCommand::setTags()
Akonadi::Item::List itemsToModify;
Q_FOREACH (const Akonadi::Item &i, mItem) {
Akonadi::Item item(i);
if ( mMode == CleanExistingAndAddNew ){
if (mMode == CleanExistingAndAddNew) {
//WorkAround. ClearTags doesn't work.
Q_FOREACH(const Akonadi::Tag &tag, item.tags()) {
Q_FOREACH (const Akonadi::Tag &tag, item.tags()) {
item.clearTag(tag);
}
//item.clearTags();
//item.clearTags();
}
if (mMode == KMSetTagCommand::Toggle) {
......@@ -1277,8 +1277,9 @@ void KMSetTagCommand::setTags()
}
}
} else {
if (!mCreatedTags.isEmpty())
if (!mCreatedTags.isEmpty()) {
item.setTags(mCreatedTags);
}
}
itemsToModify << item;
}
......
......@@ -1925,10 +1925,10 @@ void KMMainWidget::slotSelectMoreMessageTagList()
}
TagSelectDialog dlg(this, selectedMessages.count(), selectedMessages.first());
dlg.setActionCollection(QList<KActionCollection*>() << actionCollection());
dlg.setActionCollection(QList<KActionCollection *>() << actionCollection());
if (dlg.exec()) {
const Akonadi::Tag::List lst = dlg.selectedTag();
KMCommand *command = new KMSetTagCommand( lst, selectedMessages, KMSetTagCommand::CleanExistingAndAddNew );
KMCommand *command = new KMSetTagCommand(lst, selectedMessages, KMSetTagCommand::CleanExistingAndAddNew);
command->start();
}
}
......
......@@ -97,24 +97,24 @@ TagSelectDialog::~TagSelectDialog()
void TagSelectDialog::readConfig()
{
KConfigGroup group( KSharedConfig::openConfig(), "TagSelectDialog" );
const QSize size = group.readEntry( "Size", QSize(500, 300) );
if ( size.isValid() ) {
resize( size );
KConfigGroup group(KSharedConfig::openConfig(), "TagSelectDialog");
const QSize size = group.readEntry("Size", QSize(500, 300));
if (size.isValid()) {
resize(size);
}
}
void TagSelectDialog::writeConfig()
{
KConfigGroup group( KSharedConfig::openConfig(), "TagSelectDialog" );
group.writeEntry( "Size", size() );
KConfigGroup group(KSharedConfig::openConfig(), "TagSelectDialog");
group.writeEntry("Size", size());
}
void TagSelectDialog::slotAddNewTag()
{
QPointer<MailCommon::AddTagDialog> dialog = new MailCommon::AddTagDialog(mActionCollectionList, this);
dialog->setTags(mTagList);
if ( dialog->exec() ) {
if (dialog->exec()) {
mCurrentSelectedTags = selectedTag();
mListTag->clear();
mTagList.clear();
......@@ -160,13 +160,13 @@ void TagSelectDialog::slotTagsFetched(KJob *job)
if (updatelist) {
const bool select = mCurrentSelectedTags.contains(tag->tag());
item->setCheckState( select ? Qt::Checked : Qt::Unchecked );
item->setCheckState(select ? Qt::Checked : Qt::Unchecked);
} else {
if ( mNumberOfSelectedMessages == 1 ) {
const bool hasTag = mSelectedItem.hasTag( tag->tag() );
item->setCheckState( hasTag ? Qt::Checked : Qt::Unchecked );
if (mNumberOfSelectedMessages == 1) {
const bool hasTag = mSelectedItem.hasTag(tag->tag());
item->setCheckState(hasTag ? Qt::Checked : Qt::Unchecked);
} else {
item->setCheckState( Qt::Unchecked );
item->setCheckState(Qt::Unchecked);
}
}
}
......
......@@ -62,7 +62,7 @@ private:
Akonadi::Tag::List mCurrentSelectedTags;
QList<MailCommon::Tag::Ptr> mTagList;
QList<KActionCollection*> mActionCollectionList;
QList<KActionCollection *> mActionCollectionList;
QListWidget *mListTag;
};
......
......@@ -122,7 +122,7 @@ void TestLDAPClient::testIntevation()
// For some reason a fromUtf8 broke the search for me (no results).
// But this certainly looks fishy, it might break on non-utf8 systems.
QString filter = QStringLiteral("&(|(objectclass=person)(objectclass=groupofnames)(mail=*))"
"(|(cn=*Ägypten MDK*)(sn=*Ägypten MDK*))");
"(|(cn=*Ägypten MDK*)(sn=*Ägypten MDK*))");
connect(mClient, &KLDAP::LdapClient::result, this, &TestLDAPClient::slotLDAPResult);
connect(mClient, &KLDAP::LdapClient::done, this, &TestLDAPClient::slotLDAPDone);
......
......@@ -48,5 +48,4 @@ void FilterActionCopyTest::shouldHaveRequiresPart()
QCOMPARE(filter.requiredPart(), MailCommon::SearchRule::Envelope);
}
QTEST_MAIN(FilterActionCopyTest)
......@@ -73,5 +73,4 @@ void FilterActionDeleteTest::shouldDeleteItem()
QCOMPARE(context.deleteItem(), true);
}
QTEST_MAIN(FilterActionDeleteTest)
......@@ -51,7 +51,7 @@ bool FilterActionAddHeader::isEmpty() const
FilterAction::ReturnCode FilterActionAddHeader::process(ItemContext &context , bool) const
{
if ( isEmpty() ) {
if (isEmpty()) {
return ErrorButGoOn;
}
......
......@@ -59,7 +59,7 @@ bool FilterActionAddToAddressBook::isEmpty() const
FilterAction::ReturnCode FilterActionAddToAddressBook::process(ItemContext &context , bool) const
{
if ( isEmpty() ) {
if (isEmpty()) {
return ErrorButGoOn;
}
......@@ -73,8 +73,9 @@ FilterAction::ReturnCode FilterActionAddToAddressBook::process(ItemContext &cont
case BccHeader: headerLine = msg->bcc()->asUnicodeString(); break;
case UnknownHeader: break;
}
if (headerLine.isEmpty())
if (headerLine.isEmpty()) {
return ErrorButGoOn;
}
const QStringList emails = KEmailAddress::splitAddressList(headerLine);
......
......@@ -44,9 +44,9 @@ FilterAction::ReturnCode FilterActionMove::process(ItemContext &context , bool)
return ErrorButGoOn;
}
context.setMoveTargetCollection( targetFolder );
context.setMoveTargetCollection(targetFolder);
} else {
context.setMoveTargetCollection( mFolder );
context.setMoveTargetCollection(mFolder);
}
return GoOn;
}
......
......@@ -83,4 +83,3 @@ QString FilterActionRedirect::informationAboutNotValidAction() const
return i18n("Email address was missing.");
}
......@@ -41,7 +41,7 @@ public:
QStringList sieveRequires() const Q_DECL_OVERRIDE;
QString sieveCode() const Q_DECL_OVERRIDE;
static FilterAction* newAction();
static FilterAction *newAction();
QString informationAboutNotValidAction() const Q_DECL_OVERRIDE;
};
......
......@@ -97,7 +97,7 @@ public:
* @copydoc FilterAction::folderRemoved
*/
bool folderRemoved(const Akonadi::Collection &aFolder,
const Akonadi::Collection &aNewFolder) Q_DECL_OVERRIDE;
const Akonadi::Collection &aNewFolder) Q_DECL_OVERRIDE;
protected:
Akonadi::Collection mFolder;
......
......@@ -33,7 +33,7 @@ InvalidFilterDialog::InvalidFilterDialog(QWidget *parent)
setButtons(Cancel | Ok);
setDefaultButton(Ok);
setModal(true);
setButtonText(Ok, i18n( "Discard" ));
setButtonText(Ok, i18n("Discard"));
QWidget *w = new QWidget(this);
QVBoxLayout *vbox = new QVBoxLayout;
......
......@@ -27,8 +27,8 @@ InvalidFilterWidget::InvalidFilterWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *vbox = new QVBoxLayout(this);
QLabel *lab = new QLabel(i18n( "The following filters are invalid (e.g. containing no actions "
"or no search rules). Discard or edit invalid filters?" ));
QLabel *lab = new QLabel(i18n("The following filters are invalid (e.g. containing no actions "
"or no search rules). Discard or edit invalid filters?"));
lab->setWordWrap(true);
lab->setObjectName(QLatin1String("label"));
vbox->addWidget(lab);
......
......@@ -553,9 +553,10 @@ void MailFilter::purify(bool removeAction)
it.toBack();
while (it.hasPrevious()) {
FilterAction *action = it.previous();
if ( action->isEmpty() ) {
if (removeAction)
mActions.removeAll ( action );
if (action->isEmpty()) {
if (removeAction) {
mActions.removeAll(action);
}
}
}
......
......@@ -32,53 +32,53 @@ SearchPatternTest::~SearchPatternTest()
void SearchPatternTest::shouldRuleRequirePart_data()
{
QTest::addColumn<QByteArray>( "field" );
QTest::addColumn<MailCommon::SearchRule::RequiredPart>( "part" );
QTest::addColumn<QByteArray>("field");
QTest::addColumn<MailCommon::SearchRule::RequiredPart>("part");
// SearchRuleStatus
QTest::newRow( "status" ) << QByteArray( "<status>" ) << MailCommon::SearchRule::Envelope;
QTest::newRow("status") << QByteArray("<status>") << MailCommon::SearchRule::Envelope;
// SearchRuleNumerical
QTest::newRow( "numerical" ) << QByteArray( "<size>" ) << MailCommon::SearchRule::Envelope;
QTest::newRow("numerical") << QByteArray("<size>") << MailCommon::SearchRule::Envelope;
// SearchRuleDate
QTest::newRow( "date" ) << QByteArray( "<date>" ) << MailCommon::SearchRule::Envelope;
QTest::newRow("date") << QByteArray("<date>") << MailCommon::SearchRule::Envelope;
// SearchRuleString
QTest::newRow( "recipients" ) << QByteArray( "<recipients>" ) << MailCommon::SearchRule::Envelope;
QTest::newRow( "tag" ) << QByteArray( "<tag>" ) << MailCommon::SearchRule::Envelope;
QTest::newRow( "subject" ) << QByteArray( "subject" ) << MailCommon::SearchRule::Envelope;
QTest::newRow( "from" ) << QByteArray( "from" ) << MailCommon::SearchRule::Envelope;
QTest::newRow( "sender" ) << QByteArray( "sender" ) << MailCommon::SearchRule::Envelope;
QTest::newRow( "reply-to" ) << QByteArray( "reply-to" ) << MailCommon::SearchRule::Envelope;
QTest::newRow( "to" ) << QByteArray( "to" ) << MailCommon::SearchRule::Envelope;
QTest::newRow( "cc" ) << QByteArray( "cc" ) << MailCommon::SearchRule::Envelope;
QTest::newRow( "bcc" ) << QByteArray( "bcc" ) << MailCommon::SearchRule::Envelope;
QTest::newRow( "in-reply-to" ) << QByteArray( "in-reply-to" ) << MailCommon::SearchRule::Envelope;
QTest::newRow( "message-id" ) << QByteArray( "message-id" ) << MailCommon::SearchRule::Envelope;
QTest::newRow( "references" ) << QByteArray( "references" ) << MailCommon::SearchRule::Envelope;
QTest::newRow( "any header" ) << QByteArray( "<any header>" ) << MailCommon::SearchRule::Header;
QTest::newRow( "custom header" ) << QByteArray( "X-DummyHeaderName" ) << MailCommon::SearchRule::Header;
QTest::newRow( "Organization" ) << QByteArray( "Organization" ) << MailCommon::SearchRule::Header;
QTest::newRow( "List-Id" ) << QByteArray( "List-Id" ) << MailCommon::SearchRule::Header;
QTest::newRow( "Resent-From" ) << QByteArray( "Resent-From" ) << MailCommon::SearchRule::Header;
QTest::newRow( "X-Loop" ) << QByteArray( "X-Loop" ) << MailCommon::SearchRule::Header;
QTest::newRow( "X-Mailing-List" ) << QByteArray( "X-Mailing-List" ) << MailCommon::SearchRule::Header;
QTest::newRow( "X-Spam-Flag" ) << QByteArray( "X-Spam-Flag" ) << MailCommon::SearchRule::Header;
QTest::newRow( "<message>" ) << QByteArray( "<message>" ) << MailCommon::SearchRule::CompleteMessage;
QTest::newRow( "<body>" ) << QByteArray( "<body>" ) << MailCommon::SearchRule::CompleteMessage;
QTest::newRow("recipients") << QByteArray("<recipients>") << MailCommon::SearchRule::Envelope;
QTest::newRow("tag") << QByteArray("<tag>") << MailCommon::SearchRule::Envelope;
QTest::newRow("subject") << QByteArray("subject") << MailCommon::SearchRule::Envelope;
QTest::newRow("from") << QByteArray("from") << MailCommon::SearchRule::Envelope;
QTest::newRow("sender") << QByteArray("sender") << MailCommon::SearchRule::Envelope;
QTest::newRow("reply-to") << QByteArray("reply-to") << MailCommon::SearchRule::Envelope;
QTest::newRow("to") << QByteArray("to") << MailCommon::SearchRule::Envelope;
QTest::newRow("cc") << QByteArray("cc") << MailCommon::SearchRule::Envelope;
QTest::newRow("bcc") << QByteArray("bcc") << MailCommon::SearchRule::Envelope;
QTest::newRow("in-reply-to") << QByteArray("in-reply-to") << MailCommon::SearchRule::Envelope;
QTest::newRow("message-id") << QByteArray("message-id") << MailCommon::SearchRule::Envelope;
QTest::newRow("references") << QByteArray("references") << MailCommon::SearchRule::Envelope;
QTest::newRow("any header") << QByteArray("<any header>") << MailCommon::SearchRule::Header;
QTest::newRow("custom header") << QByteArray("X-DummyHeaderName") << MailCommon::SearchRule::Header;
QTest::newRow("Organization") << QByteArray("Organization") << MailCommon::SearchRule::Header;
QTest::newRow("List-Id") << QByteArray("List-Id") << MailCommon::SearchRule::Header;
QTest::newRow("Resent-From") << QByteArray("Resent-From") << MailCommon::SearchRule::Header;
QTest::newRow("X-Loop") << QByteArray("X-Loop") << MailCommon::SearchRule::Header;
QTest::newRow("X-Mailing-List") << QByteArray("X-Mailing-List") << MailCommon::SearchRule::Header;
QTest::newRow("X-Spam-Flag") << QByteArray("X-Spam-Flag") << MailCommon::SearchRule::Header;
QTest::newRow("<message>") << QByteArray("<message>") << MailCommon::SearchRule::CompleteMessage;
QTest::newRow("<body>") << QByteArray("<body>") << MailCommon::SearchRule::CompleteMessage;
}
void SearchPatternTest::shouldRuleRequirePart()
{
QFETCH( QByteArray, field );
QFETCH( MailCommon::SearchRule::RequiredPart, part );
QFETCH(QByteArray, field);
QFETCH(MailCommon::SearchRule::RequiredPart, part);
const MailCommon::SearchRule::Ptr rule = MailCommon::SearchRule::createInstance( field, MailCommon::SearchRule::FuncNone, QString() );
const MailCommon::SearchRule::Ptr rule = MailCommon::SearchRule::createInstance(field, MailCommon::SearchRule::FuncNone, QString());
QCOMPARE( rule->requiredPart(), part );
QCOMPARE(rule->requiredPart(), part);
}
QTEST_MAIN(SearchPatternTest)
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