fixed crash caused by UpdateRecentFilesList()
This commit is contained in:
@@ -214,9 +214,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||
emit SetProgressBar(0);
|
||||
}
|
||||
|
||||
//Update the file list in the File-->[import files list] area, so the user can quickly re-load a previously used .hex file.
|
||||
UpdateRecentFileList();
|
||||
|
||||
|
||||
timer->start(1000); //Check for future USB connection status changes every 1000 milliseconds.
|
||||
|
||||
@@ -326,8 +323,6 @@ void MainWindow::Connection(void)
|
||||
|
||||
if(currStatus != comm->isConnected())
|
||||
{
|
||||
UpdateRecentFileList();
|
||||
|
||||
if(comm->isConnected())
|
||||
{
|
||||
qWarning("Attempting to open device...");
|
||||
@@ -368,7 +363,7 @@ void MainWindow::setBootloadEnabled(bool enable)
|
||||
ui->action_Settings->setEnabled(enable);
|
||||
ui->actionErase_Device->setEnabled(enable && !writeConfig);
|
||||
ui->actionWrite_Device->setEnabled(enable && hexOpen);
|
||||
ui->actionExit->setEnabled(enable);
|
||||
//ui->actionExit->setEnabled(enable);
|
||||
ui->action_Verify_Device->setEnabled(enable && hexOpen);
|
||||
//ui->actionOpen->setEnabled(enable);
|
||||
ui->actionBlank_Check->setEnabled(enable && !writeConfig);
|
||||
@@ -391,7 +386,7 @@ void MainWindow::setBootloadBusy(bool busy)
|
||||
ui->action_Settings->setEnabled(!busy);
|
||||
ui->actionErase_Device->setEnabled(!busy && !writeConfig);
|
||||
ui->actionWrite_Device->setEnabled(!busy && hexOpen);
|
||||
ui->actionExit->setEnabled(!busy);
|
||||
//ui->actionExit->setEnabled(!busy);
|
||||
ui->action_Verify_Device->setEnabled(!busy && hexOpen);
|
||||
ui->btnFwBrowse->setEnabled(!busy);
|
||||
ui->action_Settings->setEnabled(!busy);
|
||||
@@ -1046,6 +1041,7 @@ void MainWindow::on_btnFwBrowse_clicked()
|
||||
return;
|
||||
}
|
||||
|
||||
ui->txtFirmwareFile->setText(newFileName);
|
||||
LoadFile(newFileName);
|
||||
}
|
||||
|
||||
@@ -1178,16 +1174,6 @@ void MainWindow::LoadFile(QString newFileName)
|
||||
QSettings settings;
|
||||
settings.beginGroup("MainWindow");
|
||||
|
||||
QStringList files = settings.value("recentFileList").toStringList();
|
||||
files.removeAll(fileName);
|
||||
files.prepend(fileName);
|
||||
while(files.size() > MAX_RECENT_FILES)
|
||||
{
|
||||
files.removeLast();
|
||||
}
|
||||
settings.setValue("recentFileList", files);
|
||||
UpdateRecentFileList();
|
||||
|
||||
stream.setIntegerBase(10);
|
||||
|
||||
msg.clear();
|
||||
@@ -1211,33 +1197,6 @@ void MainWindow::openRecentFile(void)
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::UpdateRecentFileList(void)
|
||||
{
|
||||
QSettings settings;
|
||||
settings.beginGroup("MainWindow");
|
||||
QStringList files;
|
||||
|
||||
files = settings.value("recentFileList").toStringList();
|
||||
|
||||
int recentFileCount = qMin(files.size(), MAX_RECENT_FILES);
|
||||
QString text;
|
||||
int i;
|
||||
|
||||
for(i = 0; i < recentFileCount; i++)
|
||||
{
|
||||
text = tr("&%1 %2").arg(i + 1).arg(QFileInfo(files[i]).fileName());
|
||||
|
||||
recentFiles[i]->setText(text);
|
||||
recentFiles[i]->setData(files[i]);
|
||||
recentFiles[i]->setVisible(comm->isConnected());
|
||||
}
|
||||
|
||||
for(; i < MAX_RECENT_FILES; i++)
|
||||
{
|
||||
recentFiles[i]->setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_action_About_triggered()
|
||||
{
|
||||
QString msg;
|
||||
|
||||
@@ -102,8 +102,6 @@ protected:
|
||||
|
||||
void setBootloadEnabled(bool enable);
|
||||
|
||||
void UpdateRecentFileList(void);
|
||||
|
||||
Comm::ErrorCode RemapInterruptVectors(Device* device, DeviceData* deviceData);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user