From 31f0568a876530fe42943f4685d64db717721a87 Mon Sep 17 00:00:00 2001 From: Albert S Date: Sun, 28 Aug 2022 13:09:51 +0200 Subject: [PATCH] shared: LimitQueue: Change limit type to int More consistent with "QQueue::size()" and silences warning --- gui/previewgeneratorplaintext.cpp | 2 +- shared/limitqueue.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gui/previewgeneratorplaintext.cpp b/gui/previewgeneratorplaintext.cpp index d7b4494..239e01c 100644 --- a/gui/previewgeneratorplaintext.cpp +++ b/gui/previewgeneratorplaintext.cpp @@ -88,7 +88,7 @@ struct Snippet QString PreviewGeneratorPlainText::generateLineBasedPreviewText(QTextStream &in, RenderConfig config, QString fileName) { QVector snippets; - const unsigned int contextLinesCount = 2; + const int contextLinesCount = 2; LimitQueue queue(contextLinesCount); QString currentLine; currentLine.reserve(512); diff --git a/shared/limitqueue.h b/shared/limitqueue.h index 28ad7a9..174c0af 100644 --- a/shared/limitqueue.h +++ b/shared/limitqueue.h @@ -6,11 +6,11 @@ template class LimitQueue { protected: QQueue queue; - unsigned int limit = 0; + int limit = 0; public: LimitQueue(); - LimitQueue(unsigned int limit) + LimitQueue(int limit) { this->limit = limit; } @@ -34,7 +34,7 @@ template class LimitQueue return queue.dequeue(); } - void setLimit(unsigned int limit) + void setLimit(int limit) { this->limit = limit; }