diff options
Diffstat (limited to 'action.cpp')
-rw-r--r-- | action.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/action.cpp b/action.cpp new file mode 100644 index 0000000..df52dcc --- /dev/null +++ b/action.cpp @@ -0,0 +1,18 @@ +#include "board.h" +#include "action.h" + +Action::Action(Board *board) : + QObject(board), _board(board) +{ +} + +void Action::handleDatabaseError(const char *what, const QSqlError &err) +{ + QString message = QString("Database error while %1: %2").arg(what).arg(err.text()); + emit error(this, message); +} + +void Action::handleDatabaseError(const char *what, const QSqlQuery &query) +{ + handleDatabaseError(what, query.lastError()); +} |