Qt: Fix unused variable warnings

This commit is contained in:
Vicki Pfau 2020-12-05 20:08:42 -08:00
parent a8e924ae5e
commit ec97747a94
3 changed files with 19 additions and 5 deletions

View File

@ -868,7 +868,7 @@ void CoreController::startVideoLog(const QString& path, bool compression) {
if (!vf) { if (!vf) {
return; return;
} }
startVideoLog(vf); startVideoLog(vf, compression);
} }
void CoreController::startVideoLog(VFile* vf, bool compression) { void CoreController::startVideoLog(VFile* vf, bool compression) {

View File

@ -56,7 +56,12 @@ bool LogConfigModel::setData(const QModelIndex& index, const QVariant& value, in
if (levels < 0) { if (levels < 0) {
levels = m_levels; 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) { if (index.row() == 0) {
beginResetModel(); beginResetModel();
@ -102,18 +107,27 @@ QVariant LogConfigModel::headerData(int section, Qt::Orientation orientation, in
} }
QModelIndex LogConfigModel::index(int row, int column, const QModelIndex& parent) const { QModelIndex LogConfigModel::index(int row, int column, const QModelIndex& parent) const {
if (parent.isValid()) {
return QModelIndex();
}
return createIndex(row, column, nullptr); return createIndex(row, column, nullptr);
} }
QModelIndex LogConfigModel::parent(const QModelIndex& index) const { QModelIndex LogConfigModel::parent(const QModelIndex&) const {
return QModelIndex(); return QModelIndex();
} }
int LogConfigModel::columnCount(const QModelIndex& parent) const { int LogConfigModel::columnCount(const QModelIndex& parent) const {
if (parent.isValid()) {
return 0;
}
return 8; return 8;
} }
int LogConfigModel::rowCount(const QModelIndex& parent) const { int LogConfigModel::rowCount(const QModelIndex& parent) const {
if (parent.isValid()) {
return 0;
}
return m_cache.size() + 1; return m_cache.size() + 1;
} }
@ -146,4 +160,4 @@ void LogConfigModel::save(ConfigController* config) {
} }
m_controller->setLevels(m_levels); m_controller->setLevels(m_levels);
m_controller->save(config); m_controller->save(config);
} }

View File

@ -1511,7 +1511,7 @@ void Window::setupMenu(QMenuBar* menubar) {
addGameAction(tr("View &tiles..."), "tileWindow", openControllerTView<TileView>(), "tools"); addGameAction(tr("View &tiles..."), "tileWindow", openControllerTView<TileView>(), "tools");
addGameAction(tr("View &map..."), "mapWindow", openControllerTView<MapView>(), "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) { if (!m_frameView) {
m_frameView = new FrameView(m_controller); m_frameView = new FrameView(m_controller);
connect(this, &Window::shutdown, this, [this]() { connect(this, &Window::shutdown, this, [this]() {