Commit bec7a69c authored by Christoph Cullmann's avatar Christoph Cullmann 🍨
Browse files

fix Qt 6 compile

parent 8b140e23
Pipeline #223931 failed with stage
in 2 minutes and 46 seconds
......@@ -1714,7 +1714,7 @@ void Screen::selectReplContigious(const int x, const int y)
if (row < _history->getLines()) {
col = std::min(col, _history->getLineLen(row) - 1);
} else {
col = std::min(col, _screenLines[row - _history->getLines()].size() - 1);
col = std::min(col, int(_screenLines[row - _history->getLines()].size()) - 1);
}
while (col > 0 && (getCharacter(col, row).flags & EF_REPL) == EF_REPL_NONE) {
col--;
......
......@@ -1048,19 +1048,19 @@ void Vt102Emulation::processSessionAttributeRequest(const int tokenSize, const u
}
if (attribute == 133) {
if (value[0] == L'A' || value[0] == L'N' || value[0] == L'P') {
if (value[0] == QLatin1Char('A') || value[0] == QLatin1Char('N') || value[0] == QLatin1Char('P')) {
_currentScreen->setReplMode(REPL_PROMPT);
}
if (value[0] == L'L' && _currentScreen->getCursorX() > 0) {
if (value[0] == QLatin1Char('L') && _currentScreen->getCursorX() > 0) {
_currentScreen->nextLine();
}
if (value[0] == L'B') {
if (value[0] == QLatin1Char('B')) {
_currentScreen->setReplMode(REPL_INPUT);
}
if (value[0] == L'C') {
if (value[0] == QLatin1Char('C')) {
_currentScreen->setReplMode(REPL_OUTPUT);
}
if (value[0] == L'D') {
if (value[0] == QLatin1Char('D')) {
_currentScreen->setReplMode(REPL_None);
}
}
......@@ -2671,9 +2671,9 @@ void Vt102Emulation::reportDecodingError(int token)
}
if ((token & 0xff) != 3) { // SCS
outputError.append((token >> 8) & 0xff);
outputError.append(QLatin1Char((token >> 8) & 0xff));
} else {
outputError.append((token >> 16) & 0xff);
outputError.append(QLatin1Char((token >> 16) & 0xff));
}
qCDebug(KonsoleDebug).noquote() << outputError;
......
......@@ -104,7 +104,7 @@ void TerminalPainter::drawContents(Character *image,
QFont::Bold,
QFont::Black,
};
const auto normalWeight = m_parentDisplay->font().weight();
const QFont::Weight normalWeight = static_cast<QFont::Weight>(m_parentDisplay->font().weight()); // Qt6: cast can go away
auto it = std::upper_bound(std::begin(FontWeights), std::end(FontWeights), normalWeight);
const QFont::Weight boldWeight = it != std::end(FontWeights) ? *it : QFont::Black;
paint.setRenderHint(QPainter::Antialiasing, m_parentDisplay->terminalFont()->antialiasText());
......@@ -886,7 +886,7 @@ void TerminalPainter::drawTextCharacters(QPainter &painter,
bool printerFriendly,
RenditionFlags &oldRendition,
QColor oldColor,
int normalWeight,
QFont::Weight normalWeight,
QFont::Weight boldWeight)
{
// setup painter
......
......@@ -127,7 +127,7 @@ private:
bool printerFriendly,
RenditionFlags &oldRendition,
QColor oldColor,
int normalWeight,
QFont::Weight normalWeight,
QFont::Weight boldWeight);
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment