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 ) { void Device::setParameter( const QString &name, const QString &value ) {
if(name == "devices"){
d->protocolChanged = true;
}
d->settings[name] = value; d->settings[name] = value;
} }

View file

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