Some fixes.
This commit is contained in:
parent
99ef00a98b
commit
addad0af31
@ -109,8 +109,7 @@ QVariant FeedsModelRecycleBin::data(int column, int role) const {
|
||||
}
|
||||
|
||||
bool FeedsModelRecycleBin::empty() {
|
||||
QSqlDatabase db_handle = qApp->database()->connection("FeedsModelRecycleBin",
|
||||
DatabaseFactory::FromSettings);
|
||||
QSqlDatabase db_handle = qApp->database()->connection("FeedsModelRecycleBin", DatabaseFactory::FromSettings);
|
||||
|
||||
if (!db_handle.transaction()) {
|
||||
qWarning("Starting transaction for recycle bin emptying.");
|
||||
@ -137,8 +136,7 @@ bool FeedsModelRecycleBin::empty() {
|
||||
}
|
||||
|
||||
bool FeedsModelRecycleBin::restore() {
|
||||
QSqlDatabase db_handle = qApp->database()->connection("FeedsModelRecycleBin",
|
||||
DatabaseFactory::FromSettings);
|
||||
QSqlDatabase db_handle = qApp->database()->connection("FeedsModelRecycleBin", DatabaseFactory::FromSettings);
|
||||
|
||||
if (!db_handle.transaction()) {
|
||||
qWarning("Starting transaction for recycle bin restoring.");
|
||||
@ -165,8 +163,7 @@ bool FeedsModelRecycleBin::restore() {
|
||||
}
|
||||
|
||||
void FeedsModelRecycleBin::updateCounts(bool update_total_count) {
|
||||
QSqlDatabase database = qApp->database()->connection("FeedsModelRecycleBin",
|
||||
DatabaseFactory::FromSettings);
|
||||
QSqlDatabase database = qApp->database()->connection("FeedsModelRecycleBin", DatabaseFactory::FromSettings);
|
||||
QSqlQuery query_all(database);
|
||||
query_all.setForwardOnly(true);
|
||||
|
||||
|
@ -345,10 +345,8 @@ void MessagesView::deleteSelectedMessages() {
|
||||
int row_count = m_sourceModel->rowCount();
|
||||
if (row_count > 0) {
|
||||
QModelIndex last_item = current_index.row() < row_count ?
|
||||
m_proxyModel->index(current_index.row(),
|
||||
MSG_DB_TITLE_INDEX) :
|
||||
m_proxyModel->index(row_count - 1,
|
||||
MSG_DB_TITLE_INDEX);
|
||||
m_proxyModel->index(current_index.row(), MSG_DB_TITLE_INDEX) :
|
||||
m_proxyModel->index(row_count - 1, MSG_DB_TITLE_INDEX);
|
||||
|
||||
setCurrentIndex(last_item);
|
||||
scrollTo(last_item);
|
||||
|
Loading…
x
Reference in New Issue
Block a user