Changeset View
Changeset View
Standalone View
Standalone View
addons/project/kateprojectinfoviewterminal.cpp
Show All 18 Lines | |||||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #include "kateprojectinfoviewterminal.h" | 21 | #include "kateprojectinfoviewterminal.h" | ||
22 | #include "kateprojectpluginview.h" | 22 | #include "kateprojectpluginview.h" | ||
23 | 23 | | |||
24 | #include <klocalizedstring.h> | 24 | #include <klocalizedstring.h> | ||
25 | #include <kde_terminal_interface.h> | 25 | #include <kde_terminal_interface.h> | ||
26 | #include <KPluginLoader> | 26 | #include <KPluginLoader> | ||
27 | #include <KShell> | ||||
27 | 28 | | |||
28 | KPluginFactory *KateProjectInfoViewTerminal::s_pluginFactory = nullptr; | 29 | KPluginFactory *KateProjectInfoViewTerminal::s_pluginFactory = nullptr; | ||
29 | 30 | | |||
30 | KateProjectInfoViewTerminal::KateProjectInfoViewTerminal(KateProjectPluginView *pluginView, const QString &directory) | 31 | KateProjectInfoViewTerminal::KateProjectInfoViewTerminal(KateProjectPluginView *pluginView, const QString &directory) | ||
31 | : QWidget() | 32 | : QWidget() | ||
32 | , m_pluginView(pluginView) | 33 | , m_pluginView(pluginView) | ||
33 | , m_directory(directory) | 34 | , m_directory(directory) | ||
34 | , m_konsolePart(nullptr) | 35 | , m_konsolePart(nullptr) | ||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | 69 | { | |||
88 | /** | 89 | /** | ||
89 | * init locale translation stuff | 90 | * init locale translation stuff | ||
90 | */ | 91 | */ | ||
91 | // FIXME KF5 KGlobal::locale()->insertCatalog("konsole"); | 92 | // FIXME KF5 KGlobal::locale()->insertCatalog("konsole"); | ||
92 | 93 | | |||
93 | /** | 94 | /** | ||
94 | * switch to right directory | 95 | * switch to right directory | ||
95 | */ | 96 | */ | ||
96 | qobject_cast<TerminalInterface *>(m_konsolePart)->showShellInDir(m_directory); | 97 | QString cmd = QStringLiteral(" cd ") + KShell::quoteArg(m_directory) + QStringLiteral(" && clear\n"); | ||
98 | qobject_cast<TerminalInterface *>(m_konsolePart)->sendInput(cmd); | ||||
97 | 99 | | |||
98 | /** | 100 | /** | ||
99 | * add to widget | 101 | * add to widget | ||
100 | */ | 102 | */ | ||
101 | m_layout->addWidget(m_konsolePart->widget()); | 103 | m_layout->addWidget(m_konsolePart->widget()); | ||
102 | setFocusProxy(m_konsolePart->widget()); | 104 | setFocusProxy(m_konsolePart->widget()); | ||
103 | 105 | | |||
104 | /** | 106 | /** | ||
Show All 15 Lines |