mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
attempt to fix problems with chat styles
This commit is contained in:
parent
af1c22a4d5
commit
d053400914
@ -71,12 +71,13 @@ static QString loadStyleInfo(ChatStyle::enumStyleType type, QComboBox *style_CB,
|
||||
ChatStyle::getAvailableStyles(type, styles);
|
||||
|
||||
while(style_CB->count())
|
||||
style_CB->removeItem(0) ;
|
||||
whileBlocking(style_CB)->removeItem(0) ;
|
||||
|
||||
int n=0;
|
||||
for (style = styles.begin(); style != styles.end(); ++style,++n)
|
||||
{
|
||||
style_CB->insertItem(n,style->styleName);
|
||||
whileBlocking(style_CB)->insertItem(n,style->styleName);
|
||||
|
||||
style_CB->setItemData(n, qVariantFromValue(*style),Qt::UserRole);
|
||||
|
||||
if (style->stylePath == stylePath) {
|
||||
@ -84,16 +85,17 @@ static QString loadStyleInfo(ChatStyle::enumStyleType type, QComboBox *style_CB,
|
||||
}
|
||||
}
|
||||
|
||||
style_CB->setCurrentIndex(activeItem);
|
||||
whileBlocking(style_CB)->setCurrentIndex(activeItem);
|
||||
|
||||
/* now the combobox should be filled */
|
||||
|
||||
int index = comboBox->findText(styleVariant);
|
||||
|
||||
if (index != -1) {
|
||||
comboBox->setCurrentIndex(index);
|
||||
whileBlocking(comboBox)->setCurrentIndex(index);
|
||||
} else {
|
||||
if (comboBox->count()) {
|
||||
comboBox->setCurrentIndex(0);
|
||||
whileBlocking(comboBox)->setCurrentIndex(0);
|
||||
}
|
||||
}
|
||||
return stylePath;
|
||||
|
Loading…
Reference in New Issue
Block a user