Commit ae25be96 authored by Matthias Möller's avatar Matthias Möller

fix: possible crash with multiple processes

(row variable wasn't updated, if the job widget row was changed)

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@20233 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 14a4a424
......@@ -69,7 +69,7 @@ void ProcessManagerWidget::updateStatus(QString _id, int _status) {
// No such item has been found -> returning
if(!found) return;
// Set new status
(job.progress)->setValue(_status);
}
......@@ -157,7 +157,6 @@ void ProcessManagerWidget::addJob(QString _id, QString _description,
// Insert job into local map
JobContainer job;
job.row = newRow;
job.id = name;
job.description = desc;
job.progress = progressBar;
......@@ -180,7 +179,7 @@ void ProcessManagerWidget::cancelButtonPressed() {
}
void ProcessManagerWidget::removeJob(QString _id) {
JobContainer job;
std::map<QString, JobContainer>::iterator it = processMap_.begin();
......@@ -196,9 +195,9 @@ void ProcessManagerWidget::removeJob(QString _id) {
// No such item has been found -> returning
if(!found) return;
this->processList->removeRow(job.row);
this->processList->removeRow(this->processList->row(job.id));
// Remove from local map
processMap_.erase(_id);
}
\ No newline at end of file
}
......@@ -118,7 +118,6 @@ class ProcessManagerWidget : public QWidget, public Ui::ProcessManagerWidget
// A container to hold the widget items
struct JobContainer {
int row;
QTableWidgetItem* id;
QTableWidgetItem* description;
QProgressBar* progress;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment