Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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

Don't close it when we don't select an item

parent 7e38acac
......@@ -101,8 +101,8 @@ void AttachPropertyDialog::setAttachment( KTNEFAttach *attach )
void AttachPropertyDialog::slotSave()
{
saveProperty( mUI.mProperties, mAttach, this );
accept();
if (saveProperty( mUI.mProperties, mAttach, this ))
accept();
}
void AttachPropertyDialog::formatProperties( const QMap<int,KTNEFProperty*>& props, QTreeWidget *lv,
......@@ -152,7 +152,7 @@ void AttachPropertyDialog::formatPropertySet( KTNEFPropertySet *pSet, QTreeWidge
formatProperties( pSet->attributes(), 0, item, QLatin1String("attr") );
}
void AttachPropertyDialog::saveProperty( QTreeWidget *lv, KTNEFPropertySet *pSet, QWidget *parent )
bool AttachPropertyDialog::saveProperty( QTreeWidget *lv, KTNEFPropertySet *pSet, QWidget *parent )
{
QList<QTreeWidgetItem *> list = lv->selectedItems();
if ( list.isEmpty() || !list.first() ) {
......@@ -160,7 +160,7 @@ void AttachPropertyDialog::saveProperty( QTreeWidget *lv, KTNEFPropertySet *pSet
parent,
i18nc( "@info",
"Must select an item first." ) );
return;
return false;
}
QTreeWidgetItem *item = list.first();
......@@ -199,6 +199,7 @@ void AttachPropertyDialog::saveProperty( QTreeWidget *lv, KTNEFPropertySet *pSet
}
}
}
return true;
}
QPixmap AttachPropertyDialog::loadRenderingPixmap( KTNEFPropertySet *pSet, const QColor &bgColor )
......
......@@ -47,7 +47,7 @@ class AttachPropertyDialog : public KDialog
static void formatProperties( const QMap<int,KTNEFProperty*> &, QTreeWidget *,
QTreeWidgetItem *, const QString & = QLatin1String("prop") );
static void formatPropertySet( KTNEFPropertySet *, QTreeWidget * );
static void saveProperty( QTreeWidget *, KTNEFPropertySet *, QWidget * );
static bool saveProperty( QTreeWidget *, KTNEFPropertySet *, QWidget * );
private slots:
void slotSave();
......
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