OPL::DbSummary Class Reference

The DbSummary class collects summaries of entries and relevant data from the database. More...

`#include <dbsummary.h>`

Inheritance diagram for OPL::DbSummary:

## Static Public Member Functions

static const QMap< DbSummaryKey, QString > | databaseSummary (const QString &db_path)
| Return a summary of a database. More...
static const QString | summaryString (const QString &db_path)
| returns a short summary string of the database, containing total time and date of last flight.

## Detailed Description

The DbSummary class collects summaries of entries and relevant data from the database.

Summaries are used mainly in the BackupWidget to give the user a quick overview about the contents of a database so they can decide which backup to delete/restore. This class is a helper class to avoid interfacing with the database directly. It uses a separate database connection in order to not interfere with the currently active database.

## Member Function Documentation

## databaseSummary()

const QMap< DbSummaryKey, QString > OPL::DbSummary::databaseSummary | ( | const QString & | db_path | ) |

static

Return a summary of a database.

Creates a summary of the database giving a quick overview of the relevant contents. The function runs several specialised SQL queries to create a QHash<DatabaseSummaryKey, QString> containing Total Flight Time, Number of unique aircraft and pilots, as well as the date of last flight. Uses a temporary database connection separate from the default connection in order to not tamper with the currently active database connection. The full path to the database to be summarized has to be provided.

The documentation for this class was generated from the following files:

- src/database/dbsummary.h
- src/database/dbsummary.cpp