Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F112903
kazv-util.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
817 B
Referenced Files
None
Subscribers
None
kazv-util.cpp
View Options
/*
* 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
Details
Attached
Mime Type
text/x-c
Expires
Sun, Nov 24, 2:48 AM (19 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39281
Default Alt Text
kazv-util.cpp (817 B)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment