Fix lang column count.
This commit is contained in:
parent
3bc79c071c
commit
4dc7791b87
5 changed files with 21 additions and 16 deletions
|
|
@ -68,7 +68,7 @@ FormSettings::FormSettings(QWidget *parent) : QDialog(parent), m_ui(new Ui::Form
|
||||||
|
|
||||||
// Setup behavior.
|
// Setup behavior.
|
||||||
m_ui->m_listSettings->setCurrentRow(0);
|
m_ui->m_listSettings->setCurrentRow(0);
|
||||||
m_ui->m_treeLanguages->setColumnCount(5);
|
m_ui->m_treeLanguages->setColumnCount(4);
|
||||||
m_ui->m_treeLanguages->setHeaderHidden(false);
|
m_ui->m_treeLanguages->setHeaderHidden(false);
|
||||||
m_ui->m_treeLanguages->setHeaderLabels(QStringList()
|
m_ui->m_treeLanguages->setHeaderLabels(QStringList()
|
||||||
<< /*: Language column of language list. */ tr("Language")
|
<< /*: Language column of language list. */ tr("Language")
|
||||||
|
|
@ -89,7 +89,6 @@ FormSettings::FormSettings(QWidget *parent) : QDialog(parent), m_ui(new Ui::Form
|
||||||
m_ui->m_treeLanguages->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
|
m_ui->m_treeLanguages->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
|
||||||
m_ui->m_treeLanguages->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
|
m_ui->m_treeLanguages->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
|
||||||
m_ui->m_treeLanguages->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents);
|
m_ui->m_treeLanguages->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents);
|
||||||
m_ui->m_treeLanguages->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents);
|
|
||||||
|
|
||||||
// Setup skins.
|
// Setup skins.
|
||||||
m_ui->m_treeSkins->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
m_ui->m_treeSkins->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QStackedWidget" name="m_stackedSettings">
|
<widget class="QStackedWidget" name="m_stackedSettings">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="m_pageGeneral">
|
<widget class="QWidget" name="m_pageGeneral">
|
||||||
<layout class="QFormLayout" name="formLayout_5">
|
<layout class="QFormLayout" name="formLayout_5">
|
||||||
|
|
@ -417,8 +417,8 @@ Authors of this application are NOT responsible for lost data.</string>
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>100</width>
|
<width>782</width>
|
||||||
<height>30</height>
|
<height>451</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
|
@ -495,8 +495,8 @@ Authors of this application are NOT responsible for lost data.</string>
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>167</width>
|
<width>776</width>
|
||||||
<height>219</height>
|
<height>425</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,18 @@ bool DatabaseQueries::markMessageImportant(QSqlDatabase db, int id, RootItem::Im
|
||||||
return q.exec();
|
return q.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DatabaseQueries::markFeedsReadUnread(QSqlDatabase db, const QStringList &ids, int account_id, RootItem::ReadStatus read) {
|
||||||
|
QSqlQuery query_read_msg(db);
|
||||||
|
query_read_msg.setForwardOnly(true);
|
||||||
|
query_read_msg.prepare(QString("UPDATE Messages SET is_read = :read "
|
||||||
|
"WHERE feed IN (%1) AND is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id;").arg(ids.join(QSL(", "))));
|
||||||
|
|
||||||
|
query_read_msg.bindValue(QSL(":read"), read == RootItem::Read ? 1 : 0);
|
||||||
|
query_read_msg.bindValue(QSL(":account_id"), account_id);
|
||||||
|
|
||||||
|
return query_read_msg.exec();
|
||||||
|
}
|
||||||
|
|
||||||
bool DatabaseQueries::markBinReadUnread(QSqlDatabase db, int account_id, RootItem::ReadStatus read) {
|
bool DatabaseQueries::markBinReadUnread(QSqlDatabase db, int account_id, RootItem::ReadStatus read) {
|
||||||
QSqlQuery q(db);
|
QSqlQuery q(db);
|
||||||
q.setForwardOnly(true);
|
q.setForwardOnly(true);
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ class DatabaseQueries {
|
||||||
public:
|
public:
|
||||||
static bool markMessagesReadUnread(QSqlDatabase db, const QStringList &ids, RootItem::ReadStatus read);
|
static bool markMessagesReadUnread(QSqlDatabase db, const QStringList &ids, RootItem::ReadStatus read);
|
||||||
static bool markMessageImportant(QSqlDatabase db, int id, RootItem::Importance importance);
|
static bool markMessageImportant(QSqlDatabase db, int id, RootItem::Importance importance);
|
||||||
|
static bool markFeedsReadUnread(QSqlDatabase db, const QStringList &ids, int account_id, RootItem::ReadStatus read);
|
||||||
static bool markBinReadUnread(QSqlDatabase db, int account_id, RootItem::ReadStatus read);
|
static bool markBinReadUnread(QSqlDatabase db, int account_id, RootItem::ReadStatus read);
|
||||||
static bool markAccountReadUnread(QSqlDatabase db, int account_id, RootItem::ReadStatus read);
|
static bool markAccountReadUnread(QSqlDatabase db, int account_id, RootItem::ReadStatus read);
|
||||||
static bool switchMessagesImportance(QSqlDatabase db, const QStringList &ids);
|
static bool switchMessagesImportance(QSqlDatabase db, const QStringList &ids);
|
||||||
|
|
|
||||||
|
|
@ -279,16 +279,9 @@ QStringList ServiceRoot::customIDSOfMessagesForItem(RootItem *item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ServiceRoot::markFeedsReadUnread(QList<Feed*> items, RootItem::ReadStatus read) {
|
bool ServiceRoot::markFeedsReadUnread(QList<Feed*> items, RootItem::ReadStatus read) {
|
||||||
QSqlDatabase db_handle = qApp->database()->connection(metaObject()->className(), DatabaseFactory::FromSettings);
|
QSqlDatabase database = qApp->database()->connection(metaObject()->className(), DatabaseFactory::FromSettings);
|
||||||
QSqlQuery query_read_msg(db_handle);
|
|
||||||
query_read_msg.setForwardOnly(true);
|
|
||||||
query_read_msg.prepare(QString("UPDATE Messages SET is_read = :read "
|
|
||||||
"WHERE feed IN (%1) AND is_deleted = 0 AND is_pdeleted = 0 AND account_id = :account_id;").arg(textualFeedIds(items).join(QSL(", "))));
|
|
||||||
|
|
||||||
query_read_msg.bindValue(QSL(":read"), read == RootItem::Read ? 1 : 0);
|
if (DatabaseQueries::markFeedsReadUnread(database, textualFeedIds(items), accountId(), read)) {
|
||||||
query_read_msg.bindValue(QSL(":account_id"), accountId());
|
|
||||||
|
|
||||||
if (query_read_msg.exec()) {
|
|
||||||
QList<RootItem*> itemss;
|
QList<RootItem*> itemss;
|
||||||
|
|
||||||
foreach (Feed *feed, items) {
|
foreach (Feed *feed, items) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue