mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-21 13:49:04 -04:00
removed useless root item in RsCollection dialog
This commit is contained in:
parent
2d18335da4
commit
48bd1517fc
2 changed files with 30 additions and 24 deletions
|
@ -146,6 +146,7 @@ RsCollectionDialog::RsCollectionDialog(const QString& collectionFileName
|
||||||
ui.headerFrame->setHeaderText(tr("Collection Editor"));
|
ui.headerFrame->setHeaderText(tr("Collection Editor"));
|
||||||
ui.downloadFolder_LE->hide();
|
ui.downloadFolder_LE->hide();
|
||||||
ui.downloadFolder_LB->hide();
|
ui.downloadFolder_LB->hide();
|
||||||
|
ui.destinationDir_TB->hide();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -401,30 +402,34 @@ void RsCollectionDialog::processSettings(bool bLoad)
|
||||||
*/
|
*/
|
||||||
QTreeWidgetItem* RsCollectionDialog::getRootItem()
|
QTreeWidgetItem* RsCollectionDialog::getRootItem()
|
||||||
{
|
{
|
||||||
QTreeWidgetItem* root= ui._fileEntriesTW->topLevelItem(0);
|
return ui._fileEntriesTW->invisibleRootItem();
|
||||||
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;
|
// (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->setData(COLUMN_FILEC, ROLE_SELFILEC, 1);
|
||||||
}
|
}
|
||||||
item->setFont(COLUMN_FILE, font);
|
item->setFont(COLUMN_FILE, font);
|
||||||
|
item->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
|
||||||
|
|
||||||
if (colFileInfo.filename_has_wrong_characters)
|
if (colFileInfo.filename_has_wrong_characters)
|
||||||
{
|
{
|
||||||
|
|
|
@ -377,7 +377,7 @@
|
||||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="rootIsDecorated">
|
<property name="rootIsDecorated">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="allColumnsShowFocus">
|
<property name="allColumnsShowFocus">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue