[vlc-commits] [Git][videolan/vlc][master] qt: use int instead of size_t due to QML
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Sat Jul 8 21:45:31 UTC 2023
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
fb9d4021 by Fatih Uzunoglu at 2023-07-08T21:24:01+00:00
qt: use int instead of size_t due to QML
There is no unsigned integer type in QML.
- - - - -
2 changed files:
- modules/gui/qt/playlist/playlist_controller.cpp
- modules/gui/qt/playlist/playlist_controller.hpp
Changes:
=====================================
modules/gui/qt/playlist/playlist_controller.cpp
=====================================
@@ -752,9 +752,10 @@ bool PlaylistControllerModel::isEmpty() const
return d->m_empty;
}
-size_t PlaylistControllerModel::count() const
+int PlaylistControllerModel::count() const
{
Q_D(const PlaylistControllerModel);
+ assert(d->m_count <= (size_t)INT_MAX);
return d->m_count;
}
=====================================
modules/gui/qt/playlist/playlist_controller.hpp
=====================================
@@ -85,7 +85,7 @@ public:
Q_PROPERTY(PlaybackRepeat repeatMode READ getRepeatMode WRITE setRepeatMode NOTIFY repeatModeChanged FINAL)
Q_PROPERTY(bool playAndExit READ isPlayAndExit WRITE setPlayAndExit NOTIFY playAndExitChanged FINAL)
Q_PROPERTY(bool empty READ isEmpty NOTIFY isEmptyChanged FINAL)
- Q_PROPERTY(size_t count READ count NOTIFY countChanged FINAL)
+ Q_PROPERTY(int count READ count NOTIFY countChanged FINAL)
Q_PROPERTY(SortKey sortKey READ getSortKey WRITE setSortKey NOTIFY sortKeyChanged FINAL)
Q_PROPERTY(SortOrder sortOrder READ getSortOrder WRITE setSortOrder NOTIFY sortOrderChanged FINAL)
@@ -143,7 +143,7 @@ public slots:
void setPlayAndExit(bool );
bool isEmpty() const;
- size_t count() const;
+ int count() const;
SortKey getSortKey() const;
void setSortKey(SortKey sortKey);
@@ -169,7 +169,7 @@ signals:
void playAndExitChanged( bool );
void repeatModeChanged( PlaybackRepeat );
void isEmptyChanged( bool empty );
- void countChanged(size_t );
+ void countChanged(int);
void sortKeyChanged();
void sortOrderChanged();
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/fb9d4021f5de55def9196c68891932b8663ac1d5
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/fb9d4021f5de55def9196c68891932b8663ac1d5
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