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
Education
KmPlot
Commits
5cd3999d
Commit
5cd3999d
authored
Jul 31, 2022
by
Laurent Montel
Browse files
KMessageBox::sorry is deprecated in kf5.97
parent
d71227e5
Pipeline
#210936
passed with stage
in 3 minutes and 24 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
kmplot/coordsconfigdialog.cpp
View file @
5cd3999d
...
...
@@ -73,7 +73,7 @@ bool CoordsConfigDialog::evalX(bool showError)
if
(
min
>=
max
)
{
if
(
showError
)
KMessageBox
::
sorry
(
this
,
i18n
(
"The minimum range value must be lower than the maximum range value"
));
KMessageBox
::
error
(
this
,
i18n
(
"The minimum range value must be lower than the maximum range value"
));
return
false
;
}
return
true
;
...
...
@@ -99,7 +99,7 @@ bool CoordsConfigDialog::evalY(bool showError)
if
(
min
>=
max
)
{
if
(
showError
)
KMessageBox
::
sorry
(
this
,
i18n
(
"The minimum range value must be lower than the maximum range value"
));
KMessageBox
::
error
(
this
,
i18n
(
"The minimum range value must be lower than the maximum range value"
));
return
false
;
}
return
true
;
...
...
kmplot/kmplotio.cpp
View file @
5cd3999d
...
...
@@ -285,7 +285,7 @@ bool KmPlotIO::restore(const QDomDocument &doc)
}
}
}
else
{
KMessageBox
::
sorry
(
0
,
i18n
(
"The file had an unknown version number"
));
KMessageBox
::
error
(
0
,
i18n
(
"The file had an unknown version number"
));
return
false
;
}
...
...
@@ -303,14 +303,14 @@ bool KmPlotIO::load(const QUrl &url)
bool
downloadedFile
=
false
;
if
(
!
url
.
isLocalFile
())
{
if
(
!
MainDlg
::
fileExists
(
url
))
{
KMessageBox
::
sorry
(
0
,
i18n
(
"The file does not exist."
));
KMessageBox
::
error
(
0
,
i18n
(
"The file does not exist."
));
return
false
;
}
downloadedFile
=
true
;
KIO
::
StoredTransferJob
*
transferjob
=
KIO
::
storedGet
(
url
);
KJobWidgets
::
setWindow
(
transferjob
,
0
);
if
(
!
transferjob
->
exec
())
{
KMessageBox
::
sorry
(
0
,
i18n
(
"An error appeared when opening this file (%1)"
,
transferjob
->
errorString
()));
KMessageBox
::
error
(
0
,
i18n
(
"An error appeared when opening this file (%1)"
,
transferjob
->
errorString
()));
return
false
;
}
QTemporaryFile
file
;
...
...
@@ -323,13 +323,13 @@ bool KmPlotIO::load(const QUrl &url)
f
.
setFileName
(
url
.
toLocalFile
());
if
(
!
f
.
open
(
QIODevice
::
ReadOnly
))
{
KMessageBox
::
sorry
(
0
,
i18n
(
"%1 could not be opened"
,
f
.
fileName
()));
KMessageBox
::
error
(
0
,
i18n
(
"%1 could not be opened"
,
f
.
fileName
()));
return
false
;
}
QString
errorMessage
;
int
errorLine
,
errorColumn
;
if
(
!
doc
.
setContent
(
&
f
,
&
errorMessage
,
&
errorLine
,
&
errorColumn
))
{
KMessageBox
::
sorry
(
0
,
i18n
(
"%1 could not be loaded (%2 at line %3, column %4)"
,
f
.
fileName
(),
errorMessage
,
errorLine
,
errorColumn
));
KMessageBox
::
error
(
0
,
i18n
(
"%1 could not be loaded (%2 at line %3, column %4)"
,
f
.
fileName
(),
errorMessage
,
errorLine
,
errorColumn
));
f
.
close
();
return
false
;
}
...
...
@@ -717,7 +717,7 @@ void KmPlotIO::oldParseFunction(const QDomElement &n)
else
{
ufkt
.
eq
[
0
]
->
setFstr
(
tmp_fstr
.
left
(
pos
),
0
,
0
,
true
);
if
(
!
XParser
::
self
()
->
getext
(
&
ufkt
,
tmp_fstr
))
{
KMessageBox
::
sorry
(
0
,
i18n
(
"The function %1 could not be loaded"
,
ufkt
.
eq
[
0
]
->
fstr
()));
KMessageBox
::
error
(
0
,
i18n
(
"The function %1 could not be loaded"
,
ufkt
.
eq
[
0
]
->
fstr
()));
return
;
}
}
...
...
kmplot/kparametereditor.cpp
View file @
5cd3999d
...
...
@@ -201,7 +201,7 @@ void KParameterEditor::cmdImport_clicked()
return
;
if
(
!
MainDlg
::
fileExists
(
url
))
{
KMessageBox
::
sorry
(
0
,
i18n
(
"The file does not exist."
));
KMessageBox
::
error
(
0
,
i18n
(
"The file does not exist."
));
return
;
}
...
...
@@ -211,7 +211,7 @@ void KParameterEditor::cmdImport_clicked()
KIO
::
StoredTransferJob
*
transferjob
=
KIO
::
storedGet
(
url
);
KJobWidgets
::
setWindow
(
transferjob
,
0
);
if
(
!
transferjob
->
exec
())
{
KMessageBox
::
sorry
(
0
,
i18n
(
"An error appeared when opening this file: %1"
,
transferjob
->
errorString
()));
KMessageBox
::
error
(
0
,
i18n
(
"An error appeared when opening this file: %1"
,
transferjob
->
errorString
()));
return
;
}
QTemporaryFile
tmpfile
;
...
...
@@ -256,7 +256,7 @@ void KParameterEditor::cmdImport_clicked()
}
file
.
close
();
}
else
KMessageBox
::
sorry
(
0
,
i18n
(
"An error appeared when opening this file"
));
KMessageBox
::
error
(
0
,
i18n
(
"An error appeared when opening this file"
));
if
(
!
url
.
isLocalFile
())
QFile
::
remove
(
file
.
fileName
());
...
...
@@ -290,14 +290,14 @@ void KParameterEditor::cmdExport_clicked()
}
stream
.
flush
();
}
else
KMessageBox
::
sorry
(
0
,
i18n
(
"An error appeared when saving this file"
));
KMessageBox
::
error
(
0
,
i18n
(
"An error appeared when saving this file"
));
Q_CONSTEXPR
int
permission
=
-
1
;
QFile
file
(
tmpfile
.
fileName
());
file
.
open
(
QIODevice
::
ReadOnly
);
KIO
::
StoredTransferJob
*
putjob
=
KIO
::
storedPut
(
file
.
readAll
(),
url
,
permission
,
KIO
::
JobFlag
::
Overwrite
);
if
(
!
putjob
->
exec
())
{
KMessageBox
::
sorry
(
0
,
i18n
(
"An error appeared when saving this file"
));
KMessageBox
::
error
(
0
,
i18n
(
"An error appeared when saving this file"
));
return
;
}
file
.
close
();
...
...
@@ -315,7 +315,7 @@ void KParameterEditor::cmdExport_clicked()
}
file
.
close
();
}
else
KMessageBox
::
sorry
(
0
,
i18n
(
"An error appeared when saving this file"
));
KMessageBox
::
error
(
0
,
i18n
(
"An error appeared when saving this file"
));
}
}
}
...
...
kmplot/parser.cpp
View file @
5cd3999d
...
...
@@ -1130,7 +1130,7 @@ void Parser::displayErrorDialog(Error error)
{
QString
message
(
errorString
(
error
));
if
(
!
message
.
isEmpty
())
KMessageBox
::
sorry
(
0
,
message
,
QStringLiteral
(
"KmPlot"
));
KMessageBox
::
error
(
0
,
message
,
QStringLiteral
(
"KmPlot"
));
}
QString
Parser
::
evalRemaining
()
...
...
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