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
PIM
PIM Messagelib
Commits
2666c362
Commit
2666c362
authored
Jul 28, 2022
by
Laurent Montel
Browse files
KMessageBox::sorry is deprecated in kf5.97
parent
9eba1c41
Pipeline
#210028
passed with stage
in 20 minutes and 38 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
messagecomposer/src/attachment/attachmentcontrollerbase.cpp
View file @
2666c362
...
...
@@ -165,7 +165,7 @@ void AttachmentControllerBase::AttachmentControllerBasePrivate::attachmentRemove
void
AttachmentControllerBase
::
AttachmentControllerBasePrivate
::
compressJobResult
(
KJob
*
job
)
{
if
(
job
->
error
())
{
KMessageBox
::
sorry
(
wParent
,
job
->
errorString
(),
i18n
(
"Failed to compress attachment"
));
KMessageBox
::
error
(
wParent
,
job
->
errorString
(),
i18n
(
"Failed to compress attachment"
));
return
;
}
...
...
@@ -199,7 +199,7 @@ void AttachmentControllerBase::AttachmentControllerBasePrivate::compressJobResul
void
AttachmentControllerBase
::
AttachmentControllerBasePrivate
::
loadJobResult
(
KJob
*
job
)
{
if
(
job
->
error
())
{
KMessageBox
::
sorry
(
wParent
,
job
->
errorString
(),
i18n
(
"Failed to attach file"
));
KMessageBox
::
error
(
wParent
,
job
->
errorString
(),
i18n
(
"Failed to attach file"
));
return
;
}
...
...
@@ -272,7 +272,7 @@ void AttachmentControllerBase::AttachmentControllerBasePrivate::reloadAttachment
void
AttachmentControllerBase
::
AttachmentControllerBasePrivate
::
updateJobResult
(
KJob
*
job
)
{
if
(
job
->
error
())
{
KMessageBox
::
sorry
(
wParent
,
job
->
errorString
(),
i18n
(
"Failed to reload attachment"
));
KMessageBox
::
error
(
wParent
,
job
->
errorString
(),
i18n
(
"Failed to reload attachment"
));
return
;
}
auto
ajob
=
qobject_cast
<
AttachmentUpdateJob
*>
(
job
);
...
...
@@ -375,7 +375,7 @@ void AttachmentControllerBase::AttachmentControllerBasePrivate::attachPublicKeyJ
// is that we want to show the proper caption ("public key" instead of "file")...
if
(
job
->
error
())
{
KMessageBox
::
sorry
(
wParent
,
job
->
errorString
(),
i18n
(
"Failed to attach public key"
));
KMessageBox
::
error
(
wParent
,
job
->
errorString
(),
i18n
(
"Failed to attach public key"
));
return
;
}
...
...
@@ -389,7 +389,7 @@ void AttachmentControllerBase::AttachmentControllerBasePrivate::attachVcardFromA
{
if
(
job
->
error
())
{
qCDebug
(
MESSAGECOMPOSER_LOG
)
<<
" Error during when get vCard"
;
KMessageBox
::
sorry
(
wParent
,
job
->
errorString
(),
i18n
(
"Failed to attach vCard"
));
KMessageBox
::
error
(
wParent
,
job
->
errorString
(),
i18n
(
"Failed to attach vCard"
));
return
;
}
...
...
@@ -402,7 +402,7 @@ void AttachmentControllerBase::AttachmentControllerBasePrivate::attachClipBoardE
{
if
(
job
->
error
())
{
qCDebug
(
MESSAGECOMPOSER_LOG
)
<<
" Error during when get try to attach text from clipboard"
;
KMessageBox
::
sorry
(
wParent
,
job
->
errorString
(),
i18n
(
"Failed to attach text from clipboard"
));
KMessageBox
::
error
(
wParent
,
job
->
errorString
(),
i18n
(
"Failed to attach text from clipboard"
));
return
;
}
...
...
@@ -675,7 +675,7 @@ void AttachmentControllerBase::openWith(const KService::Ptr &offer)
{
QTemporaryFile
*
tempFile
=
dumpAttachmentToTempFile
(
d
->
selectedParts
.
constFirst
());
if
(
!
tempFile
)
{
KMessageBox
::
sorry
(
d
->
wParent
,
i18n
(
"KMail was unable to write the attachment to a temporary file."
),
i18n
(
"Unable to open attachment"
));
KMessageBox
::
error
(
d
->
wParent
,
i18n
(
"KMail was unable to write the attachment to a temporary file."
),
i18n
(
"Unable to open attachment"
));
return
;
}
QUrl
url
=
QUrl
::
fromLocalFile
(
tempFile
->
fileName
());
...
...
@@ -699,7 +699,7 @@ void AttachmentControllerBase::openAttachment(const AttachmentPart::Ptr &part)
{
QTemporaryFile
*
tempFile
=
dumpAttachmentToTempFile
(
part
);
if
(
!
tempFile
)
{
KMessageBox
::
sorry
(
d
->
wParent
,
i18n
(
"KMail was unable to write the attachment to a temporary file."
),
i18n
(
"Unable to open attachment"
));
KMessageBox
::
error
(
d
->
wParent
,
i18n
(
"KMail was unable to write the attachment to a temporary file."
),
i18n
(
"Unable to open attachment"
));
return
;
}
tempFile
->
setPermissions
(
QFile
::
ReadUser
);
...
...
@@ -708,7 +708,7 @@ void AttachmentControllerBase::openAttachment(const AttachmentPart::Ptr &part)
job
->
setDeleteTemporaryFile
(
true
);
connect
(
job
,
&
KIO
::
OpenUrlJob
::
result
,
this
,
[
this
,
tempFile
](
KJob
*
job
)
{
if
(
job
->
error
()
==
KIO
::
ERR_USER_CANCELED
)
{
KMessageBox
::
sorry
(
d
->
wParent
,
i18n
(
"KMail was unable to open the attachment."
),
job
->
errorString
());
KMessageBox
::
error
(
d
->
wParent
,
i18n
(
"KMail was unable to open the attachment."
),
job
->
errorString
());
delete
tempFile
;
}
else
{
// The file was opened. Delete it only when the composer is closed
...
...
@@ -748,7 +748,7 @@ void AttachmentControllerBase::editAttachment(AttachmentPart::Ptr part, MessageV
{
QTemporaryFile
*
tempFile
=
dumpAttachmentToTempFile
(
part
);
if
(
!
tempFile
)
{
KMessageBox
::
sorry
(
d
->
wParent
,
i18n
(
"KMail was unable to write the attachment to a temporary file."
),
i18n
(
"Unable to edit attachment"
));
KMessageBox
::
error
(
d
->
wParent
,
i18n
(
"KMail was unable to write the attachment to a temporary file."
),
i18n
(
"Unable to edit attachment"
));
return
;
}
...
...
@@ -933,7 +933,7 @@ void AttachmentControllerBase::addAttachmentUrlSync(const QUrl &url)
addAttachment
(
part
);
}
else
{
if
(
ajob
->
error
())
{
KMessageBox
::
sorry
(
d
->
wParent
,
ajob
->
errorString
(),
i18nc
(
"@title:window"
,
"Failed to attach file"
));
KMessageBox
::
error
(
d
->
wParent
,
ajob
->
errorString
(),
i18nc
(
"@title:window"
,
"Failed to attach file"
));
}
}
}
...
...
messagecomposer/src/composer/composerviewbase.cpp
View file @
2666c362
...
...
@@ -1364,7 +1364,7 @@ void ComposerViewBase::writeAutoSaveToDisk(const KMime::Message::Ptr &message)
if
(
!
errorMessage
.
isEmpty
())
{
qCWarning
(
MESSAGECOMPOSER_LOG
)
<<
"Auto saving failed:"
<<
errorMessage
<<
file
.
errorString
()
<<
" m_autoSaveUUID"
<<
m_autoSaveUUID
;
if
(
!
m_autoSaveErrorShown
)
{
KMessageBox
::
sorry
(
m_parentWidget
,
KMessageBox
::
error
(
m_parentWidget
,
i18n
(
"Autosaving the message as %1 failed.
\n
"
"%2
\n
"
"Reason: %3"
,
...
...
messagecomposer/src/recipient/recipientseditor.cpp
View file @
2666c362
...
...
@@ -110,7 +110,7 @@ bool RecipientsEditor::setRecipientString(const QVector<KMime::Types::Mailbox> &
int
count
=
1
;
for
(
const
KMime
::
Types
::
Mailbox
&
mailbox
:
mailboxes
)
{
if
(
count
++
>
MessageComposer
::
MessageComposerSettings
::
self
()
->
maximumRecipients
())
{
KMessageBox
::
sorry
(
this
,
KMessageBox
::
error
(
this
,
i18ncp
(
"@info:status"
,
"Truncating recipients list to %2 of %1 entry."
,
"Truncating recipients list to %2 of %1 entries."
,
...
...
messagecomposer/src/recipient/recipientspicker.cpp
View file @
2666c362
...
...
@@ -166,7 +166,7 @@ void RecipientsPicker::pick(Recipient::Type type)
}
if
(
count
>
MessageComposerSettings
::
self
()
->
maximumRecipients
())
{
KMessageBox
::
sorry
(
this
,
KMessageBox
::
error
(
this
,
i18np
(
"You selected 1 recipient. The maximum supported number of "
"recipients is %2.
\n
Please adapt the selection."
,
"You selected %1 recipients. The maximum supported number of "
...
...
@@ -184,7 +184,7 @@ void RecipientsPicker::pick(Recipient::Type type)
Q_EMIT
pickedRecipient
(
recipient
,
tooManyAddress
);
if
(
tooManyAddress
)
{
KMessageBox
::
sorry
(
this
,
i18n
(
"You can not add more recipients."
));
KMessageBox
::
error
(
this
,
i18n
(
"You can not add more recipients."
));
break
;
}
}
...
...
messageviewer/src/widgets/opensavedfilefolderwidget.cpp
View file @
2666c362
...
...
@@ -74,7 +74,7 @@ void OpenSavedFileFolderWidget::slotOpenFile()
job
->
setDeleteTemporaryFile
(
true
);
connect
(
job
,
&
KIO
::
OpenUrlJob
::
result
,
this
,
[
this
](
KJob
*
job
)
{
if
(
job
->
error
()
==
KIO
::
ERR_USER_CANCELED
)
{
KMessageBox
::
sorry
(
this
,
i18n
(
"KMail was unable to open the attachment."
),
job
->
errorString
());
KMessageBox
::
error
(
this
,
i18n
(
"KMail was unable to open the attachment."
),
job
->
errorString
());
}
});
job
->
start
();
...
...
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