Debugger: Re-organize passing of display formats

The current setup (dumper->gui: list of descriptions,
gui->dumper: index in list) is fragile and not easily
i18n'able. Go with an enum based approach now.

Change-Id: Ie78c596065a8b2ba87ad725274da29d4be3a6da4
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2015-03-20 16:03:59 +01:00
parent b727c15a53
commit 48ac7c186b
11 changed files with 221 additions and 276 deletions

View File

@@ -576,17 +576,21 @@ void CdbEngine::setupEngine()
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSetupFailed")
notifyEngineSetupFailed();
}
const QString normalFormat = tr("Normal");
const QStringList stringFormats = QStringList()
<< normalFormat << tr("Separate Window");
DisplayFormats stringFormats;
stringFormats.append(SimpleFormat);
stringFormats.append(SeparateFormat);
WatchHandler *wh = watchHandler();
wh->addTypeFormats("QString", stringFormats);
wh->addTypeFormats("QString *", stringFormats);
wh->addTypeFormats("QByteArray", stringFormats);
wh->addTypeFormats("QByteArray *", stringFormats);
wh->addTypeFormats("std__basic_string", stringFormats); // Python dumper naming convention for std::[w]string
const QStringList imageFormats = QStringList()
<< normalFormat << tr("Image");
DisplayFormats imageFormats;
imageFormats.append(SimpleFormat);
imageFormats.append(EnhancedFormat);
wh->addTypeFormats("QImage", imageFormats);
wh->addTypeFormats("QImage *", imageFormats);
}