Page MenuHomePhorge

kazv-util.cpp
No OneTemporary

Size
766 B
Referenced Files
None
Subscribers
None

kazv-util.cpp

/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2023 tusooa <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#include <kazv-defs.hpp>
#include <QUrl>
#include <QMimeDatabase>
#include "matrix-link.hpp"
#include "kazv-util.hpp"
KazvUtil::KazvUtil(QObject *parent)
: QObject(parent)
{}
KazvUtil::~KazvUtil() = default;
QString KazvUtil::escapeHtml(const QString &orig) const
{
return orig.toHtmlEscaped();
}
QString KazvUtil::mimeTypeForUrl(const QUrl &url) const
{
return QMimeDatabase().mimeTypeForUrl(url).name();
}
QString KazvUtil::matrixLinkUserId(const QString &url) const
{
MatrixLink link = QUrl(url);
if (link.isUser()) {
return link.identifiers()[0];
}
return QStringLiteral("");
}

File Metadata

Mime Type
text/x-c
Expires
Sat, Nov 23, 7:34 AM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38897
Default Alt Text
kazv-util.cpp (766 B)

Event Timeline