Commit e72a9b01 authored by Michal Humpula's avatar Michal Humpula Committed by Christoph Cullmann
Browse files

addons/project: cleanup terminal api

* fix class comments
* hide KPart factory from clients
parent 3c87f829
......@@ -24,7 +24,7 @@ KateProjectInfoView::KateProjectInfoView(KateProjectPluginView *pluginView, Kate
/**
* skip terminal toolviews if no terminal aka KonsolePart around
*/
if (KateProjectInfoViewTerminal::pluginFactory()) {
if (KateProjectInfoViewTerminal::isLoadable()) {
/**
* terminal for the directory with the .kateproject file inside
*/
......
......@@ -125,3 +125,8 @@ bool KateProjectInfoViewTerminal::ignoreEsc() const
const auto app = qobject_cast<TerminalInterface *>(m_konsolePart)->foregroundProcessName();
return exceptList.contains(app);
}
bool KateProjectInfoViewTerminal::isLoadable()
{
return (pluginFactory() != nullptr);
}
......@@ -19,8 +19,7 @@ class KateProjectPluginView;
class KPluginFactory;
/**
* Class representing a view of a project.
* A tree like view of project content.
* Single terminal view for project toolview
*/
class KateProjectInfoViewTerminal : public QWidget
{
......@@ -39,13 +38,6 @@ public:
*/
~KateProjectInfoViewTerminal() override;
/**
* global plugin factory to create terminal
* exposed to allow to skip terminal toolview creation if not possible
* @return plugin factory for terminal or nullptr if no terminal part there
*/
static KPluginFactory *pluginFactory();
/**
* Shall the ESC key press be ignored?
* If not, the toolview will be hidden.
......@@ -53,6 +45,11 @@ public:
*/
bool ignoreEsc() const;
/**
* Check if terminal is loadable
*/
static bool isLoadable();
private Q_SLOTS:
/**
* Construct a new terminal for this view
......@@ -71,6 +68,14 @@ protected:
*/
void showEvent(QShowEvent *ev) override;
private:
/**
* global plugin factory to create terminal
* exposed to allow to skip terminal toolview creation if not possible
* @return plugin factory for terminal or nullptr if no terminal part there
*/
static KPluginFactory *pluginFactory();
private:
/**
* plugin factory for the terminal
......
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