[vlc-commits] qt: medialib: define equality operator on MLItemId

Romain Vimont git at videolan.org
Tue Dec 8 14:19:17 UTC 2020


vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Tue Nov 24 15:56:03 2020 +0100| [f727ef3492b45a7067eacb0c7927c389207e4f71] | committer: Pierre Lamot

qt: medialib: define equality operator on MLItemId

For symmetry, define operator==() in addition to operator!=().

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f727ef3492b45a7067eacb0c7927c389207e4f71
---

 modules/gui/qt/medialibrary/mlqmltypes.hpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/medialibrary/mlqmltypes.hpp b/modules/gui/qt/medialibrary/mlqmltypes.hpp
index af92ba34a1..7adcdb7d07 100644
--- a/modules/gui/qt/medialibrary/mlqmltypes.hpp
+++ b/modules/gui/qt/medialibrary/mlqmltypes.hpp
@@ -33,9 +33,13 @@ class MLItemId
 public:
     MLItemId() : id(0), type( VLC_ML_PARENT_UNKNOWN ) {}
     MLItemId( int64_t i, vlc_ml_parent_type t ) : id( i ), type( t ) {}
-    bool operator!=( const MLItemId& lhs )
+    bool operator==( const MLItemId& other )
     {
-        return id != lhs.id || type != lhs.type;
+        return id == other.id && type == other.type;
+    }
+    bool operator!=( const MLItemId& other )
+    {
+        return !(*this == other);
     }
     int64_t id;
     vlc_ml_parent_type type;



More information about the vlc-commits mailing list