fixed display of share flags as a proper nice icon set

This commit is contained in:
mr-alice 2016-11-01 10:30:36 +01:00
parent 8fe85b9bdd
commit 3430eece22
6 changed files with 89 additions and 16 deletions

View file

@ -62,7 +62,6 @@ ShareManager::ShareManager()
ui.headerFrame->setHeaderText(tr("Share Manager"));
isLoading = false;
load();
Settings->loadWidgetInformation(this);
@ -80,13 +79,12 @@ ShareManager::ShareManager()
QHeaderView* header = ui.shareddirList->horizontalHeader();
QHeaderView_setSectionResizeModeColumn(header, COLUMN_PATH, QHeaderView::Stretch);
// header->setResizeMode(COLUMN_NETWORKWIDE, QHeaderView::ResizeToContents);
// header->setResizeMode(COLUMN_BROWSABLE, QHeaderView::ResizeToContents);
header->setHighlightSections(false);
setAcceptDrops(true);
setAttribute(Qt::WA_DeleteOnClose, true);
reload();
}
void ShareManager::doubleClickedCell(int row,int column)
@ -240,20 +238,11 @@ void ShareManager::showYourself()
void ShareManager::updateFlags()
{
if(isLoading)
return ;
isLoading = true ; // stops GUI update. Otherwise each call to rsFiles->updateShareFlags() modifies the GUI that we count on to check
// what has changed => fail!
for(int row=0;row<ui.shareddirList->rowCount();++row)
{
FileStorageFlags flags = (dynamic_cast<GroupFlagsWidget*>(ui.shareddirList->cellWidget(row,COLUMN_SHARE_FLAGS)))->flags() ;
mDirInfos[row].shareflags = flags ;
}
isLoading = false ; // re-enable GUI load
load() ; // update the GUI.
}