Commit ba91583f authored by Tomaz  Canabrava's avatar Tomaz Canabrava
Browse files

Add new Library keyboardtranslator

parent fbe57423
......@@ -76,12 +76,17 @@ endif()
# This konsoleprivate_core is the "core" library that depends in nothing from konsole itself
# so we can start to detangle the codebase.
set(konsoleprivate_core_SRCS ShellCommand.cpp)
set(konsoleprivate_core_SRCS
ShellCommand.cpp
WindowSystemInfo.cpp
)
add_library(konsoleprivate_core STATIC ${konsoleprivate_core_SRCS})
target_link_libraries(konsoleprivate_core ${konsole_LIBS})
add_subdirectory(colorscheme)
add_subdirectory(keyboardtranslator)
add_subdirectory(profile)
set(konsoleprivate_SRCS ${sessionadaptors_SRCS}
......@@ -122,11 +127,6 @@ set(konsoleprivate_SRCS ${sessionadaptors_SRCS}
widgets/HistorySizeWidget.cpp
widgets/IncrementalSearchBar.cpp
KeyBindingEditor.cpp
KeyboardTranslator.cpp
FallbackKeyboardTranslator.cpp
KeyboardTranslatorReader.cpp
KeyboardTranslatorWriter.cpp
KeyboardTranslatorManager.cpp
ProcessInfo.cpp
NullProcessInfo.cpp
UnixProcessInfo.cpp
......@@ -161,7 +161,6 @@ set(konsoleprivate_SRCS ${sessionadaptors_SRCS}
Vt102Emulation.cpp
ZModemDialog.cpp
PrintOptions.cpp
WindowSystemInfo.cpp
CharacterWidth.cpp
CompositeWidgetFocusWatcher.cpp
AutoScrollHandler.cpp
......@@ -201,6 +200,7 @@ target_link_libraries(konsoleprivate
PUBLIC
konsoleprivate_core
konsolecolorscheme
keyboardtranslator
konsoleprofile
${konsole_LIBS}
)
......
......@@ -26,8 +26,8 @@
#include <QKeyEvent>
// Konsole
#include "KeyboardTranslator.h"
#include "KeyboardTranslatorManager.h"
#include "keyboardtranslator/KeyboardTranslator.h"
#include "keyboardtranslator/KeyboardTranslatorManager.h"
#include "Screen.h"
#include "ScreenWindow.h"
......
......@@ -31,9 +31,9 @@
// Konsole
#include "ui_KeyBindingEditor.h"
#include "KeyboardTranslator.h"
#include "KeyboardTranslatorReader.h"
#include "KeyboardTranslatorManager.h"
#include "keyboardtranslator/KeyboardTranslator.h"
#include "keyboardtranslator/KeyboardTranslatorReader.h"
#include "keyboardtranslator/KeyboardTranslatorManager.h"
#include "profile/EditProfileDialog.h"
......
......@@ -36,7 +36,7 @@
#include <KLocalizedString>
// Konsole
#include "KeyboardTranslator.h"
#include "keyboardtranslator/KeyboardTranslator.h"
#include "session/SessionController.h"
#include "widgets/TerminalDisplay.h"
......
add_library(keyboardtranslator
STATIC
FallbackKeyboardTranslator.cpp
KeyboardTranslatorManager.cpp
KeyboardTranslatorWriter.cpp
KeyboardTranslator.cpp
KeyboardTranslatorReader.cpp
)
target_link_libraries(
keyboardtranslator
${konsole_LIBS}
)
......@@ -22,7 +22,7 @@
// Own
#include "KeyboardTranslator.h"
#include "konsoledebug.h"
#include "../konsoledebug.h"
// System
#include <cctype>
......
......@@ -29,7 +29,7 @@
#include <QString>
// Konsole
#include "konsoleprivate_export.h"
#include "../konsoleprivate_export.h"
class QIODevice;
class QTextStream;
......
......@@ -26,7 +26,7 @@
#include "KeyboardTranslatorReader.h"
#include "KeyboardTranslatorWriter.h"
#include "konsoledebug.h"
#include "../konsoledebug.h"
// Qt
#include <QFile>
......@@ -75,7 +75,7 @@ bool KeyboardTranslatorManager::deleteTranslator(const QString &name)
if (QFile::remove(path)) {
_translators.remove(name);
return true;
}
}
qCDebug(KonsoleDebug) << "Failed to remove translator - " << path;
return false;
}
......@@ -203,7 +203,7 @@ KeyboardTranslator *KeyboardTranslatorManager::loadTranslator(QIODevice *source,
if (!reader.parseError()) {
return translator;
}
}
delete translator;
return nullptr;
}
......
......@@ -27,7 +27,7 @@
#include <QStringList>
// Konsole
#include "konsoleprivate_export.h"
#include "../konsoleprivate_export.h"
#include "KeyboardTranslator.h"
class QIODevice;
......
......@@ -21,7 +21,7 @@
#include "KeyboardTranslatorReader.h"
#include "konsoledebug.h"
#include "../konsoledebug.h"
// Qt
#include <QBuffer>
......
......@@ -26,4 +26,5 @@ target_link_libraries(
${konsole_LIBS}
konsoleprivate_core
konsolecolorscheme
keyboardtranslator
)
......@@ -53,9 +53,11 @@
#include "ui_EditProfileAdvancedPage.h"
#include "colorscheme/ColorSchemeManager.h"
#include "keyboardtranslator/KeyboardTranslator.h"
#include "keyboardtranslator/KeyboardTranslatorManager.h"
#include "KeyBindingEditor.h"
#include "KeyboardTranslator.h"
#include "KeyboardTranslatorManager.h"
#include "ProfileManager.h"
#include "ShellCommand.h"
#include "WindowSystemInfo.h"
......
......@@ -33,7 +33,7 @@
#include "Profile.h"
#include "ProfileGroup.h"
#include "Enumeration.h"
#include "KeyboardTranslatorManager.h"
#include "keyboardtranslator/KeyboardTranslatorManager.h"
#include "FontDialog.h"
#include "LabelsAligner.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment