• LNJ's avatar
    Rewrite database models to not block the GUI · e8750bad
    LNJ authored
    This rewrites parts of the main database class. All classes working on
    the database have been moved to the new database thread, so inserting
    records into the database isn't blocking the user interface anymore.
    What also improved the performance *massively* is the use of SQLite
    transactions, when inserting multiple records. So inserting is so fast
    now that it actually wouldn't necessarily require another thread, but
    with this we're safe in the future.
    
    The message model and the roster model have been splitted up into a
    database manager and the list model that is used to present cached data
    to the user. The XMPP managers are connected to both the model and the
    db classes, so both are updated in parallel.
    
    There are also two new classes for the RosterItem and the Message,
    because we need to cache those in the models in a vector. The Message
    class inherits from QXmppMessage, so we can now use the same class for
    sending messages and inserting messages into the database.
    
    Closes #273.
    e8750bad
RosterModel.h 2.91 KB