mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-29 00:27:27 -04:00
attempt to fix problems with chat styles
This commit is contained in:
parent
af1c22a4d5
commit
d053400914
1 changed files with 8 additions and 6 deletions
|
@ -71,12 +71,13 @@ static QString loadStyleInfo(ChatStyle::enumStyleType type, QComboBox *style_CB,
|
||||||
ChatStyle::getAvailableStyles(type, styles);
|
ChatStyle::getAvailableStyles(type, styles);
|
||||||
|
|
||||||
while(style_CB->count())
|
while(style_CB->count())
|
||||||
style_CB->removeItem(0) ;
|
whileBlocking(style_CB)->removeItem(0) ;
|
||||||
|
|
||||||
int n=0;
|
int n=0;
|
||||||
for (style = styles.begin(); style != styles.end(); ++style,++n)
|
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);
|
style_CB->setItemData(n, qVariantFromValue(*style),Qt::UserRole);
|
||||||
|
|
||||||
if (style->stylePath == stylePath) {
|
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 */
|
/* now the combobox should be filled */
|
||||||
|
|
||||||
int index = comboBox->findText(styleVariant);
|
int index = comboBox->findText(styleVariant);
|
||||||
|
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
comboBox->setCurrentIndex(index);
|
whileBlocking(comboBox)->setCurrentIndex(index);
|
||||||
} else {
|
} else {
|
||||||
if (comboBox->count()) {
|
if (comboBox->count()) {
|
||||||
comboBox->setCurrentIndex(0);
|
whileBlocking(comboBox)->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return stylePath;
|
return stylePath;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue