diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-08-27 22:54:06 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-08-30 02:46:41 +0200 |
| commit | e3c11fd05496bb2953e4dfe031afb1c180604d30 (patch) | |
| tree | 73450c857c97126feaa3651ac6edb789997f483c /jiddb.cpp | |
| parent | 78d9bd40849a39db1fbdbfc87b2c45e9d3e73d06 (diff) | |
| download | xxcc-e3c11fd05496bb2953e4dfe031afb1c180604d30.tar.gz | |
jiddb: Remove 'get' from public functions
Diffstat (limited to 'jiddb.cpp')
| -rw-r--r-- | jiddb.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -84,7 +84,7 @@ int JidDb::ensureContactDb(const QString &jid) const return 0; } -QList<JidDb::Message> JidDb::getMessages(const QString &jid, +QList<JidDb::Message> JidDb::messages(const QString &jid, const int tail) const { QSqlQuery q(db); @@ -95,14 +95,14 @@ QList<JidDb::Message> JidDb::getMessages(const QString &jid, { if (!q.exec("select * from '" + jid + "' order by time;")) { - std::cerr << "JidDb::getMessages: query exec failed"; + std::cerr << "JidDb::messages: query exec failed"; return QList<Message>(); } } else if (!q.exec("select * from '" + jid + "' order by time desc limit " + QString::number(tail) + ";")) { - std::cerr << "JidDb::getMessages: query exec failed" << std::endl; + std::cerr << "JidDb::messages: query exec failed" << std::endl; return QList<Message>(); } @@ -116,7 +116,7 @@ QList<JidDb::Message> JidDb::getMessages(const QString &jid, if (!ok) { - std::cerr << "JidDb::getMessages: invalid time" << std::endl; + std::cerr << "JidDb::messages: invalid time" << std::endl; // Attempt to read other messages. continue; } @@ -132,7 +132,7 @@ QList<JidDb::Message> JidDb::getMessages(const QString &jid, m.direction = Direction::Out; else { - std::cerr << "JidDb::getMessages: invalid direction" << std::endl; + std::cerr << "JidDb::messages: invalid direction" << std::endl; // Attempt to read other messages. continue; } @@ -181,7 +181,7 @@ QStringList JidDb::tables() const if (!q.exec("select name from sqlite_schema where " "type = 'table' and name not like 'sqlite_%'")) { - std::cerr << "JidDb::getConversations: query failed" << std::endl; + std::cerr << "JidDb::conversations: query failed" << std::endl; return QStringList(); } @@ -193,7 +193,7 @@ QStringList JidDb::tables() const return ret; } -QList<JidDb::Conversation> JidDb::getConversations() const +QList<JidDb::Conversation> JidDb::conversations() const { const auto conversations = tables(); QList<Conversation> ret; @@ -201,11 +201,11 @@ QList<JidDb::Conversation> JidDb::getConversations() const for (const auto &jid : conversations) if (jid.contains('@')) { - const auto messages = getMessages(jid, 1); + const auto msgs = messages(jid, 1); - if (!messages.isEmpty()) + if (!msgs.isEmpty()) { - const auto &m = messages.first(); + const auto &m = msgs.first(); ret << Conversation(jid, m.body, m.dt); } |
