current highlighted search result is no longer reset when the search string changes...
[quassel.git] / src / core / sqlitestorage.cpp
index 7f4dd78..ef510e7 100644 (file)
@@ -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"));
@@ -257,7 +269,7 @@ bool SqliteStorage::removeNetwork(UserId user, const NetworkId &networkId) {
   if(withTransaction) {
     sync();
     if(!logDb().transaction()) {
-      quWarning() << "SqliteStorage::removeNetwork(): cannot start transaction. continuing with out rollback support!";
+      qWarning() << "SqliteStorage::removeNetwork(): cannot start transaction. continuing with out rollback support!";
       withTransaction = false;
     }
   }
@@ -491,19 +503,19 @@ BufferInfo SqliteStorage::getBufferInfo(UserId user, const NetworkId &networkId,
     query->exec();
     if(!query->first()) {
       watchQuery(query);
-      quWarning() << "unable to create BufferInfo for:" << user << networkId << buffer;
+      qWarning() << "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()) {
-    quError() << "SqliteStorage::getBufferInfo(): received more then one Buffer!";
-    quError() << "         Query:" << query->lastQuery();
-    quError() << "  bound Values:";
+    qCritical() << "SqliteStorage::getBufferInfo(): received more then one Buffer!";
+    qCritical() << "         Query:" << query->lastQuery();
+    qCritical() << "  bound Values:";
     QList<QVariant> list = query->boundValues().values();
     for (int i = 0; i < list.size(); ++i)
-      quError() << i << ":" << list.at(i).toString().toAscii().data();
+      qCritical() << i << ":" << list.at(i).toString().toAscii().data();
     Q_ASSERT(false);
   }
 
@@ -813,7 +825,7 @@ bool SqliteStorage::init(const QVariantMap &settings) {
   getPasswordsQuery.exec();
 
   if(!watchQuery(&getPasswordsQuery)) {
-    quError() << "unable to migrate to new password format!";
+    qCritical() << "unable to migrate to new password format!";
     return false;
   }
 
@@ -831,6 +843,6 @@ bool SqliteStorage::init(const QVariantMap &settings) {
     watchQuery(&setPasswordsQuery);
   }
 
-  quDebug() << "successfully migrated passwords!";
+  qDebug() << "successfully migrated passwords!";
   return true;
 }