Skip to content

Commit

Permalink
Merge pull request wang-bin#1369 from gimhol/master
Browse files Browse the repository at this point in the history
replace 'QLinkedList' with 'QList'
  • Loading branch information
wang-bin authored Mar 16, 2021
2 parents 74943ea + f5321f0 commit da247aa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/subtitle/Subtitle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <QtCore/QFile>
#include <QtCore/QFileInfo>
#include <QtCore/QIODevice>
#include <QtCore/QLinkedList>
#include <QtCore/QList>
#include <QtCore/QRegExp>
#include <QtCore/QRunnable>
#include <QtCore/QThreadPool>
Expand Down Expand Up @@ -98,7 +98,7 @@ class Subtitle::Private {
QList<SubtitleProcessor*> processors;
QByteArray codec;
QStringList engine_names;
QLinkedList<SubtitleFrame> frames;
QList<SubtitleFrame> frames;
QUrl url;
QByteArray raw_data;
QString file_name;
Expand All @@ -113,7 +113,7 @@ class Subtitle::Private {
QString current_text;
QImage current_image;
SubImageSet current_ass;
QLinkedList<SubtitleFrame>::iterator itf;
QList<SubtitleFrame>::iterator itf;
/* number of subtitle frames at current time.
* <0 means itf is the last. >0 means itf is the 1st
*/
Expand Down Expand Up @@ -500,7 +500,7 @@ QString Subtitle::getText() const
priv->update_text = false;
priv->current_text.clear();
const int count = qAbs(priv->current_count);
QLinkedList<SubtitleFrame>::iterator it = priv->current_count > 0 ? priv->itf : priv->itf + (priv->current_count+1);
QList<SubtitleFrame>::iterator it = priv->current_count > 0 ? priv->itf : priv->itf + (priv->current_count+1);
for (int i = 0; i < count; ++i) {
priv->current_text.append(it->text).append(QStringLiteral("\n"));
++it;
Expand Down Expand Up @@ -595,7 +595,7 @@ bool Subtitle::processLine(const QByteArray &data, qreal pts, qreal duration)
return true;
}
// usually add to the end. TODO: test
QLinkedList<SubtitleFrame>::iterator it = priv->frames.end();
QList<SubtitleFrame>::iterator it = priv->frames.end();
if (it != priv->frames.begin())
--it;
while (it != priv->frames.begin() && f < (*it)) {--it;}
Expand All @@ -613,7 +613,7 @@ bool Subtitle::Private::prepareCurrentFrame()
{
if (frames.isEmpty())
return false;
QLinkedList<SubtitleFrame>::iterator it = itf;
QList<SubtitleFrame>::iterator it = itf;
int found = 0;
const int old_current_count = current_count;
const qreal t = this->t - delay;
Expand Down

0 comments on commit da247aa

Please sign in to comment.