Some fixes.

This commit is contained in:
Martin Rotter 2014-11-12 18:34:50 +01:00
parent 99ef00a98b
commit addad0af31
2 changed files with 5 additions and 10 deletions

View file

@ -109,8 +109,7 @@ QVariant FeedsModelRecycleBin::data(int column, int role) const {
} }
bool FeedsModelRecycleBin::empty() { bool FeedsModelRecycleBin::empty() {
QSqlDatabase db_handle = qApp->database()->connection("FeedsModelRecycleBin", QSqlDatabase db_handle = qApp->database()->connection("FeedsModelRecycleBin", DatabaseFactory::FromSettings);
DatabaseFactory::FromSettings);
if (!db_handle.transaction()) { if (!db_handle.transaction()) {
qWarning("Starting transaction for recycle bin emptying."); qWarning("Starting transaction for recycle bin emptying.");
@ -137,8 +136,7 @@ bool FeedsModelRecycleBin::empty() {
} }
bool FeedsModelRecycleBin::restore() { bool FeedsModelRecycleBin::restore() {
QSqlDatabase db_handle = qApp->database()->connection("FeedsModelRecycleBin", QSqlDatabase db_handle = qApp->database()->connection("FeedsModelRecycleBin", DatabaseFactory::FromSettings);
DatabaseFactory::FromSettings);
if (!db_handle.transaction()) { if (!db_handle.transaction()) {
qWarning("Starting transaction for recycle bin restoring."); qWarning("Starting transaction for recycle bin restoring.");
@ -165,8 +163,7 @@ bool FeedsModelRecycleBin::restore() {
} }
void FeedsModelRecycleBin::updateCounts(bool update_total_count) { void FeedsModelRecycleBin::updateCounts(bool update_total_count) {
QSqlDatabase database = qApp->database()->connection("FeedsModelRecycleBin", QSqlDatabase database = qApp->database()->connection("FeedsModelRecycleBin", DatabaseFactory::FromSettings);
DatabaseFactory::FromSettings);
QSqlQuery query_all(database); QSqlQuery query_all(database);
query_all.setForwardOnly(true); query_all.setForwardOnly(true);

View file

@ -345,10 +345,8 @@ void MessagesView::deleteSelectedMessages() {
int row_count = m_sourceModel->rowCount(); int row_count = m_sourceModel->rowCount();
if (row_count > 0) { if (row_count > 0) {
QModelIndex last_item = current_index.row() < row_count ? QModelIndex last_item = current_index.row() < row_count ?
m_proxyModel->index(current_index.row(), m_proxyModel->index(current_index.row(), MSG_DB_TITLE_INDEX) :
MSG_DB_TITLE_INDEX) : m_proxyModel->index(row_count - 1, MSG_DB_TITLE_INDEX);
m_proxyModel->index(row_count - 1,
MSG_DB_TITLE_INDEX);
setCurrentIndex(last_item); setCurrentIndex(last_item);
scrollTo(last_item); scrollTo(last_item);