[Companion] Better storage traces

This commit is contained in:
Bertrand Songis
2017-01-19 21:19:17 +01:00
parent 0d6f5b470b
commit 3c62cbf200
8 changed files with 27 additions and 9 deletions
+17 -4
View File
@@ -58,18 +58,19 @@ class StorageFormat
QString warning() {
return _warning;
}
virtual QString name() = 0;
protected:
void setError(const QString & error)
{
qDebug() << "error:" << error;
qDebug() << qPrintable(QString("[%1] error: %2").arg(name()).arg(error));
_error = error;
}
void setWarning(const QString & warning)
{
if (!warning.isEmpty())
qDebug() << "warning:" << warning;
qDebug() << qPrintable(QString("[%1] warning: %2").arg(name()).arg(warning));
_warning = warning;
}
@@ -126,6 +127,18 @@ class Storage : public StorageFormat
{
}
virtual QString name() { return "storage"; };
void setError(const QString & error)
{
_error = error;
}
void setWarning(const QString & warning)
{
_warning = warning;
}
virtual bool load(RadioData & radioData);
virtual bool write(const RadioData & radioData);
};