From 0b410e9879c8649964fb51c7d89fa7c3c3cc0d0e Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 2 May 2017 15:48:26 +0100 Subject: [PATCH] Make Qt scintilla code compatible with no-const-char conversions --- .../scintilla/qt/ScintillaEditBase/PlatQt.cpp | 6 +++--- .../scintilla/qt/ScintillaEditBase/ScintillaQt.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/qrenderdoc/3rdparty/scintilla/qt/ScintillaEditBase/PlatQt.cpp b/qrenderdoc/3rdparty/scintilla/qt/ScintillaEditBase/PlatQt.cpp index bdcb0a6dc..cfc8b9837 100644 --- a/qrenderdoc/3rdparty/scintilla/qt/ScintillaEditBase/PlatQt.cpp +++ b/qrenderdoc/3rdparty/scintilla/qt/ScintillaEditBase/PlatQt.cpp @@ -516,7 +516,7 @@ XYPOSITION SurfaceImpl::WidthText(Font &font, const char *s, int len) XYPOSITION SurfaceImpl::WidthChar(Font &font, char ch) { QFontMetricsF metrics(*FontPointer(font), device); - return metrics.width(ch); + return metrics.width(QChar::fromLatin1(ch)); } XYPOSITION SurfaceImpl::Ascent(Font &font) @@ -729,7 +729,7 @@ void Window::SetCursor(Cursor curs) void Window::SetTitle(const char *s) { if (wid) - window(wid)->setWindowTitle(s); + window(wid)->setWindowTitle(QString::fromUtf8(s)); } /* Returns rectangle of monitor pt is on, both rect and pt are in Window's @@ -1254,7 +1254,7 @@ void Platform::Assert(const char *c, const char *file, int line) char buffer[2000]; sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line); if (Platform::ShowAssertionPopUps(false)) { - QMessageBox mb("Assertion Failure", buffer, QMessageBox::NoIcon, + QMessageBox mb(QStringLiteral("Assertion Failure"), QString::fromUtf8(buffer), QMessageBox::NoIcon, QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); mb.exec(); } else { diff --git a/qrenderdoc/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.cpp b/qrenderdoc/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.cpp index 3b7db8002..b872b1363 100644 --- a/qrenderdoc/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.cpp +++ b/qrenderdoc/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.cpp @@ -67,14 +67,14 @@ void ScintillaQt::execCommand(QAction *action) } #if defined(Q_OS_WIN) -static const QString sMSDEVColumnSelect("MSDEVColumnSelect"); -static const QString sWrappedMSDEVColumnSelect("application/x-qt-windows-mime;value=\"MSDEVColumnSelect\""); +static const QString sMSDEVColumnSelect(QStringLiteral("MSDEVColumnSelect")); +static const QString sWrappedMSDEVColumnSelect(QStringLiteral("application/x-qt-windows-mime;value=\"MSDEVColumnSelect\"")); #elif defined(Q_OS_MAC) -static const QString sScintillaRecPboardType("com.scintilla.utf16-plain-text.rectangular"); -static const QString sScintillaRecMimeType("text/x-scintilla.utf16-plain-text.rectangular"); +static const QString sScintillaRecPboardType(QStringLiteral("com.scintilla.utf16-plain-text.rectangular")); +static const QString sScintillaRecMimeType(QStringLiteral("text/x-scintilla.utf16-plain-text.rectangular")); #else // Linux -static const QString sMimeRectangularMarker("text/x-rectangular-marker"); +static const QString sMimeRectangularMarker(QStringLiteral("text/x-rectangular-marker")); #endif #if defined(Q_OS_MAC) && QT_VERSION < QT_VERSION_CHECK(5, 0, 0) @@ -632,7 +632,7 @@ void ScintillaQt::AddToPopUp(const char *label, bool enabled) { QMenu *menu = static_cast(popup.GetID()); - QString text(label); + QString text = QString::fromLatin1(label); if (text.isEmpty()) { menu->addSeparator();