Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 1ea7268d authored by Laurent Montel's avatar Laurent Montel 😁

Add impptest

parent 8aab41f1
......@@ -38,9 +38,9 @@ public:
parameters = other.parameters;
}
QMap<QString, QStringList> parameters;
QString address;
};
Impp::Impp()
: d(new Private)
{
......@@ -50,12 +50,12 @@ Impp::Impp()
Impp::Impp(const Impp &other)
: d( other.d )
{
}
Impp::Impp(const QString &lang)
Impp::Impp(const QString &address)
: d(new Private)
{
d->address = address;
}
Impp::~Impp()
......@@ -63,10 +63,19 @@ Impp::~Impp()
}
bool Impp::isValid() const
{
return !d->language.isEmpty();
return !d->address.isEmpty();
}
void Impp::setAddress(const QString &address)
{
d->address = address;
}
QString Impp::address() const
{
return d->address;
}
void Impp::setParameters(const QMap<QString, QStringList> &params)
......@@ -81,7 +90,7 @@ QMap<QString, QStringList> Impp::parameters() const
bool Impp::operator==(const Impp &other) const
{
return (d->parameters == other.parameters()) && (d->language == other.language());
return (d->parameters == other.parameters()) && (d->address == other.address());
}
bool Impp::operator!=(const Impp &other) const
......@@ -102,7 +111,7 @@ QString Impp::toString() const
{
QString str;
str += QString::fromLatin1( "Impp {\n" );
//str += QString::fromLatin1( " type: %1\n" ).arg( d->language );
str += QString::fromLatin1( " address: %1\n" ).arg( d->address );
if (!d->parameters.isEmpty()) {
QMapIterator<QString, QStringList> i(d->parameters);
QString param;
......@@ -117,13 +126,13 @@ QString Impp::toString() const
}
QDataStream &KABC::operator<<(QDataStream &s, const Impp &lang)
QDataStream &KABC::operator<<(QDataStream &s, const Impp &impp)
{
return s << lang.d->parameters;
return s << impp.d->parameters;
}
QDataStream &KABC::operator>>(QDataStream &s, Impp &lang)
QDataStream &KABC::operator>>(QDataStream &s, Impp &impp)
{
s >> lang.d->parameters;
s >> impp.d->parameters;
return s;
}
......@@ -47,6 +47,9 @@ public:
bool isValid() const;
void setAddress(const QString &address);
QString address() const;
void setParameters(const QMap<QString, QStringList> &params);
QMap<QString, QStringList> parameters() const;
......
/*
This file is part of libkabc.
Copyright (c) 2015 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "impptest.h"
#include <qtest_kde.h>
ImppTest::ImppTest(QObject *parent)
: QObject(parent)
{
}
ImppTest::~ImppTest()
{
}
QTEST_KDEMAIN(ImppTest, NoGUI)
/*
This file is part of libkabc.
Copyright (c) 2015 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef IMPPTEST_H
#define IMPPTEST_H
#include <QObject>
class ImppTest : public QObject
{
Q_OBJECT
public:
explicit ImppTest(QObject *parent = 0);
~ImppTest();
};
#endif // IMPPTEST_H
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