[vlc-commits] [Git][videolan/vlc][master] 3 commits: qt: use QMap::last() instead of iterator access

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Sep 16 21:07:32 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
2af6a68e by Fatih Uzunoglu at 2023-09-16T19:53:38+00:00
qt: use QMap::last() instead of iterator access

- - - - -
283b2b48 by Fatih Uzunoglu at 2023-09-16T19:53:38+00:00
qt: proper format handling for indeterministic integer type

- - - - -
2dc1ade5 by Fatih Uzunoglu at 2023-09-16T19:53:38+00:00
qt: use QString::length() instead of QString::count()

QString::count() is deprecated with Qt 6

- - - - -


2 changed files:

- modules/gui/qt/dialogs/epg/EPGView.cpp
- modules/gui/qt/dialogs/open/open.cpp


Changes:

=====================================
modules/gui/qt/dialogs/epg/EPGView.cpp
=====================================
@@ -177,7 +177,7 @@ void EPGView::walkItems( bool b_cleanup )
 
         if( !program->eventsbytime.isEmpty() )
         {
-            const EPGItem *last = (program->eventsbytime.end() - 1).value();
+            const EPGItem *last = program->eventsbytime.last();
             if( !maxTime.isValid() ||
                  last->start().addSecs( last->duration() ) > maxTime )
             {


=====================================
modules/gui/qt/dialogs/open/open.cpp
=====================================
@@ -34,6 +34,8 @@
 
 #include <vlc_url.h>
 
+#include <cstddef>
+
 #ifndef NDEBUG
 # define DEBUG_QT 1
 #endif
@@ -406,7 +408,7 @@ void OpenDialog::stream( bool b_transcode_only )
     toggleVisible();
 
     /* Dbg and send :D */
-    msg_Dbg( p_intf, "MRL(s) passed to the Sout: %i", soutMRLS.length() );
+    msg_Dbg( p_intf, "MRL(s) passed to the Sout: %zu", static_cast<size_t>( soutMRLS.length() ) );
     for(int i = 0; i < soutMRLS.length(); i++)
     {
         msg_Dbg( p_intf, "MRL(s) passed to the Sout: %s", qtu( soutMRLS[i] ) );
@@ -471,10 +473,10 @@ QStringList OpenDialog::SeparateEntries( const QString& entries )
     QString entry;
 
     int index = 0;
-    while( index < entries.count() )
+    while( index < entries.length() )
     {
         int delim_pos = entries.indexOf( QRegularExpression( QStringLiteral( "\\s+|\"" ) ), index );
-        if( delim_pos < 0 ) delim_pos = entries.count() - 1;
+        if( delim_pos < 0 ) delim_pos = entries.length() - 1;
         entry += entries.mid( index, delim_pos - index + 1 );
         index = delim_pos + 1;
 
@@ -483,22 +485,22 @@ QStringList OpenDialog::SeparateEntries( const QString& entries )
         if( !b_quotes_mode && entry.endsWith( "\"" ) )
         {
             /* Enters quotes mode */
-            entry.truncate( entry.count() - 1 );
+            entry.truncate( entry.length() - 1 );
             b_quotes_mode = true;
         }
         else if( b_quotes_mode && entry.endsWith( "\"" ) )
         {
             /* Finished the quotes mode */
-            entry.truncate( entry.count() - 1 );
+            entry.truncate( entry.length() - 1 );
             b_quotes_mode = false;
         }
         else if( !b_quotes_mode && !entry.endsWith( "\"" ) )
         {
             /* we found a non-quoted standalone string */
-            if( index < entries.count() ||
+            if( index < entries.length() ||
                 entry.endsWith( " " ) || entry.endsWith( "\t" ) ||
                 entry.endsWith( "\r" ) || entry.endsWith( "\n" ) )
-                entry.truncate( entry.count() - 1 );
+                entry.truncate( entry.length() - 1 );
             if( !entry.isEmpty() ) entries_array.append( entry );
             entry.clear();
         }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/629d4a343045b425cf98962c588909438a85728d...2dc1ade5fe038f4b32e7e324d11dd63cfcd2664d

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/629d4a343045b425cf98962c588909438a85728d...2dc1ade5fe038f4b32e7e324d11dd63cfcd2664d
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list