Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
b455b0f9
Commit
b455b0f9
authored
Feb 08, 2021
by
Waqar Ahmed
Browse files
Disable/Enable button if/if not a git repo
parent
fbe3ad6b
Changes
2
Hide whitespace changes
Inline
Side-by-side
addons/project/branchesdialog.cpp
View file @
b455b0f9
...
...
@@ -103,7 +103,7 @@ public:
name.append(QStringLiteral(" <span style=\"color:gray; font-size:%1pt;\">tag at %2</span>").arg(fontSz));
} */
else
{
Q_
ASSERT
(
false
);
Q_
UNREACHABLE
(
);
}
doc
.
setHtml
(
name
);
...
...
addons/project/kateprojectview.cpp
View file @
b455b0f9
...
...
@@ -65,8 +65,20 @@ KateProjectView::KateProjectView(KateProjectPluginView *pluginView, KateProject
});
connect
(
m_branchesDialog
,
&
BranchesDialog
::
branchChanged
,
this
,
[
this
](
const
QString
&
branch
)
{
m_branchBtn
->
setText
(
branch
);
m_project
->
reload
();
m_project
->
reload
(
true
);
});
connect
(
m_project
,
&
KateProject
::
modelChanged
,
this
,
[
this
]
{
if
(
GitUtils
::
isGitRepo
(
m_project
->
baseDir
()))
{
m_branchBtn
->
setHidden
(
false
);
m_branchBtn
->
setText
(
GitUtils
::
getCurrentBranchName
(
m_project
->
baseDir
()));
}
else
{
m_branchBtn
->
setHidden
(
true
);
}
});
if
(
!
GitUtils
::
isGitRepo
(
m_project
->
baseDir
()))
{
m_branchBtn
->
setHidden
(
true
);
}
}
KateProjectView
::~
KateProjectView
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment