Code cleanup, todos examined

This commit is contained in:
Stefan Persson 2011-03-03 15:19:23 +00:00
parent dec6018464
commit 37dcc1ff4f
3 changed files with 9 additions and 12 deletions

View file

@ -81,9 +81,6 @@ QString &Device::name() const {
}
void Device::setParameter( const QString &name, const QString &value ) {
if(name == "devices"){
d->protocolChanged = true;
}
d->settings[name] = value;
}

View file

@ -131,12 +131,12 @@ void EditGroupDialog::setDevicesVisible(){
devices << device.toInt();
}
for (int i = 0; i < model->rowCount(); ++i){
int id = model->deviceId(model->index(i, 0));
if (id == device->id()) {
//shouldnt be able to add itself, check that here
availableProxyModel->hideRow(i);
} else if (devices.contains(id)) {
for (int i = 0; i < model->rowCount(); ++i){
int id = model->deviceId(model->index(i, 0));
if (id == device->id()) {
//shouldnt be able to add itself, check that here
availableProxyModel->hideRow(i);
} else if (devices.contains(id)) {
availableProxyModel->hideRow(i);
addedProxyModel->showRow(i);
}
@ -201,8 +201,8 @@ void ProxyModel::showAllRows() {
QString ProxyModel::getShownIds(){
QStringList addedIds;
foreach (int index, rows){ //TODO why does this crash when debugging? Unsafe?
if(index >= 0){ //TODO why can this be
foreach (int index, rows){
if(index >= 0){
DeviceModel *model = reinterpret_cast<DeviceModel *>(this->sourceModel());
if (model) {
int deviceId = model->deviceId(model->index(index, 0));

View file

@ -96,7 +96,7 @@ MethodWidget::MethodWidget( Device *device, QWidget *parent )
connect(d->execute, SIGNAL(clicked()), device, SLOT(execute()));
connect(d->up, SIGNAL(clicked()), device, SLOT(up()));
connect(d->down, SIGNAL(clicked()), device, SLOT(down()));
//TODO connect(d->stop, SIGNAL(clicked()), device, SLOT(stop()));
connect(d->stop, SIGNAL(clicked()), device, SLOT(stop()));
updateMethods(device->methods());