File: noselectattribute.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-- 865 bytes parent folder | download | duplicates (2)
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: 2008 Omat Holding B.V. <info@omat.nl>

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

#include "noselectattribute.h"

#include <QByteArray>

NoSelectAttribute::NoSelectAttribute(bool noSelect)
    : mNoSelect(noSelect)
{
}

void NoSelectAttribute::setNoSelect(bool noSelect)
{
    mNoSelect = noSelect;
}

bool NoSelectAttribute::noSelect() const
{
    return mNoSelect;
}

QByteArray NoSelectAttribute::type() const
{
    static const QByteArray sType("noselect");
    return sType;
}

Akonadi::Attribute *NoSelectAttribute::clone() const
{
    return new NoSelectAttribute(mNoSelect);
}

QByteArray NoSelectAttribute::serialized() const
{
    return mNoSelect ? QByteArray::number(1) : QByteArray::number(0);
}

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