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
85def533
Commit
85def533
authored
Apr 14, 2021
by
Krzysztof Stokop
Browse files
cleaning
parent
9c8756cc
Changes
5
Hide whitespace changes
Inline
Side-by-side
addons/project/kateproject.cpp
100755 → 100644
View file @
85def533
File mode changed from 100755 to 100644
addons/project/kateproject.h
View file @
85def533
...
...
@@ -67,7 +67,6 @@ public:
* @return success
*/
bool
reload
(
bool
force
=
false
);
/**
* Accessor to file name.
...
...
addons/project/kateprojectplugin.cpp
View file @
85def533
...
...
@@ -190,27 +190,24 @@ KateProject *KateProjectPlugin::projectForDir(QDir dir)
return
nullptr
;
}
bool
KateProjectPlugin
::
closeProject
(
KateProject
*
project
)
{
Q
_EMIT
pluginViewProjectClosing
(
project
);
Q
List
<
KTextEditor
::
Document
*
>
documents
=
KTextEditor
::
Editor
::
instance
()
->
application
()
->
documents
(
);
m_projects
.
removeOne
(
project
);
for
(
KateProject
*
projectIterator
:
m_projects
)
for
(
int
i
=
0
;
i
<
documents
.
size
();
i
++
)
if
(
QUrl
(
project
->
baseDir
()).
isParentOf
(
documents
[
i
]
->
url
().
adjusted
(
QUrl
::
RemoveScheme
)))
KTextEditor
::
Editor
::
instance
()
->
application
()
->
closeDocument
(
documents
[
i
]);
Q_EMIT
pluginViewProjectClosing
(
project
);
if
(
m_projects
.
removeOne
(
project
))
{
if
(
project
==
projectIterator
)
{
m_fileWatcher
.
removePath
(
QFileInfo
(
projectIterator
->
fileName
()).
canonicalPath
());
delete
projectIterator
;
return
true
;
}
m_fileWatcher
.
removePath
(
QFileInfo
(
project
->
fileName
()).
canonicalPath
());
delete
project
;
return
true
;
}
return
false
;
else
return
false
;
}
KateProject
*
KateProjectPlugin
::
projectForUrl
(
const
QUrl
&
url
)
{
if
(
url
.
isEmpty
()
||
!
url
.
isLocalFile
())
{
...
...
addons/project/kateprojectpluginview.cpp
View file @
85def533
...
...
@@ -10,7 +10,6 @@
#include "gitwidget.h"
#include "kateprojectinfoviewindex.h"
#include <ktexteditor/application.h>
#include <ktexteditor/codecompletioninterface.h>
#include <ktexteditor/document.h>
...
...
@@ -33,7 +32,6 @@
#include <QTimer>
#include <QVBoxLayout>
K_PLUGIN_FACTORY_WITH_JSON
(
KateProjectPluginFactory
,
"kateprojectplugin.json"
,
registerPlugin
<
KateProjectPlugin
>
();)
KateProjectPluginView
::
KateProjectPluginView
(
KateProjectPlugin
*
plugin
,
KTextEditor
::
MainWindow
*
mainWin
)
...
...
@@ -115,7 +113,6 @@ KateProjectPluginView::KateProjectPluginView(KateProjectPlugin *plugin, KTextEdi
connect
(
m_reloadButton
,
&
QToolButton
::
clicked
,
this
,
&
KateProjectPluginView
::
slotProjectReload
);
connect
(
m_closeProjectButton
,
&
QToolButton
::
clicked
,
this
,
&
KateProjectPluginView
::
slotProjectAboutToClose
);
connect
(
this
,
&
KateProjectPluginView
::
pluginProjectClose
,
m_plugin
,
&
KateProjectPlugin
::
closeProject
);
connect
(
m_plugin
,
&
KateProjectPlugin
::
pluginViewProjectClosing
,
this
,
&
KateProjectPluginView
::
slotProjectClose
);
connect
(
m_gitStatusRefreshButton
,
&
QToolButton
::
clicked
,
this
,
[
this
]
{
...
...
@@ -568,20 +565,10 @@ void KateProjectPluginView::slotProjectReload()
void
KateProjectPluginView
::
slotProjectAboutToClose
()
{
if
(
QWidget
*
current
=
m_stackedProjectViews
->
currentWidget
())
{
const
auto
project
=
static_cast
<
KateProjectView
*>
(
current
)
->
project
();
Q_EMIT
pluginProjectClose
(
project
);
for
(
int
i
=
0
;
i
<
m_mainWindow
->
views
().
size
();
i
++
)
{
if
(
QUrl
(
project
->
baseDir
()).
isParentOf
(
m_mainWindow
->
views
()[
i
]
->
document
()
->
url
().
adjusted
(
QUrl
::
RemoveScheme
)))
{
KTextEditor
::
Editor
::
instance
()
->
application
()
->
closeDocument
(
m_mainWindow
->
views
()[
i
]
->
document
());
}
}
m_plugin
->
closeProject
(
project
);
}
}
...
...
@@ -591,7 +578,6 @@ void KateProjectPluginView::slotProjectClose(KateProject *project)
m_stackedProjectViews
->
removeWidget
(
m_stackedProjectViews
->
currentWidget
());
m_stackedProjectInfoViews
->
removeWidget
(
m_stackedProjectInfoViews
->
currentWidget
());
m_stackedgitViews
->
removeWidget
(
m_stackedgitViews
->
currentWidget
());
m_plugin
->
projects
().
removeAt
(
m_plugin
->
projects
().
indexOf
(
project
));
m_projectsCombo
->
removeItem
(
m_plugin
->
projects
().
indexOf
(
project
));
m_projectsComboGit
->
removeItem
(
m_plugin
->
projects
().
indexOf
(
project
));
}
...
...
kate/kateviewmanager.cpp
View file @
85def533
...
...
@@ -278,7 +278,6 @@ void KateViewManager::slotDocumentClose()
slotDocumentClose
(
activeView
()
->
document
());
}
KTextEditor
::
Document
*
KateViewManager
::
openUrl
(
const
QUrl
&
url
,
const
QString
&
encoding
,
bool
activate
,
bool
isTempFile
,
const
KateDocumentInfo
&
docInfo
)
{
KTextEditor
::
Document
*
doc
=
KateApp
::
self
()
->
documentManager
()
->
openUrl
(
url
,
encoding
,
isTempFile
,
docInfo
);
...
...
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