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
SDK
Kompare
Commits
02e53dd0
Commit
02e53dd0
authored
Oct 19, 2022
by
Friedrich W. H. Kossebau
Browse files
Remove manual overwrite dialog, duplicating QFileDialog behaviour
parent
1cf9b1b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/komparepart/kompare_part.cpp
View file @
02e53dd0
...
...
@@ -560,41 +560,14 @@ void KomparePart::saveDiff()
saveProperties
(
config
.
data
());
config
->
sync
();
while
(
1
)
{
QUrl
url
=
QFileDialog
::
getSaveFileUrl
(
widget
(),
i18nc
(
"@title:window"
,
"Save .diff"
),
m_info
.
destination
,
i18n
(
"Patch Files (*.diff *.dif *.patch)"
));
if
(
url
.
isLocalFile
()
&&
QFile
::
exists
(
url
.
toLocalFile
()))
{
int
result
=
KMessageBox
::
warningYesNoCancel
(
widget
(),
i18n
(
"The file exists or is write-protected; do you want to overwrite it?"
),
i18nc
(
"@window:title"
,
"File Exists"
),
KStandardGuiItem
::
overwrite
(),
KGuiItem
(
i18nc
(
"@action:button"
,
"Do Not Overwrite"
)));
if
(
result
==
KMessageBox
::
Cancel
)
{
break
;
}
else
if
(
result
==
KMessageBox
::
No
)
{
continue
;
}
else
{
qCDebug
(
KOMPAREPART
)
<<
"URL = "
<<
url
.
toDisplayString
();
qCDebug
(
KOMPAREPART
)
<<
"Directory = "
<<
w
->
directory
();
qCDebug
(
KOMPAREPART
)
<<
"DiffSettings = "
<<
m_diffSettings
;
m_modelList
->
saveDiff
(
url
.
url
(),
w
->
directory
(),
m_diffSettings
);
break
;
}
}
else
{
qCDebug
(
KOMPAREPART
)
<<
"URL = "
<<
url
.
toDisplayString
();
qCDebug
(
KOMPAREPART
)
<<
"Directory = "
<<
w
->
directory
();
qCDebug
(
KOMPAREPART
)
<<
"DiffSettings = "
<<
m_diffSettings
;
m_modelList
->
saveDiff
(
url
.
url
(),
w
->
directory
(),
m_diffSettings
);
break
;
}
}
QUrl
url
=
QFileDialog
::
getSaveFileUrl
(
widget
(),
i18nc
(
"@title:window"
,
"Save .diff"
),
m_info
.
destination
,
i18n
(
"Patch Files (*.diff *.dif *.patch)"
));
qCDebug
(
KOMPAREPART
)
<<
"URL = "
<<
url
.
toDisplayString
();
qCDebug
(
KOMPAREPART
)
<<
"Directory = "
<<
w
->
directory
();
qCDebug
(
KOMPAREPART
)
<<
"DiffSettings = "
<<
m_diffSettings
;
m_modelList
->
saveDiff
(
url
.
url
(),
w
->
directory
(),
m_diffSettings
);
}
}
...
...
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