feat: add Konsole recipe source and patches
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -44,11 +44,22 @@ include(ECMEnableSanitizers)
|
||||
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED
|
||||
Core
|
||||
- Multimedia
|
||||
- PrintSupport
|
||||
Widgets
|
||||
- Core5Compat
|
||||
)
|
||||
|
||||
+find_package(Qt6 ${QT_MIN_VERSION} CONFIG COMPONENTS Multimedia)
|
||||
+if(Qt6Multimedia_FOUND)
|
||||
+ set(HAVE_MULTIMEDIA TRUE)
|
||||
+endif()
|
||||
+
|
||||
+find_package(Qt6 ${QT_MIN_VERSION} CONFIG COMPONENTS PrintSupport)
|
||||
+if(Qt6PrintSupport_FOUND)
|
||||
+ set(HAVE_PRINTSUPPORT TRUE)
|
||||
+endif()
|
||||
+
|
||||
+find_package(Qt6 ${QT_MIN_VERSION} CONFIG COMPONENTS Core5Compat)
|
||||
+if(Qt6Core5Compat_FOUND)
|
||||
+ set(HAVE_CORE5COMPAT TRUE)
|
||||
+endif()
|
||||
+
|
||||
find_package(KF6 ${KF6_DEP_VERSION} REQUIRED
|
||||
Bookmarks
|
||||
Config
|
||||
@@ -103,7 +114,6 @@ set_package_properties(KF6DocTools PROPERTIES DESCRIPTION
|
||||
)
|
||||
|
||||
-find_package(ICU 61.0 COMPONENTS uc i18n REQUIRED)
|
||||
+find_package(ICU 61.0 COMPONENTS uc i18n)
|
||||
|
||||
if(UNIX AND NOT APPLE AND NOT ANDROID AND NOT HAIKU)
|
||||
option(WITH_X11 "Build with X11 integration" ON)
|
||||
--- a/src/Vt102Emulation.h
|
||||
+++ b/src/Vt102Emulation.h
|
||||
@@ -11,7 +11,9 @@
|
||||
// Qt
|
||||
#include <QHash>
|
||||
#include <QMap>
|
||||
+#if HAVE_MULTIMEDIA
|
||||
#include <QMediaPlayer>
|
||||
+#endif
|
||||
#include <QPair>
|
||||
#include <QVector>
|
||||
#include <QList>
|
||||
@@ -100,7 +102,11 @@
|
||||
private Q_SLOTS:
|
||||
void updateSessionAttributes();
|
||||
+#if HAVE_MULTIMEDIA
|
||||
void deletePlayer(QMediaPlayer::MediaStatus);
|
||||
+#else
|
||||
+ void deletePlayer(int);
|
||||
+#endif
|
||||
|
||||
private:
|
||||
unsigned int applyCharset(uint c);
|
||||
@@ -315,7 +321,9 @@
|
||||
int getFreeGraphicsImageId();
|
||||
|
||||
+#if HAVE_MULTIMEDIA
|
||||
QMediaPlayer *player;
|
||||
+#endif
|
||||
};
|
||||
|
||||
}
|
||||
--- a/src/Vt102Emulation.cpp
|
||||
+++ b/src/Vt102Emulation.cpp
|
||||
@@ -12,7 +12,9 @@
|
||||
#include <cstdio>
|
||||
|
||||
// Qt
|
||||
+#if HAVE_MULTIMEDIA
|
||||
#include <QAudioOutput>
|
||||
+#endif
|
||||
#include <QBuffer>
|
||||
#include <QEvent>
|
||||
#include <QKeyEvent>
|
||||
@@ -1295,12 +1297,16 @@
|
||||
if (inlineMedia) {
|
||||
+#if HAVE_MULTIMEDIA
|
||||
if (player == nullptr) {
|
||||
player = new QMediaPlayer(this);
|
||||
player->setAudioOutput(new QAudioOutput(player));
|
||||
connect(player, &QMediaPlayer::mediaStatusChanged, this, &Vt102Emulation::deletePlayer);
|
||||
}
|
||||
QBuffer *buffer = new QBuffer(player);
|
||||
buffer->setData(tokenData);
|
||||
buffer->open(QIODevice::ReadOnly);
|
||||
delete (QIODevice *)(player->sourceDevice());
|
||||
player->setSourceDevice(buffer);
|
||||
player->play();
|
||||
+#else
|
||||
+ return;
|
||||
+#endif
|
||||
return;
|
||||
}
|
||||
@@ -1336,12 +1342,16 @@
|
||||
+#if HAVE_MULTIMEDIA
|
||||
void Vt102Emulation::deletePlayer(QMediaPlayer::MediaStatus mediaStatus)
|
||||
{
|
||||
if (mediaStatus == QMediaPlayer::EndOfMedia || mediaStatus == QMediaPlayer::InvalidMedia) {
|
||||
QIODevice *buffer = (QIODevice *)(player->sourceDevice());
|
||||
buffer->deleteLater();
|
||||
player->deleteLater();
|
||||
player = nullptr;
|
||||
}
|
||||
}
|
||||
+#else
|
||||
+void Vt102Emulation::deletePlayer(int) {}
|
||||
+#endif
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -295,7 +295,9 @@
|
||||
target_link_libraries(konsoleprivate
|
||||
PUBLIC
|
||||
- Qt6::Core5Compat
|
||||
+ $<$<BOOL:${HAVE_CORE5COMPAT}>:Qt6::Core5Compat>
|
||||
PRIVATE
|
||||
KF6::IconWidgets
|
||||
KF6::BookmarksWidgets
|
||||
)
|
||||
Reference in New Issue
Block a user