Skip to content

Commit 532a75d

Browse files
Apply linter suggestions
Summary: linters automated changed (+ fixes to the changes made) Differential Revision: D78368814 fbshipit-source-id: 253b47cee88a73cfa15c62f2c79444e879176538
1 parent 36bae76 commit 532a75d

5 files changed

Lines changed: 22 additions & 24 deletions

File tree

tools/vrsplayer/FileReader.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,12 @@ class OpenProgressDialog : public ProgressLogger {
191191
protected:
192192
void logMessage(const string& message) override {
193193
ProgressLogger::logMessage(message);
194-
progressDialog_.setLabelText(QString().fromStdString(message));
194+
progressDialog_.setLabelText(QString::fromStdString(message));
195195
qApp->processEvents();
196196
}
197197
void logErrorMessage(const string& message) override {
198198
ProgressLogger::logErrorMessage(message);
199-
progressDialog_.setLabelText(QString().fromStdString(message));
199+
progressDialog_.setLabelText(QString::fromStdString(message));
200200
qApp->processEvents();
201201
}
202202
void updateStep(size_t progress, size_t maxProgress) override {
@@ -429,7 +429,7 @@ vector<FrameWidget*> FileReader::openFile(QVBoxLayout* videoFrames, QWidget* wid
429429
return frames;
430430
}
431431

432-
void FileReader::setOverlayColor(QColor color) {
432+
void FileReader::setOverlayColor(const QColor& color) {
433433
for (auto& image : imageReaders_) {
434434
image.second->getWidget()->setOverlayColor(color);
435435
}
@@ -1243,7 +1243,7 @@ void FileReader::loadConfiguration() {
12431243
fileConfig_ = make_unique<QSettings>("VRSplayer", ss.str().c_str());
12441244
layoutPresets_ = fileConfig_->value(kLayoutPresets).toMap();
12451245
if (DEBUG_CONFIG) {
1246-
for (auto key : layoutPresets_.keys()) {
1246+
for (const auto& key : layoutPresets_.keys()) {
12471247
QJsonDocument jdoc = QJsonDocument::fromVariant(layoutPresets_[key]);
12481248
QByteArray config = jdoc.toJson();
12491249
XR_LOGI("\nPreset {}: {}", key.toStdString(), string(config.constData(), config.size()));
@@ -1302,7 +1302,7 @@ void FileReader::setTimeRange(double start, double end, uint32_t firstDataRecord
13021302
firstDataRecordIndex_ = firstDataRecordIndex;
13031303
durationChanged(start, end, rawTimeToPosition(endTime_ - startTime_));
13041304
cout << "Player time range: " << helpers::humanReadableTimestamp(startTime_) << " - "
1305-
<< helpers::humanReadableTimestamp(end) << endl;
1305+
<< helpers::humanReadableTimestamp(end) << '\n';
13061306
}
13071307

13081308
} // namespace vrsp

tools/vrsplayer/FileReader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class FileReader : public QObject {
121121

122122
public slots:
123123
std::vector<FrameWidget*> openFile(const QString& url, QVBoxLayout* videoFrame, QWidget* parent);
124-
void setOverlayColor(QColor color);
124+
void setOverlayColor(const QColor& color);
125125
void setFontSize(int fontSize);
126126
void setSolidBackground(bool solid);
127127
void recordTypeChanged(const QString& type);

tools/vrsplayer/FrameWidget.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <map>
2222
#include <memory>
2323
#include <mutex>
24+
#include <utility>
2425

2526
#include <QtCore/qglobal.h>
2627
#include <QtWidgets/QWidget>
@@ -125,7 +126,7 @@ class FrameWidget : public QWidget {
125126
setNeedsUpdate();
126127
}
127128
void setOverlayColor(QColor color) {
128-
overlayColor_ = color;
129+
overlayColor_ = std::move(color);
129130
setNeedsUpdate();
130131
}
131132
void setFontSize(int fontSize) {

tools/vrsplayer/PlayerUI.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
#include <cctype>
2020

21+
#include <utility>
22+
2123
#include <fmt/format.h>
2224

2325
#include <qmessagebox.h>
@@ -94,12 +96,7 @@ class JumpSlider : public QSlider {
9496

9597
} // namespace
9698

97-
PlayerUI::PlayerUI(PlayerWindow* playerWindow)
98-
: QWidget(nullptr),
99-
playerWindow_{playerWindow},
100-
time_{nullptr},
101-
positionSlider_{nullptr},
102-
statusLabel_{nullptr} {
99+
PlayerUI::PlayerUI(PlayerWindow* playerWindow) : QWidget(nullptr), playerWindow_{playerWindow} {
103100
fileReader_.setPlayerUi(this);
104101
connect(
105102
this,
@@ -419,7 +416,7 @@ void PlayerUI::reportError(const QString& errorTitle, const QString& errorMessag
419416
}
420417

421418
void PlayerUI::setOverlayColor(QColor color) {
422-
overlayColor_ = color;
419+
overlayColor_ = std::move(color);
423420
fileReader_.setOverlayColor(overlayColor_);
424421
settings_.setValue(kOverlayColorSetting, overlayColor_);
425422
overlaySettingChanged();

tools/vrsplayer/PlayerUI.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,22 +110,22 @@ class PlayerUI : public QWidget {
110110
bool eventFilter(QObject* obj, QEvent* event) override;
111111

112112
private:
113-
PlayerWindow* playerWindow_;
113+
PlayerWindow* playerWindow_{nullptr};
114114
QSettings settings_;
115115
QColor overlayColor_{Qt::yellow};
116116
int fontSize_{14};
117117
bool solidBackground_{false};
118118
FileReader fileReader_;
119-
QVBoxLayout* videoFrames_;
119+
QVBoxLayout* videoFrames_{nullptr};
120120
std::vector<FrameWidget*> frames_;
121-
QAbstractButton* backwardButton_;
122-
QAbstractButton* stopButton_;
123-
QAbstractButton* playPauseButton_;
124-
QAbstractButton* forwardButton_;
125-
QComboBox* speedControl_;
126-
QLabel* time_;
127-
QSlider* positionSlider_;
128-
QLabel* statusLabel_;
121+
QAbstractButton* backwardButton_{nullptr};
122+
QAbstractButton* stopButton_{nullptr};
123+
QAbstractButton* playPauseButton_{nullptr};
124+
QAbstractButton* forwardButton_{nullptr};
125+
QComboBox* speedControl_{nullptr};
126+
QLabel* time_{nullptr};
127+
QSlider* positionSlider_{nullptr};
128+
QLabel* statusLabel_{nullptr};
129129
QTimer checkForUpdatesTimer_;
130130
PathPreparer pathPreparer_;
131131
};

0 commit comments

Comments
 (0)