Page MenuHomePhorge

helper.cpp
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

helper.cpp

/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2020 Tusooa Zhu <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#include <libkazv-config.hpp>
#include <immer/config.hpp> // https://github.com/arximboldi/immer/issues/168
#include "kazv-log.hpp"
#include "helper.hpp"
using namespace Kazv;
QString trustLevelToQStringFunc(DeviceTrustLevel trustLevel)
{
switch (trustLevel) {
case Blocked:
return QStringLiteral("blocked");
case Unseen:
return QStringLiteral("unseen");
case Seen:
return QStringLiteral("seen");
case Verified:
return QStringLiteral("verified");
default:
qCWarning(kazvLog) << "trustLevelToQStringFunc(): Unknown trust level:" << trustLevel;
return QStringLiteral();
}
}
DeviceTrustLevel qStringToTrustLevelFunc(QString trustLevel)
{
if (trustLevel == QStringLiteral("blocked")) {
return Blocked;
} else if (trustLevel == QStringLiteral("unseen")) {
return Unseen;
} else if (trustLevel == QStringLiteral("seen")) {
return Seen;
} else if (trustLevel == QStringLiteral("verified")) {
return Verified;
} else {
qCWarning(kazvLog) << "QStringToTrustLevelFunc(): Unknown trust level:" << trustLevel;
return Blocked;
}
}

File Metadata

Mime Type
text/x-c
Expires
Sun, Dec 1, 11:38 AM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41674
Default Alt Text
helper.cpp (1 KB)

Event Timeline