Commit 11907165 authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Use enum class


Signed-off-by: Waqar Ahmed's avatarWaqar Ahmed <waqar.17a@gmail.com>
parent 147c3a59
......@@ -612,7 +612,7 @@ void GitWidget::opencommitChangesDialog()
}
}
void GitWidget::handleClick(const QModelIndex &idx, int clickAction)
void GitWidget::handleClick(const QModelIndex &idx, ClickAction clickAction)
{
auto type = idx.data(GitStatusModel::TreeItemType);
if (type != GitStatusModel::NodeFile) {
......
......@@ -32,6 +32,8 @@ class View;
class Document;
}
enum class ClickAction : uint8_t;
class GitWidget : public QWidget
{
Q_OBJECT
......@@ -97,7 +99,7 @@ private Q_SLOTS:
void gitStatusReady(int exit, QProcess::ExitStatus);
void parseStatusReady();
void opencommitChangesDialog();
void handleClick(const QModelIndex &idx, int clickAction);
void handleClick(const QModelIndex &idx, ClickAction clickAction);
void treeViewSingleClicked(const QModelIndex &idx);
void treeViewDoubleClicked(const QModelIndex &idx);
......
......@@ -162,8 +162,8 @@ void KateProjectConfigPage::reset()
m_cbMultiProjectGoto->setCheckState(m_plugin->multiProjectGoto() ? Qt::Checked : Qt::Unchecked);
m_cbGitStatusDiffNumStat->setChecked(m_plugin->showGitStatusWithNumStat());
m_cmbSingleClick->setCurrentIndex(m_plugin->singleClickAcion());
m_cmbDoubleClick->setCurrentIndex(m_plugin->doubleClickAcion());
m_cmbSingleClick->setCurrentIndex((int)m_plugin->singleClickAcion());
m_cmbDoubleClick->setCurrentIndex((int)m_plugin->doubleClickAcion());
m_changed = false;
}
......
......@@ -355,24 +355,24 @@ bool KateProjectPlugin::showGitStatusWithNumStat()
void KateProjectPlugin::setSingleClickAction(ClickAction cb)
{
m_singleClick = cb;
m_singleClickAction = cb;
writeConfig();
}
ClickAction KateProjectPlugin::singleClickAcion()
{
return m_singleClick;
return m_singleClickAction;
}
void KateProjectPlugin::setDoubleClickAction(ClickAction cb)
{
m_doubleClick = cb;
m_doubleClickAction = cb;
writeConfig();
}
ClickAction KateProjectPlugin::doubleClickAcion()
{
return m_doubleClick;
return m_doubleClickAction;
}
void KateProjectPlugin::setMultiProject(bool completion, bool gotoSymbol)
......@@ -398,8 +398,8 @@ void KateProjectPlugin::readConfig()
m_multiProjectGoto = config.readEntry("multiProjectCompletion", false);
m_gitNumStat = config.readEntry("gitStatusNumStat", true);
m_singleClick = (ClickAction)config.readEntry("gitStatusSingleClick", (int)ClickAction::ShowDiff);
m_doubleClick = (ClickAction)config.readEntry("gitStatusDoubleClick", (int)ClickAction::StageUnstage);
m_singleClickAction = (ClickAction)config.readEntry("gitStatusSingleClick", (int)ClickAction::ShowDiff);
m_doubleClickAction = (ClickAction)config.readEntry("gitStatusDoubleClick", (int)ClickAction::StageUnstage);
Q_EMIT configUpdated();
}
......@@ -430,8 +430,8 @@ void KateProjectPlugin::writeConfig()
config.writeEntry("multiProjectGoto", m_multiProjectGoto);
config.writeEntry("gitStatusNumStat", m_gitNumStat);
config.writeEntry("gitStatusSingleClick", (int)m_singleClick);
config.writeEntry("gitStatusDoubleClick", (int)m_doubleClick);
config.writeEntry("gitStatusSingleClick", (int)m_singleClickAction);
config.writeEntry("gitStatusDoubleClick", (int)m_doubleClickAction);
Q_EMIT configUpdated();
}
......
......@@ -21,7 +21,7 @@
#include "kateproject.h"
#include "kateprojectcompletion.h"
enum ClickAction {
enum class ClickAction : uint8_t {
NoAction = 0,
ShowDiff,
OpenFile,
......
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