all repos — mgba @ ec97747a94171a322384dcd7858aeb1bf44ed767

mGBA Game Boy Advance Emulator

Qt: Fix unused variable warnings
Vicki Pfau vi@endrift.com
Sat, 05 Dec 2020 20:08:42 -0800
commit

ec97747a94171a322384dcd7858aeb1bf44ed767

parent

a8e924ae5ebe4819114d25f91ac9ca301cd24fc0

M src/platform/qt/CoreController.cppsrc/platform/qt/CoreController.cpp

@@ -868,7 +868,7 @@ VFile* vf = VFileDevice::open(path, O_WRONLY | O_CREAT | O_TRUNC);

if (!vf) { return; } - startVideoLog(vf); + startVideoLog(vf, compression); } void CoreController::startVideoLog(VFile* vf, bool compression) {
M src/platform/qt/LogConfigModel.cppsrc/platform/qt/LogConfigModel.cpp

@@ -56,7 +56,12 @@ } else {

if (levels < 0) { levels = m_levels; } - levels ^= 1 << (index.column() - 1); + int bit = 1 << (index.column() - 1); + if (value.value<Qt::CheckState>() == Qt::Unchecked) { + levels &= ~bit; + } else { + levels |= bit; + } } if (index.row() == 0) { beginResetModel();

@@ -102,18 +107,27 @@ }

} QModelIndex LogConfigModel::index(int row, int column, const QModelIndex& parent) const { + if (parent.isValid()) { + return QModelIndex(); + } return createIndex(row, column, nullptr); } -QModelIndex LogConfigModel::parent(const QModelIndex& index) const { +QModelIndex LogConfigModel::parent(const QModelIndex&) const { return QModelIndex(); } int LogConfigModel::columnCount(const QModelIndex& parent) const { + if (parent.isValid()) { + return 0; + } return 8; } int LogConfigModel::rowCount(const QModelIndex& parent) const { + if (parent.isValid()) { + return 0; + } return m_cache.size() + 1; }

@@ -146,4 +160,4 @@ }

} m_controller->setLevels(m_levels); m_controller->save(config); -}+}
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -1511,7 +1511,7 @@ addGameAction(tr("View &sprites..."), "spriteWindow", openControllerTView<ObjView>(), "tools");

addGameAction(tr("View &tiles..."), "tileWindow", openControllerTView<TileView>(), "tools"); addGameAction(tr("View &map..."), "mapWindow", openControllerTView<MapView>(), "tools"); - Action* frameWindow = addGameAction(tr("&Frame inspector..."), "frameWindow", [this]() { + addGameAction(tr("&Frame inspector..."), "frameWindow", [this]() { if (!m_frameView) { m_frameView = new FrameView(m_controller); connect(this, &Window::shutdown, this, [this]() {