Commit cd954038 authored by Laurent Montel's avatar Laurent Montel 😁

Add parent

parent 9b47218e
......@@ -98,7 +98,7 @@ ArchiveMailWidget::~ArchiveMailWidget()
void ArchiveMailWidget::customContextMenuRequested(const QPoint &)
{
const QList<QTreeWidgetItem *> listItems = mWidget->treeWidget->selectedItems();
QMenu menu;
QMenu menu(this);
menu.addAction(i18n("Add..."), this, &ArchiveMailWidget::slotAddItem);
if (!listItems.isEmpty()) {
if (listItems.count() == 1) {
......
......@@ -192,7 +192,7 @@ void FollowUpReminderInfoWidget::customContextMenuRequested(const QPoint &pos)
const QList<QTreeWidgetItem *> listItems = mTreeWidget->selectedItems();
const int nbElementSelected = listItems.count();
if (nbElementSelected > 0) {
QMenu menu;
QMenu menu(this);
QAction *showMessage = nullptr;
FollowUpReminderInfoItem *mailItem = nullptr;
if ((nbElementSelected == 1)) {
......
......@@ -104,7 +104,7 @@ void SendLaterWidget::customContextMenuRequested(const QPoint &)
{
const QList<QTreeWidgetItem *> listItems = mWidget->treeWidget->selectedItems();
if (!listItems.isEmpty()) {
QMenu menu;
QMenu menu(this);
if (listItems.count() == 1) {
menu.addAction(i18n("Send now"), this, &SendLaterWidget::slotSendNow);
}
......
......@@ -1996,7 +1996,7 @@ bool KMComposerWin::insertFromMimeData(const QMimeData *source, bool forceAttach
QImage image = qvariant_cast<QImage>(source->imageData());
QFileInfo fi(source->text());
QMenu menu;
QMenu menu(this);
const QAction *addAsInlineImageAction = menu.addAction(i18n("Add as &Inline Image"));
/*const QAction *addAsAttachmentAction = */ menu.addAction(i18n("Add as &Attachment"));
const QAction *selectedAction = menu.exec(QCursor::pos());
......
......@@ -2677,7 +2677,7 @@ void KMMainWidget::slotContactSearchJobForMessagePopupDone(KJob *job)
void KMMainWidget::showMessagePopup(const Akonadi::Item &msg, const QUrl &url, const QUrl &imageUrl, const QPoint &aPoint, bool contactAlreadyExists, bool uniqueContactFound,
const WebEngineViewer::WebHitTestResult &result)
{
QMenu *menu = new QMenu;
QMenu *menu = new QMenu(this);
bool urlMenuAdded = false;
......
......@@ -503,7 +503,7 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item &msg, const QUrl &url
if (!url.isEmpty()) {
if (url.scheme() == QLatin1String("mailto")) {
// popup on a mailto URL
menu = new QMenu;
menu = new QMenu(this);
menu->addAction(mReaderWin->mailToComposeAction());
if (messageHasPayload) {
menu->addAction(mReaderWin->mailToReplyAction());
......@@ -529,7 +529,7 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item &msg, const QUrl &url
urlMenuAdded = true;
} else if (url.scheme() != QLatin1String("attachment")) {
// popup on a not-mailto URL
menu = new QMenu;
menu = new QMenu(this);
menu->addAction(mReaderWin->urlOpenAction());
menu->addAction(mReaderWin->addBookmarksAction());
menu->addAction(mReaderWin->urlSaveAsAction());
......@@ -550,7 +550,7 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item &msg, const QUrl &url
const QString selectedText(mReaderWin->copyText());
if (!selectedText.isEmpty()) {
if (!menu) {
menu = new QMenu;
menu = new QMenu(this);
}
if (urlMenuAdded) {
menu->addSeparator();
......@@ -575,7 +575,7 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item &msg, const QUrl &url
}
} else if (!urlMenuAdded) {
if (!menu) {
menu = new QMenu;
menu = new QMenu(this);
}
// popup somewhere else (i.e., not a URL) on the message
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment