Skip to content

Commit 2958e5a

Browse files
committed
Silence some warnings and fix bug with RTL editor
This silences a couple of compiler warnings. The changes in the grammar parser serve the same purpose: they silence at least some of the warnings Antlr prints while generating the parser code. In the Edit Dialog a missing break is added to a switch statement. This seems like it actually was an unintended fallthrough for once, setting the focus to the hex editor instead of the RTL editor.
1 parent 2045a4d commit 2958e5a

11 files changed

Lines changed: 474 additions & 554 deletions

src/EditDialog.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,10 +629,12 @@ void EditDialog::setDataInBuffer(const QByteArray& bArrdata, DataSources source)
629629
// We don't want this when the QtBuffer has been automatically switched due to the insertion of RTL text,
630630
// (detected through the state of the apply button) otherwise that would break the typing flow of the user.
631631
if (!isReadOnly)
632+
{
632633
if (!ui->buttonApply->isEnabled())
633634
ui->qtEdit->selectAll();
634635
else
635636
ui->qtEdit->moveCursor(QTextCursor::End);
637+
}
636638
ui->qtEdit->setEnabled(true);
637639
break;
638640
}
@@ -913,6 +915,7 @@ void EditDialog::setFocus()
913915
case RtlTextEditor:
914916
ui->qtEdit->setFocus();
915917
ui->qtEdit->selectAll();
918+
break;
916919
case HexEditor:
917920
hexEdit->setFocus();
918921
break;

src/MainWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ void MainWindow::updateRecentFileActions()
15411541
// Add shortcut for opening the file using the keyboard. However, if the application is configured to store
15421542
// more than nine recently opened files don't set shortcuts for the later ones which wouldn't be single digit anymore.
15431543
if(i < 9)
1544-
recentFileActs[i]->setShortcut(QKeySequence(Qt::CTRL + (Qt::Key_1+i)));
1544+
recentFileActs[i]->setShortcut(QKeySequence(static_cast<int>(Qt::CTRL + (Qt::Key_1+static_cast<unsigned int>(i)))));
15451545
}
15461546
for (int j = numRecentFiles; j < MaxRecentFiles; ++j)
15471547
recentFileActs[j]->setVisible(false);

src/TableBrowser.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ BrowseDataTableSettings& TableBrowser::settings(const sqlb::ObjectIdentifier& ob
148148
return browseTableSettings[object];
149149
}
150150

151-
void TableBrowser::setSettings(const sqlb::ObjectIdentifier& table, const BrowseDataTableSettings& data)
151+
void TableBrowser::setSettings(const sqlb::ObjectIdentifier& table, const BrowseDataTableSettings& table_settings)
152152
{
153-
browseTableSettings[table] = data;
153+
browseTableSettings[table] = table_settings;
154154
}
155155

156156
void TableBrowser::setStructure(QAbstractItemModel* model, const QString& old_table)
@@ -451,7 +451,6 @@ void TableBrowser::updateRecordsetLabel()
451451
txt = tr("%1 - %2 of >= %3").arg(from).arg(to).arg(total);
452452
break;
453453
case SqliteTableModel::RowCount::Complete:
454-
default:
455454
txt = tr("%1 - %2 of %3").arg(from).arg(to).arg(total);
456455
break;
457456
}

src/TableBrowser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class TableBrowser : public QWidget
8484

8585
QMap<sqlb::ObjectIdentifier, BrowseDataTableSettings> allSettings() const { return browseTableSettings; }
8686
BrowseDataTableSettings& settings(const sqlb::ObjectIdentifier& object);
87-
void setSettings(const sqlb::ObjectIdentifier& table, const BrowseDataTableSettings& data);
87+
void setSettings(const sqlb::ObjectIdentifier& table, const BrowseDataTableSettings& table_settings);
8888

8989
void setStructure(QAbstractItemModel* model, const QString& old_table = QString());
9090
void updateStructure();

0 commit comments

Comments
 (0)