mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 08:29:26 -05:00
removed useless root item in RsCollection dialog
This commit is contained in:
parent
2d18335da4
commit
48bd1517fc
@ -146,6 +146,7 @@ RsCollectionDialog::RsCollectionDialog(const QString& collectionFileName
|
||||
ui.headerFrame->setHeaderText(tr("Collection Editor"));
|
||||
ui.downloadFolder_LE->hide();
|
||||
ui.downloadFolder_LB->hide();
|
||||
ui.destinationDir_TB->hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -401,30 +402,34 @@ void RsCollectionDialog::processSettings(bool bLoad)
|
||||
*/
|
||||
QTreeWidgetItem* RsCollectionDialog::getRootItem()
|
||||
{
|
||||
QTreeWidgetItem* root= ui._fileEntriesTW->topLevelItem(0);
|
||||
if (!root) {
|
||||
root= new QTreeWidgetItem;
|
||||
root->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate);
|
||||
root->setText(COLUMN_FILE, "/");
|
||||
root->setToolTip(COLUMN_FILE,tr("This is the root directory."));
|
||||
root->setText(COLUMN_FILEPATH, "/");
|
||||
root->setText(COLUMN_HASH, "");
|
||||
root->setData(COLUMN_HASH, ROLE_NAME, "");
|
||||
root->setData(COLUMN_HASH, ROLE_PATH, "");
|
||||
root->setData(COLUMN_HASH, ROLE_TYPE, DIR_TYPE_DIR);
|
||||
root->setText(COLUMN_SIZE, misc::friendlyUnit(0));
|
||||
root->setToolTip(COLUMN_SIZE, tr("Real Size: Waiting child..."));
|
||||
root->setData(COLUMN_SIZE, ROLE_SIZE, 0);
|
||||
root->setData(COLUMN_SIZE, ROLE_SELSIZE, 0);
|
||||
root->setText(COLUMN_FILEC, "0");
|
||||
root->setToolTip(COLUMN_FILEC, tr("Real File Count: Waiting child..."));
|
||||
root->setData(COLUMN_FILEC, ROLE_FILEC, 0);
|
||||
root->setData(COLUMN_FILEC, ROLE_SELFILEC, 0);
|
||||
ui._fileEntriesTW->addTopLevelItem(root);
|
||||
}
|
||||
root->setExpanded(true);
|
||||
return ui._fileEntriesTW->invisibleRootItem();
|
||||
|
||||
return root;
|
||||
// (csoler) I removed this code because it does the job of the invisibleRootItem() method.
|
||||
//
|
||||
// QTreeWidgetItem* root= ui._fileEntriesTW->topLevelItem(0);
|
||||
// if (!root) {
|
||||
// root= new QTreeWidgetItem;
|
||||
// root->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate);
|
||||
// root->setText(COLUMN_FILE, "/");
|
||||
// root->setToolTip(COLUMN_FILE,tr("This is the root directory."));
|
||||
// root->setText(COLUMN_FILEPATH, "/");
|
||||
// root->setText(COLUMN_HASH, "");
|
||||
// root->setData(COLUMN_HASH, ROLE_NAME, "");
|
||||
// root->setData(COLUMN_HASH, ROLE_PATH, "");
|
||||
// root->setData(COLUMN_HASH, ROLE_TYPE, DIR_TYPE_DIR);
|
||||
// root->setText(COLUMN_SIZE, misc::friendlyUnit(0));
|
||||
// root->setToolTip(COLUMN_SIZE, tr("Real Size: Waiting child..."));
|
||||
// root->setData(COLUMN_SIZE, ROLE_SIZE, 0);
|
||||
// root->setData(COLUMN_SIZE, ROLE_SELSIZE, 0);
|
||||
// root->setText(COLUMN_FILEC, "0");
|
||||
// root->setToolTip(COLUMN_FILEC, tr("Real File Count: Waiting child..."));
|
||||
// root->setData(COLUMN_FILEC, ROLE_FILEC, 0);
|
||||
// root->setData(COLUMN_FILEC, ROLE_SELFILEC, 0);
|
||||
// ui._fileEntriesTW->addTopLevelItem(root);
|
||||
// }
|
||||
// root->setExpanded(true);
|
||||
//
|
||||
// return root;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -515,6 +520,7 @@ bool RsCollectionDialog::addChild(QTreeWidgetItem* parent, const std::vector<Col
|
||||
item->setData(COLUMN_FILEC, ROLE_SELFILEC, 1);
|
||||
}
|
||||
item->setFont(COLUMN_FILE, font);
|
||||
item->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
|
||||
|
||||
if (colFileInfo.filename_has_wrong_characters)
|
||||
{
|
||||
|
@ -377,7 +377,7 @@
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
<property name="rootIsDecorated">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
|
Loading…
Reference in New Issue
Block a user