File: noinferiorsattribute.cpp

package info (click to toggle)
kdepim-runtime 4%3A24.12.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 24,012 kB
  • sloc: cpp: 90,562; xml: 1,020; javascript: 60; sh: 58; makefile: 13
file content (45 lines) | stat: -rw-r--r-- 946 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
    SPDX-FileCopyrightText: 2012 Christian Mollekopf <mollekopf@kolabsys.com>

    SPDX-License-Identifier: LGPL-2.1-or-later
*/

#include "noinferiorsattribute.h"

#include <QByteArray>

NoInferiorsAttribute::NoInferiorsAttribute(bool noInferiors)
    : mNoInferiors(noInferiors)
{
}

void NoInferiorsAttribute::setNoInferiors(bool noInferiors)
{
    mNoInferiors = noInferiors;
}

bool NoInferiorsAttribute::noInferiors() const
{
    return mNoInferiors;
}

QByteArray NoInferiorsAttribute::type() const
{
    static const QByteArray sType("noinferiors");
    return sType;
}

Akonadi::Attribute *NoInferiorsAttribute::clone() const
{
    return new NoInferiorsAttribute(mNoInferiors);
}

QByteArray NoInferiorsAttribute::serialized() const
{
    return mNoInferiors ? QByteArray::number(1) : QByteArray::number(0);
}

void NoInferiorsAttribute::deserialize(const QByteArray &data)
{
    mNoInferiors = (data.toInt() == 0) ? false : true;
}