From 0a78bfe4ac8bec71ab2ccc3d6286f2f2b475dcd3 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Mon, 20 Feb 2023 13:13:13 +0500 Subject: [PATCH] Fix inconsistent dll linkage errors and warnings on windows --- src/CMakeLists.txt | 33 +++++++++++++-- src/CopyInputDialog.h | 3 +- src/EscapeSequenceUrlExtractor.h | 4 +- src/HistorySizeDialog.h | 3 +- src/RenameTabDialog.h | 3 +- src/SSHProcessInfo.h | 2 +- src/SaveHistoryTask.h | 3 +- src/ScreenWindow.h | 3 +- src/SearchHistoryTask.h | 3 +- src/ShouldApplyProperty.h | 3 +- src/ZModemDialog.h | 4 +- src/autotests/CMakeLists.txt | 2 +- src/colorscheme/CMakeLists.txt | 2 +- src/colorscheme/ColorSchemeEditor.h | 4 +- src/decoders/CMakeLists.txt | 2 +- src/decoders/HTMLDecoder.h | 2 +- src/decoders/PlainTextDecoder.h | 2 +- src/decoders/TerminalCharacterDecoder.h | 5 +-- src/filterHotSpots/ColorFilter.h | 2 +- src/filterHotSpots/ColorFilterHotSpot.h | 2 +- src/filterHotSpots/EscapeSequenceUrlFilter.h | 2 +- .../EscapeSequenceUrlFilterHotSpot.h | 2 +- src/filterHotSpots/FileFilter.h | 2 +- src/filterHotSpots/FileFilterHotspot.h | 2 +- src/filterHotSpots/Filter.h | 3 +- src/filterHotSpots/FilterChain.h | 3 +- src/filterHotSpots/HotSpot.h | 3 +- src/filterHotSpots/RegExpFilter.h | 3 +- src/filterHotSpots/RegExpFilterHotspot.h | 2 +- src/filterHotSpots/TerminalImageFilterChain.h | 2 +- src/filterHotSpots/UrlFilterHotspot.h | 2 +- .../FallbackKeyboardTranslator.h | 2 +- src/keyboardtranslator/KeyboardTranslator.cpp | 4 +- src/keyboardtranslator/KeyboardTranslator.h | 8 ++-- .../KeyboardTranslatorManager.cpp | 10 ++--- .../KeyboardTranslatorManager.h | 1 - .../KeyboardTranslatorReader.cpp | 10 ++--- .../KeyboardTranslatorReader.h | 2 +- src/profile/CMakeLists.txt | 27 ------------ src/profile/Profile.h | 7 ++-- src/profile/ProfileCommandParser.h | 3 +- src/profile/ProfileGroup.h | 3 +- src/profile/ProfileList.h | 3 +- src/profile/ProfileManager.cpp | 12 +++--- src/profile/ProfileManager.h | 5 ++- src/profile/ProfileModel.h | 4 +- src/profile/ProfileReader.h | 2 +- src/profile/ProfileWriter.h | 2 +- src/session/CMakeLists.txt | 42 ------------------- src/session/Session.h | 5 ++- src/session/SessionController.cpp | 2 +- src/session/SessionController.h | 3 +- src/session/SessionDisplayConnection.h | 6 +-- src/session/SessionManager.cpp | 3 +- src/session/SessionManager.h | 4 +- src/terminalDisplay/TerminalFonts.h | 3 +- src/widgets/EditProfileDialog.h | 1 + src/widgets/IncrementalSearchBar.h | 4 +- 58 files changed, 127 insertions(+), 164 deletions(-) delete mode 100644 src/profile/CMakeLists.txt delete mode 100644 src/session/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f11a58f8e..f067155c0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -49,6 +49,16 @@ qt_add_dbus_adaptor(windowadaptors_SRCS ViewManager.h Konsole::ViewManager) +# qdbuscpp2xml -m Session.h -o org.kde.konsole.Session.xml +# Generate dbus .xml files; do not store .xml in source folder +qt_generate_dbus_interface(session/Session.h org.kde.konsole.Session.xml OPTIONS -m) + +qt_add_dbus_adaptor( + sessionadaptors_SRCS + ${CMAKE_CURRENT_BINARY_DIR}/org.kde.konsole.Session.xml + session/Session.h + Konsole::Session +) set(konsole_LIBS KF5::XmlGui @@ -114,8 +124,6 @@ target_link_libraries(konsolehelpers add_subdirectory(colorscheme) add_subdirectory(keyboardtranslator) -add_subdirectory(profile) -add_subdirectory(session) add_subdirectory(characters) add_subdirectory(decoders) add_subdirectory(plugins) @@ -191,6 +199,25 @@ set(konsoleprivate_SRCS ${windowadaptors_SRCS} terminalDisplay/TerminalFonts.cpp terminalDisplay/TerminalBell.cpp + profile/Profile.cpp + profile/ProfileCommandParser.cpp + profile/ProfileGroup.cpp + profile/ProfileList.cpp + profile/ProfileReader.cpp + profile/ProfileWriter.cpp + profile/ProfileManager.cpp + profile/ProfileModel.cpp + + ${sessionadaptors_SRCS} + session/Session.cpp + session/SessionController.cpp + session/SessionDisplayConnection.cpp + session/SessionGroup.cpp + session/SessionListModel.cpp + session/SessionManager.cpp + session/SessionTask.cpp + ${CMAKE_CURRENT_BINARY_DIR}/org.kde.konsole.Session.xml + widgets/TerminalDisplayAccessible.cpp widgets/TerminalHeaderBar.cpp widgets/ViewContainer.cpp @@ -239,8 +266,6 @@ target_link_libraries(konsoleprivate konsolecolorscheme keyboardtranslator konsolehelpers - konsolesession - konsoleprofile konsolecharacters konsoledecoders KF5::NewStuffWidgets diff --git a/src/CopyInputDialog.h b/src/CopyInputDialog.h index 34e2c3f25..37b9b4e37 100644 --- a/src/CopyInputDialog.h +++ b/src/CopyInputDialog.h @@ -15,6 +15,7 @@ #include // Konsole +#include "konsoleprivate_export.h" #include "session/Session.h" #include "session/SessionListModel.h" #include "session/SessionManager.h" @@ -34,7 +35,7 @@ class CheckableSessionModel; * set using setMasterSession(). After the dialog has been executed, * the set of chosen sessions can be retrieved using chosenSessions() */ -class CopyInputDialog : public QDialog +class KONSOLEPRIVATE_EXPORT CopyInputDialog : public QDialog { Q_OBJECT diff --git a/src/EscapeSequenceUrlExtractor.h b/src/EscapeSequenceUrlExtractor.h index b5085bbc5..7ebf6718f 100644 --- a/src/EscapeSequenceUrlExtractor.h +++ b/src/EscapeSequenceUrlExtractor.h @@ -10,6 +10,8 @@ #include +#include "konsoleprivate_export.h" + namespace Konsole { class Screen; @@ -34,7 +36,7 @@ struct ExtractedUrl { /* Stored in Screen, but used in V10Emulation to * store extracted URL's. Perhaps this should be a Model? */ -class EscapeSequenceUrlExtractor : public QObject +class KONSOLEPRIVATE_EXPORT EscapeSequenceUrlExtractor : public QObject { Q_OBJECT diff --git a/src/HistorySizeDialog.h b/src/HistorySizeDialog.h index 71490b788..5dc931fbe 100644 --- a/src/HistorySizeDialog.h +++ b/src/HistorySizeDialog.h @@ -13,6 +13,7 @@ // Konsole #include "Enumeration.h" +#include "konsoleprivate_export.h" namespace Ui { @@ -21,7 +22,7 @@ class HistorySizeDialog; namespace Konsole { -class HistorySizeDialog : public QDialog +class KONSOLEPRIVATE_EXPORT HistorySizeDialog : public QDialog { Q_OBJECT diff --git a/src/RenameTabDialog.h b/src/RenameTabDialog.h index e49a860b0..bb567fbef 100644 --- a/src/RenameTabDialog.h +++ b/src/RenameTabDialog.h @@ -8,6 +8,7 @@ #define RENAMETABDIALOG_H // KDE +#include "konsoleprivate_export.h" #include namespace Ui @@ -17,7 +18,7 @@ class RenameTabDialog; namespace Konsole { -class RenameTabDialog : public QDialog +class KONSOLEPRIVATE_EXPORT RenameTabDialog : public QDialog { Q_OBJECT diff --git a/src/SSHProcessInfo.h b/src/SSHProcessInfo.h index 07d8bc3bd..57b3836bc 100644 --- a/src/SSHProcessInfo.h +++ b/src/SSHProcessInfo.h @@ -14,7 +14,7 @@ namespace Konsole /** * Lightweight class which provides additional information about SSH processes. */ -class SSHProcessInfo +class KONSOLEPRIVATE_EXPORT SSHProcessInfo { public: /** diff --git a/src/SaveHistoryTask.h b/src/SaveHistoryTask.h index 0eeb1bc25..d31cf884e 100644 --- a/src/SaveHistoryTask.h +++ b/src/SaveHistoryTask.h @@ -8,6 +8,7 @@ #ifndef SAVEHISTORYTASK_H #define SAVEHISTORYTASK_H +#include "konsoleprivate_export.h" #include "session/SessionTask.h" #include @@ -20,7 +21,7 @@ class TerminalCharacterDecoder; * A task which prompts for a URL for each session and saves that session's output * to the given URL */ -class SaveHistoryTask : public SessionTask +class KONSOLEPRIVATE_EXPORT SaveHistoryTask : public SessionTask { Q_OBJECT diff --git a/src/ScreenWindow.h b/src/ScreenWindow.h index 78d0ba6d9..157b18eec 100644 --- a/src/ScreenWindow.h +++ b/src/ScreenWindow.h @@ -15,6 +15,7 @@ // Konsole #include "../characters/Character.h" #include "Screen.h" +#include "konsoleprivate_export.h" namespace Konsole { @@ -35,7 +36,7 @@ namespace Konsole * be called. This in turn will update the window's position and emit the outputChanged() signal * if necessary. */ -class ScreenWindow : public QObject +class KONSOLEPRIVATE_EXPORT ScreenWindow : public QObject { Q_OBJECT diff --git a/src/SearchHistoryTask.h b/src/SearchHistoryTask.h index fd5e2eae2..50ab47b7c 100644 --- a/src/SearchHistoryTask.h +++ b/src/SearchHistoryTask.h @@ -14,6 +14,7 @@ #include "Enumeration.h" #include "ScreenWindow.h" +#include "konsoleprivate_export.h" #include "session/Session.h" #include "session/SessionTask.h" @@ -34,7 +35,7 @@ namespace Konsole * TODO - Implementation requirements: * May provide progress feedback to the user when searching very large output logs. */ -class SearchHistoryTask : public SessionTask +class KONSOLEPRIVATE_EXPORT SearchHistoryTask : public SessionTask { Q_OBJECT diff --git a/src/ShouldApplyProperty.h b/src/ShouldApplyProperty.h index d1f3eab44..0e50d6a9c 100644 --- a/src/ShouldApplyProperty.h +++ b/src/ShouldApplyProperty.h @@ -9,12 +9,13 @@ #ifndef SHOULDAPPLYPROPERTY_H #define SHOULDAPPLYPROPERTY_H +#include "konsoleprivate_export.h" #include "profile/Profile.h" namespace Konsole { /** Utility class to simplify code in SessionManager::applyProfile(). */ -class ShouldApplyProperty +class KONSOLEPRIVATE_EXPORT ShouldApplyProperty { public: ShouldApplyProperty(const Profile::Ptr &profile, bool modifiedOnly); diff --git a/src/ZModemDialog.h b/src/ZModemDialog.h index 4c4b1bad0..3b5a0bfa2 100644 --- a/src/ZModemDialog.h +++ b/src/ZModemDialog.h @@ -9,11 +9,13 @@ #include +#include "konsoleprivate_export.h" + class KTextEdit; class QDialogButtonBox; namespace Konsole { -class ZModemDialog : public QDialog +class KONSOLEPRIVATE_EXPORT ZModemDialog : public QDialog { Q_OBJECT diff --git a/src/autotests/CMakeLists.txt b/src/autotests/CMakeLists.txt index 4a03b40a2..64eb1a69d 100644 --- a/src/autotests/CMakeLists.txt +++ b/src/autotests/CMakeLists.txt @@ -2,7 +2,7 @@ include(ECMAddTests) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) -set(KONSOLE_TEST_LIBS Qt::Test konsoleprivate konsolecharacters) +set(KONSOLE_TEST_LIBS Qt::Test konsoleprivate konsolecharacters konsoledecoders) # ATM issue with non-termination due to message dialog if(QT_MAJOR_VERSION EQUAL "5") diff --git a/src/colorscheme/CMakeLists.txt b/src/colorscheme/CMakeLists.txt index 7afea50ba..848b05489 100644 --- a/src/colorscheme/CMakeLists.txt +++ b/src/colorscheme/CMakeLists.txt @@ -29,7 +29,7 @@ add_library(konsolecolorscheme # Needed to link this static lib to shared libs set_target_properties(konsolecolorscheme PROPERTIES POSITION_INDEPENDENT_CODE ON) -generate_export_header(konsolecolorscheme BASE_NAME konsolecolorscheme) +# generate_export_header(konsolecolorscheme BASE_NAME konsolecolorscheme) target_include_directories(konsolecolorscheme PUBLIC ${CMAKE_CURRENT_BINARY_DIR} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/colorscheme/ColorSchemeEditor.h b/src/colorscheme/ColorSchemeEditor.h index 079d32eca..13d6b560a 100644 --- a/src/colorscheme/ColorSchemeEditor.h +++ b/src/colorscheme/ColorSchemeEditor.h @@ -13,8 +13,6 @@ // KDE #include -#include "konsolecolorscheme_export.h" - class QTableWidgetItem; namespace Ui @@ -38,7 +36,7 @@ class ColorScheme; * * When changes are made the colorsChanged() signal is emitted. */ -class KONSOLECOLORSCHEME_EXPORT ColorSchemeEditor : public QDialog +class ColorSchemeEditor : public QDialog { Q_OBJECT diff --git a/src/decoders/CMakeLists.txt b/src/decoders/CMakeLists.txt index 3a03944a6..7fe6644c3 100644 --- a/src/decoders/CMakeLists.txt +++ b/src/decoders/CMakeLists.txt @@ -6,7 +6,7 @@ add_library(konsoledecoders ) set_target_properties(konsoledecoders PROPERTIES POSITION_INDEPENDENT_CODE ON) -generate_export_header(konsoledecoders BASE_NAME konsoledecoders) +# generate_export_header(konsoledecoders BASE_NAME konsoledecoders) target_include_directories(konsoledecoders PUBLIC ${CMAKE_CURRENT_BINARY_DIR} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/decoders/HTMLDecoder.h b/src/decoders/HTMLDecoder.h index 758444d49..3e13fc87d 100644 --- a/src/decoders/HTMLDecoder.h +++ b/src/decoders/HTMLDecoder.h @@ -18,7 +18,7 @@ namespace Konsole /** * A terminal character decoder which produces pretty HTML markup */ -class KONSOLEDECODERS_EXPORT HTMLDecoder : public TerminalCharacterDecoder +class HTMLDecoder : public TerminalCharacterDecoder { public: /** diff --git a/src/decoders/PlainTextDecoder.h b/src/decoders/PlainTextDecoder.h index b84a547ca..cbd3683f5 100644 --- a/src/decoders/PlainTextDecoder.h +++ b/src/decoders/PlainTextDecoder.h @@ -20,7 +20,7 @@ namespace Konsole * A terminal character decoder which produces plain text, ignoring colors and other appearance-related * properties of the original characters. */ -class KONSOLEDECODERS_EXPORT PlainTextDecoder : public TerminalCharacterDecoder +class PlainTextDecoder : public TerminalCharacterDecoder { public: PlainTextDecoder(); diff --git a/src/decoders/TerminalCharacterDecoder.h b/src/decoders/TerminalCharacterDecoder.h index e1924a9bc..2b4c9e36d 100644 --- a/src/decoders/TerminalCharacterDecoder.h +++ b/src/decoders/TerminalCharacterDecoder.h @@ -13,9 +13,6 @@ // Konsole characters #include -// Konsole decoders -#include "konsoledecoders_export.h" - class QTextStream; namespace Konsole @@ -29,7 +26,7 @@ namespace Konsole * Derived classes may produce either plain text with no other color or appearance information, or * they may produce text which incorporates these additional properties. */ -class KONSOLEDECODERS_EXPORT TerminalCharacterDecoder +class TerminalCharacterDecoder { public: virtual ~TerminalCharacterDecoder() diff --git a/src/filterHotSpots/ColorFilter.h b/src/filterHotSpots/ColorFilter.h index b93709a85..9f3343de2 100644 --- a/src/filterHotSpots/ColorFilter.h +++ b/src/filterHotSpots/ColorFilter.h @@ -11,7 +11,7 @@ namespace Konsole { -class ColorFilter : public RegExpFilter +class KONSOLEPRIVATE_EXPORT ColorFilter : public RegExpFilter { public: ColorFilter(); diff --git a/src/filterHotSpots/ColorFilterHotSpot.h b/src/filterHotSpots/ColorFilterHotSpot.h index 563854995..581bc8790 100644 --- a/src/filterHotSpots/ColorFilterHotSpot.h +++ b/src/filterHotSpots/ColorFilterHotSpot.h @@ -14,7 +14,7 @@ namespace Konsole { -class ColorFilterHotSpot : public RegExpFilterHotSpot +class KONSOLEPRIVATE_EXPORT ColorFilterHotSpot : public RegExpFilterHotSpot { public: ColorFilterHotSpot(int startLine, int startColumn, int endLine, int endColumn, const QStringList &capturedTexts, const QColor &color); diff --git a/src/filterHotSpots/EscapeSequenceUrlFilter.h b/src/filterHotSpots/EscapeSequenceUrlFilter.h index 9988a4e81..0badce849 100644 --- a/src/filterHotSpots/EscapeSequenceUrlFilter.h +++ b/src/filterHotSpots/EscapeSequenceUrlFilter.h @@ -23,7 +23,7 @@ class TerminalDisplay; * for the Vt102Emulation or at least the data structure that holds the information * so we can create the hotspots. */ -class EscapeSequenceUrlFilter : public Filter +class KONSOLEPRIVATE_EXPORT EscapeSequenceUrlFilter : public Filter { public: EscapeSequenceUrlFilter(Session *session, TerminalDisplay *display); diff --git a/src/filterHotSpots/EscapeSequenceUrlFilterHotSpot.h b/src/filterHotSpots/EscapeSequenceUrlFilterHotSpot.h index 5d26b535e..c3c4306f6 100644 --- a/src/filterHotSpots/EscapeSequenceUrlFilterHotSpot.h +++ b/src/filterHotSpots/EscapeSequenceUrlFilterHotSpot.h @@ -12,7 +12,7 @@ namespace Konsole { -class EscapeSequenceUrlHotSpot : public HotSpot +class KONSOLEPRIVATE_EXPORT EscapeSequenceUrlHotSpot : public HotSpot { public: EscapeSequenceUrlHotSpot(int startLine, int startColumn, int endLine, int endColumn, const QString &text, const QString &url); diff --git a/src/filterHotSpots/FileFilter.h b/src/filterHotSpots/FileFilter.h index 7c13ec409..ebb14ba97 100644 --- a/src/filterHotSpots/FileFilter.h +++ b/src/filterHotSpots/FileFilter.h @@ -23,7 +23,7 @@ class HotSpot; * https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_267 */ -class FileFilter : public RegExpFilter +class KONSOLEPRIVATE_EXPORT FileFilter : public RegExpFilter { public: explicit FileFilter(Session *session, const QString &wordCharacters); diff --git a/src/filterHotSpots/FileFilterHotspot.h b/src/filterHotSpots/FileFilterHotspot.h index 391d4f402..a2b57055e 100644 --- a/src/filterHotSpots/FileFilterHotspot.h +++ b/src/filterHotSpots/FileFilterHotspot.h @@ -31,7 +31,7 @@ class TerminalDisplay; /** * Hotspot type created by FileFilter instances. */ -class FileFilterHotSpot : public RegExpFilterHotSpot +class KONSOLEPRIVATE_EXPORT FileFilterHotSpot : public RegExpFilterHotSpot { Q_OBJECT public: diff --git a/src/filterHotSpots/Filter.h b/src/filterHotSpots/Filter.h index 7f11e14c6..09c4ca879 100644 --- a/src/filterHotSpots/Filter.h +++ b/src/filterHotSpots/Filter.h @@ -20,6 +20,7 @@ // Konsole #include "../characters/Character.h" +#include "konsoleprivate_export.h" class QAction; class QMenu; @@ -48,7 +49,7 @@ class HotSpot; * When processing the text they should create instances of Filter::HotSpot subclasses for sections of interest * and add them to the filter's list of hotspots using addHotSpot() */ -class Filter +class KONSOLEPRIVATE_EXPORT Filter { public: /** Constructs a new filter. */ diff --git a/src/filterHotSpots/FilterChain.h b/src/filterHotSpots/FilterChain.h index b3f9078c1..3f1922d0d 100644 --- a/src/filterHotSpots/FilterChain.h +++ b/src/filterHotSpots/FilterChain.h @@ -14,6 +14,7 @@ #include #include "HotSpot.h" +#include "konsoleprivate_export.h" class QLeaveEvent; class QPainter; @@ -41,7 +42,7 @@ class TerminalDisplay; * The hotSpots() method return all of the hotspots in the text and on * a given line respectively. */ -class FilterChain +class KONSOLEPRIVATE_EXPORT FilterChain { public: explicit FilterChain(TerminalDisplay *terminalDisplay); diff --git a/src/filterHotSpots/HotSpot.h b/src/filterHotSpots/HotSpot.h index 9a0234078..a22385e9f 100644 --- a/src/filterHotSpots/HotSpot.h +++ b/src/filterHotSpots/HotSpot.h @@ -10,6 +10,7 @@ #include +#include "konsoleprivate_export.h" #include #include #include @@ -36,7 +37,7 @@ class TerminalDisplay; * Hotspots may have more than one action, in which case the list of actions can be obtained using the * actions() method. These actions may then be displayed in a popup menu or toolbar for example. */ -class HotSpot : public QObject +class KONSOLEPRIVATE_EXPORT HotSpot : public QObject { // krazy suggest using Q_OBJECT here but moc can not handle // nested classes diff --git a/src/filterHotSpots/RegExpFilter.h b/src/filterHotSpots/RegExpFilter.h index d28ff6ba4..dc135cc8f 100644 --- a/src/filterHotSpots/RegExpFilter.h +++ b/src/filterHotSpots/RegExpFilter.h @@ -10,6 +10,7 @@ #include "Filter.h" +#include "konsoleprivate_export.h" #include #include @@ -23,7 +24,7 @@ class HotSpot; * Subclasses can reimplement newHotSpot() to return custom hotspot types when matches for the regular expression * are found. */ -class RegExpFilter : public Filter +class KONSOLEPRIVATE_EXPORT RegExpFilter : public Filter { public: /** Constructs a new regular expression filter */ diff --git a/src/filterHotSpots/RegExpFilterHotspot.h b/src/filterHotSpots/RegExpFilterHotspot.h index d68ec604b..badd404ee 100644 --- a/src/filterHotSpots/RegExpFilterHotspot.h +++ b/src/filterHotSpots/RegExpFilterHotspot.h @@ -17,7 +17,7 @@ namespace Konsole * Type of hotspot created by RegExpFilter. The capturedTexts() method can be used to find the text * matched by the filter's regular expression. */ -class RegExpFilterHotSpot : public HotSpot +class KONSOLEPRIVATE_EXPORT RegExpFilterHotSpot : public HotSpot { public: RegExpFilterHotSpot(int startLine, int startColumn, int endLine, int endColumn, const QStringList &capturedTexts); diff --git a/src/filterHotSpots/TerminalImageFilterChain.h b/src/filterHotSpots/TerminalImageFilterChain.h index a1e1f4318..01c7e873c 100644 --- a/src/filterHotSpots/TerminalImageFilterChain.h +++ b/src/filterHotSpots/TerminalImageFilterChain.h @@ -19,7 +19,7 @@ namespace Konsole class TerminalDisplay; /** A filter chain which processes character images from terminal displays */ -class TerminalImageFilterChain : public FilterChain +class KONSOLEPRIVATE_EXPORT TerminalImageFilterChain : public FilterChain { public: explicit TerminalImageFilterChain(TerminalDisplay *terminalDisplay); diff --git a/src/filterHotSpots/UrlFilterHotspot.h b/src/filterHotSpots/UrlFilterHotspot.h index fe1242585..4145625eb 100644 --- a/src/filterHotSpots/UrlFilterHotspot.h +++ b/src/filterHotSpots/UrlFilterHotspot.h @@ -19,7 +19,7 @@ namespace Konsole * Hotspot type created by UrlFilter instances. The activate() method opens a web browser * at the given URL when called. */ -class UrlFilterHotSpot : public RegExpFilterHotSpot +class KONSOLEPRIVATE_EXPORT UrlFilterHotSpot : public RegExpFilterHotSpot { public: UrlFilterHotSpot(int startLine, int startColumn, int endLine, int endColumn, const QStringList &capturedTexts); diff --git a/src/keyboardtranslator/FallbackKeyboardTranslator.h b/src/keyboardtranslator/FallbackKeyboardTranslator.h index a76441e5d..1dc529095 100644 --- a/src/keyboardtranslator/FallbackKeyboardTranslator.h +++ b/src/keyboardtranslator/FallbackKeyboardTranslator.h @@ -14,7 +14,7 @@ namespace Konsole { -class KONSOLEPRIVATE_EXPORT FallbackKeyboardTranslator : public KeyboardTranslator +class FallbackKeyboardTranslator : public KeyboardTranslator { public: FallbackKeyboardTranslator(); diff --git a/src/keyboardtranslator/KeyboardTranslator.cpp b/src/keyboardtranslator/KeyboardTranslator.cpp index 191707fab..b535b4f42 100644 --- a/src/keyboardtranslator/KeyboardTranslator.cpp +++ b/src/keyboardtranslator/KeyboardTranslator.cpp @@ -9,8 +9,6 @@ // Own #include "KeyboardTranslator.h" -#include "../konsoledebug.h" - // System #include #include @@ -21,6 +19,8 @@ // KDE #include +Q_LOGGING_CATEGORY(KonsoleKeyTrDebug, "org.kde.konsole.keytranslator", QtDebugMsg) + using namespace Konsole; KeyboardTranslator::Entry::Entry() diff --git a/src/keyboardtranslator/KeyboardTranslator.h b/src/keyboardtranslator/KeyboardTranslator.h index 243f42fa8..9cc460795 100644 --- a/src/keyboardtranslator/KeyboardTranslator.h +++ b/src/keyboardtranslator/KeyboardTranslator.h @@ -11,16 +11,16 @@ // Qt #include +#include #include #include #include -// Konsole -#include "../konsoleprivate_export.h" - class QIODevice; class QTextStream; +Q_DECLARE_LOGGING_CATEGORY(KonsoleKeyTrDebug) + namespace Konsole { /** @@ -36,7 +36,7 @@ namespace Konsole * (Shift,Ctrl,Alt,Meta etc.) and state flags which indicate the state * which the terminal must be in for the key sequence to apply. */ -class KONSOLEPRIVATE_EXPORT KeyboardTranslator +class KeyboardTranslator { public: /** diff --git a/src/keyboardtranslator/KeyboardTranslatorManager.cpp b/src/keyboardtranslator/KeyboardTranslatorManager.cpp index 1e1a16621..1f25402ad 100644 --- a/src/keyboardtranslator/KeyboardTranslatorManager.cpp +++ b/src/keyboardtranslator/KeyboardTranslatorManager.cpp @@ -13,8 +13,6 @@ #include "KeyboardTranslatorReader.h" #include "KeyboardTranslatorWriter.h" -#include "../konsoledebug.h" - // Qt #include #include @@ -48,7 +46,7 @@ void KeyboardTranslatorManager::addTranslator(KeyboardTranslator *translator) _translators.insert(translator->name(), translator); if (!saveTranslator(translator)) { - qCDebug(KonsoleDebug) << "Unable to save translator" << translator->name() << "to disk."; + qCDebug(KonsoleKeyTrDebug) << "Unable to save translator" << translator->name() << "to disk."; } } @@ -62,7 +60,7 @@ bool KeyboardTranslatorManager::deleteTranslator(const QString &name) _translators.remove(name); return true; } - qCDebug(KonsoleDebug) << "Failed to remove translator - " << path; + qCDebug(KonsoleKeyTrDebug) << "Failed to remove translator - " << path; return false; } @@ -126,7 +124,7 @@ const KeyboardTranslator *KeyboardTranslatorManager::findTranslator(const QStrin if (translator != nullptr) { _translators[name] = translator; } else if (!name.isEmpty()) { - qCDebug(KonsoleDebug) << "Unable to load translator" << name; + qCDebug(KonsoleKeyTrDebug) << "Unable to load translator" << name; } return translator; @@ -142,7 +140,7 @@ bool KeyboardTranslatorManager::saveTranslator(const KeyboardTranslator *transla QFile destination(path); if (!destination.open(QIODevice::WriteOnly | QIODevice::Text)) { - qCDebug(KonsoleDebug) << "Unable to save keyboard translation:" << destination.errorString(); + qCDebug(KonsoleKeyTrDebug) << "Unable to save keyboard translation:" << destination.errorString(); return false; } diff --git a/src/keyboardtranslator/KeyboardTranslatorManager.h b/src/keyboardtranslator/KeyboardTranslatorManager.h index 54524950e..4109fa55b 100644 --- a/src/keyboardtranslator/KeyboardTranslatorManager.h +++ b/src/keyboardtranslator/KeyboardTranslatorManager.h @@ -14,7 +14,6 @@ #include // Konsole -#include "../konsoleprivate_export.h" #include "KeyboardTranslator.h" class QIODevice; diff --git a/src/keyboardtranslator/KeyboardTranslatorReader.cpp b/src/keyboardtranslator/KeyboardTranslatorReader.cpp index d542ac6eb..ae15d1591 100644 --- a/src/keyboardtranslator/KeyboardTranslatorReader.cpp +++ b/src/keyboardtranslator/KeyboardTranslatorReader.cpp @@ -8,8 +8,6 @@ #include "KeyboardTranslatorReader.h" -#include "../konsoledebug.h" - // Qt #include #include @@ -82,7 +80,7 @@ void KeyboardTranslatorReader::readNext() } else if (tokens[2].type == Token::Command) { // identify command if (!parseAsCommand(tokens[2].text, command)) { - qCDebug(KonsoleDebug) << "Key" << tokens[1].text << ", Command" << tokens[2].text << "not understood. "; + qCDebug(KonsoleKeyTrDebug) << "Key" << tokens[1].text << ", Command" << tokens[2].text << "not understood. "; } } @@ -180,7 +178,7 @@ bool KeyboardTranslatorReader::decodeSequence(const QString &text, } else if (parseAsKeyCode(buffer, itemKeyCode)) { keyCode = itemKeyCode; } else { - qCDebug(KonsoleDebug) << "Unable to parse key binding item:" << buffer; + qCDebug(KonsoleKeyTrDebug) << "Unable to parse key binding item:" << buffer; } buffer.clear(); @@ -254,7 +252,7 @@ bool KeyboardTranslatorReader::parseAsKeyCode(const QString &item, int &keyCode) #endif if (sequence.count() > 1) { - qCDebug(KonsoleDebug) << "Unhandled key codes in sequence: " << item; + qCDebug(KonsoleKeyTrDebug) << "Unhandled key codes in sequence: " << item; } } else { return false; @@ -364,7 +362,7 @@ QList KeyboardTranslatorReader::tokenize(const QRegularExpressionMatch keyMatch(key.match(text)); if (!keyMatch.hasMatch()) { - qCDebug(KonsoleDebug) << "Line in keyboard translator file could not be parsed:" << text; + qCDebug(KonsoleKeyTrDebug) << "Line in keyboard translator file could not be parsed:" << text; return list; } diff --git a/src/keyboardtranslator/KeyboardTranslatorReader.h b/src/keyboardtranslator/KeyboardTranslatorReader.h index 6d9385c13..a88e1fa99 100644 --- a/src/keyboardtranslator/KeyboardTranslatorReader.h +++ b/src/keyboardtranslator/KeyboardTranslatorReader.h @@ -44,7 +44,7 @@ namespace Konsole * } * @endcode */ -class KONSOLEPRIVATE_EXPORT KeyboardTranslatorReader +class KeyboardTranslatorReader { public: /** Constructs a new reader which parses the given @p source */ diff --git a/src/profile/CMakeLists.txt b/src/profile/CMakeLists.txt deleted file mode 100644 index f26c983c7..000000000 --- a/src/profile/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ - - -add_library(konsoleprofile -OBJECT - Profile.cpp - ProfileCommandParser.cpp - ProfileGroup.cpp - ProfileList.cpp - ProfileReader.cpp - ProfileWriter.cpp - ProfileManager.cpp - ProfileModel.cpp - ${konsoleprofile_SRCS} -) -set_property(TARGET konsoleprofile PROPERTY POSITION_INDEPENDENT_CODE ON) - -generate_export_header(konsoleprofile BASE_NAME konsoleprofile) -target_include_directories(konsoleprofile PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries( - konsoleprofile - ${konsole_LIBS} - konsoleprivate_core - konsolecolorscheme - keyboardtranslator - konsolehelpers - KF5::CoreAddons -) diff --git a/src/profile/Profile.h b/src/profile/Profile.h index 864de6cdd..66adea04e 100644 --- a/src/profile/Profile.h +++ b/src/profile/Profile.h @@ -17,12 +17,11 @@ #include #include +#include "konsoleprivate_export.h" + #include #include -// Konsole -#include "konsoleprofile_export.h" - namespace Konsole { class ProfileGroup; @@ -45,7 +44,7 @@ class ProfileGroup; * Profiles can be loaded from disk using ProfileReader instances * and saved to disk using ProfileWriter instances. */ -class KONSOLEPROFILE_EXPORT Profile : public QSharedData +class KONSOLEPRIVATE_EXPORT Profile : public QSharedData { Q_GADGET diff --git a/src/profile/ProfileCommandParser.h b/src/profile/ProfileCommandParser.h index 27b48477a..4812047ad 100644 --- a/src/profile/ProfileCommandParser.h +++ b/src/profile/ProfileCommandParser.h @@ -11,7 +11,6 @@ // Konsole #include "Profile.h" -#include "konsoleprofile_export.h" class QVariant; template @@ -36,7 +35,7 @@ namespace Konsole * Icon=konsole;Directory=/home/bob * @endcode */ -class KONSOLEPROFILE_EXPORT ProfileCommandParser +class KONSOLEPRIVATE_EXPORT ProfileCommandParser { public: /** diff --git a/src/profile/ProfileGroup.h b/src/profile/ProfileGroup.h index 9e97bd755..89a9dec8c 100644 --- a/src/profile/ProfileGroup.h +++ b/src/profile/ProfileGroup.h @@ -11,7 +11,6 @@ // Konsole #include "Profile.h" -#include "konsoleprofile_export.h" // Qt #include @@ -31,7 +30,7 @@ namespace Konsole * The Profile::Name and Profile::Path properties are unique to individual * profiles, setting these properties on a ProfileGroup has no effect. */ -class KONSOLEPROFILE_EXPORT ProfileGroup : public Profile +class KONSOLEPRIVATE_EXPORT ProfileGroup : public Profile { public: using Ptr = QExplicitlySharedDataPointer; diff --git a/src/profile/ProfileList.h b/src/profile/ProfileList.h index 65894d5c0..031638f78 100644 --- a/src/profile/ProfileList.h +++ b/src/profile/ProfileList.h @@ -15,7 +15,6 @@ // Konsole #include "Profile.h" -#include "konsoleprofile_export.h" class QActionGroup; class QKeySequence; @@ -33,7 +32,7 @@ namespace Konsole * The user-data associated with each session can be passed to the createProfile() method of the * SessionManager to create a new terminal session. */ -class KONSOLEPROFILE_EXPORT ProfileList : public QObject +class KONSOLEPRIVATE_EXPORT ProfileList : public QObject { Q_OBJECT diff --git a/src/profile/ProfileManager.cpp b/src/profile/ProfileManager.cpp index 8a6b2e18c..18b315867 100644 --- a/src/profile/ProfileManager.cpp +++ b/src/profile/ProfileManager.cpp @@ -10,8 +10,6 @@ #include "ProfileManager.h" #include "PopStackOnExit.h" -#include "konsoledebug.h" - // Qt #include #include @@ -30,6 +28,8 @@ #include "ProfileReader.h" #include "ProfileWriter.h" +Q_LOGGING_CATEGORY(KonsoleProfileDebug, "org.kde.konsole.profile", QtDebugMsg) + using namespace Konsole; static bool stringLessThan(const QString &p1, const QString &p2) @@ -143,7 +143,7 @@ Profile::Ptr ProfileManager::loadProfile(const QString &shortPath) PopStackOnExit popGuardOnExit(recursionGuard); if (recursionGuard.contains(path)) { - qCDebug(KonsoleDebug) << "Ignoring attempt to load profile recursively from" << path; + qCDebug(KonsoleProfileDebug) << "Ignoring attempt to load profile recursively from" << path; return _builtinProfile; } recursionGuard.push(path); @@ -163,10 +163,10 @@ Profile::Ptr ProfileManager::loadProfile(const QString &shortPath) } if (!result) { - qCDebug(KonsoleDebug) << "Could not load profile from " << path; + qCDebug(KonsoleProfileDebug) << "Could not load profile from " << path; return Profile::Ptr(); } else if (newProfile->name().isEmpty()) { - qCWarning(KonsoleDebug) << path << " does not have a valid name, ignoring."; + qCWarning(KonsoleProfileDebug) << path << " does not have a valid name, ignoring."; return Profile::Ptr(); } else { addProfile(newProfile); @@ -352,7 +352,7 @@ bool ProfileManager::deleteProfile(Profile::Ptr profile) // try to delete the config file if (profile->isPropertySet(Profile::Path) && QFile::exists(profile->path())) { if (!QFile::remove(profile->path())) { - qCDebug(KonsoleDebug) << "Could not delete profile: " << profile->path() << "The file is most likely in a directory which is read-only."; + qCDebug(KonsoleProfileDebug) << "Could not delete profile: " << profile->path() << "The file is most likely in a directory which is read-only."; return false; } diff --git a/src/profile/ProfileManager.h b/src/profile/ProfileManager.h index d7c21d9ac..ecbe00e98 100644 --- a/src/profile/ProfileManager.h +++ b/src/profile/ProfileManager.h @@ -12,6 +12,7 @@ // Qt #include #include +#include #include #include @@ -21,13 +22,15 @@ // Konsole #include "Profile.h" +Q_DECLARE_LOGGING_CATEGORY(KonsoleProfileDebug) + namespace Konsole { /** * Manages profiles which specify various settings for terminal sessions * and their displays. */ -class KONSOLEPROFILE_EXPORT ProfileManager : public QObject +class KONSOLEPRIVATE_EXPORT ProfileManager : public QObject { Q_OBJECT diff --git a/src/profile/ProfileModel.h b/src/profile/ProfileModel.h index cbcf2dcdf..f393f129e 100644 --- a/src/profile/ProfileModel.h +++ b/src/profile/ProfileModel.h @@ -7,7 +7,7 @@ #ifndef PROFILE_MODEL_H #define PROFILE_MODEL_H -#include "konsoleprofile_export.h" +#include "konsoleprivate_export.h" #include #include @@ -17,7 +17,7 @@ namespace Konsole { class Profile; -class KONSOLEPROFILE_EXPORT ProfileModel : public QAbstractTableModel +class KONSOLEPRIVATE_EXPORT ProfileModel : public QAbstractTableModel { Q_OBJECT public: diff --git a/src/profile/ProfileReader.h b/src/profile/ProfileReader.h index 1f4d6a52c..7a79f3b5e 100644 --- a/src/profile/ProfileReader.h +++ b/src/profile/ProfileReader.h @@ -16,7 +16,7 @@ class KConfig; namespace Konsole { /** Interface for all classes which can load profile settings from a file. */ -class KONSOLEPROFILE_EXPORT ProfileReader +class KONSOLEPRIVATE_EXPORT ProfileReader { public: ProfileReader(); diff --git a/src/profile/ProfileWriter.h b/src/profile/ProfileWriter.h index 3237568b8..fb45da366 100644 --- a/src/profile/ProfileWriter.h +++ b/src/profile/ProfileWriter.h @@ -16,7 +16,7 @@ class KConfig; namespace Konsole { /** Interface for all classes which can write profile settings to a file. */ -class KONSOLEPROFILE_EXPORT ProfileWriter +class KONSOLEPRIVATE_EXPORT ProfileWriter { public: ProfileWriter(); diff --git a/src/session/CMakeLists.txt b/src/session/CMakeLists.txt deleted file mode 100644 index 3cfcca396..000000000 --- a/src/session/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -#TODO: This Needs TerminalDisplay. Perhaps we should create a library -# that has only TerminalDisplay and link with this one? It's a hard thing -# to do as currently SessionController depends on TerminalDisplay and -# TerminalDisplay depends on SessionController. - -# qdbuscpp2xml -m Session.h -o org.kde.konsole.Session.xml -# Generate dbus .xml files; do not store .xml in source folder -qt_generate_dbus_interface(Session.h org.kde.konsole.Session.xml OPTIONS -m) - -qt_add_dbus_adaptor( - sessionadaptors_SRCS - ${CMAKE_CURRENT_BINARY_DIR}/org.kde.konsole.Session.xml - Session.h - Konsole::Session -) - -set(konsole_session_SRCS - ${sessionadaptors_SRCS} - Session.cpp - SessionController.cpp - SessionDisplayConnection.cpp - SessionGroup.cpp - SessionListModel.cpp - SessionManager.cpp - SessionTask.cpp - ${CMAKE_CURRENT_BINARY_DIR}/org.kde.konsole.Session.xml -) - -add_library(konsolesession - OBJECT - ${konsole_session_SRCS} -) - -set_property(TARGET konsolesession PROPERTY POSITION_INDEPENDENT_CODE ON) - -generate_export_header(konsolesession BASE_NAME konsolesession) -target_include_directories(konsolesession PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries( - konsolesession - ${konsole_LIBS} - konsoleprofile # TODO: Must be removed from here, Used only for ProfileCommandParser::parse in SessionManager::sessionProfileCommandReceived -) diff --git a/src/session/Session.h b/src/session/Session.h index 6da867001..b30560759 100644 --- a/src/session/Session.h +++ b/src/session/Session.h @@ -11,6 +11,7 @@ // Qt #include +#include #include #include #include @@ -21,7 +22,7 @@ // Konsole #include "Shortcut_p.h" #include "config-konsole.h" -#include "konsolesession_export.h" +#include "konsoleprivate_export.h" class QColor; class QTextCodec; @@ -49,7 +50,7 @@ class HistoryType; * or send input to the program in the terminal in the form of keypresses and mouse * activity. */ -class KONSOLESESSION_EXPORT Session : public QObject +class KONSOLEPRIVATE_EXPORT Session : public QObject { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.konsole.Session") diff --git a/src/session/SessionController.cpp b/src/session/SessionController.cpp index bdfe9e35f..5cf6f6b5a 100644 --- a/src/session/SessionController.cpp +++ b/src/session/SessionController.cpp @@ -8,7 +8,6 @@ // Own #include "SessionController.h" -#include "konsoledebug.h" #include "profile/ProfileManager.h" #include "terminalDisplay/TerminalColor.h" #include "terminalDisplay/TerminalFonts.h" @@ -68,6 +67,7 @@ #include "SaveHistoryTask.h" #include "ScreenWindow.h" #include "SearchHistoryTask.h" +#include "konsoledebug.h" #include "filterHotSpots/ColorFilter.h" #include "filterHotSpots/EscapeSequenceUrlFilter.h" diff --git a/src/session/SessionController.h b/src/session/SessionController.h index d01c7acd5..e284aa205 100644 --- a/src/session/SessionController.h +++ b/src/session/SessionController.h @@ -24,6 +24,7 @@ #include "Session.h" #include "SessionDisplayConnection.h" #include "ViewProperties.h" +#include "konsoleprivate_export.h" class QAction; class QTextCodec; @@ -65,7 +66,7 @@ class HotSpot; * which contains the view to plug the controller's actions into the menu when * the view is focused. */ -class KONSOLESESSION_EXPORT SessionController : public ViewProperties, public KXMLGUIClient +class KONSOLEPRIVATE_EXPORT SessionController : public ViewProperties, public KXMLGUIClient { Q_OBJECT diff --git a/src/session/SessionDisplayConnection.h b/src/session/SessionDisplayConnection.h index b0bf60576..5712c17c1 100644 --- a/src/session/SessionDisplayConnection.h +++ b/src/session/SessionDisplayConnection.h @@ -10,15 +10,15 @@ // Qt #include #include -// Konsole -#include "konsolesession_export.h" + +#include "konsoleprivate_export.h" namespace Konsole { class Session; class TerminalDisplay; -class KONSOLESESSION_EXPORT SessionDisplayConnection : public QObject +class KONSOLEPRIVATE_EXPORT SessionDisplayConnection : public QObject { Q_OBJECT public: diff --git a/src/session/SessionManager.cpp b/src/session/SessionManager.cpp index d1ba96e68..8725962b6 100644 --- a/src/session/SessionManager.cpp +++ b/src/session/SessionManager.cpp @@ -9,8 +9,6 @@ // Own #include "SessionManager.h" -#include "konsoledebug.h" - // Qt #include #include @@ -25,6 +23,7 @@ #include "EscapeSequenceUrlExtractor.h" #include "Screen.h" #include "ShouldApplyProperty.h" +#include "konsoledebug.h" #include "history/HistoryTypeFile.h" #include "history/HistoryTypeNone.h" diff --git a/src/session/SessionManager.h b/src/session/SessionManager.h index b283f2dc2..a7854713b 100644 --- a/src/session/SessionManager.h +++ b/src/session/SessionManager.h @@ -17,8 +17,6 @@ // TODO: Move the Property away from Profile.h #include "profile/Profile.h" -#include "konsolesession_export.h" - class KConfig; namespace Konsole @@ -29,7 +27,7 @@ class Profile; /** * Manages running terminal sessions. */ -class KONSOLESESSION_EXPORT SessionManager : public QObject +class KONSOLEPRIVATE_EXPORT SessionManager : public QObject { Q_OBJECT diff --git a/src/terminalDisplay/TerminalFonts.h b/src/terminalDisplay/TerminalFonts.h index 5a42811c3..bb27a43b9 100644 --- a/src/terminalDisplay/TerminalFonts.h +++ b/src/terminalDisplay/TerminalFonts.h @@ -11,13 +11,14 @@ #include +#include "konsoleprivate_export.h" #include "profile/Profile.h" class QFont; namespace Konsole { -class TerminalFont +class KONSOLEPRIVATE_EXPORT TerminalFont { public: explicit TerminalFont(QWidget *parent = nullptr); diff --git a/src/widgets/EditProfileDialog.h b/src/widgets/EditProfileDialog.h index 4e76096d2..841d9ced0 100644 --- a/src/widgets/EditProfileDialog.h +++ b/src/widgets/EditProfileDialog.h @@ -18,6 +18,7 @@ #include "colorscheme/ColorScheme.h" #include "colorscheme/ColorSchemeEditor.h" #include "colorscheme/ColorSchemeViewDelegate.h" +#include "konsoleprivate_export.h" #include "profile/Profile.h" #include "profile/ProfileGroup.h" diff --git a/src/widgets/IncrementalSearchBar.h b/src/widgets/IncrementalSearchBar.h index 5ce02425d..82777e185 100644 --- a/src/widgets/IncrementalSearchBar.h +++ b/src/widgets/IncrementalSearchBar.h @@ -11,6 +11,8 @@ #include #include +#include "konsoleprivate_export.h" + class QAction; class QTimer; class QLineEdit; @@ -39,7 +41,7 @@ namespace Konsole * as a regular expression. * The matchRegExpToggled() signal is emitted when this is changed. */ -class IncrementalSearchBar : public QWidget +class KONSOLEPRIVATE_EXPORT IncrementalSearchBar : public QWidget { Q_OBJECT