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
dccb4032
Commit
dccb4032
authored
Mar 21, 2021
by
Krzysztof Stokop
Browse files
Update kateproject.cpp, kateproject.h, and kateprojectpluginview.cpp cleaning
parent
bc3af83e
Changes
3
Hide whitespace changes
Inline
Side-by-side
addons/project/kateproject.cpp
View file @
dccb4032
...
...
@@ -73,20 +73,6 @@ bool KateProject::reload(bool force)
return
load
(
m_globalProject
,
force
);
}
void
KateProject
::
close
(
bool
force
)
{
QVariantMap
map
=
readProjectFile
();
if
(
!
map
.
isEmpty
())
{
m_plugin
->
deleteProject
(
this
);
m_globalProject
.
clear
();
delete
this
;
}
load
(
m_globalProject
,
force
);
}
/**
* Read a JSON document from file.
*
...
...
addons/project/kateproject.h
View file @
dccb4032
...
...
@@ -68,12 +68,6 @@ public:
*/
bool
reload
(
bool
force
=
false
);
/**
* Try to close a project.
* @param force will enforce the worker to update files list and co even if the content of the file was not changed!
* @return success
*/
void
close
(
bool
force
=
false
);
/**
* Accessor to file name.
...
...
addons/project/kateprojectpluginview.cpp
View file @
dccb4032
...
...
@@ -111,9 +111,9 @@ KateProjectPluginView::KateProjectPluginView(KateProjectPlugin *plugin, KTextEdi
});
connect
(
m_projectsCombo
,
static_cast
<
void
(
QComboBox
::*
)(
int
)
>
(
&
QComboBox
::
currentIndexChanged
),
this
,
&
KateProjectPluginView
::
slotCurrentChanged
);
connect
(
m_reloadButton
,
&
QToolButton
::
clicked
,
this
,
&
KateProjectPluginView
::
slotProjectReload
);
//---
connect
(
m_closeProjectButton
,
&
QToolButton
::
clicked
,
this
,
&
KateProjectPluginView
::
slotProjectClose
);
//---
connect
(
m_gitStatusRefreshButton
,
&
QToolButton
::
clicked
,
this
,
[
this
]
{
if
(
auto
widget
=
m_stackedgitViews
->
currentWidget
())
{
qobject_cast
<
GitWidget
*>
(
widget
)
->
getStatus
();
...
...
@@ -567,7 +567,8 @@ void KateProjectPluginView::slotProjectClose()
if
(
QWidget
*
current
=
m_stackedProjectViews
->
currentWidget
())
{
const
auto
project
=
static_cast
<
KateProjectView
*>
(
current
)
->
project
();
m_project2View
.
erase
(
m_project2View
.
find
(
static_cast
<
KateProjectView
*>
(
current
)
->
project
()));
m_stackedProjectViews
->
removeWidget
(
m_stackedProjectViews
->
currentWidget
());
m_stackedProjectInfoViews
->
removeWidget
(
m_stackedProjectInfoViews
->
currentWidget
());
...
...
@@ -577,8 +578,8 @@ void KateProjectPluginView::slotProjectClose()
m_projectsCombo
->
removeItem
(
m_plugin
->
projects
().
indexOf
(
static_cast
<
KateProjectView
*>
(
current
)
->
project
()));
m_projectsComboGit
->
removeItem
(
m_plugin
->
projects
().
indexOf
(
static_cast
<
KateProjectView
*>
(
current
)
->
project
()));
static_cast
<
KateProjectView
*>
(
current
)
->
project
()
->
close
(
true
);
//delete static_cast<KateProjectView *>(current)->project();
m_plugin
->
closeProject
(
project
);
}
}
...
...
Write
Preview
Markdown
is supported
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