summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Dbx_sqlite/src/dbcontacts.cpp2
-rw-r--r--plugins/NewStory/src/history_dlg.cpp12
2 files changed, 3 insertions, 11 deletions
diff --git a/plugins/Dbx_sqlite/src/dbcontacts.cpp b/plugins/Dbx_sqlite/src/dbcontacts.cpp
index f66e5840e8..407f643a81 100644
--- a/plugins/Dbx_sqlite/src/dbcontacts.cpp
+++ b/plugins/Dbx_sqlite/src/dbcontacts.cpp
@@ -3,7 +3,7 @@
void CDbxSQLite::InitContacts()
{
sqlite3_stmt *stmt = nullptr;
- sqlite3_prepare_v2(m_db, "SELECT contacts.id, COUNT(es.id) FROM contacts LEFT JOIN events_srt es ON es.contact_id = contacts.id GROUP BY contacts.id;", -1, &stmt, nullptr);
+ sqlite3_prepare_v2(m_db, "SELECT contact_id, COUNT(id) FROM events_srt GROUP BY contact_id;", -1, &stmt, nullptr);
int rc = 0;
while ((rc = sqlite3_step(stmt)) == SQLITE_ROW) {
MCONTACT hContact = sqlite3_column_int64(stmt, 0);
diff --git a/plugins/NewStory/src/history_dlg.cpp b/plugins/NewStory/src/history_dlg.cpp
index b8553dc00d..b38fd3efde 100644
--- a/plugins/NewStory/src/history_dlg.cpp
+++ b/plugins/NewStory/src/history_dlg.cpp
@@ -219,18 +219,10 @@ class CHistoryDlg : public CDlgBase
void UpdateTitle()
{
- switch (m_hContact) {
- case INVALID_CONTACT_ID:
+ if (m_hContact == INVALID_CONTACT_ID)
SetWindowText(m_hwnd, TranslateT("Global history search"));
- break;
-
- case 0:
- SetWindowText(m_hwnd, TranslateT("System history"));
- break;
-
- default:
+ else
SetWindowText(m_hwnd, TplFormatString(TPL_TITLE, m_hContact, 0));
- }
}
void BuildBookmarksList()