mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-23 14:41:04 -04:00
fixed empty names in header drop menu
This commit is contained in:
parent
a8adf8d494
commit
e081567fbc
2 changed files with 21 additions and 8 deletions
|
@ -217,12 +217,20 @@ QMenu *RSTreeWidget::createStandardContextMenu(QMenu *contextMenu)
|
|||
|
||||
QTreeWidgetItem *item = headerItem();
|
||||
int columnCount = item->columnCount();
|
||||
for (int column = 0; column < columnCount; ++column) {
|
||||
for (int column = 0; column < columnCount; ++column)
|
||||
{
|
||||
QMap<int, bool>::const_iterator it = mColumnCustomizable.find(column);
|
||||
if (it != mColumnCustomizable.end() && *it == false) {
|
||||
continue;
|
||||
}
|
||||
QAction *action = headerMenu->addAction(QIcon(), item->text(column), this, SLOT(columnVisible()));
|
||||
QString txt = item->text(column) ;
|
||||
if(txt == "")
|
||||
txt = item->data(column,Qt::UserRole).toString() ;
|
||||
|
||||
if(txt=="")
|
||||
txt = tr("[no title]") ;
|
||||
|
||||
QAction *action = headerMenu->addAction(QIcon(), txt, this, SLOT(columnVisible()));
|
||||
action->setCheckable(true);
|
||||
action->setData(column);
|
||||
action->setChecked(!isColumnHidden(column));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue