From 1d8995423d2ae2f697863df2e8d325bf45966621 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Fri, 16 Aug 2024 10:34:30 +0800 Subject: [PATCH 1/3] TerminalPlugin: use correct includes --- plugins/terminal/TerminalPlugin.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/terminal/TerminalPlugin.cpp b/plugins/terminal/TerminalPlugin.cpp index 3e43dcf..0508d8b 100644 --- a/plugins/terminal/TerminalPlugin.cpp +++ b/plugins/terminal/TerminalPlugin.cpp @@ -1,5 +1,6 @@ #include "TerminalPlugin.h" +#include #include #include #include @@ -7,8 +8,11 @@ #include #include +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #include - +#else +#include +#endif Preferences::Preferences(const QObject *parent, const QString &color, @@ -39,7 +43,6 @@ Preferences::Preferences(const QObject *parent, parent, SLOT(fontSizeChanged(int))); } - TerminalPlugin::TerminalPlugin() : QObject(), JuffPlugin() { w_ = new QTermWidget(); w_->setScrollBarPosition(QTermWidget::ScrollBarRight); From e5737f86a6e117596c58599aeade7effaa41f42f Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Fri, 16 Aug 2024 10:43:16 +0800 Subject: [PATCH 2/3] CMakeLists: fix linking to qtermwidget --- plugins/terminal/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/terminal/CMakeLists.txt b/plugins/terminal/CMakeLists.txt index fcbf75e..b0bef13 100644 --- a/plugins/terminal/CMakeLists.txt +++ b/plugins/terminal/CMakeLists.txt @@ -5,12 +5,13 @@ set (terminal_UI preferences.ui) if (USE_QT5) find_package ( QTermWidget5 REQUIRED ) qt5_wrap_ui(terminal_UI_SRC ${terminal_UI}) + set(qtermwidget_lib "qtermwidget5") else (USE_QT5) find_package ( QTermWidget4 REQUIRED ) qt4_wrap_ui(terminal_UI_SRC ${terminal_UI}) + set(qtermwidget_lib "qtermwidget4") endif (USE_QT5) add_library(terminal SHARED ${terminal_SRC} ${terminal_MOC} ${terminal_UI_SRC}) -target_link_libraries(terminal ${JUFFED_LIBRARY} qtermwidget5) +target_link_libraries(terminal ${JUFFED_LIBRARY} ${qtermwidget_lib}) install(TARGETS terminal DESTINATION ${JUFFED_PLUGINS_DIR}) - From b612563ea45ea211aba92693f57ea473194a277e Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Fri, 16 Aug 2024 10:55:01 +0800 Subject: [PATCH 3/3] main.cpp: fix regression introduced by AA_UseHighDpiPixmaps Fixes breakage from https://github.com/Mezomish/juffed/commit/91f833f6bb89eb355cccb1233836d2812df22bfe --- src/app/main.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index c1815c7..a3e9b39 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -3,6 +3,7 @@ #include "MainSettings.h" #include "Settings.h" +#include #include #include #include @@ -134,25 +135,27 @@ bool hasValidDoubleDashParam( const QCoreApplication& app ) { return true; } } - + return false; } int runSingle(int argc, char* argv[]) { QtSingleApplication app(argc, argv); +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); +#endif initApp(app); if ( hasValidDoubleDashParam( app ) ) { return 0; } - + // check if instance already exists QStringList fileList; foreach (QString param, app.arguments()) { fileList << QFileInfo(param).absoluteFilePath(); } - + if ( app.sendMessage(fileList.join("\n")) ) return 0; @@ -169,13 +172,15 @@ int runSingle(int argc, char* argv[]) { int runNotSingle(int argc, char* argv[]) { QApplication app(argc, argv); +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); +#endif initApp(app); if ( hasValidDoubleDashParam( app ) ) { return 0; } - + JuffEd juffed; juffed.mainWindow()->show();