]> sigrok.org Git - pulseview.git/commitdiff
Whitespace fixes.
authorUwe Hermann <redacted>
Sat, 9 Mar 2013 10:41:41 +0000 (11:41 +0100)
committerUwe Hermann <redacted>
Sat, 9 Mar 2013 10:43:04 +0000 (11:43 +0100)
pv/dialogs/connect.cpp
pv/mainwindow.cpp
pv/prop/binding/deviceoptions.cpp
pv/prop/double.cpp
pv/prop/enum.cpp
pv/samplingbar.cpp

index 51de735e00e1d5e24eb1ad6d5e0dab13ee877f15..cb83b3d7b55cadbbcd74db66d159109d783b9ae0 100644 (file)
@@ -95,12 +95,12 @@ void Connect::populate_drivers()
                if ((sr_config_list(drivers[i], SR_CONF_DEVICE_OPTIONS,
                        (const void **)&hwopts, NULL) == SR_OK) && hwopts)
                        for (int j = 0; hwopts[j]; j++)
-                               if(hwopts[j] == SR_CONF_SAMPLERATE) {
+                               if (hwopts[j] == SR_CONF_SAMPLERATE) {
                                        supported_device = true;
                                        break;
                                }
 
-               if(supported_device)
+               if (supported_device)
                        _drivers.addItem(QString("%1 (%2)").arg(
                                drivers[i]->longname).arg(drivers[i]->name),
                                qVariantFromValue((void*)drivers[i]));
@@ -126,7 +126,7 @@ void Connect::scan_pressed()
        _device_list.clear();
 
        const int index = _drivers.currentIndex();
-       if(index == -1)
+       if (index == -1)
                return;
 
        sr_dev_driver *const driver = (sr_dev_driver*)_drivers.itemData(
index 03562b8f54e57d421aefa86fe764e6d6f376a819..da01858748a74704888a9d851b8fb270b0c9d5df 100644 (file)
@@ -226,7 +226,7 @@ void MainWindow::on_actionOpen_triggered()
 void MainWindow::on_actionConnect_triggered()
 {
        dialogs::Connect dlg(this);
-       if(!dlg.exec())
+       if (!dlg.exec())
                return;
 
        struct sr_dev_inst *const sdi = dlg.get_selected_device();
index 9db50dd0548f55c7fd2eeb11bd7ddd52846cc83f..b0feb717a191a7e81d2daa029f6f4687a3c7b0b6 100644 (file)
@@ -195,7 +195,7 @@ const void* DeviceOptions::enum_getter(
        const struct sr_dev_inst *sdi, int key)
 {
        const void *data = NULL;
-       if(sr_config_get(sdi->driver, key, &data, sdi) != SR_OK) {
+       if (sr_config_get(sdi->driver, key, &data, sdi) != SR_OK) {
                qDebug() <<
                        "WARNING: Failed to get value of config id" << key;
                return NULL;
@@ -207,7 +207,7 @@ double DeviceOptions::samplerate_value_getter(
        const struct sr_dev_inst *sdi)
 {
        uint64_t *samplerate = NULL;
-       if(sr_config_get(sdi->driver, SR_CONF_SAMPLERATE,
+       if (sr_config_get(sdi->driver, SR_CONF_SAMPLERATE,
                (const void**)&samplerate, sdi) != SR_OK) {
                qDebug() <<
                        "WARNING: Failed to get value of sample rate";
@@ -220,7 +220,7 @@ void DeviceOptions::samplerate_value_setter(
        struct sr_dev_inst *sdi, double value)
 {
        uint64_t samplerate = value;
-       if(sr_config_set(sdi, SR_CONF_SAMPLERATE,
+       if (sr_config_set(sdi, SR_CONF_SAMPLERATE,
                &samplerate) != SR_OK)
                qDebug() <<
                        "WARNING: Failed to set value of sample rate";
@@ -239,7 +239,7 @@ const void* DeviceOptions::samplerate_list_getter(
                return NULL;
        }
 
-       if(sr_config_get(sdi->driver, SR_CONF_SAMPLERATE,
+       if (sr_config_get(sdi->driver, SR_CONF_SAMPLERATE,
                (const void**)&samplerate, sdi) != SR_OK ||
                !samplerate) {
                qDebug() <<
@@ -248,7 +248,7 @@ const void* DeviceOptions::samplerate_list_getter(
        }
 
        for (const uint64_t *rate = samplerates->list; *rate; rate++)
-               if(*rate == *samplerate)
+               if (*rate == *samplerate)
                        return (const void*)rate;
 
        return NULL;
index d7c79ca7db19ce6481d3b8293c06848fcd5364d0..c1e776e1f6c890c21d9d435cbc66316d8976e528 100644 (file)
@@ -50,15 +50,15 @@ Double::Double(QString name,
 
 QWidget* Double::get_widget(QWidget *parent)
 {
-       if(_spin_box)
+       if (_spin_box)
                return _spin_box;
 
        _spin_box = new QDoubleSpinBox(parent);
        _spin_box->setDecimals(_decimals);
        _spin_box->setSuffix(_suffix);
-       if(_range)
+       if (_range)
                _spin_box->setRange(_range->first, _range->second);
-       if(_step)
+       if (_step)
                _spin_box->setSingleStep(*_step);
 
        _spin_box->setValue(_getter ? _getter() : 0.0);
@@ -70,7 +70,7 @@ void Double::commit()
 {
        assert(_setter);
 
-       if(!_spin_box)
+       if (!_spin_box)
                return;
 
        _setter(_spin_box->value());
index ce33c5a8e724b779214d61416e23cda74b91db39..54fe5fedca8284b15dc2f051a44a7f5e3e1dba22 100644 (file)
@@ -48,15 +48,15 @@ QWidget* Enum::get_widget(QWidget *parent)
                return _selector;
 
        const void *value = NULL;
-       if(_getter)
+       if (_getter)
                value = _getter();
 
        _selector = new QComboBox(parent);
-       for(unsigned int i = 0; i < _values.size(); i++) {
+       for (unsigned int i = 0; i < _values.size(); i++) {
                const pair<const void*, QString> &v = _values[i];
                _selector->addItem(v.second,
                        qVariantFromValue((void*)v.first));
-               if(v.first == value)
+               if (v.first == value)
                        _selector->setCurrentIndex(i);
        }
 
index 040700331f6c5aedae66f1175cf9fa1d699975db..24fcc40a86794b88f5e97af7686dc2cdf188cd9d 100644 (file)
@@ -145,8 +145,8 @@ struct sr_dev_inst* SamplingBar::get_selected_device() const
 
 void SamplingBar::set_selected_device(struct sr_dev_inst *const sdi)
 {
-       for(int i = 0; i < _device_selector.count(); i++)
-               if(sdi == _device_selector.itemData(i).value<void*>()) {
+       for (int i = 0; i < _device_selector.count(); i++)
+               if (sdi == _device_selector.itemData(i).value<void*>()) {
                        _device_selector.setCurrentIndex(i);
                        return;
                }
@@ -213,7 +213,7 @@ void SamplingBar::update_sample_rate_selector_value()
        assert(sdi);
 
        uint64_t *samplerate = NULL;
-       if(sr_config_get(sdi->driver, SR_CONF_SAMPLERATE,
+       if (sr_config_get(sdi->driver, SR_CONF_SAMPLERATE,
                (const void**)&samplerate, sdi) != SR_OK) {
                qDebug() <<
                                "WARNING: Failed to get value of sample rate";
@@ -227,8 +227,8 @@ void SamplingBar::update_sample_rate_selector_value()
                _sample_rate_value.setValue(*samplerate);
        else if (_sample_rate_list_action->isVisible())
        {
-               for(int i = 0; i < _sample_rate_list.count(); i++)
-                       if(*samplerate == _sample_rate_list.itemData(
+               for (int i = 0; i < _sample_rate_list.count(); i++)
+                       if (*samplerate == _sample_rate_list.itemData(
                                i).value<uint64_t>())
                                _sample_rate_list.setCurrentIndex(i);
        }