Commit 8d03962a authored by Nicolas Carion's avatar Nicolas Carion

clang-tidy style

parent ee71e5c1
......@@ -72,7 +72,7 @@ public:
private:
struct Data;
struct Private;
Private *const d;
Private *const d; // NOLINT
};
#endif
......@@ -95,7 +95,7 @@ signals:
void showDescriptionChanged();
private:
EffectListWidget *q;
EffectListWidget *q; // NOLINT
};
#endif
......@@ -135,12 +135,12 @@ void EffectStackModel::removeEffect(const std::shared_ptr<EffectItemModel> &effe
Fun redo = removeItem_lambda(effect->getId());
bool res = redo();
if (res) {
int inFades = int(fadeIns.size());
int outFades = int(fadeOuts.size());
fadeIns.erase(effect->getId());
fadeOuts.erase(effect->getId());
inFades = int(fadeIns.size()) - inFades;
outFades = int(fadeOuts.size()) - outFades;
int inFades = int(m_fadeIns.size());
int outFades = int(m_fadeOuts.size());
m_fadeIns.erase(effect->getId());
m_fadeOuts.erase(effect->getId());
inFades = int(m_fadeIns.size()) - inFades;
outFades = int(m_fadeOuts.size()) - outFades;
QString effectName = EffectsRepository::get()->getName(effect->getAssetId());
Fun update = [this, current, inFades, outFades]() {
// Required to build the effect view
......@@ -253,9 +253,9 @@ void EffectStackModel::fromXml(const QDomElement &effectsXml, Fun &undo, Fun &re
connect(effect.get(), &AssetParameterModel::modelChanged, this, &EffectStackModel::modelChanged);
connect(effect.get(), &AssetParameterModel::replugEffect, this, &EffectStackModel::replugEffect, Qt::DirectConnection);
if (effectId == QLatin1String("fadein") || effectId == QLatin1String("fade_from_black")) {
fadeIns.insert(effect->getId());
m_fadeIns.insert(effect->getId());
} else if (effectId == QLatin1String("fadeout") || effectId == QLatin1String("fade_to_black")) {
fadeOuts.insert(effect->getId());
m_fadeOuts.insert(effect->getId());
}
local_redo();
UPDATE_UNDO_REDO(local_redo, local_undo, undo, redo);
......@@ -301,10 +301,10 @@ bool EffectStackModel::copyEffect(const std::shared_ptr<AbstractEffectItem> &sou
connect(effect.get(), &AssetParameterModel::replugEffect, this, &EffectStackModel::replugEffect, Qt::DirectConnection);
QVector<int> roles = {TimelineModel::EffectNamesRole};
if (effectId == QLatin1String("fadein") || effectId == QLatin1String("fade_from_black")) {
fadeIns.insert(effect->getId());
m_fadeIns.insert(effect->getId());
roles << TimelineModel::FadeInRole;
} else if (effectId == QLatin1String("fadeout") || effectId == QLatin1String("fade_to_black")) {
fadeOuts.insert(effect->getId());
m_fadeOuts.insert(effect->getId());
roles << TimelineModel::FadeOutRole;
}
bool res = local_redo();
......@@ -395,7 +395,7 @@ bool EffectStackModel::adjustStackLength(bool adjustFromEnd, int oldIn, int oldD
continue;
}
std::shared_ptr<EffectItemModel> effect = std::static_pointer_cast<EffectItemModel>(leaf);
if (fadeInDuration > 0 && fadeIns.count(leaf->getId()) > 0) {
if (fadeInDuration > 0 && m_fadeIns.count(leaf->getId()) > 0) {
int oldEffectIn = qMax(0, effect->filter().get_in());
int oldEffectOut = effect->filter().get_out();
qDebug() << "--previous effect: " << oldEffectIn << "-" << oldEffectOut;
......@@ -444,7 +444,7 @@ bool EffectStackModel::adjustStackLength(bool adjustFromEnd, int oldIn, int oldD
PUSH_LAMBDA(reverse, undo);
}
}
} else if (fadeOutDuration > 0 && fadeOuts.count(leaf->getId()) > 0) {
} else if (fadeOutDuration > 0 && m_fadeOuts.count(leaf->getId()) > 0) {
int effectDuration = qMin(fadeOutDuration, duration);
int newFadeIn = out - effectDuration;
int oldFadeIn = effect->filter().get_int("in");
......@@ -500,7 +500,7 @@ bool EffectStackModel::adjustFadeLength(int duration, bool fromStart, bool audio
QWriteLocker locker(&m_lock);
if (fromStart) {
// Fade in
if (fadeIns.empty()) {
if (m_fadeIns.empty()) {
if (audioFade) {
appendEffect(QStringLiteral("fadein"));
}
......@@ -517,7 +517,7 @@ bool EffectStackModel::adjustFadeLength(int duration, bool fromStart, bool audio
qDebug() << "//// SETTING CLIP FADIN: " << duration;
int oldDuration = -1;
for (int i = 0; i < rootItem->childCount(); ++i) {
if (fadeIns.count(std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) > 0) {
if (m_fadeIns.count(std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) > 0) {
std::shared_ptr<EffectItemModel> effect = std::static_pointer_cast<EffectItemModel>(rootItem->child(i));
if (oldDuration == -1) {
oldDuration = effect->filter().get_length();
......@@ -542,7 +542,7 @@ bool EffectStackModel::adjustFadeLength(int duration, bool fromStart, bool audio
}
} else {
// Fade out
if (fadeOuts.empty()) {
if (m_fadeOuts.empty()) {
if (audioFade) {
appendEffect(QStringLiteral("fadeout"));
}
......@@ -560,7 +560,7 @@ bool EffectStackModel::adjustFadeLength(int duration, bool fromStart, bool audio
int oldDuration = -1;
QList<QModelIndex> indexes;
for (int i = 0; i < rootItem->childCount(); ++i) {
if (fadeOuts.count(std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) > 0) {
if (m_fadeOuts.count(std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) > 0) {
std::shared_ptr<EffectItemModel> effect = std::static_pointer_cast<EffectItemModel>(rootItem->child(i));
if (oldDuration == -1) {
oldDuration = effect->filter().get_length();
......@@ -591,21 +591,21 @@ int EffectStackModel::getFadePosition(bool fromStart)
{
QWriteLocker locker(&m_lock);
if (fromStart) {
if (fadeIns.empty()) {
if (m_fadeIns.empty()) {
return 0;
}
for (int i = 0; i < rootItem->childCount(); ++i) {
if (*(fadeIns.begin()) == std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) {
if (*(m_fadeIns.begin()) == std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) {
std::shared_ptr<EffectItemModel> effect = std::static_pointer_cast<EffectItemModel>(rootItem->child(i));
return effect->filter().get_length();
}
}
} else {
if (fadeOuts.empty()) {
if (m_fadeOuts.empty()) {
return 0;
}
for (int i = 0; i < rootItem->childCount(); ++i) {
if (*(fadeOuts.begin()) == std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) {
if (*(m_fadeOuts.begin()) == std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) {
std::shared_ptr<EffectItemModel> effect = std::static_pointer_cast<EffectItemModel>(rootItem->child(i));
return effect->filter().get_length();
}
......@@ -619,8 +619,8 @@ bool EffectStackModel::removeFade(bool fromStart)
QWriteLocker locker(&m_lock);
std::vector<int> toRemove;
for (int i = 0; i < rootItem->childCount(); ++i) {
if ((fromStart && fadeIns.count(std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) > 0) ||
(!fromStart && fadeOuts.count(std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) > 0)) {
if ((fromStart && m_fadeIns.count(std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) > 0) ||
(!fromStart && m_fadeOuts.count(std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) > 0)) {
toRemove.push_back(i);
}
}
......@@ -670,9 +670,9 @@ void EffectStackModel::registerItem(const std::shared_ptr<TreeItem> &item)
effectItem->setEffectStackEnabled(m_effectStackEnabled);
const QString &effectId = effectItem->getAssetId();
if (effectId == QLatin1String("fadein") || effectId == QLatin1String("fade_from_black")) {
fadeIns.insert(effectItem->getId());
m_fadeIns.insert(effectItem->getId());
} else if (effectId == QLatin1String("fadeout") || effectId == QLatin1String("fade_to_black")) {
fadeOuts.insert(effectItem->getId());
m_fadeOuts.insert(effectItem->getId());
}
ix = getIndexFromItem(effectItem);
if (!effectItem->isAudio() && !m_loadingExisting) {
......@@ -791,9 +791,9 @@ void EffectStackModel::importEffects(const std::weak_ptr<Mlt::Service> &service,
effect->prepareKeyframes();
if (redo()) {
if (effectId == QLatin1String("fadein") || effectId == QLatin1String("fade_from_black")) {
fadeIns.insert(effect->getId());
m_fadeIns.insert(effect->getId());
} else if (effectId == QLatin1String("fadeout") || effectId == QLatin1String("fade_to_black")) {
fadeOuts.insert(effect->getId());
m_fadeOuts.insert(effect->getId());
}
}
}
......@@ -992,7 +992,7 @@ void EffectStackModel::replugEffect(const std::shared_ptr<AssetParameterModel> &
void EffectStackModel::cleanFadeEffects(bool outEffects, Fun &undo, Fun &redo)
{
QWriteLocker locker(&m_lock);
const auto &toDelete = outEffects ? fadeOuts : fadeIns;
const auto &toDelete = outEffects ? m_fadeOuts : m_fadeIns;
for (int id : toDelete) {
auto effect = std::static_pointer_cast<EffectItemModel>(getItemById(id));
Fun operation = removeItem_lambda(id);
......@@ -1005,9 +1005,9 @@ void EffectStackModel::cleanFadeEffects(bool outEffects, Fun &undo, Fun &redo)
Fun updateRedo = [this, toDelete, outEffects]() {
for (int id : toDelete) {
if (outEffects) {
fadeOuts.erase(id);
m_fadeOuts.erase(id);
} else {
fadeIns.erase(id);
m_fadeIns.erase(id);
}
}
QVector<int> roles = {TimelineModel::EffectNamesRole};
......
......@@ -164,8 +164,8 @@ protected:
private:
mutable QReadWriteLock m_lock;
std::unordered_set<int> fadeIns;
std::unordered_set<int> fadeOuts;
std::unordered_set<int> m_fadeIns;
std::unordered_set<int> m_fadeOuts;
/** @brief: When loading a project, we load filters/effects that are already planted
* in the producer, so we shouldn't plant them again. Setting this value to
......
......@@ -1423,7 +1423,7 @@ void Monitor::setCustomProfile(const QString &profile, const Timecode &tc)
// TODO or deprecate
Q_UNUSED(profile)
m_timePos->updateTimeCode(tc);
if (true) {
if (/* DISABLES CODE */ (true)) {
return;
}
slotActivateMonitor();
......@@ -1976,7 +1976,7 @@ bool Monitor::startCapture(const QString &params, const QString &path, Mlt::Prod
{
// TODO
m_controller = nullptr;
if (false) { // render->updateProducer(p)) {
if (/* DISABLES CODE */ (false)) { // render->updateProducer(p)) {
m_glMonitor->reconfigureMulti(params, path, p->profile());
return true;
}
......
......@@ -71,7 +71,7 @@ public:
const int16_t *get_audio() const;
private:
QExplicitlySharedDataPointer<FrameData> d;
QExplicitlySharedDataPointer<FrameData> d; // NOLINT
};
#endif // SHAREDFRAME_H
......@@ -35,7 +35,7 @@ ClipStabilize::ClipStabilize(const std::vector<QString> &binIds, const QString &
: QDialog(parent)
, m_filtername(filterName)
, m_binIds(binIds)
, vbox(nullptr)
, m_vbox(nullptr)
{
setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
setupUi(this);
......@@ -83,7 +83,7 @@ ClipStabilize::ClipStabilize(const std::vector<QString> &binIds, const QString &
connect(buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &ClipStabilize::slotValidate);
vbox = new QVBoxLayout(optionsbox);
m_vbox = new QVBoxLayout(optionsbox);
QHashIterator<QString, QHash<QString, QString>> hi(m_ui_params);
m_tc.setFormat(KdenliveSettings::project_fps());
while (hi.hasNext()) {
......@@ -99,19 +99,19 @@ ClipStabilize::ClipStabilize(const std::vector<QString> &binIds, const QString &
dbl->setObjectName(hi.key());
dbl->setToolTip(val[QStringLiteral("tooltip")]);
connect(dbl, &DoubleWidget::valueChanged, this, &ClipStabilize::slotUpdateParams);
vbox->addWidget(dbl);
m_vbox->addWidget(dbl);
} else if (val[QStringLiteral("type")] == QLatin1String("bool")) {
auto *ch = new QCheckBox(hi.key(), this);
ch->setCheckState(val[QStringLiteral("value")] == QLatin1String("0") ? Qt::Unchecked : Qt::Checked);
ch->setObjectName(hi.key());
connect(ch, &QCheckBox::stateChanged, this, &ClipStabilize::slotUpdateParams);
ch->setToolTip(val[QStringLiteral("tooltip")]);
vbox->addWidget(ch);
m_vbox->addWidget(ch);
} else if (val[QStringLiteral("type")] == QLatin1String("position")) {
PositionWidget *posedit = new PositionWidget(hi.key(), 0, 0, out, m_tc, QString(), this);
posedit->setToolTip(val[QStringLiteral("tooltip")]);
posedit->setObjectName(hi.key());
vbox->addWidget(posedit);
m_vbox->addWidget(posedit);
connect(posedit, &PositionWidget::valueChanged, this, &ClipStabilize::slotUpdateParams);
}
}
......@@ -163,8 +163,8 @@ QString ClipStabilize::desc() const
void ClipStabilize::slotUpdateParams()
{
for (int i = 0; i < vbox->count(); ++i) {
QWidget *w = vbox->itemAt(i)->widget();
for (int i = 0; i < m_vbox->count(); ++i) {
QWidget *w = m_vbox->itemAt(i)->widget();
QString name = w->objectName();
if (!name.isEmpty() && m_ui_params.contains(name)) {
if (m_ui_params[name][QStringLiteral("type")] == QLatin1String("int") || m_ui_params[name][QStringLiteral("type")] == QLatin1String("double")) {
......
......@@ -53,7 +53,7 @@ private:
QString m_filtername;
std::vector<QString> m_binIds;
QHash<QString, QHash<QString, QString>> m_ui_params;
QVBoxLayout *vbox;
QVBoxLayout *m_vbox;
void fillParameters(QStringList);
std::unordered_map<QString, QString> m_fixedParams;
Timecode m_tc;
......
......@@ -45,16 +45,16 @@ ProfileWidget::ProfileWidget(QWidget *parent)
lay->setContentsMargins(0, 0, 0, 0);
auto *labelLay = new QHBoxLayout;
QLabel *fpsLabel = new QLabel(i18n("Fps"), this);
fpsFilt = new QComboBox(this);
fpsLabel->setBuddy(fpsFilt);
m_fpsFilt = new QComboBox(this);
fpsLabel->setBuddy(m_fpsFilt);
labelLay->addWidget(fpsLabel);
labelLay->addWidget(fpsFilt);
labelLay->addWidget(m_fpsFilt);
QLabel *scanningLabel = new QLabel(i18n("Scanning"), this);
scanningFilt = new QComboBox(this);
scanningLabel->setBuddy(scanningFilt);
m_scanningFilt = new QComboBox(this);
scanningLabel->setBuddy(m_scanningFilt);
labelLay->addWidget(scanningLabel);
labelLay->addWidget(scanningFilt);
labelLay->addWidget(m_scanningFilt);
labelLay->addStretch(1);
auto *manage_profiles = new QToolButton(this);
......@@ -106,31 +106,31 @@ ProfileWidget::ProfileWidget(QWidget *parent)
refreshFpsCombo();
auto updateFps = [&]() {
double current = fpsFilt->currentData().toDouble();
KdenliveSettings::setProfile_fps_filter(fpsFilt->currentText());
double current = m_fpsFilt->currentData().toDouble();
KdenliveSettings::setProfile_fps_filter(m_fpsFilt->currentText());
m_filter->setFilterFps(current > 0, current);
slotFilterChanged();
};
connect(fpsFilt, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), updateFps);
int ix = fpsFilt->findText(KdenliveSettings::profile_fps_filter());
connect(m_fpsFilt, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), updateFps);
int ix = m_fpsFilt->findText(KdenliveSettings::profile_fps_filter());
if (ix > -1) {
fpsFilt->setCurrentIndex(ix);
m_fpsFilt->setCurrentIndex(ix);
}
scanningFilt->addItem("Any", -1);
scanningFilt->addItem("Interlaced", 0);
scanningFilt->addItem("Progressive", 1);
m_scanningFilt->addItem("Any", -1);
m_scanningFilt->addItem("Interlaced", 0);
m_scanningFilt->addItem("Progressive", 1);
auto updateScanning = [&]() {
int current = scanningFilt->currentData().toInt();
KdenliveSettings::setProfile_scanning_filter(scanningFilt->currentText());
int current = m_scanningFilt->currentData().toInt();
KdenliveSettings::setProfile_scanning_filter(m_scanningFilt->currentText());
m_filter->setFilterInterlaced(current != -1, current == 0);
slotFilterChanged();
};
connect(scanningFilt, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), updateScanning);
connect(m_scanningFilt, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), updateScanning);
ix = scanningFilt->findText(KdenliveSettings::profile_scanning_filter());
ix = m_scanningFilt->findText(KdenliveSettings::profile_scanning_filter());
if (ix > -1) {
scanningFilt->setCurrentIndex(ix);
m_scanningFilt->setCurrentIndex(ix);
}
setLayout(lay);
}
......@@ -141,21 +141,21 @@ void ProfileWidget::refreshFpsCombo()
{
QLocale locale;
QVariant currentValue;
if (fpsFilt->count() > 1) {
if (m_fpsFilt->count() > 1) {
// remember last selected value
currentValue = fpsFilt->currentData();
currentValue = m_fpsFilt->currentData();
}
fpsFilt->clear();
m_fpsFilt->clear();
locale.setNumberOptions(QLocale::OmitGroupSeparator);
fpsFilt->addItem("Any", -1);
m_fpsFilt->addItem("Any", -1);
auto all_fps = ProfileRepository::get()->getAllFps();
for (double fps : all_fps) {
fpsFilt->addItem(locale.toString(fps), fps);
m_fpsFilt->addItem(locale.toString(fps), fps);
}
if (currentValue.isValid()) {
int ix = fpsFilt->findData(currentValue);
int ix = m_fpsFilt->findData(currentValue);
if (ix > -1) {
fpsFilt->setCurrentIndex(ix);
m_fpsFilt->setCurrentIndex(ix);
}
}
}
......@@ -167,8 +167,8 @@ void ProfileWidget::loadProfile(const QString &profile)
m_originalProfile = m_currentProfile = m_lastValidProfile = profile;
if (!trySelectProfile(profile)) {
// When loading a profile, ensure it is visible so reset filters if necessary
fpsFilt->setCurrentIndex(0);
scanningFilt->setCurrentIndex(0);
m_fpsFilt->setCurrentIndex(0);
m_scanningFilt->setCurrentIndex(0);
}
}
}
......
......@@ -57,8 +57,8 @@ private:
QString m_originalProfile;
void slotUpdateInfoDisplay();
QComboBox *fpsFilt;
QComboBox *scanningFilt;
QComboBox *m_fpsFilt;
QComboBox *m_scanningFilt;
QTreeView *m_treeView;
std::shared_ptr<ProfileTreeModel> m_treeModel;
......
......@@ -85,7 +85,7 @@ TemporaryData::TemporaryData(KdenliveDoc *doc, bool currentProjectOnly, QWidget
, m_globalDelete(nullptr)
{
chartColors << QColor(Qt::darkRed) << QColor(Qt::darkBlue) << QColor(Qt::darkGreen) << QColor(Qt::darkMagenta);
mCurrentSizes << 0 << 0 << 0 << 0;
m_currentSizes << 0 << 0 << 0 << 0;
auto *lay = new QVBoxLayout;
m_currentPage = new QWidget(this);
......@@ -261,7 +261,7 @@ void TemporaryData::gotPreviewSize(KJob *job)
button->widget()->setEnabled(total > 0);
}
m_totalCurrent += total;
mCurrentSizes[0] = total;
m_currentSizes[0] = total;
m_previewSize->setText(KIO::convertSize(total));
updateTotal();
}
......@@ -273,7 +273,7 @@ void TemporaryData::gotProxySize(KIO::filesize_t total)
button->widget()->setEnabled(total > 0);
}
m_totalCurrent += total;
mCurrentSizes[1] = total;
m_currentSizes[1] = total;
m_proxySize->setText(KIO::convertSize(total));
updateTotal();
}
......@@ -290,7 +290,7 @@ void TemporaryData::gotAudioSize(KJob *job)
button->widget()->setEnabled(total > 0);
}
m_totalCurrent += total;
mCurrentSizes[2] = total;
m_currentSizes[2] = total;
m_audioSize->setText(KIO::convertSize(total));
updateTotal();
}
......@@ -307,7 +307,7 @@ void TemporaryData::gotThumbSize(KJob *job)
button->widget()->setEnabled(total > 0);
}
m_totalCurrent += total;
mCurrentSizes[3] = total;
m_currentSizes[3] = total;
m_thumbSize->setText(KIO::convertSize(total));
updateTotal();
}
......@@ -320,7 +320,7 @@ void TemporaryData::updateTotal()
button->widget()->setEnabled(m_totalCurrent > 0);
}
QList<int> segments;
for (KIO::filesize_t size : mCurrentSizes) {
for (KIO::filesize_t size : m_currentSizes) {
if (m_totalCurrent == 0) {
segments << 0;
} else {
......
......@@ -112,8 +112,7 @@ private:
QGridLayout *m_grid;
KIO::filesize_t m_totalCurrent;
KIO::filesize_t m_totalGlobal;
QList<KIO::filesize_t> mCurrentSizes;
QList<KIO::filesize_t> mGlobalSizes;
QList<KIO::filesize_t> m_currentSizes;
QStringList m_globalDirectories;
QString m_processingDirectory;
QDir m_globalDir;
......
......@@ -42,23 +42,24 @@
LoginDialog::LoginDialog(QWidget *parent)
: QDialog(parent)
, ui(new Ui::LoginDialog)
, m_ui(new Ui::LoginDialog)
{
ui->setupUi(this);
m_ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
setWindowTitle(i18n("Freesound Login"));
connect(ui->CancelButton, &QPushButton::clicked, this, &LoginDialog::slotRejected);
connect(ui->GetHQpreview, &QPushButton::clicked, this, &LoginDialog::slotGetHQPreview);
ui->FreeSoundLoginLabel->setText(i18n("Enter your freesound account details to download the highest quality version of this file. Or use the High Quality "
"preview file instead (no freesound account required)."));
// ui->textBrowser
connect(ui->webView, &QWebView::urlChanged, this, &LoginDialog::urlChanged);
connect(m_ui->CancelButton, &QPushButton::clicked, this, &LoginDialog::slotRejected);
connect(m_ui->GetHQpreview, &QPushButton::clicked, this, &LoginDialog::slotGetHQPreview);
m_ui->FreeSoundLoginLabel->setText(
i18n("Enter your freesound account details to download the highest quality version of this file. Or use the High Quality "
"preview file instead (no freesound account required)."));
// m_ui->textBrowser
connect(m_ui->webView, &QWebView::urlChanged, this, &LoginDialog::urlChanged);
}
LoginDialog::~LoginDialog()
{
delete ui;
delete m_ui;
}
void LoginDialog::slotGetHQPreview()
......@@ -105,5 +106,5 @@ QString LoginDialog::authCode() const
void LoginDialog::setLoginUrl(const QUrl &url)
{
ui->webView->setUrl(url);
m_ui->webView->setUrl(url);
}
......@@ -90,7 +90,7 @@ private slots:
void slotRejected();
private:
Ui::LoginDialog *ui;
Ui::LoginDialog *m_ui;
QString m_strAuthCode;
};
......
......@@ -253,7 +253,7 @@ void OAuth2::serviceRequestFinished(QNetworkReply *reply)
m_bAccessTokenRec = true;
}
if (map.contains(QStringLiteral("refresh_token"))) {
mstr_RefreshToken = map.value(QStringLiteral("refresh_token")).toString();
m_strRefreshToken = map.value(QStringLiteral("refresh_token")).toString();
}
if (map.contains(QStringLiteral("expires_in"))) {
// iExpiresIn = map.value("expires_in").toInt(); //time in seconds until the access_token expires
......@@ -271,7 +271,7 @@ void OAuth2::serviceRequestFinished(QNetworkReply *reply)
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup authGroup(config, "FreeSoundAuthentication");
authGroup.writeEntry(QStringLiteral("freesound_access_token"), m_strAccessToken);
authGroup.writeEntry(QStringLiteral("freesound_refresh_token"), mstr_RefreshToken);
authGroup.writeEntry(QStringLiteral("freesound_refresh_token"), m_strRefreshToken);
// access tokens have a limited lifetime of 24 hours.
emit accessTokenReceived(m_strAccessToken); // notifies ResourceWidget::slotAccessTokenReceived
......@@ -316,6 +316,6 @@ void OAuth2::obtainNewAccessToken()
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup authGroup(config, "FreeSoundAuthentication");
mstr_RefreshToken = authGroup.readEntry(QStringLiteral("freesound_refresh_token"));
OAuth2::RequestAccessCode(true, mstr_RefreshToken); // request new access code via the refresh token method
m_strRefreshToken = authGroup.readEntry(QStringLiteral("freesound_refresh_token"));
OAuth2::RequestAccessCode(true, m_strRefreshToken); // request new access code via the refresh token method
}
......@@ -129,7 +129,7 @@ private:
QString m_strRedirectURI;
QString m_strResponseType;
QString mstr_RefreshToken;
QString m_strRefreshToken;
bool m_bAccessTokenRec;
void RequestAccessCode(bool pIsReRequest, const QString &pCode);
......
......@@ -60,7 +60,7 @@ AbstractScopeWidget::AbstractScopeWidget(bool trackMouse, QWidget *parent)
, m_semaphoreHUD(1)
, m_semaphoreScope(1)
, m_semaphoreBackground(1)
, initialDimensionUpdateDone(false)
, m_initialDimensionUpdateDone(false)
, m_requestForcedUpdate(false)
, m_rescaleMinDist(4)
, m_rescaleVerticalThreshold(2.0f)
......
......@@ -260,7 +260,7 @@ private:
QFuture<QImage> m_threadScope;
QFuture<QImage> m_threadBackground;
bool initialDimensionUpdateDone;
bool m_initialDimensionUpdateDone;
bool m_requestForcedUpdate;
QImage m_scopeImage;
......
......@@ -29,7 +29,7 @@ AudioSignal::AudioSignal(QWidget *parent)
{
setMinimumHeight(10);
setMinimumWidth(10);
dbscale << 0 << -1 << -2 << -3 << -4 << -5 << -6 << -8 << -10 << -20 << -40;
m_dbscale << 0 << -1 << -2 << -3 << -4 << -5 << -6 << -8 << -10 << -20 << -40;
m_menu->removeAction(m_aRealtime);
connect(&m_timer, &QTimer::timeout, this, &AudioSignal::slotNoAudioTimeout);
init();
......@@ -52,15 +52,15 @@ QImage AudioSignal::renderAudioScope(uint, const audioShortVector &audioFrame, c
chanAvg.append(char(val / num_samples));
}
if (peeks.count() != chanAvg.count()) {
peeks = QByteArray(chanAvg.count(), 0);
peekage = QByteArray(chanAvg.count(), 0);
if (m_peeks.count() != chanAvg.count()) {
m_peeks = QByteArray(chanAvg.count(), 0);
m_peekage = QByteArray(chanAvg.count(), 0);
}
for (int chan = 0; chan < peeks.count(); chan++) {
peekage[chan] = char(peekage[chan] + 1);
if (peeks.at(chan) < chanAvg.at(chan) || peekage.at(chan) > 50) {
peekage[chan] = 0;
peeks[chan] = chanAvg[chan];
for (int chan = 0; chan < m_peeks.count(); chan++) {
m_peekage[chan] = char(m_peekage[chan] + 1);
if (m_peeks.at(chan) < chanAvg.at(chan) || m_peekage.at(chan) > 50) {
m_peekage[chan] = 0;
m_peeks[chan] = chanAvg[chan];
}
}
......@@ -76,12 +76,12 @@ QImage AudioSignal::renderAudioScope(uint, const audioShortVector &audioFrame, c
int dbsize = 20;
if (!horiz) {
// calculate actual width of lowest=longest db scale mark based on drawing font
dbsize = p.fontMetrics().width(QString().sprintf("%d", dbscale.at(dbscale.size() - 1)));
dbsize = p.fontMetrics().width(QString().sprintf("%d", m_dbscale.at(m_dbscale.size() - 1)));
}
bool showdb = width() > (dbsize + 40);
// valpixel=1.0 for 127, 1.0+(1/40) for 1 short oversample, 1.0+(2/40) for longer oversample
for (int i = 0; i < numchan; ++i) {
// int maxx= (unsigned char)channels[i] * (horiz ? width() : height() ) / 127;
// int maxx= (unsigned char)m_channels[i] * (horiz ? width() : height() ) / 127;
double valpixel = valueToPixel((double)(unsigned char)chanAvg[i] / 127.0);
int maxx = height() * valpixel;
int xdelta = height() / 42;
......@@ -119,18 +119,18 @@ QImage AudioSignal::renderAudioScope(uint, const audioShortVector &audioFrame, c
maxx -= xdelta;
}
}