Commit 5bc40921 authored by Dawit Alemayehu's avatar Dawit Alemayehu
Browse files

Implemented the required copy constructor and assignment operator for ExtraFields since it used

in a Qt container (QMap).

CCBUG: 256712
CCBUG: 198396
parent 4a346543
......@@ -47,12 +47,29 @@ using namespace KIO;
class ExtraField
{
public:
public:
ExtraField()
: flags(AuthInfo::ExtraFieldNoFlags)
{
}
ExtraField(const ExtraField& other)
: customTitle(other.customTitle),
flags (other.flags),
value (other.value)
{
}
ExtraField& operator=(const ExtraField& other)
{
customTitle = other.customTitle;
flags = other.flags;
value = other.value;
}
QString customTitle; // reserved for future use
AuthInfo::FieldFlags flags;
QVariant value;
ExtraField() : flags(AuthInfo::ExtraFieldNoFlags) {}
};
Q_DECLARE_METATYPE(ExtraField)
......@@ -87,7 +104,7 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, ExtraField &extra
{
QDBusVariant value;
int flag;
argument.beginStructure();
argument >> extraField.customTitle >> flag >> value;
argument.endStructure();
......@@ -100,9 +117,6 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, ExtraField &extra
class KIO::AuthInfoPrivate
{
public:
AuthInfoPrivate()
{}
QMap<QString, ExtraField> extraFields;
};
......@@ -143,7 +157,7 @@ AuthInfo& AuthInfo::operator= ( const AuthInfo& info )
readOnly = info.readOnly;
keepPassword = info.keepPassword;
modified = info.modified;
d->extraFields = info.d->extraFields;
d->extraFields = info.d->extraFields;
return *this;
}
......
......@@ -230,7 +230,7 @@ public:
* it has been closed.
*/
bool keepPassword;
/**
* Flags for extra fields
* @since 4.1
......@@ -279,9 +279,10 @@ public:
* @since 4.3
*/
static void registerMetaTypes();
protected:
bool modified;
private:
friend class ::KIO::AuthInfoPrivate;
AuthInfoPrivate * const d;
......
Supports Markdown
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