]> sigrok.org Git - pulseview.git/blobdiff - pv/widgets/devicetoolbutton.cpp
Fix clazy warnings regarding range-for references
[pulseview.git] / pv / widgets / devicetoolbutton.cpp
index d553aba32987d7bded07a7be5767d63501fb69c0..6a12aa25c446904651b60bfe6de58e13d27eaa12 100644 (file)
@@ -14,8 +14,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <cassert>
@@ -92,7 +91,7 @@ void DeviceToolButton::update_device_list()
        menu_.setDefaultAction(connect_action_);
        menu_.addSeparator();
 
-       for (weak_ptr<Device> dev_weak_ptr : devices_) {
+       for (weak_ptr<Device>& dev_weak_ptr : devices_) {
                shared_ptr<Device> dev(dev_weak_ptr.lock());
                if (!dev)
                        continue;
@@ -118,7 +117,7 @@ void DeviceToolButton::on_action(QObject *action)
        selected_device_.reset();
 
        Device *const dev = (Device*)((QAction*)action)->data().value<void*>();
-       for (weak_ptr<Device> dev_weak_ptr : devices_) {
+       for (weak_ptr<Device>& dev_weak_ptr : devices_) {
                shared_ptr<Device> dev_ptr(dev_weak_ptr);
                if (dev_ptr.get() == dev) {
                        selected_device_ = shared_ptr<Device>(dev_ptr);
@@ -158,5 +157,5 @@ void DeviceToolButton::on_menu_hover_timeout()
        QToolTip::showText(QCursor::pos(), device_tooltip_);
 }
 
-} // widgets
-} // pv
+}  // namespace widgets
+}  // namespace pv