-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathloginreminderinfo.cpp
More file actions
95 lines (82 loc) · 2.78 KB
/
loginreminderinfo.cpp
File metadata and controls
95 lines (82 loc) · 2.78 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// SPDX-FileCopyrightText: 2021 - 2023 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#include "loginreminderinfo.h"
void registerLoginReminderInfoMetaType()
{
qRegisterMetaType<LoginUtmpx>("LoginUtmpx");
qDBusRegisterMetaType<LoginUtmpx>();
qRegisterMetaType<Spent>("Spent");
qDBusRegisterMetaType<Spent>();
qRegisterMetaType<LoginReminderInfo>("LoginReminderInfo");
qDBusRegisterMetaType<LoginReminderInfo>();
}
bool Spent::operator ==(const Spent &other)
{
return (LastChange == other.LastChange)
&& (Min == other.Min)
&& (Max == other.Max)
&& (Warn == other.Warn)
&& (Inactive == other.Inactive)
&& (Expire == other.Expire);
}
bool LoginUtmpx::operator ==(const LoginUtmpx &other)
{
return (InittabID == other.InittabID)
&& (Line == other.Line)
&& (Host == other.Host)
&& (Address == other.Address)
&& (Time == other.Time);
}
bool LoginReminderInfo::operator ==(const LoginReminderInfo &other)
{
return (Username == other.Username)
&& (spent == other.spent)
&& (CurrentLogin == other.CurrentLogin)
&& (LastLogin == other.LastLogin)
&& (FailCountSinceLastLogin == other.FailCountSinceLastLogin);
}
QDBusArgument &operator<<(QDBusArgument &arg, const Spent &other)
{
arg.beginStructure();
arg << other.LastChange << other.Min << other.Max << other.Warn << other.Inactive << other.Expire;
arg.endStructure();
return arg;
}
const QDBusArgument &operator>>(const QDBusArgument &arg, Spent &other)
{
arg.beginStructure();
arg >> other.LastChange >> other.Min >> other.Max >> other.Warn >> other.Inactive >> other.Expire;
arg.endStructure();
return arg;
}
QDBusArgument &operator<<(QDBusArgument &arg, const LoginUtmpx &other)
{
arg.beginStructure();
arg << other.InittabID << other.Line << other.Host << other.Address<< other.Time;
arg.endStructure();
return arg;
}
const QDBusArgument &operator>>(const QDBusArgument &arg, LoginUtmpx &other)
{
arg.beginStructure();
arg >> other.InittabID >> other.Line >> other.Host >> other.Address >> other.Time;
arg.endStructure();
return arg;
}
QDBusArgument &operator<<(QDBusArgument &arg, const LoginReminderInfo &other)
{
arg.beginStructure();
arg << other.Username << other.spent << other.CurrentLogin
<< other.LastLogin << other.FailCountSinceLastLogin;
arg.endStructure();
return arg;
}
const QDBusArgument &operator>>(const QDBusArgument &arg, LoginReminderInfo &other)
{
arg.beginStructure();
arg >> other.Username >> other.spent >> other.CurrentLogin
>> other.LastLogin >> other.FailCountSinceLastLogin;
arg.endStructure();
return arg;
}