mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-24 12:59:58 -06:00
Simplify code
The parameter for populateTable isn't needed anymore
This commit is contained in:
@@ -389,14 +389,14 @@ void MainWindow::clearTableBrowser()
|
||||
qobject_cast<FilterTableHeader*>(ui->dataTable->horizontalHeader())->generateFilters(0);
|
||||
}
|
||||
|
||||
void MainWindow::populateTable(QString tablename)
|
||||
void MainWindow::populateTable()
|
||||
{
|
||||
// Early exit if the Browse Data tab isn't visible as there is no need to update it in this case
|
||||
if(ui->mainTab->currentIndex() != 1)
|
||||
return;
|
||||
|
||||
// Remove the model-view link if the table name is empty in order to remove any data from the view
|
||||
if(ui->comboBrowseTable->model()->rowCount(ui->comboBrowseTable->rootModelIndex()) == 0 && tablename.isEmpty())
|
||||
if(ui->comboBrowseTable->model()->rowCount(ui->comboBrowseTable->rootModelIndex()) == 0)
|
||||
{
|
||||
clearTableBrowser();
|
||||
return;
|
||||
@@ -404,9 +404,8 @@ void MainWindow::populateTable(QString tablename)
|
||||
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
|
||||
// Default parameter -> use current table name
|
||||
if(tablename.isNull())
|
||||
tablename = ui->comboBrowseTable->currentText();
|
||||
// Get current table name
|
||||
QString tablename = ui->comboBrowseTable->currentText();
|
||||
|
||||
// Set model
|
||||
bool reconnectSelectionSignals = false;
|
||||
|
||||
@@ -160,7 +160,7 @@ private slots:
|
||||
void changeTreeSelection();
|
||||
void fileNew();
|
||||
void populateStructure();
|
||||
void populateTable(QString tablename = QString());
|
||||
void populateTable();
|
||||
void clearTableBrowser();
|
||||
bool fileClose();
|
||||
void addRecord();
|
||||
|
||||
@@ -2071,7 +2071,7 @@
|
||||
<sender>comboBrowseTable</sender>
|
||||
<signal>activated(QString)</signal>
|
||||
<receiver>MainWindow</receiver>
|
||||
<slot>populateTable(QString)</slot>
|
||||
<slot>populateTable()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>118</x>
|
||||
@@ -2967,7 +2967,7 @@
|
||||
<slots>
|
||||
<slot>fileOpen()</slot>
|
||||
<slot>fileClose()</slot>
|
||||
<slot>populateTable(QString)</slot>
|
||||
<slot>populateTable()</slot>
|
||||
<slot>addRecord()</slot>
|
||||
<slot>deleteRecord()</slot>
|
||||
<slot>navigatePrevious()</slot>
|
||||
|
||||
Reference in New Issue
Block a user