fix: port Konsole to Redox Qt surface
This commit is contained in:
@@ -0,0 +1,439 @@
|
|||||||
|
diff --git a/konsole-v24.08.3/CMakeLists.txt b/konsole-v24.08.3/CMakeLists.txt
|
||||||
|
--- a/konsole-v24.08.3/CMakeLists.txt
|
||||||
|
+++ b/konsole-v24.08.3/CMakeLists.txt
|
||||||
|
@@ -43,13 +43,23 @@ include(ECMQtDeclareLoggingCategory)
|
||||||
|
# Allows passing e.g. -DECM_ENABLE_SANITIZERS='address;undefined' to cmake.
|
||||||
|
include(ECMEnableSanitizers)
|
||||||
|
|
||||||
|
+string(REPLACE " -fpermissive" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||||
|
+
|
||||||
|
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED
|
||||||
|
Core
|
||||||
|
- Multimedia
|
||||||
|
- PrintSupport
|
||||||
|
Widgets
|
||||||
|
Core5Compat
|
||||||
|
)
|
||||||
|
+find_package(Qt6Multimedia ${QT_MIN_VERSION} CONFIG QUIET)
|
||||||
|
+find_package(Qt6PrintSupport ${QT_MIN_VERSION} CONFIG QUIET)
|
||||||
|
+set(HAVE_QTMULTIMEDIA 0)
|
||||||
|
+if(TARGET Qt6::Multimedia)
|
||||||
|
+ set(HAVE_QTMULTIMEDIA 1)
|
||||||
|
+endif()
|
||||||
|
+set(HAVE_QTPRINTSUPPORT 0)
|
||||||
|
+if(TARGET Qt6::PrintSupport)
|
||||||
|
+ set(HAVE_QTPRINTSUPPORT 1)
|
||||||
|
+endif()
|
||||||
|
|
||||||
|
find_package(KF6 ${KF6_DEP_VERSION} REQUIRED
|
||||||
|
Bookmarks
|
||||||
|
@@ -104,7 +114,7 @@ if(USE_DBUS)
|
||||||
|
set(HAVE_DBUS 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
-find_package(KF6DocTools ${KF6_DEP_VERSION})
|
||||||
|
+find_package(KF6DocTools ${KF6_DEP_VERSION} QUIET)
|
||||||
|
set_package_properties(KF6DocTools PROPERTIES DESCRIPTION
|
||||||
|
"Tools to generate documentation"
|
||||||
|
TYPE OPTIONAL
|
||||||
|
diff --git a/konsole-v24.08.3/src/CMakeLists.txt b/konsole-v24.08.3/src/CMakeLists.txt
|
||||||
|
--- a/konsole-v24.08.3/src/CMakeLists.txt
|
||||||
|
+++ b/konsole-v24.08.3/src/CMakeLists.txt
|
||||||
|
@@ -65,8 +65,6 @@ endif()
|
||||||
|
|
||||||
|
set(konsole_LIBS
|
||||||
|
KF6::XmlGui
|
||||||
|
- Qt::Multimedia
|
||||||
|
- Qt::PrintSupport
|
||||||
|
Qt::Xml
|
||||||
|
KF6::Notifications
|
||||||
|
KF6::WindowSystem
|
||||||
|
@@ -79,6 +77,14 @@ set(konsole_LIBS
|
||||||
|
KF6::NewStuffCore
|
||||||
|
)
|
||||||
|
|
||||||
|
+if(TARGET Qt6::Multimedia)
|
||||||
|
+ list(APPEND konsole_LIBS Qt::Multimedia)
|
||||||
|
+endif()
|
||||||
|
+
|
||||||
|
+if(TARGET Qt6::PrintSupport)
|
||||||
|
+ list(APPEND konsole_LIBS Qt::PrintSupport)
|
||||||
|
+endif()
|
||||||
|
+
|
||||||
|
if(NOT WIN32)
|
||||||
|
list(APPEND konsole_LIBS
|
||||||
|
KF6::Pty
|
||||||
|
@@ -234,13 +240,16 @@ set(konsoleprivate_SRCS ${windowadaptors_SRCS}
|
||||||
|
widgets/TerminalHeaderBar.cpp
|
||||||
|
widgets/ViewContainer.cpp
|
||||||
|
widgets/ViewSplitter.cpp
|
||||||
|
- widgets/KonsolePrintManager.cpp
|
||||||
|
|
||||||
|
${dbus_xml_srcs}
|
||||||
|
|
||||||
|
../data/data.qrc
|
||||||
|
../desktop/konsole.qrc)
|
||||||
|
|
||||||
|
+if(TARGET Qt6::PrintSupport)
|
||||||
|
+ list(APPEND konsoleprivate_SRCS widgets/KonsolePrintManager.cpp)
|
||||||
|
+endif()
|
||||||
|
+
|
||||||
|
kconfig_add_kcfg_files(konsoleprivate_SRCS settings/KonsoleSettings.kcfgc)
|
||||||
|
|
||||||
|
### Konsole Application
|
||||||
|
diff --git a/konsole-v24.08.3/src/config-konsole.h.cmake b/konsole-v24.08.3/src/config-konsole.h.cmake
|
||||||
|
--- a/konsole-v24.08.3/src/config-konsole.h.cmake
|
||||||
|
+++ b/konsole-v24.08.3/src/config-konsole.h.cmake
|
||||||
|
@@ -17,3 +17,7 @@
|
||||||
|
|
||||||
|
/* Defined if system has the malloc_trim function, which is a GNU extension */
|
||||||
|
#cmakedefine01 HAVE_MALLOC_TRIM
|
||||||
|
+
|
||||||
|
+#cmakedefine01 HAVE_QTMULTIMEDIA
|
||||||
|
+
|
||||||
|
+#cmakedefine01 HAVE_QTPRINTSUPPORT
|
||||||
|
diff --git a/konsole-v24.08.3/src/Vt102Emulation.h b/konsole-v24.08.3/src/Vt102Emulation.h
|
||||||
|
--- a/konsole-v24.08.3/src/Vt102Emulation.h
|
||||||
|
+++ b/konsole-v24.08.3/src/Vt102Emulation.h
|
||||||
|
@@ -9,9 +9,12 @@
|
||||||
|
#define VT102EMULATION_H
|
||||||
|
|
||||||
|
// Qt
|
||||||
|
+#include "config-konsole.h"
|
||||||
|
#include <QHash>
|
||||||
|
#include <QMap>
|
||||||
|
+#if HAVE_QTMULTIMEDIA
|
||||||
|
#include <QMediaPlayer>
|
||||||
|
+#endif
|
||||||
|
#include <QPair>
|
||||||
|
#include <QVector>
|
||||||
|
#include <QList>
|
||||||
|
@@ -100,7 +103,9 @@ private Q_SLOTS:
|
||||||
|
// pair in _pendingSessionAttributesUpdates.
|
||||||
|
// Used to buffer multiple attribute updates in the current session
|
||||||
|
void updateSessionAttributes();
|
||||||
|
+#if HAVE_QTMULTIMEDIA
|
||||||
|
void deletePlayer(QMediaPlayer::MediaStatus);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
private:
|
||||||
|
unsigned int applyCharset(uint c);
|
||||||
|
@@ -315,7 +320,9 @@ private:
|
||||||
|
// For kitty graphics protocol - image cache
|
||||||
|
int getFreeGraphicsImageId();
|
||||||
|
|
||||||
|
+#if HAVE_QTMULTIMEDIA
|
||||||
|
QMediaPlayer *player;
|
||||||
|
+#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
diff --git a/konsole-v24.08.3/src/Vt102Emulation.cpp b/konsole-v24.08.3/src/Vt102Emulation.cpp
|
||||||
|
--- a/konsole-v24.08.3/src/Vt102Emulation.cpp
|
||||||
|
+++ b/konsole-v24.08.3/src/Vt102Emulation.cpp
|
||||||
|
@@ -12,7 +12,9 @@
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
// Qt
|
||||||
|
+#if HAVE_QTMULTIMEDIA
|
||||||
|
#include <QAudioOutput>
|
||||||
|
+#endif
|
||||||
|
#include <QBuffer>
|
||||||
|
#include <QEvent>
|
||||||
|
#include <QKeyEvent>
|
||||||
|
@@ -70,7 +72,9 @@ Vt102Emulation::Vt102Emulation()
|
||||||
|
, _pendingSessionAttributesUpdates(QHash<int, QString>())
|
||||||
|
, _sessionAttributesUpdateTimer(new QTimer(this))
|
||||||
|
, _reportFocusEvents(false)
|
||||||
|
+#if HAVE_QTMULTIMEDIA
|
||||||
|
, player(nullptr)
|
||||||
|
+#endif
|
||||||
|
{
|
||||||
|
_sessionAttributesUpdateTimer->setSingleShot(true);
|
||||||
|
QObject::connect(_sessionAttributesUpdateTimer, &QTimer::timeout, this, &Konsole::Vt102Emulation::updateSessionAttributes);
|
||||||
|
@@ -1295,6 +1299,7 @@ void Vt102Emulation::processSessionAttributeRequest(const int tokenSize, const u
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (inlineMedia) {
|
||||||
|
+#if HAVE_QTMULTIMEDIA
|
||||||
|
if (player == nullptr) {
|
||||||
|
player = new QMediaPlayer(this);
|
||||||
|
player->setAudioOutput(new QAudioOutput(player));
|
||||||
|
@@ -1306,6 +1311,7 @@ void Vt102Emulation::processSessionAttributeRequest(const int tokenSize, const u
|
||||||
|
delete (QIODevice *)(player->sourceDevice());
|
||||||
|
player->setSourceDevice(buffer);
|
||||||
|
player->play();
|
||||||
|
+#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!inlineImage) {
|
||||||
|
@@ -1333,6 +1339,7 @@ void Vt102Emulation::processSessionAttributeRequest(const int tokenSize, const u
|
||||||
|
_sessionAttributesUpdateTimer->start(20);
|
||||||
|
}
|
||||||
|
|
||||||
|
+#if HAVE_QTMULTIMEDIA
|
||||||
|
void Vt102Emulation::deletePlayer(QMediaPlayer::MediaStatus mediaStatus)
|
||||||
|
{
|
||||||
|
if (mediaStatus == QMediaPlayer::EndOfMedia || mediaStatus == QMediaPlayer::InvalidMedia) {
|
||||||
|
@@ -1342,6 +1349,7 @@ void Vt102Emulation::deletePlayer(QMediaPlayer::MediaStatus mediaStatus)
|
||||||
|
player = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
void Vt102Emulation::updateSessionAttributes()
|
||||||
|
{
|
||||||
|
diff --git a/konsole-v24.08.3/src/session/SessionController.cpp b/konsole-v24.08.3/src/session/SessionController.cpp
|
||||||
|
--- a/konsole-v24.08.3/src/session/SessionController.cpp
|
||||||
|
+++ b/konsole-v24.08.3/src/session/SessionController.cpp
|
||||||
|
@@ -8,6 +8,8 @@
|
||||||
|
// Own
|
||||||
|
#include "SessionController.h"
|
||||||
|
|
||||||
|
+#include "config-konsole.h"
|
||||||
|
+
|
||||||
|
#include "profile/ProfileManager.h"
|
||||||
|
#include "terminalDisplay/TerminalColor.h"
|
||||||
|
#include "terminalDisplay/TerminalFonts.h"
|
||||||
|
@@ -145,7 +147,9 @@ SessionController::SessionController(Session *sessionParam, TerminalDisplay *vie
|
||||||
|
setupExtraActions();
|
||||||
|
}
|
||||||
|
|
||||||
|
+#if HAVE_QTPRINTSUPPORT
|
||||||
|
connect(this, &SessionController::requestPrint, view(), &TerminalDisplay::printScreen);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
actionCollection()->addAssociatedWidget(viewParam);
|
||||||
|
|
||||||
|
@@ -730,9 +734,11 @@ void SessionController::setupCommonActions()
|
||||||
|
action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_S));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if HAVE_QTPRINTSUPPORT
|
||||||
|
action = KStandardAction::print(this, &SessionController::requestPrint, collection);
|
||||||
|
action->setText(i18n("&Print Screen..."));
|
||||||
|
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::Key_P);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
action = collection->addAction(QStringLiteral("adjust-history"), this, &SessionController::showHistoryOptions);
|
||||||
|
action->setText(i18n("Adjust Scrollback..."));
|
||||||
|
diff --git a/konsole-v24.08.3/src/terminalDisplay/TerminalDisplay.h b/konsole-v24.08.3/src/terminalDisplay/TerminalDisplay.h
|
||||||
|
--- a/konsole-v24.08.3/src/terminalDisplay/TerminalDisplay.h
|
||||||
|
+++ b/konsole-v24.08.3/src/terminalDisplay/TerminalDisplay.h
|
||||||
|
@@ -8,6 +8,8 @@
|
||||||
|
#ifndef TERMINALDISPLAY_H
|
||||||
|
#define TERMINALDISPLAY_H
|
||||||
|
|
||||||
|
+#include "config-konsole.h"
|
||||||
|
+
|
||||||
|
// Qt
|
||||||
|
#include <QColor>
|
||||||
|
#include <QPointer>
|
||||||
|
@@ -834,7 +836,9 @@ private:
|
||||||
|
TerminalColor *_terminalColor = nullptr;
|
||||||
|
std::unique_ptr<TerminalFont> _terminalFont;
|
||||||
|
|
||||||
|
+#if HAVE_QTPRINTSUPPORT
|
||||||
|
std::unique_ptr<KonsolePrintManager> _printManager;
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
bool _semanticUpDown;
|
||||||
|
bool _semanticInputClick;
|
||||||
|
diff --git a/konsole-v24.08.3/src/terminalDisplay/TerminalDisplay.cpp b/konsole-v24.08.3/src/terminalDisplay/TerminalDisplay.cpp
|
||||||
|
--- a/konsole-v24.08.3/src/terminalDisplay/TerminalDisplay.cpp
|
||||||
|
+++ b/konsole-v24.08.3/src/terminalDisplay/TerminalDisplay.cpp
|
||||||
|
@@ -55,7 +55,9 @@
|
||||||
|
#include "../characters/ExtendedCharTable.h"
|
||||||
|
#include "../characters/LineBlockCharacters.h"
|
||||||
|
#include "../decoders/PlainTextDecoder.h"
|
||||||
|
+#if HAVE_QTPRINTSUPPORT
|
||||||
|
#include "../widgets/KonsolePrintManager.h"
|
||||||
|
+#endif
|
||||||
|
#include "../widgets/TerminalDisplayAccessible.h"
|
||||||
|
#include "EscapeSequenceUrlExtractor.h"
|
||||||
|
#include "PrintOptions.h"
|
||||||
|
@@ -308,6 +310,7 @@ TerminalDisplay::TerminalDisplay(QWidget *parent)
|
||||||
|
|
||||||
|
_terminalPainter = new TerminalPainter(this);
|
||||||
|
|
||||||
|
+#if HAVE_QTPRINTSUPPORT
|
||||||
|
auto ldrawBackground = [this](QPainter &painter, const QRect &rect, const QColor &backgroundColor, bool useOpacitySetting) {
|
||||||
|
_terminalPainter->drawBackground(painter, rect, backgroundColor, useOpacitySetting);
|
||||||
|
};
|
||||||
|
@@ -319,6 +322,7 @@ TerminalDisplay::TerminalDisplay(QWidget *parent)
|
||||||
|
};
|
||||||
|
|
||||||
|
_printManager.reset(new KonsolePrintManager(ldrawBackground, ldrawContents, lgetBackgroundColor));
|
||||||
|
+#endif
|
||||||
|
ubidi = ubidi_open();
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -3182,6 +3186,7 @@ void TerminalDisplay::applyProfile(const Profile::Ptr &profile)
|
||||||
|
|
||||||
|
void TerminalDisplay::printScreen()
|
||||||
|
{
|
||||||
|
+#if HAVE_QTPRINTSUPPORT
|
||||||
|
auto lprintContent = [this](QPainter &painter, bool friendly) {
|
||||||
|
QPoint columnLines(_usedLines, _usedColumns);
|
||||||
|
auto lfontget = [this]() {
|
||||||
|
@@ -3194,6 +3199,7 @@ void TerminalDisplay::printScreen()
|
||||||
|
_printManager->printContent(painter, friendly, columnLines, lfontget, lfontset);
|
||||||
|
};
|
||||||
|
_printManager->printRequest(lprintContent, this);
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
Character TerminalDisplay::getCursorCharacter(int column, int line)
|
||||||
|
diff --git a/konsole-v24.08.3/src/colorscheme/ColorSchemeWallpaper.cpp b/konsole-v24.08.3/src/colorscheme/ColorSchemeWallpaper.cpp
|
||||||
|
--- a/konsole-v24.08.3/src/colorscheme/ColorSchemeWallpaper.cpp
|
||||||
|
+++ b/konsole-v24.08.3/src/colorscheme/ColorSchemeWallpaper.cpp
|
||||||
|
@@ -201,11 +201,11 @@ QImage ColorSchemeWallpaper::FlipImage(const QImage image, const ColorSchemeWall
|
||||||
|
{
|
||||||
|
switch (flipType) {
|
||||||
|
case Horizontal:
|
||||||
|
- return image.mirrored(true, false);
|
||||||
|
+ return image.flipped(Qt::Horizontal);
|
||||||
|
case Vertical:
|
||||||
|
- return image.mirrored(false, true);
|
||||||
|
+ return image.flipped(Qt::Vertical);
|
||||||
|
case Both:
|
||||||
|
- return image.mirrored(true, true);
|
||||||
|
+ return image.flipped(Qt::Horizontal | Qt::Vertical);
|
||||||
|
default:
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
diff --git a/konsole-v24.08.3/src/EscapeSequenceUrlExtractor.cpp b/konsole-v24.08.3/src/EscapeSequenceUrlExtractor.cpp
|
||||||
|
--- a/konsole-v24.08.3/src/EscapeSequenceUrlExtractor.cpp
|
||||||
|
+++ b/konsole-v24.08.3/src/EscapeSequenceUrlExtractor.cpp
|
||||||
|
@@ -33,7 +33,8 @@ void EscapeSequenceUrlExtractor::appendUrlText_impl(uint c)
|
||||||
|
const int realCcolumn = _screen->getCursorY() + _screen->getHistLines();
|
||||||
|
_currentUrl.begin = Coordinate{realCcolumn, _screen->getCursorX() - 1};
|
||||||
|
}
|
||||||
|
- _currentUrl.text += QString::fromUcs4(&c, 1);
|
||||||
|
+ const auto codepoint = static_cast<char32_t>(c);
|
||||||
|
+ _currentUrl.text += QString::fromUcs4(&codepoint, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void EscapeSequenceUrlExtractor::setUrl(const QString &url)
|
||||||
|
diff --git a/konsole-v24.08.3/src/ProcessInfo.cpp b/konsole-v24.08.3/src/ProcessInfo.cpp
|
||||||
|
--- a/konsole-v24.08.3/src/ProcessInfo.cpp
|
||||||
|
+++ b/konsole-v24.08.3/src/ProcessInfo.cpp
|
||||||
|
@@ -1272,6 +1272,7 @@ ProcessInfo *ProcessInfo::newInstance(int pid, int sessionPid)
|
||||||
|
#elif defined(Q_OS_OPENBSD)
|
||||||
|
info = new OpenBSDProcessInfo(pid);
|
||||||
|
#else
|
||||||
|
+ Q_UNUSED(sessionPid);
|
||||||
|
info = new NullProcessInfo(pid);
|
||||||
|
#endif
|
||||||
|
info->readProcessInfo(pid);
|
||||||
|
diff --git a/konsole-v24.08.3/src/Screen.cpp b/konsole-v24.08.3/src/Screen.cpp
|
||||||
|
--- a/konsole-v24.08.3/src/Screen.cpp
|
||||||
|
+++ b/konsole-v24.08.3/src/Screen.cpp
|
||||||
|
@@ -1838,16 +1838,17 @@ void Screen::setSelectionEnd(const int x, const int y, const bool trimTrailingWh
|
||||||
|
// Do not let this code go to a release.
|
||||||
|
if (_screenLines.size() < line) {
|
||||||
|
QFile konsoleInfo(QStringLiteral("~/konsole_info_crash_array_out_of_bounds.txt"));
|
||||||
|
- konsoleInfo.open(QIODevice::WriteOnly);
|
||||||
|
- QTextStream messages(&konsoleInfo);
|
||||||
|
-
|
||||||
|
- messages << "_selBegin" << _selBegin << "\n";
|
||||||
|
- messages << "endPos" << endPos << "\n";
|
||||||
|
- messages << "_selBottomRight" << _selBottomRight << "\n";
|
||||||
|
- messages << "bottomRow Calculation: (_selBottomRight / _columns) = " << _selBottomRight << "/" << _columns << "\n";
|
||||||
|
- messages << "line Calculation: (bottomRow - _history->getLines()) = " << bottomRow << "-" << _history->getLines() << "\n";
|
||||||
|
- messages << "_screenLines.count()" << _screenLines.size() << "\n";
|
||||||
|
- messages << "line" << line << "\n";
|
||||||
|
+ if (konsoleInfo.open(QIODevice::WriteOnly)) {
|
||||||
|
+ QTextStream messages(&konsoleInfo);
|
||||||
|
+
|
||||||
|
+ messages << "_selBegin" << _selBegin << "\n";
|
||||||
|
+ messages << "endPos" << endPos << "\n";
|
||||||
|
+ messages << "_selBottomRight" << _selBottomRight << "\n";
|
||||||
|
+ messages << "bottomRow Calculation: (_selBottomRight / _columns) = " << _selBottomRight << "/" << _columns << "\n";
|
||||||
|
+ messages << "line Calculation: (bottomRow - _history->getLines()) = " << bottomRow << "-" << _history->getLines() << "\n";
|
||||||
|
+ messages << "_screenLines.count()" << _screenLines.size() << "\n";
|
||||||
|
+ messages << "line" << line << "\n";
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
// HACK: do not crash.
|
||||||
|
diff --git a/konsole-v24.08.3/src/filterHotSpots/FileFilter.cpp b/konsole-v24.08.3/src/filterHotSpots/FileFilter.cpp
|
||||||
|
--- a/konsole-v24.08.3/src/filterHotSpots/FileFilter.cpp
|
||||||
|
+++ b/konsole-v24.08.3/src/filterHotSpots/FileFilter.cpp
|
||||||
|
@@ -93,7 +93,7 @@ QSharedPointer<HotSpot> FileFilter::newHotSpot(int startLine, int startColumn, i
|
||||||
|
|
||||||
|
// '.' and '..' could be valid hotspots, but '..................' most likely isn't
|
||||||
|
static const QRegularExpression allDotRe{QRegularExpression::anchoredPattern(QStringLiteral("\\.{3}"))};
|
||||||
|
- if (allDotRe.match(filename).hasMatch()) {
|
||||||
|
+ if (allDotRe.matchView(filename).hasMatch()) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/konsole-v24.08.3/src/terminalDisplay/TerminalDisplay.cpp b/konsole-v24.08.3/src/terminalDisplay/TerminalDisplay.cpp
|
||||||
|
--- a/konsole-v24.08.3/src/terminalDisplay/TerminalDisplay.cpp
|
||||||
|
+++ b/konsole-v24.08.3/src/terminalDisplay/TerminalDisplay.cpp
|
||||||
|
@@ -2309,7 +2309,7 @@ void TerminalDisplay::doPaste(QString text, bool appendReturn)
|
||||||
|
if (isUnsafe(c)) {
|
||||||
|
const QString sequence = charToSequence(c);
|
||||||
|
const QString description = characterDescriptions.value(c.unicode(), QString());
|
||||||
|
- QString entry = QStringLiteral("U+%1").arg(c.unicode(), 4, 16, QLatin1Char('0'));
|
||||||
|
+ QString entry = QStringLiteral("U+%1").arg(static_cast<uint>(c.unicode()), 4, 16, QLatin1Char('0'));
|
||||||
|
if (!sequence.isEmpty()) {
|
||||||
|
entry += QStringLiteral("\t%1").arg(sequence);
|
||||||
|
}
|
||||||
|
diff --git a/konsole-v24.08.3/src/MainWindow.cpp b/konsole-v24.08.3/src/MainWindow.cpp
|
||||||
|
--- a/konsole-v24.08.3/src/MainWindow.cpp
|
||||||
|
+++ b/konsole-v24.08.3/src/MainWindow.cpp
|
||||||
|
@@ -370,7 +370,7 @@ void MainWindow::setupActions()
|
||||||
|
});
|
||||||
|
|
||||||
|
// Set up themes
|
||||||
|
- auto *manager = new KColorSchemeManager(actionCollection());
|
||||||
|
+ auto *manager = KColorSchemeManager::instance();
|
||||||
|
manager->setAutosaveChanges(true);
|
||||||
|
KActionMenu *selectionMenu = KColorSchemeMenu::createMenu(manager, this);
|
||||||
|
auto winColorSchemeMenu = new QAction(this);
|
||||||
|
diff --git a/konsole-v24.08.3/src/plugins/QuickCommands/filtermodel.cpp b/konsole-v24.08.3/src/plugins/QuickCommands/filtermodel.cpp
|
||||||
|
--- a/konsole-v24.08.3/src/plugins/QuickCommands/filtermodel.cpp
|
||||||
|
+++ b/konsole-v24.08.3/src/plugins/QuickCommands/filtermodel.cpp
|
||||||
|
@@ -33,8 +33,9 @@ bool FilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParen
|
||||||
|
|
||||||
|
void FilterModel::setInvertFilter(bool invert)
|
||||||
|
{
|
||||||
|
+ beginFilterChange();
|
||||||
|
m_invertFilter = invert;
|
||||||
|
- invalidateFilter();
|
||||||
|
+ endFilterChange(QSortFilterProxyModel::Direction::Rows);
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "moc_filtermodel.cpp"
|
||||||
|
diff --git a/konsole-v24.08.3/src/plugins/SSHManager/sshmanagerfiltermodel.cpp b/konsole-v24.08.3/src/plugins/SSHManager/sshmanagerfiltermodel.cpp
|
||||||
|
--- a/konsole-v24.08.3/src/plugins/SSHManager/sshmanagerfiltermodel.cpp
|
||||||
|
+++ b/konsole-v24.08.3/src/plugins/SSHManager/sshmanagerfiltermodel.cpp
|
||||||
|
@@ -31,8 +31,9 @@ bool SSHManagerFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &s
|
||||||
|
|
||||||
|
void SSHManagerFilterModel::setInvertFilter(bool invert)
|
||||||
|
{
|
||||||
|
+ beginFilterChange();
|
||||||
|
m_invertFilter = invert;
|
||||||
|
- invalidateFilter();
|
||||||
|
+ endFilterChange(QSortFilterProxyModel::Direction::Rows);
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "moc_sshmanagerfiltermodel.cpp"
|
||||||
|
diff --git a/konsole-v24.08.3/src/plugins/QuickCommands/quickcommandswidget.cpp b/konsole-v24.08.3/src/plugins/QuickCommands/quickcommandswidget.cpp
|
||||||
|
--- a/konsole-v24.08.3/src/plugins/QuickCommands/quickcommandswidget.cpp
|
||||||
|
+++ b/konsole-v24.08.3/src/plugins/QuickCommands/quickcommandswidget.cpp
|
||||||
|
@@ -314,7 +314,11 @@ void QuickCommandsWidget::runShellCheck()
|
||||||
|
}
|
||||||
|
|
||||||
|
QTemporaryFile file;
|
||||||
|
- file.open();
|
||||||
|
+ if (!file.open()) {
|
||||||
|
+ ui->warning->setPlainText(file.errorString());
|
||||||
|
+ ui->tabWidget->setTabText(1, i18n("Warnings (*)"));
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
QTextStream ts(&file);
|
||||||
|
ts << "#!/bin/bash\n";
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#TODO: Konsole — KDE terminal emulator. Qt6-based, depends on kf6-kio.
|
#TODO: Konsole — KDE terminal emulator. Qt6-based, depends on kf6-kio.
|
||||||
# Bell audio (Qt6Multimedia) and printing (Qt6PrintSupport) disabled via cmake patch.
|
# Bell audio (Qt6Multimedia) and printing (Qt6PrintSupport) disabled via cmake patch.
|
||||||
# Core5Compat linked if available. ICU required for BiDi text rendering.
|
# Core5Compat is provided by qt5compat. ICU required for BiDi text rendering.
|
||||||
[source]
|
[source]
|
||||||
tar = "https://invent.kde.org/utilities/konsole/-/archive/v24.08.3/konsole-v24.08.3.tar.gz"
|
tar = "https://invent.kde.org/utilities/konsole/-/archive/v24.08.3/konsole-v24.08.3.tar.gz"
|
||||||
patches = [
|
patches = [
|
||||||
@@ -12,6 +12,7 @@ template = "custom"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"icu",
|
"icu",
|
||||||
"qtbase",
|
"qtbase",
|
||||||
|
"qt5compat",
|
||||||
"kf6-extra-cmake-modules",
|
"kf6-extra-cmake-modules",
|
||||||
"kf6-kcoreaddons",
|
"kf6-kcoreaddons",
|
||||||
"kf6-ki18n",
|
"kf6-ki18n",
|
||||||
@@ -50,9 +51,9 @@ for qtdir in plugins mkspecs metatypes modules; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \
|
sed -i -E "s/^[[:space:]]*ecm_install_po_files_as_qm/#&/" \
|
||||||
"${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true
|
"${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true
|
||||||
sed -i 's/^ki18n_install(po)/#ki18n_install(po)/' \
|
sed -i -E 's/^[[:space:]]*ki18n_install[[:space:]]*[(][[:space:]]*po[[:space:]]*[)]/#&/' \
|
||||||
"${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true
|
"${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true
|
||||||
|
|
||||||
rm -f CMakeCache.txt
|
rm -f CMakeCache.txt
|
||||||
@@ -64,6 +65,8 @@ cmake "${COOKBOOK_SOURCE}" \
|
|||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \
|
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \
|
||||||
|
-DKF6_HOST_TOOLING=/usr/lib/cmake \
|
||||||
|
-DWITH_X11=OFF \
|
||||||
-DBUILD_TESTING=OFF \
|
-DBUILD_TESTING=OFF \
|
||||||
-Wno-dev
|
-Wno-dev
|
||||||
|
|
||||||
|
|||||||
@@ -43,13 +43,23 @@ include(CheckIncludeFiles)
|
|||||||
# Allows passing e.g. -DECM_ENABLE_SANITIZERS='address;undefined' to cmake.
|
# Allows passing e.g. -DECM_ENABLE_SANITIZERS='address;undefined' to cmake.
|
||||||
include(ECMEnableSanitizers)
|
include(ECMEnableSanitizers)
|
||||||
|
|
||||||
|
string(REPLACE " -fpermissive" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||||
|
|
||||||
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED
|
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED
|
||||||
Core
|
Core
|
||||||
Multimedia
|
|
||||||
PrintSupport
|
|
||||||
Widgets
|
Widgets
|
||||||
Core5Compat
|
Core5Compat
|
||||||
)
|
)
|
||||||
|
find_package(Qt6Multimedia ${QT_MIN_VERSION} CONFIG QUIET)
|
||||||
|
find_package(Qt6PrintSupport ${QT_MIN_VERSION} CONFIG QUIET)
|
||||||
|
set(HAVE_QTMULTIMEDIA 0)
|
||||||
|
if(TARGET Qt6::Multimedia)
|
||||||
|
set(HAVE_QTMULTIMEDIA 1)
|
||||||
|
endif()
|
||||||
|
set(HAVE_QTPRINTSUPPORT 0)
|
||||||
|
if(TARGET Qt6::PrintSupport)
|
||||||
|
set(HAVE_QTPRINTSUPPORT 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(KF6 ${KF6_DEP_VERSION} REQUIRED
|
find_package(KF6 ${KF6_DEP_VERSION} REQUIRED
|
||||||
Bookmarks
|
Bookmarks
|
||||||
@@ -96,7 +106,7 @@ if(USE_DBUS)
|
|||||||
set(HAVE_DBUS 1)
|
set(HAVE_DBUS 1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(KF6DocTools ${KF6_DEP_VERSION})
|
find_package(KF6DocTools ${KF6_DEP_VERSION} QUIET)
|
||||||
set_package_properties(KF6DocTools PROPERTIES DESCRIPTION
|
set_package_properties(KF6DocTools PROPERTIES DESCRIPTION
|
||||||
"Tools to generate documentation"
|
"Tools to generate documentation"
|
||||||
TYPE OPTIONAL
|
TYPE OPTIONAL
|
||||||
@@ -157,7 +167,7 @@ ecm_qt_install_logging_categories(
|
|||||||
DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}"
|
DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}"
|
||||||
)
|
)
|
||||||
|
|
||||||
ki18n_install( po )
|
#ki18n_install( po )
|
||||||
if(KF6DocTools_FOUND)
|
if(KF6DocTools_FOUND)
|
||||||
kdoctools_install( po )
|
kdoctools_install( po )
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -65,8 +65,6 @@ endif()
|
|||||||
|
|
||||||
set(konsole_LIBS
|
set(konsole_LIBS
|
||||||
KF6::XmlGui
|
KF6::XmlGui
|
||||||
Qt::Multimedia
|
|
||||||
Qt::PrintSupport
|
|
||||||
Qt::Xml
|
Qt::Xml
|
||||||
KF6::Notifications
|
KF6::Notifications
|
||||||
KF6::WindowSystem
|
KF6::WindowSystem
|
||||||
@@ -79,6 +77,14 @@ set(konsole_LIBS
|
|||||||
KF6::NewStuffCore
|
KF6::NewStuffCore
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(TARGET Qt6::Multimedia)
|
||||||
|
list(APPEND konsole_LIBS Qt::Multimedia)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(TARGET Qt6::PrintSupport)
|
||||||
|
list(APPEND konsole_LIBS Qt::PrintSupport)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT WIN32)
|
if(NOT WIN32)
|
||||||
list(APPEND konsole_LIBS
|
list(APPEND konsole_LIBS
|
||||||
KF6::Pty
|
KF6::Pty
|
||||||
@@ -234,13 +240,16 @@ set(konsoleprivate_SRCS ${windowadaptors_SRCS}
|
|||||||
widgets/TerminalHeaderBar.cpp
|
widgets/TerminalHeaderBar.cpp
|
||||||
widgets/ViewContainer.cpp
|
widgets/ViewContainer.cpp
|
||||||
widgets/ViewSplitter.cpp
|
widgets/ViewSplitter.cpp
|
||||||
widgets/KonsolePrintManager.cpp
|
|
||||||
|
|
||||||
${dbus_xml_srcs}
|
${dbus_xml_srcs}
|
||||||
|
|
||||||
../data/data.qrc
|
../data/data.qrc
|
||||||
../desktop/konsole.qrc)
|
../desktop/konsole.qrc)
|
||||||
|
|
||||||
|
if(TARGET Qt6::PrintSupport)
|
||||||
|
list(APPEND konsoleprivate_SRCS widgets/KonsolePrintManager.cpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
kconfig_add_kcfg_files(konsoleprivate_SRCS settings/KonsoleSettings.kcfgc)
|
kconfig_add_kcfg_files(konsoleprivate_SRCS settings/KonsoleSettings.kcfgc)
|
||||||
|
|
||||||
### Konsole Application
|
### Konsole Application
|
||||||
@@ -408,4 +417,3 @@ if(COVERAGE_GENERATE_HTML)
|
|||||||
COMMAND ${GENHTML} --ignore-errors source --demangle-cpp -o coverage coverage.info
|
COMMAND ${GENHTML} --ignore-errors source --demangle-cpp -o coverage coverage.info
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ void EscapeSequenceUrlExtractor::appendUrlText_impl(uint c)
|
|||||||
const int realCcolumn = _screen->getCursorY() + _screen->getHistLines();
|
const int realCcolumn = _screen->getCursorY() + _screen->getHistLines();
|
||||||
_currentUrl.begin = Coordinate{realCcolumn, _screen->getCursorX() - 1};
|
_currentUrl.begin = Coordinate{realCcolumn, _screen->getCursorX() - 1};
|
||||||
}
|
}
|
||||||
_currentUrl.text += QString::fromUcs4(&c, 1);
|
const auto codepoint = static_cast<char32_t>(c);
|
||||||
|
_currentUrl.text += QString::fromUcs4(&codepoint, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EscapeSequenceUrlExtractor::setUrl(const QString &url)
|
void EscapeSequenceUrlExtractor::setUrl(const QString &url)
|
||||||
|
|||||||
@@ -370,7 +370,7 @@ void MainWindow::setupActions()
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Set up themes
|
// Set up themes
|
||||||
auto *manager = new KColorSchemeManager(actionCollection());
|
auto *manager = KColorSchemeManager::instance();
|
||||||
manager->setAutosaveChanges(true);
|
manager->setAutosaveChanges(true);
|
||||||
KActionMenu *selectionMenu = KColorSchemeMenu::createMenu(manager, this);
|
KActionMenu *selectionMenu = KColorSchemeMenu::createMenu(manager, this);
|
||||||
auto winColorSchemeMenu = new QAction(this);
|
auto winColorSchemeMenu = new QAction(this);
|
||||||
|
|||||||
@@ -1272,6 +1272,7 @@ ProcessInfo *ProcessInfo::newInstance(int pid, int sessionPid)
|
|||||||
#elif defined(Q_OS_OPENBSD)
|
#elif defined(Q_OS_OPENBSD)
|
||||||
info = new OpenBSDProcessInfo(pid);
|
info = new OpenBSDProcessInfo(pid);
|
||||||
#else
|
#else
|
||||||
|
Q_UNUSED(sessionPid);
|
||||||
info = new NullProcessInfo(pid);
|
info = new NullProcessInfo(pid);
|
||||||
#endif
|
#endif
|
||||||
info->readProcessInfo(pid);
|
info->readProcessInfo(pid);
|
||||||
|
|||||||
@@ -1838,16 +1838,17 @@ void Screen::setSelectionEnd(const int x, const int y, const bool trimTrailingWh
|
|||||||
// Do not let this code go to a release.
|
// Do not let this code go to a release.
|
||||||
if (_screenLines.size() < line) {
|
if (_screenLines.size() < line) {
|
||||||
QFile konsoleInfo(QStringLiteral("~/konsole_info_crash_array_out_of_bounds.txt"));
|
QFile konsoleInfo(QStringLiteral("~/konsole_info_crash_array_out_of_bounds.txt"));
|
||||||
konsoleInfo.open(QIODevice::WriteOnly);
|
if (konsoleInfo.open(QIODevice::WriteOnly)) {
|
||||||
QTextStream messages(&konsoleInfo);
|
QTextStream messages(&konsoleInfo);
|
||||||
|
|
||||||
messages << "_selBegin" << _selBegin << "\n";
|
messages << "_selBegin" << _selBegin << "\n";
|
||||||
messages << "endPos" << endPos << "\n";
|
messages << "endPos" << endPos << "\n";
|
||||||
messages << "_selBottomRight" << _selBottomRight << "\n";
|
messages << "_selBottomRight" << _selBottomRight << "\n";
|
||||||
messages << "bottomRow Calculation: (_selBottomRight / _columns) = " << _selBottomRight << "/" << _columns << "\n";
|
messages << "bottomRow Calculation: (_selBottomRight / _columns) = " << _selBottomRight << "/" << _columns << "\n";
|
||||||
messages << "line Calculation: (bottomRow - _history->getLines()) = " << bottomRow << "-" << _history->getLines() << "\n";
|
messages << "line Calculation: (bottomRow - _history->getLines()) = " << bottomRow << "-" << _history->getLines() << "\n";
|
||||||
messages << "_screenLines.count()" << _screenLines.size() << "\n";
|
messages << "_screenLines.count()" << _screenLines.size() << "\n";
|
||||||
messages << "line" << line << "\n";
|
messages << "line" << line << "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK: do not crash.
|
// HACK: do not crash.
|
||||||
|
|||||||
@@ -12,7 +12,9 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
// Qt
|
// Qt
|
||||||
|
#if HAVE_QTMULTIMEDIA
|
||||||
#include <QAudioOutput>
|
#include <QAudioOutput>
|
||||||
|
#endif
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
@@ -70,7 +72,9 @@ Vt102Emulation::Vt102Emulation()
|
|||||||
, _pendingSessionAttributesUpdates(QHash<int, QString>())
|
, _pendingSessionAttributesUpdates(QHash<int, QString>())
|
||||||
, _sessionAttributesUpdateTimer(new QTimer(this))
|
, _sessionAttributesUpdateTimer(new QTimer(this))
|
||||||
, _reportFocusEvents(false)
|
, _reportFocusEvents(false)
|
||||||
|
#if HAVE_QTMULTIMEDIA
|
||||||
, player(nullptr)
|
, player(nullptr)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
_sessionAttributesUpdateTimer->setSingleShot(true);
|
_sessionAttributesUpdateTimer->setSingleShot(true);
|
||||||
QObject::connect(_sessionAttributesUpdateTimer, &QTimer::timeout, this, &Konsole::Vt102Emulation::updateSessionAttributes);
|
QObject::connect(_sessionAttributesUpdateTimer, &QTimer::timeout, this, &Konsole::Vt102Emulation::updateSessionAttributes);
|
||||||
@@ -1295,6 +1299,7 @@ void Vt102Emulation::processSessionAttributeRequest(const int tokenSize, const u
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (inlineMedia) {
|
if (inlineMedia) {
|
||||||
|
#if HAVE_QTMULTIMEDIA
|
||||||
if (player == nullptr) {
|
if (player == nullptr) {
|
||||||
player = new QMediaPlayer(this);
|
player = new QMediaPlayer(this);
|
||||||
player->setAudioOutput(new QAudioOutput(player));
|
player->setAudioOutput(new QAudioOutput(player));
|
||||||
@@ -1306,6 +1311,7 @@ void Vt102Emulation::processSessionAttributeRequest(const int tokenSize, const u
|
|||||||
delete (QIODevice *)(player->sourceDevice());
|
delete (QIODevice *)(player->sourceDevice());
|
||||||
player->setSourceDevice(buffer);
|
player->setSourceDevice(buffer);
|
||||||
player->play();
|
player->play();
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!inlineImage) {
|
if (!inlineImage) {
|
||||||
@@ -1333,6 +1339,7 @@ void Vt102Emulation::processSessionAttributeRequest(const int tokenSize, const u
|
|||||||
_sessionAttributesUpdateTimer->start(20);
|
_sessionAttributesUpdateTimer->start(20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if HAVE_QTMULTIMEDIA
|
||||||
void Vt102Emulation::deletePlayer(QMediaPlayer::MediaStatus mediaStatus)
|
void Vt102Emulation::deletePlayer(QMediaPlayer::MediaStatus mediaStatus)
|
||||||
{
|
{
|
||||||
if (mediaStatus == QMediaPlayer::EndOfMedia || mediaStatus == QMediaPlayer::InvalidMedia) {
|
if (mediaStatus == QMediaPlayer::EndOfMedia || mediaStatus == QMediaPlayer::InvalidMedia) {
|
||||||
@@ -1342,6 +1349,7 @@ void Vt102Emulation::deletePlayer(QMediaPlayer::MediaStatus mediaStatus)
|
|||||||
player = nullptr;
|
player = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void Vt102Emulation::updateSessionAttributes()
|
void Vt102Emulation::updateSessionAttributes()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,9 +9,12 @@
|
|||||||
#define VT102EMULATION_H
|
#define VT102EMULATION_H
|
||||||
|
|
||||||
// Qt
|
// Qt
|
||||||
|
#include "config-konsole.h"
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
#if HAVE_QTMULTIMEDIA
|
||||||
#include <QMediaPlayer>
|
#include <QMediaPlayer>
|
||||||
|
#endif
|
||||||
#include <QPair>
|
#include <QPair>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
@@ -100,7 +103,9 @@ private Q_SLOTS:
|
|||||||
// pair in _pendingSessionAttributesUpdates.
|
// pair in _pendingSessionAttributesUpdates.
|
||||||
// Used to buffer multiple attribute updates in the current session
|
// Used to buffer multiple attribute updates in the current session
|
||||||
void updateSessionAttributes();
|
void updateSessionAttributes();
|
||||||
|
#if HAVE_QTMULTIMEDIA
|
||||||
void deletePlayer(QMediaPlayer::MediaStatus);
|
void deletePlayer(QMediaPlayer::MediaStatus);
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int applyCharset(uint c);
|
unsigned int applyCharset(uint c);
|
||||||
@@ -315,7 +320,9 @@ private:
|
|||||||
// For kitty graphics protocol - image cache
|
// For kitty graphics protocol - image cache
|
||||||
int getFreeGraphicsImageId();
|
int getFreeGraphicsImageId();
|
||||||
|
|
||||||
|
#if HAVE_QTMULTIMEDIA
|
||||||
QMediaPlayer *player;
|
QMediaPlayer *player;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,11 +201,11 @@ QImage ColorSchemeWallpaper::FlipImage(const QImage image, const ColorSchemeWall
|
|||||||
{
|
{
|
||||||
switch (flipType) {
|
switch (flipType) {
|
||||||
case Horizontal:
|
case Horizontal:
|
||||||
return image.mirrored(true, false);
|
return image.flipped(Qt::Horizontal);
|
||||||
case Vertical:
|
case Vertical:
|
||||||
return image.mirrored(false, true);
|
return image.flipped(Qt::Vertical);
|
||||||
case Both:
|
case Both:
|
||||||
return image.mirrored(true, true);
|
return image.flipped(Qt::Horizontal | Qt::Vertical);
|
||||||
default:
|
default:
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,3 +17,7 @@
|
|||||||
|
|
||||||
/* Defined if system has the malloc_trim function, which is a GNU extension */
|
/* Defined if system has the malloc_trim function, which is a GNU extension */
|
||||||
#cmakedefine01 HAVE_MALLOC_TRIM
|
#cmakedefine01 HAVE_MALLOC_TRIM
|
||||||
|
|
||||||
|
#cmakedefine01 HAVE_QTMULTIMEDIA
|
||||||
|
|
||||||
|
#cmakedefine01 HAVE_QTPRINTSUPPORT
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ QSharedPointer<HotSpot> FileFilter::newHotSpot(int startLine, int startColumn, i
|
|||||||
|
|
||||||
// '.' and '..' could be valid hotspots, but '..................' most likely isn't
|
// '.' and '..' could be valid hotspots, but '..................' most likely isn't
|
||||||
static const QRegularExpression allDotRe{QRegularExpression::anchoredPattern(QStringLiteral("\\.{3}"))};
|
static const QRegularExpression allDotRe{QRegularExpression::anchoredPattern(QStringLiteral("\\.{3}"))};
|
||||||
if (allDotRe.match(filename).hasMatch()) {
|
if (allDotRe.matchView(filename).hasMatch()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,9 @@ bool FilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParen
|
|||||||
|
|
||||||
void FilterModel::setInvertFilter(bool invert)
|
void FilterModel::setInvertFilter(bool invert)
|
||||||
{
|
{
|
||||||
|
beginFilterChange();
|
||||||
m_invertFilter = invert;
|
m_invertFilter = invert;
|
||||||
invalidateFilter();
|
endFilterChange(QSortFilterProxyModel::Direction::Rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_filtermodel.cpp"
|
#include "moc_filtermodel.cpp"
|
||||||
|
|||||||
@@ -314,7 +314,11 @@ void QuickCommandsWidget::runShellCheck()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QTemporaryFile file;
|
QTemporaryFile file;
|
||||||
file.open();
|
if (!file.open()) {
|
||||||
|
ui->warning->setPlainText(file.errorString());
|
||||||
|
ui->tabWidget->setTabText(1, i18n("Warnings (*)"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QTextStream ts(&file);
|
QTextStream ts(&file);
|
||||||
ts << "#!/bin/bash\n";
|
ts << "#!/bin/bash\n";
|
||||||
|
|||||||
@@ -31,8 +31,9 @@ bool SSHManagerFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &s
|
|||||||
|
|
||||||
void SSHManagerFilterModel::setInvertFilter(bool invert)
|
void SSHManagerFilterModel::setInvertFilter(bool invert)
|
||||||
{
|
{
|
||||||
|
beginFilterChange();
|
||||||
m_invertFilter = invert;
|
m_invertFilter = invert;
|
||||||
invalidateFilter();
|
endFilterChange(QSortFilterProxyModel::Direction::Rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_sshmanagerfiltermodel.cpp"
|
#include "moc_sshmanagerfiltermodel.cpp"
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
// Own
|
// Own
|
||||||
#include "SessionController.h"
|
#include "SessionController.h"
|
||||||
|
|
||||||
|
#include "config-konsole.h"
|
||||||
|
|
||||||
#include "profile/ProfileManager.h"
|
#include "profile/ProfileManager.h"
|
||||||
#include "terminalDisplay/TerminalColor.h"
|
#include "terminalDisplay/TerminalColor.h"
|
||||||
#include "terminalDisplay/TerminalFonts.h"
|
#include "terminalDisplay/TerminalFonts.h"
|
||||||
@@ -145,7 +147,9 @@ SessionController::SessionController(Session *sessionParam, TerminalDisplay *vie
|
|||||||
setupExtraActions();
|
setupExtraActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if HAVE_QTPRINTSUPPORT
|
||||||
connect(this, &SessionController::requestPrint, view(), &TerminalDisplay::printScreen);
|
connect(this, &SessionController::requestPrint, view(), &TerminalDisplay::printScreen);
|
||||||
|
#endif
|
||||||
|
|
||||||
actionCollection()->addAssociatedWidget(viewParam);
|
actionCollection()->addAssociatedWidget(viewParam);
|
||||||
|
|
||||||
@@ -730,9 +734,11 @@ void SessionController::setupCommonActions()
|
|||||||
action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_S));
|
action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_S));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_QTPRINTSUPPORT
|
||||||
action = KStandardAction::print(this, &SessionController::requestPrint, collection);
|
action = KStandardAction::print(this, &SessionController::requestPrint, collection);
|
||||||
action->setText(i18n("&Print Screen..."));
|
action->setText(i18n("&Print Screen..."));
|
||||||
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::Key_P);
|
collection->setDefaultShortcut(action, Konsole::ACCEL | Qt::Key_P);
|
||||||
|
#endif
|
||||||
|
|
||||||
action = collection->addAction(QStringLiteral("adjust-history"), this, &SessionController::showHistoryOptions);
|
action = collection->addAction(QStringLiteral("adjust-history"), this, &SessionController::showHistoryOptions);
|
||||||
action->setText(i18n("Adjust Scrollback..."));
|
action->setText(i18n("Adjust Scrollback..."));
|
||||||
|
|||||||
@@ -55,7 +55,9 @@
|
|||||||
#include "../characters/ExtendedCharTable.h"
|
#include "../characters/ExtendedCharTable.h"
|
||||||
#include "../characters/LineBlockCharacters.h"
|
#include "../characters/LineBlockCharacters.h"
|
||||||
#include "../decoders/PlainTextDecoder.h"
|
#include "../decoders/PlainTextDecoder.h"
|
||||||
|
#if HAVE_QTPRINTSUPPORT
|
||||||
#include "../widgets/KonsolePrintManager.h"
|
#include "../widgets/KonsolePrintManager.h"
|
||||||
|
#endif
|
||||||
#include "../widgets/TerminalDisplayAccessible.h"
|
#include "../widgets/TerminalDisplayAccessible.h"
|
||||||
#include "EscapeSequenceUrlExtractor.h"
|
#include "EscapeSequenceUrlExtractor.h"
|
||||||
#include "PrintOptions.h"
|
#include "PrintOptions.h"
|
||||||
@@ -308,6 +310,7 @@ TerminalDisplay::TerminalDisplay(QWidget *parent)
|
|||||||
|
|
||||||
_terminalPainter = new TerminalPainter(this);
|
_terminalPainter = new TerminalPainter(this);
|
||||||
|
|
||||||
|
#if HAVE_QTPRINTSUPPORT
|
||||||
auto ldrawBackground = [this](QPainter &painter, const QRect &rect, const QColor &backgroundColor, bool useOpacitySetting) {
|
auto ldrawBackground = [this](QPainter &painter, const QRect &rect, const QColor &backgroundColor, bool useOpacitySetting) {
|
||||||
_terminalPainter->drawBackground(painter, rect, backgroundColor, useOpacitySetting);
|
_terminalPainter->drawBackground(painter, rect, backgroundColor, useOpacitySetting);
|
||||||
};
|
};
|
||||||
@@ -319,6 +322,7 @@ TerminalDisplay::TerminalDisplay(QWidget *parent)
|
|||||||
};
|
};
|
||||||
|
|
||||||
_printManager.reset(new KonsolePrintManager(ldrawBackground, ldrawContents, lgetBackgroundColor));
|
_printManager.reset(new KonsolePrintManager(ldrawBackground, ldrawContents, lgetBackgroundColor));
|
||||||
|
#endif
|
||||||
ubidi = ubidi_open();
|
ubidi = ubidi_open();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2305,7 +2309,7 @@ void TerminalDisplay::doPaste(QString text, bool appendReturn)
|
|||||||
if (isUnsafe(c)) {
|
if (isUnsafe(c)) {
|
||||||
const QString sequence = charToSequence(c);
|
const QString sequence = charToSequence(c);
|
||||||
const QString description = characterDescriptions.value(c.unicode(), QString());
|
const QString description = characterDescriptions.value(c.unicode(), QString());
|
||||||
QString entry = QStringLiteral("U+%1").arg(c.unicode(), 4, 16, QLatin1Char('0'));
|
QString entry = QStringLiteral("U+%1").arg(static_cast<uint>(c.unicode()), 4, 16, QLatin1Char('0'));
|
||||||
if (!sequence.isEmpty()) {
|
if (!sequence.isEmpty()) {
|
||||||
entry += QStringLiteral("\t%1").arg(sequence);
|
entry += QStringLiteral("\t%1").arg(sequence);
|
||||||
}
|
}
|
||||||
@@ -3182,6 +3186,7 @@ void TerminalDisplay::applyProfile(const Profile::Ptr &profile)
|
|||||||
|
|
||||||
void TerminalDisplay::printScreen()
|
void TerminalDisplay::printScreen()
|
||||||
{
|
{
|
||||||
|
#if HAVE_QTPRINTSUPPORT
|
||||||
auto lprintContent = [this](QPainter &painter, bool friendly) {
|
auto lprintContent = [this](QPainter &painter, bool friendly) {
|
||||||
QPoint columnLines(_usedLines, _usedColumns);
|
QPoint columnLines(_usedLines, _usedColumns);
|
||||||
auto lfontget = [this]() {
|
auto lfontget = [this]() {
|
||||||
@@ -3194,6 +3199,7 @@ void TerminalDisplay::printScreen()
|
|||||||
_printManager->printContent(painter, friendly, columnLines, lfontget, lfontset);
|
_printManager->printContent(painter, friendly, columnLines, lfontget, lfontset);
|
||||||
};
|
};
|
||||||
_printManager->printRequest(lprintContent, this);
|
_printManager->printRequest(lprintContent, this);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Character TerminalDisplay::getCursorCharacter(int column, int line)
|
Character TerminalDisplay::getCursorCharacter(int column, int line)
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
#ifndef TERMINALDISPLAY_H
|
#ifndef TERMINALDISPLAY_H
|
||||||
#define TERMINALDISPLAY_H
|
#define TERMINALDISPLAY_H
|
||||||
|
|
||||||
|
#include "config-konsole.h"
|
||||||
|
|
||||||
// Qt
|
// Qt
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
@@ -834,7 +836,9 @@ private:
|
|||||||
TerminalColor *_terminalColor = nullptr;
|
TerminalColor *_terminalColor = nullptr;
|
||||||
std::unique_ptr<TerminalFont> _terminalFont;
|
std::unique_ptr<TerminalFont> _terminalFont;
|
||||||
|
|
||||||
|
#if HAVE_QTPRINTSUPPORT
|
||||||
std::unique_ptr<KonsolePrintManager> _printManager;
|
std::unique_ptr<KonsolePrintManager> _printManager;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool _semanticUpDown;
|
bool _semanticUpDown;
|
||||||
bool _semanticInputClick;
|
bool _semanticInputClick;
|
||||||
|
|||||||
Reference in New Issue
Block a user