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
Родитель 04d3e282fb
Коммит d3a333e03c
1 изменённых файлов: 16 добавлений и 22 удалений

Просмотреть файл

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