summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-06-16 13:56:39 +0200
committerMontel Laurent <[email protected]>2017-06-16 13:56:39 +0200
commit2df0f3e45d110c86e7c1e75a6b41a8b5a99bffdd (patch)
tree5fbe7544abbf21b7034443b16a6c946437c63d60
parentab3c0c588029c0e0dd293ab15f23dc6c719be191 (diff)
Add parent to QMenu. Minor optimization. Use nullptr
-rw-r--r--ktnef/src/attachpropertydialog.cpp4
-rw-r--r--ktnef/src/ktnefmain.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/ktnef/src/attachpropertydialog.cpp b/ktnef/src/attachpropertydialog.cpp
index d2c1a7b..afc4e56 100644
--- a/ktnef/src/attachpropertydialog.cpp
+++ b/ktnef/src/attachpropertydialog.cpp
@@ -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",
diff --git a/ktnef/src/ktnefmain.cpp b/ktnef/src/ktnefmain.cpp
index 46b8c7f..e06d963 100644
--- a/ktnef/src/ktnefmain.cpp
+++ b/ktnef/src/ktnefmain.cpp
@@ -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();