xwayland/selection: reduce string allocations

This commit is contained in:
Fushan Wen 2024-09-09 21:40:43 +08:00
parent e851b18d16
commit 5cfe84b23b
No known key found for this signature in database
GPG key ID: 2E48D1487C91DCAA

View file

@ -65,12 +65,12 @@ QStringList Selection::atomToMimeTypes(xcb_atom_t atom)
QStringList mimeTypes;
if (atom == atoms->utf8_string) {
mimeTypes << QString::fromLatin1("text/plain;charset=utf-8");
mimeTypes << QStringLiteral("text/plain;charset=utf-8");
} else if (atom == atoms->text) {
mimeTypes << QString::fromLatin1("text/plain");
mimeTypes << QStringLiteral("text/plain");
} else if (atom == atoms->uri_list) {
mimeTypes << "text/uri-list"
<< "text/x-uri";
mimeTypes << QStringLiteral("text/uri-list")
<< QStringLiteral("text/x-uri");
} else {
mimeTypes << atomName(atom);
}