Skip to content
GitLab
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
d5f592f2
Commit
d5f592f2
authored
Apr 24, 2021
by
Krzysztof Stokop
Browse files
Update kateprojectplugin.cpp
parent
568ac672
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/project/kateprojectplugin.cpp
View file @
d5f592f2
...
@@ -196,23 +196,18 @@ bool KateProjectPlugin::closeProject(KateProject *project)
...
@@ -196,23 +196,18 @@ bool KateProjectPlugin::closeProject(KateProject *project)
{
{
QList
<
KTextEditor
::
Document
*
>
documents
=
KTextEditor
::
Editor
::
instance
()
->
application
()
->
documents
();
QList
<
KTextEditor
::
Document
*
>
documents
=
KTextEditor
::
Editor
::
instance
()
->
application
()
->
documents
();
QVector
<
KTextEditor
::
Document
*
>
projectDocuments
;
QVector
<
KTextEditor
::
Document
*
>
projectDocuments
;
QString
text
=
i18n
(
"Documents will be closed:
\n
"
);
QWidget
*
window
=
KTextEditor
::
Editor
::
instance
()
->
application
()
->
activeMainWindow
()
->
window
();
QString
title
=
i18n
(
"Confirm project closing: "
)
+
project
->
name
();
for
(
int
i
=
0
;
i
<
documents
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
documents
.
size
();
i
++
)
{
if
(
QUrl
(
project
->
baseDir
()).
isParentOf
(
documents
[
i
]
->
url
().
adjusted
(
QUrl
::
RemoveScheme
)))
if
(
QUrl
(
project
->
baseDir
()).
isParentOf
(
documents
[
i
]
->
url
().
adjusted
(
QUrl
::
RemoveScheme
)))
{
projectDocuments
.
push_back
(
documents
[
i
]);
projectDocuments
.
push_back
(
documents
[
i
]);
text
+=
documents
[
i
]
->
url
().
adjusted
(
QUrl
::
RemoveScheme
).
toDisplayString
();
text
+=
i18n
(
"
\n
"
);
QString
title
=
i18n
(
"Confirm project closing: "
)
+
project
->
name
();
}
QString
text
=
i18n
(
"Do you want to close "
)
+
QString
::
number
(
projectDocuments
.
size
())
+
i18n
(
" documents and "
)
+
project
->
name
()
+
i18n
(
" project?"
);
}
QMessageBox
confirmationBox
(
QMessageBox
::
Information
,
title
,
text
,
QMessageBox
::
Cancel
|
QMessageBox
::
Yes
);
QMessageBox
confirmationBox
;
confirmationBox
.
setDefaultButton
(
QMessageBox
::
Cancel
);
if
(
16384
==
confirmationBox
.
exec
())
//4194304 for QMessageBox::Cancel
if
(
QMessageBox
::
Yes
==
confirmationBox
.
question
(
window
,
title
,
text
,
QMessageBox
::
No
|
QMessageBox
::
Yes
,
QMessageBox
::
No
))
{
{
for
(
int
i
=
0
;
i
<
projectDocuments
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
projectDocuments
.
size
();
i
++
)
KTextEditor
::
Editor
::
instance
()
->
application
()
->
closeDocument
(
projectDocuments
[
i
]);
KTextEditor
::
Editor
::
instance
()
->
application
()
->
closeDocument
(
projectDocuments
[
i
]);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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