Commit 2df0f3e4 authored by Laurent Montel's avatar Laurent Montel 😁

Add parent to QMenu. Minor optimization. Use nullptr

parent ab3c0c58
......@@ -40,7 +40,7 @@
AttachPropertyDialog::AttachPropertyDialog(QWidget *parent)
: QDialog(parent)
, mAttach(0)
, mAttach(nullptr)
{
setModal(true);
......@@ -170,7 +170,7 @@ void AttachPropertyDialog::formatPropertySet(KTNEFPropertySet *pSet, QTreeWidget
bool AttachPropertyDialog::saveProperty(QTreeWidget *lv, KTNEFPropertySet *pSet, QWidget *parent)
{
QList<QTreeWidgetItem *> list = lv->selectedItems();
if (list.isEmpty() || !list.first()) {
if (list.isEmpty()) {
KMessageBox::error(
parent,
i18nc("@info",
......
......@@ -216,7 +216,7 @@ void KTNEFMain::loadFile(const QString &filename)
void KTNEFMain::openFile()
{
QString filename = QFileDialog::getOpenFileName(this, i18nc("@title:window", "Open TNEF File"));
const QString filename = QFileDialog::getOpenFileName(this, i18nc("@title:window", "Open TNEF File"));
if (!filename.isEmpty()) {
loadFile(filename);
}
......@@ -420,7 +420,7 @@ void KTNEFMain::contextMenuEvent(QContextMenuEvent *event)
}
QAction *prop = nullptr;
QMenu *menu = new QMenu();
QMenu *menu = new QMenu(this);
if (list.count() == 1) {
createOpenWithMenu(menu);
menu->addSeparator();
......
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