From bb33d48ea165677c21aff600e217adf7b4b3dd81 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 11 Sep 2024 11:17:54 -0400 Subject: [PATCH] Remove unused Qt class variables --- .gitignore | 1 + src/config.cpp | 2 -- src/mainwindow.cpp | 3 --- src/project.cpp | 2 -- src/ui/colorpicker.cpp | 1 - src/ui/regionmapeditor.cpp | 1 - src/ui/tileseteditor.cpp | 1 - src/ui/tileseteditortileselector.cpp | 2 -- 8 files changed, 1 insertion(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 9157e62c..2a731404 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ porymap.app* porymap porymap.cfg porymap.log +build/ # Qt generated files ui_*.h diff --git a/src/config.cpp b/src/config.cpp index ef18f360..8c4213d8 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -208,7 +208,6 @@ void KeyValueConfigBase::load() { } QTextStream in(&file); - QList configLines; static const QRegularExpression re("^(?[^=]+)=(?.*)$"); while (!in.atEnd()) { QString line = in.readLine().trimmed(); @@ -1060,7 +1059,6 @@ QMap UserConfig::getKeyValueMap() { } void UserConfig::init() { - QString dirName = QDir(this->projectDir).dirName().toLower(); this->useEncounterJson = true; this->customScripts.clear(); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ecac1703..e87592f3 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1253,7 +1253,6 @@ void MainWindow::onOpenMapListContextMenu(const QPoint &point) // Build custom context menu depending on which type of item was selected (map group, map name, etc.) if (itemType == "map_group") { - QString groupName = selectedItem->data(Qt::UserRole).toString(); int groupNum = selectedItem->data(MapListUserRoles::GroupRole).toInt(); QMenu* menu = new QMenu(this); QActionGroup* actions = new QActionGroup(menu); @@ -1727,7 +1726,6 @@ void MainWindow::paste() { else if (!clipboardText.isEmpty()) { // we only can paste json text // so, check if clipboard text is valid json - QString parseError; QJsonDocument pasteJsonDoc = QJsonDocument::fromJson(clipboardText.toUtf8()); // test empty @@ -2033,7 +2031,6 @@ void MainWindow::updateObjects() { } void MainWindow::updateSelectedObjects() { - QList all_events = editor->getObjects(); QList events; if (editor->selected_events && editor->selected_events->length()) { diff --git a/src/project.cpp b/src/project.cpp index 690323f5..ea42988c 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -1933,8 +1933,6 @@ void Project::appendTilesetLabel(QString label, QString isSecondaryStr) { } bool Project::readTilesetLabels() { - QStringList primaryTilesets; - QStringList secondaryTilesets; this->primaryTilesetLabels.clear(); this->secondaryTilesetLabels.clear(); this->tilesetLabelsOrdered.clear(); diff --git a/src/ui/colorpicker.cpp b/src/ui/colorpicker.cpp index ee2baff3..dccffc0e 100644 --- a/src/ui/colorpicker.cpp +++ b/src/ui/colorpicker.cpp @@ -48,7 +48,6 @@ void ColorPicker::hover(int mouseX, int mouseY) { return; // 15 X 15 box with 8x magnification = 120px square) - QRect zoomRect(mouseX - zoom_box_dimensions / 2, mouseY - zoom_box_dimensions / 2, zoom_box_dimensions, zoom_box_dimensions); QPixmap grab = screen->grabWindow(0, mouseX - zoom_box_dimensions / 2, mouseY - zoom_box_dimensions / 2, zoom_box_dimensions, zoom_box_dimensions); int pixelRatio = grab.devicePixelRatio(); diff --git a/src/ui/regionmapeditor.cpp b/src/ui/regionmapeditor.cpp index 0a5451a7..372c6e05 100644 --- a/src/ui/regionmapeditor.cpp +++ b/src/ui/regionmapeditor.cpp @@ -1009,7 +1009,6 @@ void RegionMapEditor::on_tabWidget_Region_Map_currentChanged(int index) { } void RegionMapEditor::on_comboBox_RM_ConnectedMap_textActivated(const QString &mapsec) { - QString layer = this->region_map->getLayer(); this->region_map->setSquareMapSection(this->currIndex, mapsec); onRegionMapLayoutSelectedTileChanged(this->currIndex);// re-draw layout image diff --git a/src/ui/tileseteditor.cpp b/src/ui/tileseteditor.cpp index 9ef50cc6..60a469e0 100644 --- a/src/ui/tileseteditor.cpp +++ b/src/ui/tileseteditor.cpp @@ -996,7 +996,6 @@ void TilesetEditor::on_actionImport_Secondary_Metatiles_triggered() void TilesetEditor::importTilesetMetatiles(Tileset *tileset, bool primary) { - QString descriptor = primary ? "primary" : "secondary"; QString descriptorCaps = primary ? "Primary" : "Secondary"; QString filepath = QFileDialog::getOpenFileName( diff --git a/src/ui/tileseteditortileselector.cpp b/src/ui/tileseteditortileselector.cpp index 99cb38f4..6984c0e3 100644 --- a/src/ui/tileseteditortileselector.cpp +++ b/src/ui/tileseteditortileselector.cpp @@ -294,8 +294,6 @@ void TilesetEditorTileSelector::drawUnused() { QPixmap redX(16, 16); redX.fill(Qt::transparent); - QBitmap mask(16, 16); - QPen whitePen(Qt::white); whitePen.setWidth(1); QPen pinkPen(Qt::magenta);