From 6f176c620b5084306c55677c90b374c88c741777 Mon Sep 17 00:00:00 2001 From: defnax Date: Wed, 6 Jan 2010 23:03:54 +0000 Subject: [PATCH] fixed remove rows before adding new git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1981 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/DetailsDialog.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/DetailsDialog.cpp b/retroshare-gui/src/gui/DetailsDialog.cpp index 1ba7b6520..4a01c7d48 100644 --- a/retroshare-gui/src/gui/DetailsDialog.cpp +++ b/retroshare-gui/src/gui/DetailsDialog.cpp @@ -98,9 +98,6 @@ void DetailsDialog::closeEvent (QCloseEvent * event) { QWidget::closeEvent(event); - int c; - c = CommentsModel->rowCount(); - CommentsModel->removeRows(0,c); } void DetailsDialog::setFileName(const QString & filename) @@ -108,6 +105,10 @@ void DetailsDialog::setFileName(const QString & filename) int c; QModelIndex index; + c = CommentsModel->rowCount(); + CommentsModel->removeRows(0,c); + + { c = CommentsModel->rowCount(); CommentsModel->insertRow(c); @@ -119,6 +120,7 @@ void DetailsDialog::setFileName(const QString & filename) index = CommentsModel->index(c, 2); CommentsModel->setData(index, filename); + } ui.name_label_2->setText(filename);