Fix creation of history item when a new entry is added.

Add corresponding gui test.
This commit is contained in:
Florian Geyer
2012-05-10 10:29:25 +02:00
parent 887e4067ec
commit 44489bf6f8
4 changed files with 63 additions and 2 deletions

View File

@@ -134,6 +134,7 @@ void EditEntryWidget::loadEntry(Entry* entry, bool create, const QString& groupN
{
m_entry = entry;
m_metadata = metadata;
m_create = create;
if (create) {
m_ui->headerLabel->setText(groupName+" > "+tr("Add entry"));
@@ -212,7 +213,9 @@ void EditEntryWidget::saveEntry()
m_currentAttribute = QPersistentModelIndex();
m_entry->beginUpdate();
if (!m_create) {
m_entry->beginUpdate();
}
m_entry->setTitle(m_mainUi->titleEdit->text());
m_entry->setUsername(m_mainUi->usernameEdit->text());
@@ -245,7 +248,9 @@ void EditEntryWidget::saveEntry()
}
}
m_entry->endUpdate();
if (!m_create) {
m_entry->endUpdate();
}
m_entry = 0;
m_entryAttributes->clear();