From d3a333e03c3e63cb86370259f2e13e50c466a0fe Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 22 Aug 2013 16:20:04 +0200 Subject: [PATCH] Fix the 'copy button' in the protocol log Fix #863 Also added more padding for the filename because it might be big, and in case it's not enough, always add at least a space. --- src/mirall/itemprogressdialog.cpp | 38 +++++++++++++------------------ 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/src/mirall/itemprogressdialog.cpp b/src/mirall/itemprogressdialog.cpp index 8b16cc428..2f6d13cfc 100644 --- a/src/mirall/itemprogressdialog.cpp +++ b/src/mirall/itemprogressdialog.cpp @@ -203,28 +203,22 @@ void ItemProgressDialog::copyToClipboard() int topLevelItems = _ui->_treeWidget->topLevelItemCount(); for (int i = 0; i < topLevelItems; i++) { - QTreeWidgetItem *item = _ui->_treeWidget->topLevelItem(i); - ts << left << qSetFieldWidth(0) - << item->data(0, Qt::DisplayRole).toString() - << endl; - int childItems = item->childCount(); - for (int j = 0; j < childItems; j++) { - QTreeWidgetItem *child =item->child(j); - // time stamp - ts << left << qSetFieldWidth(10) - << child->data(0,Qt::DisplayRole).toString() - // file name - << qSetFieldWidth(50) - << child->data(1,Qt::DisplayRole).toString() - // action - << qSetFieldWidth(15) - << child->data(2, Qt::DisplayRole).toString() - // size - << qSetFieldWidth(10) - << child->data(3, Qt::DisplayRole).toString() - << qSetFieldWidth(0) - << endl; - } + QTreeWidgetItem *child = _ui->_treeWidget->topLevelItem(i); + // time stamp + ts << left << qSetFieldWidth(10) + << child->data(0,Qt::DisplayRole).toString() + // file name + << qSetFieldWidth(64) + << child->data(1,Qt::DisplayRole).toString() + << qSetFieldWidth(0) << ' ' + // action + << qSetFieldWidth(15) + << child->data(3, Qt::DisplayRole).toString() + // size + << qSetFieldWidth(10) + << child->data(4, Qt::DisplayRole).toString() + << qSetFieldWidth(0) + << endl; } QApplication::clipboard()->setText(text);