From 0e0c610df0d3d4044d0b21ddc1752a5dacd7f86e Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Tue, 4 Feb 2014 00:18:51 +0100 Subject: utils/regtools: make qeditor able to poke directly at a hwstub device This commit add the very handy feature of being able to read registers directly from a device using hwstub. This is mostly trivial using the hwstub library and the biggest change here is actually: - being able to read registers by name and/or addresses - being able to enumerate devives The UI code currently doesn't handle hotplug but the backend does so it should be trivial to add in the future. It also opens up the possibility the write registers from hwstub or save the register values to a file. Since it relies on both hwstub and libusb, a switch has been introduced in qmake to disable it (use -config nohwstub). Change-Id: I5d7d7a2a7c97ecd7407227357c8553c2773ea6cc --- utils/regtools/qeditor/main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'utils/regtools/qeditor/main.cpp') diff --git a/utils/regtools/qeditor/main.cpp b/utils/regtools/qeditor/main.cpp index 0e4e67bfb7..576d3a16fc 100644 --- a/utils/regtools/qeditor/main.cpp +++ b/utils/regtools/qeditor/main.cpp @@ -6,25 +6,24 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - Backend *backend = new Backend; + Backend backend;; QDir dir(QCoreApplication::applicationDirPath()); dir.cdUp(); dir.cd("desc"); dir.setFilter(QDir::Files); - printf("%s\n", dir.absolutePath().toStdString().c_str()); QFileInfoList list = dir.entryInfoList(); for(int i = 0; i < list.size(); i++) { QFileInfo fileInfo = list.at(i); if(fileInfo.fileName().right(4) != ".xml" || fileInfo.fileName().left(5) != "regs-") continue; - backend->LoadSocDesc(fileInfo.absoluteFilePath()); + backend.LoadSocDesc(fileInfo.absoluteFilePath()); } QCoreApplication::setOrganizationName("Rockbox"); QCoreApplication::setApplicationName("Register Editor"); QCoreApplication::setOrganizationDomain("rockbox.org"); - MainWindow win(backend); + MainWindow win(&backend); win.show(); return app.exec(); } -- cgit v1.2.3