Merge pull request #2764 from csoler/v0.6-BugFixing_30

Bug fixing
This commit is contained in:
csoler 2023-08-27 16:28:22 +02:00 committed by GitHub
commit 17562e727e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -95,6 +95,7 @@
#define ROW_SENTBOX 3 #define ROW_SENTBOX 3
#define ROW_TRASHBOX 4 #define ROW_TRASHBOX 4
// #define DEBUG_MESSAGES_DIALOG 1
class MessageSortFilterProxyModel: public QSortFilterProxyModel class MessageSortFilterProxyModel: public QSortFilterProxyModel
{ {
@ -365,15 +366,18 @@ void MessagesDialog::preModelUpdate()
if (m.isValid()) { if (m.isValid()) {
mTmpSavedCurrentId = m.sibling(m.row(), RsMessageModel::COLUMN_THREAD_MSGID).data(RsMessageModel::MsgIdRole).toString(); mTmpSavedCurrentId = m.sibling(m.row(), RsMessageModel::COLUMN_THREAD_MSGID).data(RsMessageModel::MsgIdRole).toString();
} }
#ifdef DEBUG_MESSAGES_DIALOG
std::cerr << "Pre-change: saving selection for " << mTmpSavedSelectedIds.size() << " indexes" << std::endl; std::cerr << "Pre-change: saving selection for " << mTmpSavedSelectedIds.size() << " indexes" << std::endl;
#endif
} }
void MessagesDialog::postModelUpdate() void MessagesDialog::postModelUpdate()
{ {
// restore selection // restore selection
#ifdef DEBUG_MESSAGES_DIALOG
std::cerr << "Post-change: restoring selection for " << mTmpSavedSelectedIds.size() << " indexes" << std::endl; std::cerr << "Post-change: restoring selection for " << mTmpSavedSelectedIds.size() << " indexes" << std::endl;
#endif
QItemSelection sel; QItemSelection sel;
foreach(const QString& s,mTmpSavedSelectedIds) foreach(const QString& s,mTmpSavedSelectedIds)

View File

@ -75,7 +75,8 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
ui.cmboLanguage->addItem(FilesDefs::getIconFromQtResourcePath(":/images/flags/" + code + ".png"), LanguageSupport::languageName(code), code); ui.cmboLanguage->addItem(FilesDefs::getIconFromQtResourcePath(":/images/flags/" + code + ".png"), LanguageSupport::languageName(code), code);
} }
foreach (QString style, QStyleFactory::keys()) { foreach (QString style, QStyleFactory::keys()) {
ui.cmboStyle->addItem(style, style.toLower()); if(style.toLower() != "gtk2" || (getenv("QT_QPA_PLATFORMTHEME")!=nullptr && !strcmp(getenv("QT_QPA_PLATFORMTHEME"),"gtk2"))) // make sure that if style is gtk2, the system has the correct environment variable set.
ui.cmboStyle->addItem(style, style.toLower());
} }
QMap<QString, QString> styleSheets; QMap<QString, QString> styleSheets;
@ -266,9 +267,9 @@ void AppearancePage::load()
index = ui.mainPageButtonType_CB->findData(Settings->getPageButtonLoc()); index = ui.mainPageButtonType_CB->findData(Settings->getPageButtonLoc());
if (index != 0) { if (index != 0) {
ui.cmboTollButtonsStyle->hide(); ui.cmboTollButtonsStyle->show();
}else { }else {
ui.cmboTollButtonsStyle->show(); ui.cmboTollButtonsStyle->hide();
} }
whileBlocking(ui.mainPageButtonType_CB)->setCurrentIndex(!Settings->getPageButtonLoc()); whileBlocking(ui.mainPageButtonType_CB)->setCurrentIndex(!Settings->getPageButtonLoc());