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.
This commit is contained in:
Olivier Goffart 2013-08-22 16:20:04 +02:00
parent 04d3e282fb
commit d3a333e03c

View file

@ -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);