Commit 7ff19f9e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Astyle kdelibs

parent 01108226
......@@ -79,8 +79,8 @@ void SearchPotentialDuplicateContactJobTest::shouldReturnListWhenThreeItemsAreDu
Akonadi::Item itemA;
KContacts::Addressee address;
address.setName(QLatin1String("foo1"));
itemA.setPayload<KContacts::Addressee>( address );
itemA.setMimeType( KContacts::Addressee::mimeType() );
itemA.setPayload<KContacts::Addressee>(address);
itemA.setMimeType(KContacts::Addressee::mimeType());
lst << itemA << itemA << itemA;
......@@ -98,15 +98,15 @@ void SearchPotentialDuplicateContactJobTest::shouldReturnTwoList()
Akonadi::Item item;
KContacts::Addressee addressA;
addressA.setName(QLatin1String("foo1"));
item.setPayload<KContacts::Addressee>( addressA );
item.setMimeType( KContacts::Addressee::mimeType() );
item.setPayload<KContacts::Addressee>(addressA);
item.setMimeType(KContacts::Addressee::mimeType());
lst << item << item << item;
KContacts::Addressee addressB;
addressB.setName(QLatin1String("foo2"));
item.setPayload<KContacts::Addressee>( addressB );
item.setMimeType( KContacts::Addressee::mimeType() );
item.setPayload<KContacts::Addressee>(addressB);
item.setMimeType(KContacts::Addressee::mimeType());
lst << item << item << item;
......@@ -126,15 +126,15 @@ void SearchPotentialDuplicateContactJobTest::shouldReturnList_data()
Akonadi::Item itemA;
KContacts::Addressee addressA;
addressA.setName(QLatin1String("foo1"));
itemA.setPayload<KContacts::Addressee>( addressA );
itemA.setMimeType( KContacts::Addressee::mimeType() );
itemA.setPayload<KContacts::Addressee>(addressA);
itemA.setMimeType(KContacts::Addressee::mimeType());
Akonadi::Item itemB;
KContacts::Addressee addressB;
addressB.setName(QLatin1String("foo2"));
itemB.setPayload<KContacts::Addressee>( addressB );
itemB.setMimeType( KContacts::Addressee::mimeType() );
itemB.setPayload<KContacts::Addressee>(addressB);
itemB.setMimeType(KContacts::Addressee::mimeType());
Akonadi::Item::List lst;
lst << itemA;
......@@ -160,23 +160,23 @@ void SearchPotentialDuplicateContactJobTest::shouldReturnList_data()
KContacts::Addressee addressC;
addressC.setName(QLatin1String("foo3"));
itemC.setPayload<KContacts::Addressee>( addressC );
itemC.setMimeType( KContacts::Addressee::mimeType() );
itemC.setPayload<KContacts::Addressee>(addressC);
itemC.setMimeType(KContacts::Addressee::mimeType());
lst.clear();
lst << itemB << itemC <<itemA << itemA << itemB << itemC;
lst << itemB << itemC << itemA << itemA << itemB << itemC;
QTest::newRow("threeDuplicate") << lst << 3;
lst.clear();
lst << itemB << itemC <<itemA;
lst << itemB << itemC << itemA;
QTest::newRow("threeDifferent") << lst << 0;
}
void SearchPotentialDuplicateContactJobTest::shouldReturnList()
{
QFETCH( Akonadi::Item::List, listItem );
QFETCH( int, numberOfList );
QFETCH(Akonadi::Item::List, listItem);
QFETCH(int, numberOfList);
SearchPotentialDuplicateContactJob job(listItem);
QSignalSpy spy(&job, SIGNAL(finished(QList<Akonadi::Item::List>)));
......
......@@ -48,7 +48,7 @@ ContactSelectionDialog::ContactSelectionDialog(QItemSelectionModel *selectionMod
QVBoxLayout *layout = new QVBoxLayout;
mainWidget->setLayout(layout);
mSelectionWidget = new ContactSelectionWidget( selectionModel, this );
mSelectionWidget = new ContactSelectionWidget(selectionModel, this);
if (allowToSelectTypeToExport) {
layout->addWidget(mSelectionWidget);
mVCardExport = new VCardExportSelectionWidget;
......
......@@ -47,7 +47,7 @@ public:
* @param selectionModel The model that contains the currently selected contacts.
* @param parent The parent widget.
*/
explicit ContactSelectionDialog(QItemSelectionModel *selectionModel, bool allowToSelectTypeToExport, QWidget *parent = 0 );
explicit ContactSelectionDialog(QItemSelectionModel *selectionModel, bool allowToSelectTypeToExport, QWidget *parent = 0);
/**
* Sets the @p message text.
......
......@@ -39,7 +39,7 @@ CsvXXPort::CsvXXPort(QWidget *parent)
{
}
bool CsvXXPort::exportContacts(const KContacts::Addressee::List &contacts , VCardExportSelectionWidget::ExportFields ) const
bool CsvXXPort::exportContacts(const KContacts::Addressee::List &contacts , VCardExportSelectionWidget::ExportFields) const
{
QUrl url = KFileDialog::getSaveUrl(QUrl(QLatin1String("addressbook.csv")));
if (url.isEmpty()) {
......
......@@ -30,7 +30,7 @@ public:
explicit CsvXXPort(QWidget *parent = Q_NULLPTR);
KContacts::Addressee::List importContacts() const;
bool exportContacts( const KContacts::Addressee::List &contacts, VCardExportSelectionWidget::ExportFields ) const;
bool exportContacts(const KContacts::Addressee::List &contacts, VCardExportSelectionWidget::ExportFields) const;
private:
void exportToFile(QFile *, const KContacts::Addressee::List &) const;
......
......@@ -341,7 +341,7 @@ KContacts::Addressee::List GMXXXPort::importContacts() const
/* export */
bool GMXXXPort::exportContacts( const KContacts::AddresseeList &list, VCardExportSelectionWidget::ExportFields ) const
bool GMXXXPort::exportContacts(const KContacts::AddresseeList &list, VCardExportSelectionWidget::ExportFields) const
{
QUrl url = KFileDialog::getSaveUrl(QUrl::fromLocalFile(QDir::homePath() + QLatin1String("/addressbook.gmx")), GMX_FILESELECTION_STRING);
if (url.isEmpty()) {
......
......@@ -49,7 +49,7 @@ KContacts::Addressee::List LDAPXXPort::importContacts() const
return contacts;
}
bool LDAPXXPort::exportContacts( const KContacts::Addressee::List &, VCardExportSelectionWidget::ExportFields ) const
bool LDAPXXPort::exportContacts(const KContacts::Addressee::List &, VCardExportSelectionWidget::ExportFields) const
{
return false;
}
......@@ -91,7 +91,7 @@ KContacts::Addressee::List LDIFXXPort::importContacts() const
return contacts;
}
bool LDIFXXPort::exportContacts( const KContacts::Addressee::List &list, VCardExportSelectionWidget::ExportFields ) const
bool LDIFXXPort::exportContacts(const KContacts::Addressee::List &list, VCardExportSelectionWidget::ExportFields) const
{
const QUrl url =
QFileDialog::getSaveFileUrl(parentWidget(), QString(), QUrl::fromLocalFile(QDir::homePath() + QLatin1String("/addressbook.ldif")), QLatin1String("text/x-ldif"));
......
......@@ -33,7 +33,7 @@ KContacts::Addressee::List XXPort::importContacts() const
return KContacts::Addressee::List();
}
bool XXPort::exportContacts(const KContacts::Addressee::List & , VCardExportSelectionWidget::ExportFields) const
bool XXPort::exportContacts(const KContacts::Addressee::List &, VCardExportSelectionWidget::ExportFields) const
{
return false;
}
......
......@@ -54,7 +54,7 @@ public:
/**
* Exports the list of @p contacts.
*/
virtual bool exportContacts( const KContacts::Addressee::List &contacts, VCardExportSelectionWidget::ExportFields ) const = 0;
virtual bool exportContacts(const KContacts::Addressee::List &contacts, VCardExportSelectionWidget::ExportFields) const = 0;
/**
* Sets module specific options.
......
......@@ -55,13 +55,13 @@ VCardXXPort::VCardXXPort(QWidget *parent)
{
}
bool VCardXXPort::exportContacts( const KContacts::Addressee::List &contacts, VCardExportSelectionWidget::ExportFields exportFields) const
bool VCardXXPort::exportContacts(const KContacts::Addressee::List &contacts, VCardExportSelectionWidget::ExportFields exportFields) const
{
KContacts::VCardConverter converter;
QUrl url;
const KContacts::Addressee::List list = filterContacts( contacts, exportFields );
if ( list.isEmpty() ) { // no contact selected
const KContacts::Addressee::List list = filterContacts(contacts, exportFields);
if (list.isEmpty()) { // no contact selected
return true;
}
......@@ -265,7 +265,7 @@ bool VCardXXPort::doExport(const QUrl &url, const QByteArray &data) const
return KIO::NetAccess::upload(tmpFile.fileName(), newUrl, parentWidget());
}
KContacts::Addressee::List VCardXXPort::filterContacts( const KContacts::Addressee::List &addrList, VCardExportSelectionWidget::ExportFields exportFieldType ) const
KContacts::Addressee::List VCardXXPort::filterContacts(const KContacts::Addressee::List &addrList, VCardExportSelectionWidget::ExportFields exportFieldType) const
{
KContacts::Addressee::List list;
......@@ -274,15 +274,15 @@ KContacts::Addressee::List VCardXXPort::filterContacts( const KContacts::Address
}
KContacts::Addressee::List::ConstIterator it;
KContacts::Addressee::List::ConstIterator end( addrList.end() );
for ( it = addrList.begin(); it != end; ++it ) {
KContacts::Addressee::List::ConstIterator end(addrList.end());
for (it = addrList.begin(); it != end; ++it) {
KContacts::Addressee addr;
addr.setUid((*it).uid());
addr.setFormattedName((*it).formattedName());
bool addrDone = false;
if ( exportFieldType & VCardExportSelectionWidget::DiplayName ) { // output display name as N field
if (exportFieldType & VCardExportSelectionWidget::DiplayName) { // output display name as N field
QString fmtName = (*it).formattedName();
QStringList splitNames = fmtName.split(QLatin1Char(' '), QString::SkipEmptyParts);
if (splitNames.count() >= 2) {
......@@ -303,47 +303,47 @@ KContacts::Addressee::List VCardXXPort::filterContacts( const KContacts::Address
addr.setSuffix((*it).suffix());
}
addr.setNickName( (*it).nickName() );
addr.setMailer( (*it).mailer() );
addr.setTimeZone( (*it).timeZone() );
addr.setGeo( (*it).geo() );
addr.setProductId( (*it).productId() );
addr.setSortString( (*it).sortString() );
addr.setUrl( (*it).url() );
addr.setExtraUrlList( (*it).extraUrlList() );
addr.setSecrecy( (*it).secrecy() );
addr.setSound( (*it).sound() );
addr.setEmailList( (*it).emailList() );
addr.setCategories( (*it).categories() );
addr.setExtraSoundList( (*it).extraSoundList() );
addr.setGender( (*it).gender() );
addr.setLangs( (*it).langs() );
addr.setKind( (*it).kind() );
addr.setMembers( (*it).members() );
addr.setRelationShips( (*it).relationShips() );
if ( exportFieldType & VCardExportSelectionWidget::Private ) {
addr.setBirthday( (*it).birthday() );
addr.setNote( (*it).note() );
addr.setNickName((*it).nickName());
addr.setMailer((*it).mailer());
addr.setTimeZone((*it).timeZone());
addr.setGeo((*it).geo());
addr.setProductId((*it).productId());
addr.setSortString((*it).sortString());
addr.setUrl((*it).url());
addr.setExtraUrlList((*it).extraUrlList());
addr.setSecrecy((*it).secrecy());
addr.setSound((*it).sound());
addr.setEmailList((*it).emailList());
addr.setCategories((*it).categories());
addr.setExtraSoundList((*it).extraSoundList());
addr.setGender((*it).gender());
addr.setLangs((*it).langs());
addr.setKind((*it).kind());
addr.setMembers((*it).members());
addr.setRelationShips((*it).relationShips());
if (exportFieldType & VCardExportSelectionWidget::Private) {
addr.setBirthday((*it).birthday());
addr.setNote((*it).note());
}
if ( exportFieldType & VCardExportSelectionWidget::Picture ) {
if ( exportFieldType & VCardExportSelectionWidget::Private ) {
addr.setPhoto( (*it).photo() );
addr.setExtraPhotoList( (*it).extraPhotoList() );
if (exportFieldType & VCardExportSelectionWidget::Picture) {
if (exportFieldType & VCardExportSelectionWidget::Private) {
addr.setPhoto((*it).photo());
addr.setExtraPhotoList((*it).extraPhotoList());
}
if ( exportFieldType & VCardExportSelectionWidget::Business ) {
addr.setLogo( (*it).logo() );
addr.setExtraLogoList( (*it).extraLogoList() );
if (exportFieldType & VCardExportSelectionWidget::Business) {
addr.setLogo((*it).logo());
addr.setExtraLogoList((*it).extraLogoList());
}
}
if ( exportFieldType & VCardExportSelectionWidget::Business ) {
addr.setTitle( (*it).title() );
addr.setRole( (*it).role() );
addr.setOrganization( (*it).organization() );
addr.setDepartment( (*it).department() );
if (exportFieldType & VCardExportSelectionWidget::Business) {
addr.setTitle((*it).title());
addr.setRole((*it).role());
addr.setOrganization((*it).organization());
addr.setDepartment((*it).department());
KContacts::PhoneNumber::List phones = (*it).phoneNumbers(KContacts::PhoneNumber::Work);
KContacts::PhoneNumber::List::Iterator phoneIt;
......@@ -360,39 +360,39 @@ KContacts::Addressee::List VCardXXPort::filterContacts( const KContacts::Address
KContacts::PhoneNumber::List phones = (*it).phoneNumbers();
KContacts::PhoneNumber::List::Iterator phoneIt;
for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) {
for (phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt) {
int phoneType = (*phoneIt).type();
if ( (phoneType & KContacts::PhoneNumber::Home) && (exportFieldType & VCardExportSelectionWidget::Private) ) {
addr.insertPhoneNumber( *phoneIt );
} else if ( (phoneType & KContacts::PhoneNumber::Work) && (exportFieldType & VCardExportSelectionWidget::Business) ) {
addr.insertPhoneNumber( *phoneIt );
} else if ( (exportFieldType & VCardExportSelectionWidget::Other) ) {
addr.insertPhoneNumber( *phoneIt );
if ((phoneType & KContacts::PhoneNumber::Home) && (exportFieldType & VCardExportSelectionWidget::Private)) {
addr.insertPhoneNumber(*phoneIt);
} else if ((phoneType & KContacts::PhoneNumber::Work) && (exportFieldType & VCardExportSelectionWidget::Business)) {
addr.insertPhoneNumber(*phoneIt);
} else if ((exportFieldType & VCardExportSelectionWidget::Other)) {
addr.insertPhoneNumber(*phoneIt);
}
}
KContacts::Address::List addresses = (*it).addresses();
KContacts::Address::List::Iterator addrIt;
for ( addrIt = addresses.begin(); addrIt != addresses.end(); ++addrIt ) {
for (addrIt = addresses.begin(); addrIt != addresses.end(); ++addrIt) {
int addressType = (*addrIt).type();
if ( (addressType & KContacts::Address::Home) && exportFieldType & VCardExportSelectionWidget::Private ) {
addr.insertAddress( *addrIt );
} else if ( (addressType & KContacts::Address::Work) && (exportFieldType & VCardExportSelectionWidget::Business) ) {
addr.insertAddress( *addrIt );
} else if ( exportFieldType & VCardExportSelectionWidget::Other ) {
addr.insertAddress( *addrIt );
if ((addressType & KContacts::Address::Home) && exportFieldType & VCardExportSelectionWidget::Private) {
addr.insertAddress(*addrIt);
} else if ((addressType & KContacts::Address::Work) && (exportFieldType & VCardExportSelectionWidget::Business)) {
addr.insertAddress(*addrIt);
} else if (exportFieldType & VCardExportSelectionWidget::Other) {
addr.insertAddress(*addrIt);
}
}
if ( exportFieldType & VCardExportSelectionWidget::Other ) {
addr.setCustoms( (*it).customs() );
if (exportFieldType & VCardExportSelectionWidget::Other) {
addr.setCustoms((*it).customs());
}
if ( exportFieldType & VCardExportSelectionWidget::Encryption ) {
addKey( addr, KContacts::Key::PGP );
addKey( addr, KContacts::Key::X509 );
if (exportFieldType & VCardExportSelectionWidget::Encryption) {
addKey(addr, KContacts::Key::PGP);
addKey(addr, KContacts::Key::X509);
}
list.append(addr);
......
......@@ -28,7 +28,7 @@ public:
explicit VCardXXPort(QWidget *parent = Q_NULLPTR);
KContacts::Addressee::List importContacts() const;
bool exportContacts( const KContacts::Addressee::List &contacts, VCardExportSelectionWidget::ExportFields exportFieldType ) const;
bool exportContacts(const KContacts::Addressee::List &contacts, VCardExportSelectionWidget::ExportFields exportFieldType) const;
private:
KContacts::Addressee::List parseVCard(const QByteArray &data) const;
......
......@@ -28,14 +28,14 @@
VCardExportSelectionWidget::VCardExportSelectionWidget(QWidget *parent)
: QWidget(parent)
{
QGridLayout *layout = new QGridLayout( this );
QGridLayout *layout = new QGridLayout(this);
QGroupBox *gbox = new QGroupBox(
i18nc( "@title:group", "Fields to be exported" ), this );
gbox->setFlat( true );
layout->addWidget( gbox, 0, 0, 1, 2 );
i18nc("@title:group", "Fields to be exported"), this);
gbox->setFlat(true);
layout->addWidget(gbox, 0, 0, 1, 2);
mPrivateBox = new QCheckBox( i18nc( "@option:check", "Private fields" ), this );
mPrivateBox = new QCheckBox(i18nc("@option:check", "Private fields"), this);
mPrivateBox->setToolTip(
i18nc("@info:tooltip", "Export private fields"));
mPrivateBox->setWhatsThis(
......@@ -44,7 +44,7 @@ VCardExportSelectionWidget::VCardExportSelectionWidget(QWidget *parent)
"private fields to the vCard output file."));
layout->addWidget(mPrivateBox, 1, 0);
mBusinessBox = new QCheckBox( i18nc( "@option:check", "Business fields" ), this );
mBusinessBox = new QCheckBox(i18nc("@option:check", "Business fields"), this);
mBusinessBox->setToolTip(
i18nc("@info:tooltip", "Export business fields"));
mBusinessBox->setWhatsThis(
......@@ -53,7 +53,7 @@ VCardExportSelectionWidget::VCardExportSelectionWidget(QWidget *parent)
"business fields to the vCard output file."));
layout->addWidget(mBusinessBox, 2, 0);
mOtherBox = new QCheckBox( i18nc( "@option:check", "Other fields" ), this );
mOtherBox = new QCheckBox(i18nc("@option:check", "Other fields"), this);
mOtherBox->setToolTip(
i18nc("@info:tooltip", "Export other fields"));
mOtherBox->setWhatsThis(
......@@ -62,7 +62,7 @@ VCardExportSelectionWidget::VCardExportSelectionWidget(QWidget *parent)
"other fields to the vCard output file."));
layout->addWidget(mOtherBox, 3, 0);
mEncryptionKeys = new QCheckBox( i18nc( "@option:check", "Encryption keys" ), this );
mEncryptionKeys = new QCheckBox(i18nc("@option:check", "Encryption keys"), this);
mEncryptionKeys->setToolTip(
i18nc("@info:tooltip", "Export encryption keys"));
mEncryptionKeys->setWhatsThis(
......@@ -71,7 +71,7 @@ VCardExportSelectionWidget::VCardExportSelectionWidget(QWidget *parent)
"encryption keys to the vCard output file."));
layout->addWidget(mEncryptionKeys, 1, 1);
mPictureBox = new QCheckBox( i18nc( "@option:check", "Pictures" ), this );
mPictureBox = new QCheckBox(i18nc("@option:check", "Pictures"), this);
mPictureBox->setToolTip(
i18nc("@info:tooltip", "Export pictures"));
mPictureBox->setWhatsThis(
......@@ -81,43 +81,43 @@ VCardExportSelectionWidget::VCardExportSelectionWidget(QWidget *parent)
layout->addWidget(mPictureBox, 2, 1);
gbox = new QGroupBox(
i18nc( "@title:group", "Export options" ), this );
gbox->setFlat( true );
layout->addWidget( gbox, 4, 0, 1, 2 );
i18nc("@title:group", "Export options"), this);
gbox->setFlat(true);
layout->addWidget(gbox, 4, 0, 1, 2);
mDisplayNameBox = new QCheckBox( i18nc( "@option:check", "Display name as full name" ), this );
mDisplayNameBox = new QCheckBox(i18nc("@option:check", "Display name as full name"), this);
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 );
KConfig config( QLatin1String("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 ) );
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);
KConfig config(QLatin1String("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));
}
VCardExportSelectionWidget::~VCardExportSelectionWidget()
{
KConfig config( QLatin1String("kaddressbookrc") );
KConfigGroup group( &config, "XXPortVCard" );
group.writeEntry( "ExportPrivateFields", mPrivateBox->isChecked() );
group.writeEntry( "ExportBusinessFields", mBusinessBox->isChecked() );
group.writeEntry( "ExportOtherFields", mOtherBox->isChecked() );
group.writeEntry( "ExportEncryptionKeys", mEncryptionKeys->isChecked() );
group.writeEntry( "ExportPictureFields", mPictureBox->isChecked() );
group.writeEntry( "ExportDisplayName", mDisplayNameBox->isChecked() );
KConfig config(QLatin1String("kaddressbookrc"));
KConfigGroup group(&config, "XXPortVCard");
group.writeEntry("ExportPrivateFields", mPrivateBox->isChecked());
group.writeEntry("ExportBusinessFields", mBusinessBox->isChecked());
group.writeEntry("ExportOtherFields", mOtherBox->isChecked());
group.writeEntry("ExportEncryptionKeys", mEncryptionKeys->isChecked());
group.writeEntry("ExportPictureFields", mPictureBox->isChecked());
group.writeEntry("ExportDisplayName", mDisplayNameBox->isChecked());
}
VCardExportSelectionWidget::ExportFields VCardExportSelectionWidget::exportType() const
......
......@@ -25,7 +25,7 @@ class VCardExportSelectionWidget : public QWidget
{
Q_OBJECT
public:
explicit VCardExportSelectionWidget(QWidget *parent=0);
explicit VCardExportSelectionWidget(QWidget *parent = 0);
~VCardExportSelectionWidget();
enum ExportField {
None = 0,
......
......@@ -15,7 +15,6 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "vcardviewerdialog.h"
#include <KLocalizedString>
#include <KStandardGuiItem>
......
......@@ -20,7 +20,8 @@
#include <QDialog>
#include <KContacts/Addressee>
namespace KAddressBookGrantlee {
namespace KAddressBookGrantlee
{
class GrantleeContactViewer;
}
class QPushButton;
......
......@@ -181,10 +181,10 @@ void XXPortManager::slotExport(const QString &identifier)
const bool selectExportType = (identifier == QLatin1String("vcard21") || identifier == QLatin1String("vcard30") || identifier == QLatin1String("vcard40"));
QPointer<ContactSelectionDialog> dlg =
new ContactSelectionDialog( mSelectionModel, selectExportType, mParentWidget );
dlg->setMessageText( i18n( "Which contact do you want to export?" ) );
dlg->setDefaultAddressBook( mDefaultAddressBook );
if ( !dlg->exec() || !dlg ) {
new ContactSelectionDialog(mSelectionModel, selectExportType, mParentWidget);
dlg->setMessageText(i18n("Which contact do you want to export?"));
dlg->setDefaultAddressBook(mDefaultAddressBook);
if (!dlg->exec() || !dlg) {
delete dlg;
return;
}
......@@ -203,7 +203,7 @@ void XXPortManager::slotExport(const QString &identifier)
return;
}
xxport->exportContacts( contacts, exportFields );
xxport->exportContacts(contacts, exportFields);
delete xxport;
}
......
......@@ -41,7 +41,8 @@ using namespace KSieveUi;
static int MINIMUMACTION = 1;
static int MAXIMUMACTION = 8;
namespace {
namespace
{
inline const QString indentation()
{
return QLatin1String(" ");
......
......@@ -35,7 +35,8 @@
#include <QDomElement>
#include "libksieve_debug.h"
namespace {
namespace
{
inline const QString defaultScriptName()
{
return QLatin1String("SCRIPTNAME: ");
......