[vlc-devel] [PATCH 2/6] qt: add positionRole on ChapterListModel
Olaf Hering
olaf at aepfle.de
Fri Jun 14 14:35:00 CEST 2019
On Fri, May 31, Abel Tesfaye wrote:
> +++ b/modules/gui/qt/util/input_models.cpp
> +QString ChapterListModel::getNameAtPosition(float pos) const
> +{
> + if(m_title == nullptr)
> + return qtr("nothing found");
> +
> + vlc_tick_t posTime = pos * m_title->length;
> + int prevChapterIndex = 0;
> +
> + for(unsigned int i=0;i<m_title->chapter_count;i++){
> +
> + vlc_tick_t currentChapterTime = m_title->chapters[i].time;
> +
> + if(currentChapterTime > posTime)
> + return qfu(m_title->chapters[prevChapterIndex].name);
> +
> + else if(i == (m_title->chapter_count - 1))
> + return qfu(m_title->chapters[i].name);
> +
> + prevChapterIndex = i;
> + }
> +}
This is f9243e9a2be0c6a91acd48b2b05bca637e78f8e4, and gcc complains:
gui/qt/util/input_models.cpp: In member function 'QString ChapterListModel::getNameAtPosition(float) const':
gui/qt/util/input_models.cpp:367:1: warning: control reaches end of non-void function [-Wreturn-type]
Olaf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190614/ad692250/attachment.sig>
More information about the vlc-devel
mailing list