shared: LimitQueue: Change limit type to int
More consistent with "QQueue::size()" and silences warning
This commit is contained in:
parent
238f9add49
commit
31f0568a87
@ -88,7 +88,7 @@ struct Snippet
|
|||||||
QString PreviewGeneratorPlainText::generateLineBasedPreviewText(QTextStream &in, RenderConfig config, QString fileName)
|
QString PreviewGeneratorPlainText::generateLineBasedPreviewText(QTextStream &in, RenderConfig config, QString fileName)
|
||||||
{
|
{
|
||||||
QVector<Snippet> snippets;
|
QVector<Snippet> snippets;
|
||||||
const unsigned int contextLinesCount = 2;
|
const int contextLinesCount = 2;
|
||||||
LimitQueue<QString> queue(contextLinesCount);
|
LimitQueue<QString> queue(contextLinesCount);
|
||||||
QString currentLine;
|
QString currentLine;
|
||||||
currentLine.reserve(512);
|
currentLine.reserve(512);
|
||||||
|
@ -6,11 +6,11 @@ template <class T> class LimitQueue
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
QQueue<T> queue;
|
QQueue<T> queue;
|
||||||
unsigned int limit = 0;
|
int limit = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LimitQueue();
|
LimitQueue();
|
||||||
LimitQueue(unsigned int limit)
|
LimitQueue(int limit)
|
||||||
{
|
{
|
||||||
this->limit = limit;
|
this->limit = limit;
|
||||||
}
|
}
|
||||||
@ -34,7 +34,7 @@ template <class T> class LimitQueue
|
|||||||
return queue.dequeue();
|
return queue.dequeue();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setLimit(unsigned int limit)
|
void setLimit(int limit)
|
||||||
{
|
{
|
||||||
this->limit = limit;
|
this->limit = limit;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user