Commit dccb4032 authored by Krzysztof Stokop's avatar Krzysztof Stokop
Browse files

Update kateproject.cpp, kateproject.h, and kateprojectpluginview.cpp cleaning

parent bc3af83e
......@@ -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.
*
......
......@@ -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.
......
......@@ -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);
}
}
......
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