Some qt6 prep

This commit is contained in:
Nicolas Werner 2021-12-28 20:09:08 +01:00
parent 2866826356
commit 5ca98829f7
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
32 changed files with 89 additions and 66 deletions

View file

@ -140,7 +140,7 @@ InputBar::updateAtRoom(const QString &t)
auto start = finder.position();
finder.toNextBoundary();
auto end = finder.position();
if (start > 0 && end - start >= 4 && t.midRef(start, end - start) == "room" &&
if (start > 0 && end - start >= 4 && t.mid(start, end - start) == "room" &&
t.at(start - 1) == QChar('@')) {
roomMention = true;
break;
@ -324,7 +324,7 @@ InputBar::message(const QString &msg, MarkdownOverride useMarkdown, bool rainbow
QString body;
bool firstLine = true;
for (const auto &line : related.quoted_body.split("\n")) {
for (auto line : related.quoted_body.splitRef(u'\n')) {
if (firstLine) {
firstLine = false;
body = QString("> <%1> %2\n").arg(related.quoted_user, line);
@ -707,9 +707,9 @@ InputBar::showPreview(const QMimeData &source, const QString &path, const QStrin
QSize dimensions;
QString blurhash;
auto mimeClass = mime.split("/")[0];
auto mimeClass = mime.splitRef(u'/')[0];
nhlog::ui()->debug("Mime: {}", mime.toStdString());
if (mimeClass == "image") {
if (mimeClass == u"image") {
QImage img = utils::readImage(data);
dimensions = img.size();