Minor debugging tidy ups. Some tracing disabled until either a configurable use is...
[qwerkisync] / DBBackends / RtcomEventLogger.cpp
index 20daa23..dbea940 100644 (file)
@@ -399,7 +399,7 @@ void RtcomEventLogger::Reindex()
                                                        if(min == 0)
                                                                min = one;
 
-                                                       qDebug() << "( " << one << ", " << two << " )";
+                                                       //qDebug() << "( " << one << ", " << two << " )";
                                                        mapping.insert(one, two);
                                                }
                                        }
@@ -437,23 +437,23 @@ void RtcomEventLogger::Reindex()
                        int val(min);
                        sequence.append(0);
                        sequence.append(val);
-                       qDebug().nospace() << "val1: " << val << ", ";
+                       //qDebug().nospace() << "val1: " << val << ", ";
 
                        while((val = mapping[val]) && val != min)
                        {
                                sequence.append(val);
-                               qDebug().nospace() << val << ", ";
+                               //qDebug().nospace() << val << ", ";
                        }
                        sequence.append(0);
 
-                       qDebug().nospace() << "seq: ";
+                       //qDebug().nospace() << "seq: ";
                        QList<QPair<int,int> > updates;
                        int last(sequence.first());
                        foreach(int seq, sequence)
                        {
                                if(seq != last)
                                {
-                                       qDebug().nospace() << seq << ", " << last << ", ";
+                                       //qDebug().nospace() << seq << ", " << last << ", ";
                                        updates.append(QPair<int,int>(seq, last));
                                }
 
@@ -488,7 +488,7 @@ void RtcomEventLogger::Reindex()
                                }
                        }
 
-                       qDebug() << query;
+                       //qDebug() << query;
 
                        QSqlQuery * UpdateQuery(new QSqlQuery( db ));
                        if(UpdateQuery != NULL)
@@ -502,9 +502,7 @@ void RtcomEventLogger::Reindex()
                                        {
                                                for( QStringList::const_iterator currentStatement(statements.constBegin()); currentStatement != statements.constEnd(); ++currentStatement)
                                                {
-                                                       if ( UpdateQuery->exec( *currentStatement ))
-                                                               qDebug() << "Query OK, " << UpdateQuery->numRowsAffected() << " rows affected.";
-                                                       else
+                                                       if (!UpdateQuery->exec(*currentStatement))
                                                        {
                                                                qDebug() << "Query Failed: " << *currentStatement;
                                                                throw std::exception();
@@ -632,10 +630,10 @@ QDebug operator<<(QDebug dbg, RTComElEvent &event)
        dbg.nospace() << "\tservice:\t" << event.fld_service << "\n";
        dbg.nospace() << "\tevt_typ_id:\t" << event.fld_event_type_id << "\n";
        dbg.nospace() << "\tevt_typ:\t" << event.fld_event_type << "\n";
-       dbg.nospace() << "\tstore-time:\t" << QDateTime::fromTime_t(event.fld_storage_time) << "\n";
-       dbg.nospace() << "\tstart-time:\t" << QDateTime::fromTime_t(event.fld_start_time) << "\n";
-       dbg.nospace() << "\tend-time:\t\t" << QDateTime::fromTime_t(event.fld_end_time) << "\n";
-       dbg.nospace() << "\tis-read:\t\t" << (event.fld_is_read ? "true" : "false") << "\n";
+       dbg.nospace() << "\tstore-time:\t" << QDateTime::fromTime_t(event.fld_storage_time).toUTC() << "\n";
+       dbg.nospace() << "\tstart-time:\t" << QDateTime::fromTime_t(event.fld_start_time).toUTC() << "\n";
+       dbg.nospace() << "\tend-time:\t" << QDateTime::fromTime_t(event.fld_end_time).toUTC() << "\n";
+       dbg.nospace() << "\tis-read:\t" << (event.fld_is_read ? "true" : "false") << "\n";
        dbg.nospace() << "\tdirection:\t" << (event.fld_outgoing ? "Outgoing" : "Incoming") << "\n";
        dbg.nospace() << "\tflags:\t\t" << "0x" << QString::number(event.fld_flags, 16) << "\n";
        dbg.nospace() << "\tbytes sent:\t" << event.fld_bytes_sent << "\n";
@@ -644,6 +642,7 @@ QDebug operator<<(QDebug dbg, RTComElEvent &event)
        dbg.nospace() << "\tlocal-name:\t" << event.fld_local_name << "\n";
        dbg.nospace() << "\tremote-uid:\t" << event.fld_remote_uid << "\n";
        dbg.nospace() << "\tremote-name:\t" << event.fld_remote_name << "\n";
+       dbg.nospace() << "\tremote-ebid:\t" << event.fld_remote_ebook_uid << "\n";
        dbg.nospace() << "\tchannel:\t\t" << event.fld_channel << "\n";
        dbg.nospace() << "\tfree-text:\t" << event.fld_free_text << "\n";
        dbg.nospace() << "\tgroup-uid:\t" << event.fld_group_uid << "\n";