Page MenuHomePhorge

kazv-util.cpp
No OneTemporary

Size
817 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)
, m_kfQtMajorVersion(KAZV_KF_QT_MAJOR_VERSION)
{}
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
Sun, Nov 24, 2:48 AM (22 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39281
Default Alt Text
kazv-util.cpp (817 B)

Event Timeline