Commit d160cd58 authored by Laurent Montel's avatar Laurent Montel 😁

Astyle kdelibs

parent 5e723248
......@@ -234,7 +234,6 @@ void AddressTest::formatTest()
}
}
void AddressTest::shouldExportVcard3()
{
KContacts::Address address;
......@@ -302,12 +301,12 @@ void AddressTest::shouldParseAddressVCard3()
void AddressTest::shouldParseAddressVCard4()
{
QByteArray vcarddata("BEGIN:VCARD\r\n"
"VERSION:4.0\r\n"
"ADR;LABEL=\"My Label\";TYPE=home:1234;My Extended Label;My Street;My Locality\r\n"
" ;My Region;My Postalcode;My country\r\nEMAIL:foo@kde.org\r\n"
"N:;;;;\r\n"
"UID:testuid\r\n"
"END:VCARD\r\n\r\n");
"VERSION:4.0\r\n"
"ADR;LABEL=\"My Label\";TYPE=home:1234;My Extended Label;My Street;My Locality\r\n"
" ;My Region;My Postalcode;My country\r\nEMAIL:foo@kde.org\r\n"
"N:;;;;\r\n"
"UID:testuid\r\n"
"END:VCARD\r\n\r\n");
KContacts::VCardTool vcard;
const KContacts::AddresseeList lst = vcard.parseVCards(vcarddata);
QCOMPARE(lst.count(), 1);
......@@ -353,7 +352,6 @@ void AddressTest::shouldParseAddressVCard4WithGeoPosition()
QCOMPARE(geo.longitude(), 45.1f);
}
void AddressTest::shouldExportVCard4WithGeoPosition()
{
KContacts::Address address;
......@@ -375,7 +373,6 @@ void AddressTest::shouldExportVCard4WithGeoPosition()
geo.setLongitude(45.1f);
address.setGeo(geo);
KContacts::AddresseeList lst;
KContacts::Addressee addr;
addr.setEmails(QStringList() << QStringLiteral("foo@kde.org"));
......
......@@ -22,7 +22,6 @@
#include <QTest>
#include "vcardtool.h"
ImportExportVCardTest::ImportExportVCardTest(QObject *parent)
: QObject(parent)
{
......@@ -107,7 +106,7 @@ void ImportExportVCardTest::shouldExportFullTestVcard4()
const KContacts::AddresseeList lst = vcard.parseVCards(vcarddata);
const QByteArray result = vcard.exportVCards(lst, KContacts::VCard::v4_0);
qDebug() << " result "<< result;
qDebug() << " result " << result;
QCOMPARE(result, vcardexpected);
}
......
......@@ -156,7 +156,6 @@ void ImppTest::shouldParseImppVcard4()
QCOMPARE(impp.type(), KContacts::Impp::Skype);
}
QByteArray createCard(KContacts::Impp::ImppType type)
{
QByteArray expected("BEGIN:VCARD\n"
......
......@@ -24,7 +24,6 @@
#include <qtest.h>
#include "vcardtool.h"
QTEST_MAIN(KeyTest)
void KeyTest::storeTest()
......@@ -148,12 +147,12 @@ void KeyTest::shouldExportVCard4()
void KeyTest::shouldParseVcard3()
{
QByteArray vcarddata("BEGIN:VCARD\r\n"
"VERSION:3.0\r\n"
"EMAIL:foo@kde.org\r\n"
"KEY;TYPE=PGP:https://foo.org/sherlock-holmes.pub.asc\r\n"
"N:;;;;\r\n"
"UID:testuid\r\n"
"END:VCARD\r\n\r\n");
"VERSION:3.0\r\n"
"EMAIL:foo@kde.org\r\n"
"KEY;TYPE=PGP:https://foo.org/sherlock-holmes.pub.asc\r\n"
"N:;;;;\r\n"
"UID:testuid\r\n"
"END:VCARD\r\n\r\n");
KContacts::VCardTool vcard;
const KContacts::AddresseeList lst = vcard.parseVCards(vcarddata);
......@@ -169,12 +168,12 @@ void KeyTest::shouldParseVcard3()
void KeyTest::shouldParseVcard4()
{
QByteArray vcarddata("BEGIN:VCARD\r\n"
"VERSION:4.0\r\n"
"EMAIL:foo@kde.org\r\n"
"KEY;MEDIATYPE=application/pgp-keys:https://foo.org/sherlock-holmes.pub.asc\r\n"
"N:;;;;\r\n"
"UID:testuid\r\n"
"END:VCARD\r\n\r\n");
"VERSION:4.0\r\n"
"EMAIL:foo@kde.org\r\n"
"KEY;MEDIATYPE=application/pgp-keys:https://foo.org/sherlock-holmes.pub.asc\r\n"
"N:;;;;\r\n"
"UID:testuid\r\n"
"END:VCARD\r\n\r\n");
KContacts::VCardTool vcard;
const KContacts::AddresseeList lst = vcard.parseVCards(vcarddata);
QCOMPARE(lst.count(), 1);
......
......@@ -143,7 +143,6 @@ void RelatedTest::shouldParseRelatedWithArgument()
QCOMPARE(related.parameters().count(), 2);
}
void RelatedTest::shouldParseWithoutRelated()
{
QByteArray vcarddata("BEGIN:VCARD\n"
......
......@@ -332,7 +332,6 @@ public:
*/
Geo geo() const;
private:
class Private;
QSharedDataPointer<Private> d;
......
......@@ -460,7 +460,6 @@ public:
void setExtraTitleList(const Title::List &urltitle);
Title::List extraTitleList() const;
/**
Return title.
*/
......
......@@ -28,7 +28,6 @@
#include <QtCore/QVector>
#include <QtCore/QMap>
namespace KContacts
{
......@@ -210,7 +209,6 @@ public:
void setParameters(const QMap<QString, QStringList> &params);
QMap<QString, QStringList> parameters() const;
private:
class Private;
QSharedDataPointer<Private> d;
......
......@@ -116,13 +116,13 @@ VCard::List VCardParser::parseVCards(const QByteArray &text)
QByteArray key;
QList<QByteArray> params;
const int currentLineLength(currentLine.length());
for(int i = 0; i < currentLineLength; ++i) {
for (int i = 0; i < currentLineLength; ++i) {
char character = currentLine.at(i);
if (keyFound) {
QList<QByteArray> tmpParams = currentLine.right(currentLineLength-i).split(';');
QList<QByteArray> tmpParams = currentLine.right(currentLineLength - i).split(';');
QByteArray tmpParameter;
bool valueAdded = false;
Q_FOREACH(const QByteArray &parameter, tmpParams) {
Q_FOREACH (const QByteArray &parameter, tmpParams) {
if (parameter.contains('=')) {
if (tmpParameter.isEmpty()) {
tmpParameter = parameter;
......
......@@ -164,7 +164,6 @@ QByteArray VCardTool::createVCards(const Addressee::List &list,
adrLine.addParameter(QStringLiteral("encoding"), QStringLiteral("QUOTED-PRINTABLE"));
}
const bool hasLabel = !(*it).label().isEmpty();
QMap<QString, Address::TypeFlag>::ConstIterator typeIt;
QStringList addreLineType;
......@@ -749,7 +748,7 @@ Addressee::List VCardTool::parseVCards(const QByteArray &vcard) const
if (!label.isEmpty()) {
if (label.length() > 1) {
if (label.at(0) == QLatin1Char('"') && label.at(label.length() - 1) == QLatin1Char('"')) {
label = label.mid(1, label.length() - 2 );
label = label.mid(1, label.length() - 2);
}
}
address.setLabel(label);
......@@ -1494,7 +1493,6 @@ QStringList VCardTool::splitString(QChar sep, const QString &str) const
return list;
}
void VCardTool::imppService(const QString &serviceType, KContacts::Impp &impp) const
{
if (serviceType == QLatin1String("facebook")) {
......
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