projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Properly updating the new message marker on buffer switches
[quassel.git]
/
src
/
core
/
sqlitestorage.cpp
diff --git
a/src/core/sqlitestorage.cpp
b/src/core/sqlitestorage.cpp
index
84b7776
..
ef510e7
100644
(file)
--- a/
src/core/sqlitestorage.cpp
+++ b/
src/core/sqlitestorage.cpp
@@
-113,6
+113,18
@@
UserId SqliteStorage::validateUser(const QString &user, const QString &password)
}
}
}
}
+UserId SqliteStorage::internalUser() {
+ QSqlQuery query(logDb());
+ query.prepare(queryString("select_internaluser"));
+ query.exec();
+
+ if(query.first()) {
+ return query.value(0).toInt();
+ } else {
+ return 0;
+ }
+}
+
void SqliteStorage::delUser(UserId user) {
QSqlQuery query(logDb());
query.prepare(queryString("delete_backlog_by_uid"));
void SqliteStorage::delUser(UserId user) {
QSqlQuery query(logDb());
query.prepare(queryString("delete_backlog_by_uid"));
@@
-257,7
+269,7
@@
bool SqliteStorage::removeNetwork(UserId user, const NetworkId &networkId) {
if(withTransaction) {
sync();
if(!logDb().transaction()) {
if(withTransaction) {
sync();
if(!logDb().transaction()) {
- q
u
Warning() << "SqliteStorage::removeNetwork(): cannot start transaction. continuing with out rollback support!";
+ qWarning() << "SqliteStorage::removeNetwork(): cannot start transaction. continuing with out rollback support!";
withTransaction = false;
}
}
withTransaction = false;
}
}
@@
-491,19
+503,19
@@
BufferInfo SqliteStorage::getBufferInfo(UserId user, const NetworkId &networkId,
query->exec();
if(!query->first()) {
watchQuery(query);
query->exec();
if(!query->first()) {
watchQuery(query);
- q
uWarning() << "unable to create BufferInfo for:
" << user << networkId << buffer;
+ q
Warning() << "unable to create BufferInfo for:
" << user << networkId << buffer;
return BufferInfo();
}
}
BufferInfo bufferInfo = BufferInfo(query->value(0).toInt(), networkId, (BufferInfo::Type)query->value(1).toInt(), 0, buffer);
if(query->next()) {
return BufferInfo();
}
}
BufferInfo bufferInfo = BufferInfo(query->value(0).toInt(), networkId, (BufferInfo::Type)query->value(1).toInt(), 0, buffer);
if(query->next()) {
- q
uError
() << "SqliteStorage::getBufferInfo(): received more then one Buffer!";
- q
uError() << " Query:
" << query->lastQuery();
- q
uError
() << " bound Values:";
+ q
Critical
() << "SqliteStorage::getBufferInfo(): received more then one Buffer!";
+ q
Critical() << " Query:
" << query->lastQuery();
+ q
Critical
() << " bound Values:";
QList<QVariant> list = query->boundValues().values();
for (int i = 0; i < list.size(); ++i)
QList<QVariant> list = query->boundValues().values();
for (int i = 0; i < list.size(); ++i)
- q
uError() << i << ":
" << list.at(i).toString().toAscii().data();
+ q
Critical() << i << ":
" << list.at(i).toString().toAscii().data();
Q_ASSERT(false);
}
Q_ASSERT(false);
}
@@
-813,7
+825,7
@@
bool SqliteStorage::init(const QVariantMap &settings) {
getPasswordsQuery.exec();
if(!watchQuery(&getPasswordsQuery)) {
getPasswordsQuery.exec();
if(!watchQuery(&getPasswordsQuery)) {
- q
uError
() << "unable to migrate to new password format!";
+ q
Critical
() << "unable to migrate to new password format!";
return false;
}
return false;
}
@@
-831,6
+843,6
@@
bool SqliteStorage::init(const QVariantMap &settings) {
watchQuery(&setPasswordsQuery);
}
watchQuery(&setPasswordsQuery);
}
- q
u
Debug() << "successfully migrated passwords!";
+ qDebug() << "successfully migrated passwords!";
return true;
}
return true;
}