From 80bf76dc318276f67eeec32b8f68e82cf4bb7e62 Mon Sep 17 00:00:00 2001 From: am Date: Sat, 18 Jul 2009 17:54:27 +0000 Subject: Again huge changes (should go on vacation more often :)) -turned archive tab into a QDialog -fixed duplicate handling in ListModel -fixed html output in archive dialog -actually made archiving work -changed covertype to text in database -fixed bug with covertype in coveritem git-svn-id: file:///var/svn/repos2/shemov/trunk@390 f440f766-f032-0410-8965-dc7d17de2ca0 --- listeditor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'listeditor.cpp') diff --git a/listeditor.cpp b/listeditor.cpp index d3d2caf..df63e15 100644 --- a/listeditor.cpp +++ b/listeditor.cpp @@ -45,8 +45,11 @@ void ListEditor::addItem(){ if(mEdit->text().isEmpty()){ return; } - QString newItem = mEdit->text().toLower(); - mModel->addItem(newItem); + QString newItem = mEdit->text().toLower().trimmed(); + QModelIndex idx = mModel->index(newItem); + if(idx == QModelIndex()){ + mModel->addItem(newItem); + } } void ListEditor::removeItem(){ -- cgit v1.2.3-70-g09d2