Commit 7ef5187f authored by Julius Künzel's avatar Julius Künzel
Browse files

GIT_SILENT Code Gardening Pt. 1: (not only) Clang-Tidy and Clazy

parent fa33bbf2
......@@ -8,8 +8,8 @@
#include "abstractmodel/abstracttreemodel.hpp"
#include "abstractmodel/treeitem.hpp"
#include "assettreemodel.hpp"
#include <utility>
#include <klocalizedstring.h>
#include <utility>
AssetFilter::AssetFilter(QObject *parent)
: QSortFilterProxyModel(parent)
......
......@@ -771,7 +771,7 @@ bool KeyframeModel::removeAllKeyframes(Fun &undo, Fun &redo)
update_redo_start();
bool res = true;
bool first = true;
for (const auto &p : all_pos) {
for (const auto &p : qAsConst(all_pos)) {
if (first) { // skip first point
first = false;
continue;
......
......@@ -20,8 +20,6 @@
#include <effects/effectsrepository.hpp>
#define DEBUG_LOCALE false
static QVector<int> bypassRoles = {AssetParameterModel::InRole,AssetParameterModel::OutRole,AssetParameterModel::ParentInRole,AssetParameterModel::ParentDurationRole,AssetParameterModel::ParentPositionRole,AssetParameterModel::HideKeyframesFirstRole};
AssetParameterModel::AssetParameterModel(std::unique_ptr<Mlt::Properties> asset, const QDomElement &assetXml, const QString &assetId, ObjectId ownerId,
const QString& originalDecimalPoint, QObject *parent)
: QAbstractListModel(parent)
......@@ -216,7 +214,7 @@ AssetParameterModel::AssetParameterModel(std::unique_ptr<Mlt::Properties> asset,
}
qDebug() << "END parsing of " << assetId << ". Number of found parameters" << m_rows.size();
modelChanged();
emit modelChanged();
}
void AssetParameterModel::prepareKeyframes()
......@@ -434,6 +432,15 @@ AssetParameterModel::~AssetParameterModel() = default;
QVariant AssetParameterModel::data(const QModelIndex &index, int role) const
{
const QVector<int> bypassRoles = {
AssetParameterModel::InRole,
AssetParameterModel::OutRole,
AssetParameterModel::ParentInRole,
AssetParameterModel::ParentDurationRole,
AssetParameterModel::ParentPositionRole,
AssetParameterModel::HideKeyframesFirstRole
};
if (bypassRoles.contains(role)) {
switch (role) {
case InRole:
......
......@@ -130,7 +130,8 @@ void UrlListParamWidget::slotRefresh()
if (!currentValue.isEmpty()) {
QString path = QUrl(currentValue).adjusted(QUrl::RemoveFilename).toString();
QDir dir(path);
for (const auto &filename : dir.entryList(m_fileExt, QDir::Files)) {
QStringList entrys = dir.entryList(m_fileExt, QDir::Files);
for (const auto &filename : qAsConst(entrys)) {
values.append(dir.filePath(filename));
}
// make sure the current value is added. If it is a duplicate we remove it later
......
......@@ -1864,7 +1864,7 @@ void Bin::cleanDocument()
}
setEnabled(false);
// Cleanup references in the cli properties dialog
requestShowClipProperties(nullptr);
emit requestShowClipProperties(nullptr);
// Cleanup previous project
m_itemModel->clean();
......@@ -2177,7 +2177,7 @@ void Bin::selectProxyModel(const QModelIndex &id)
m_tagsWidget->setTagData(clip->tags());
ClipType::ProducerType type = clip->clipType();
m_openAction->setEnabled(type == ClipType::Image || type == ClipType::Audio || type == ClipType::Text || type == ClipType::TextTemplate);
requestShowClipProperties(clip, false);
emit requestShowClipProperties(clip, false);
m_deleteAction->setText(i18n("Delete Clip"));
m_proxyAction->setText(i18n("Proxy Clip"));
//TODO: testing only, we should check clip type...
......@@ -2198,7 +2198,7 @@ void Bin::selectProxyModel(const QModelIndex &id)
m_proxyAction->setText(i18n("Proxy Folder"));
} else if (currentItem->itemType() == AbstractProjectItem::SubClipItem) {
m_tagsWidget->setTagData(currentItem->tags());
requestShowClipProperties(std::static_pointer_cast<ProjectClip>(currentItem->parent()), false);
emit requestShowClipProperties(std::static_pointer_cast<ProjectClip>(currentItem->parent()), false);
m_openAction->setEnabled(false);
m_reloadAction->setEnabled(false);
m_replaceAction->setEnabled(false);
......@@ -2223,7 +2223,7 @@ void Bin::selectProxyModel(const QModelIndex &id)
m_openAction->setEnabled(false);
m_deleteAction->setEnabled(false);
m_renameAction->setEnabled(false);
requestShowClipProperties(nullptr);
emit requestShowClipProperties(nullptr);
emit requestClipShow(nullptr);
// clear effect stack
emit requestShowEffectStack(QString(), nullptr, QSize(), false);
......@@ -2770,7 +2770,7 @@ void Bin::slotSwitchClipProperties(const std::shared_ptr<ProjectClip> &clip)
ClipCreationDialog::createQTextClip(m_doc, parentFolder, this, clip.get());
} else {
m_propertiesPanel->setEnabled(true);
requestShowClipProperties(clip);
emit requestShowClipProperties(clip);
m_propertiesDock->show();
m_propertiesDock->raise();
}
......@@ -2782,7 +2782,7 @@ void Bin::doRefreshPanel(const QString &id)
{
std::shared_ptr<ProjectClip> currentItem = getFirstSelectedClip();
if ((currentItem != nullptr) && currentItem->AbstractProjectItem::clipId() == id) {
requestShowClipProperties(currentItem, true);
emit requestShowClipProperties(currentItem, true);
}
}
......@@ -2868,7 +2868,7 @@ void Bin::reloadMonitorIfActive(const QString &id)
if (m_monitor->activeClipId() == id || m_monitor->activeClipId().isEmpty()) {
slotOpenCurrent();
if (m_monitor->activeClipId() == id) {
requestShowClipProperties(getBinClip(id), true);
emit requestShowClipProperties(getBinClip(id), true);
}
}
}
......@@ -4135,7 +4135,7 @@ void Bin::slotRefreshClipThumbnail(const QString &id)
ClipLoadTask::start({ObjectType::BinClip,id.toInt()}, QDomElement(), true, -1, -1, this);
}
void Bin::slotAddClipExtraData(const QString &id, const QString &key, const QString &clipData, QUndoCommand *groupCommand)
void Bin::slotAddClipExtraData(const QString &id, const QString &key, const QString &clipData)
{
std::shared_ptr<ProjectClip> clip = m_itemModel->getClipByBinID(id);
if (!clip) {
......@@ -4146,10 +4146,8 @@ void Bin::slotAddClipExtraData(const QString &id, const QString &key, const QStr
oldProps.insert(key, oldValue);
QMap<QString, QString> newProps;
newProps.insert(key, clipData);
auto *command = new EditClipCommand(this, id, oldProps, newProps, true, groupCommand);
if (!groupCommand) {
m_doc->commandStack()->push(command);
}
auto *command = new EditClipCommand(this, id, oldProps, newProps, true);
m_doc->commandStack()->push(command);
}
void Bin::slotUpdateClipProperties(const QString &id, const QMap<QString, QString> &properties, bool refreshPropertiesPanel)
......
......@@ -426,7 +426,7 @@ public slots:
void slotLocateClip();
void showClipProperties(const std::shared_ptr<ProjectClip> &clip, bool forceRefresh = false);
/** @brief Add extra data to a clip. */
void slotAddClipExtraData(const QString &id, const QString &key, const QString &data = QString(), QUndoCommand *groupCommand = nullptr);
void slotAddClipExtraData(const QString &id, const QString &key, const QString &data = QString());
void slotUpdateClipProperties(const QString &id, const QMap<QString, QString> &properties, bool refreshPropertiesPanel);
/** @brief Add effect to active Bin clip (used when double clicking an effect in list). */
void slotAddEffect(QString id, const QStringList &effectData);
......
......@@ -391,7 +391,10 @@ void ProjectClip::reloadProducer(bool refreshOnly, bool isProxy, bool forceAudio
}
QDomDocument doc;
QDomElement xml;
QString resource(m_properties->get("resource"));
QString resource;
if (m_properties) {
resource = m_properties->get("resource");
}
if (m_service.isEmpty() && !resource.isEmpty()) {
xml = ClipCreator::getXmlFromUrl(resource).documentElement();
} else {
......@@ -2170,16 +2173,12 @@ void ProjectClip::updateTimelineOnReload()
{
if (m_registeredClips.size() > 0 && m_registeredClips.size() < 3) {
for (const auto &clip : m_registeredClips) {
bool reloadProducer = true;
if (auto timeline = clip.second.lock()) {
if (timeline->getClipPlaytime(clip.first) < static_cast<int>(frameDuration())) {
reloadProducer = false;
break;
break; // don't reload producer
}
}
if (reloadProducer) {
m_resetTimelineOccurences = true;
}
m_resetTimelineOccurences = true;
}
}
}
......
......@@ -147,10 +147,11 @@ void ProxyTest::startTest()
parameters << QStringLiteral("-i") << src.fileName();
}
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
for (const QString &s : params.split(QLatin1Char(' '), QString::SkipEmptyParts)) {
QStringList paramList = params.split(QLatin1Char(' '), QString::SkipEmptyParts);
#else
for (const QString &s : params.split(QLatin1Char(' '), Qt::SkipEmptyParts)) {
QStringList paramList = params.split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
for (const QString &s : qAsConst(paramList)) {
QString t = s.simplified();
if (t != QLatin1String("-noautorotate")) {
parameters << t;
......
......@@ -1858,38 +1858,37 @@ void RenderWidget::refreshView()
}
}
}
if (!pCore->mltACodecs().isEmpty()) {
QString format;
if (params.startsWith(QLatin1String("acodec="))) {
format = params.section(QStringLiteral("acodec="), 1, 1);
} else if (params.contains(QStringLiteral(" acodec="))) {
format = params.section(QStringLiteral(" acodec="), 1, 1);
}
if (!format.isEmpty()) {
format = format.section(QLatin1Char(' '), 0, 0).toLower();
if (!pCore->mltACodecs().contains(format)) {
item->setData(0, ErrorRole, i18n("Unsupported audio codec: %1", format));
item->setIcon(0, brokenIcon);
item->setForeground(0, disabled);
item->setBackground(0, disabledbg);
}
// check for missing audio codecs
QString format;
if (params.startsWith(QLatin1String("acodec="))) {
format = params.section(QStringLiteral("acodec="), 1, 1);
} else if (params.contains(QStringLiteral(" acodec="))) {
format = params.section(QStringLiteral(" acodec="), 1, 1);
}
if (!format.isEmpty()) {
format = format.section(QLatin1Char(' '), 0, 0).toLower();
if (!pCore->mltACodecs().contains(format)) {
item->setData(0, ErrorRole, i18n("Unsupported audio codec: %1", format));
item->setIcon(0, brokenIcon);
item->setForeground(0, disabled);
item->setBackground(0, disabledbg);
}
}
if (!pCore->mltVCodecs().isEmpty()) {
QString format;
if (params.startsWith(QLatin1String("vcodec="))) {
format = params.section(QStringLiteral("vcodec="), 1, 1);
} else if (params.contains(QStringLiteral(" vcodec="))) {
format = params.section(QStringLiteral(" vcodec="), 1, 1);
}
if (!format.isEmpty()) {
format = format.section(QLatin1Char(' '), 0, 0).toLower();
if (!pCore->mltVCodecs().contains(format)) {
item->setData(0, ErrorRole, i18n("Unsupported video codec: %1", format));
item->setIcon(0, brokenIcon);
item->setForeground(0, disabled);
continue;
}
// check for missing video codecs
format.clear();
if (params.startsWith(QLatin1String("vcodec="))) {
format = params.section(QStringLiteral("vcodec="), 1, 1);
} else if (params.contains(QStringLiteral(" vcodec="))) {
format = params.section(QStringLiteral(" vcodec="), 1, 1);
}
if (!format.isEmpty()) {
format = format.section(QLatin1Char(' '), 0, 0).toLower();
if (!pCore->mltVCodecs().contains(format)) {
item->setData(0, ErrorRole, i18n("Unsupported video codec: %1", format));
item->setIcon(0, brokenIcon);
item->setForeground(0, disabled);
continue;
}
}
if (params.contains(QStringLiteral(" profile=")) || params.startsWith(QLatin1String("profile="))) {
......
......@@ -45,12 +45,6 @@ SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#endif
// Recommended MLT version
const int mltVersionMajor = MLT_MIN_MAJOR_VERSION;
const int mltVersionMinor = MLT_MIN_MINOR_VERSION;
const int mltVersionRevision = MLT_MIN_PATCH_VERSION;
static const char kdenlive_version[] = KDENLIVE_VERSION;
MyWizardPage::MyWizardPage(QWidget *parent)
: QWizardPage(parent)
......@@ -78,7 +72,7 @@ Wizard::Wizard(bool autoClose, bool appImageCheck, QWidget *parent)
setOption(QWizard::NoBackButtonOnLastPage, true);
// setOption(QWizard::ExtendedWatermarkPixmap, false);
m_page = new MyWizardPage(this);
m_page->setTitle(i18n("Welcome to Kdenlive %1", QString(kdenlive_version)));
m_page->setTitle(i18n("Welcome to Kdenlive %1", QString(KDENLIVE_VERSION)));
m_page->setSubTitle(i18n("Using MLT %1", mlt_version_get_string()));
setPixmap(QWizard::LogoPixmap, QIcon::fromTheme(QStringLiteral(":/pics/kdenlive.png")).pixmap(logoHeight, logoHeight));
m_startLayout = new QVBoxLayout;
......@@ -389,11 +383,11 @@ void Wizard::checkMltComponents()
m_errors.append(i18n("<li>Cannot start MLT backend, check your installation</li>"));
m_systemCheckIsOk = false;
} else {
int mltVersion = (mltVersionMajor << 16) + (mltVersionMinor << 8) + mltVersionRevision;
int mltVersion = QT_VERSION_CHECK(MLT_MIN_MAJOR_VERSION, MLT_MIN_MINOR_VERSION, MLT_MIN_PATCH_VERSION);
int runningVersion = mlt_version_get_int();
if (runningVersion < mltVersion) {
m_errors.append(
i18n("<li>Unsupported MLT version<br/>Please <b>upgrade</b> to %1.%2.%3</li>", mltVersionMajor, mltVersionMinor, mltVersionRevision));
i18n("<li>Unsupported MLT version<br/>Please <b>upgrade</b> to %1.%2.%3</li>", MLT_MIN_MAJOR_VERSION, MLT_MIN_MINOR_VERSION, MLT_MIN_PATCH_VERSION));
m_systemCheckIsOk = false;
}
// Retrieve the list of available transitions.
......@@ -947,7 +941,8 @@ void Wizard::testHwEncoders()
return;
}
tmp2.close();
QStringList args2{"-hide_banner", "-y", "-hwaccel", "cuvid", "-f", "lavfi", "-i", "smptebars=duration=5:size=1280x720:rate=25",
QStringList args2{"-hide_banner", "-y", "-hwaccel", "cuvid", "-f", "lavfi", "-i",
"smptebars=duration=5:size=1280x720:rate=25",
"-c:v", "h264_nvenc", "-an", "-f", "mp4", tmp2.fileName()};
qDebug() << "// FFMPEG ARGS: " << args2;
hwEncoders.start(KdenliveSettings::ffmpegpath(), args2);
......
......@@ -427,8 +427,8 @@ bool DocumentChecker::hasErrorInClips()
}
infoLabel.append(i18n("Missing proxies can be recreated on opening."));
m_ui.rebuildProxies->setChecked(true);
connect(m_ui.rebuildProxies, &QCheckBox::stateChanged, [this] (int state) {
for (QDomElement e : m_missingProxies) {
connect(m_ui.rebuildProxies, &QCheckBox::stateChanged, this, [this] (int state) {
for (auto e : qAsConst(m_missingProxies)) {
if (state == Qt::Checked) {
e.setAttribute(QStringLiteral("_replaceproxy"), QStringLiteral("1"));
} else {
......
......@@ -1165,7 +1165,6 @@ void KdenliveDoc::setMetadata(const QMap<QString, QString> &meta)
QMap<QString, QString> KdenliveDoc::proxyClipsById(const QStringList &ids, bool proxy, QMap<QString, QString> proxyPath)
{
QMap<QString, QString> existingProxies;
QList<std::shared_ptr<ProjectClip>> clipList;
for (auto &id : ids) {
auto clip = pCore->projectItemModel()->getClipByBinID(id);
QMap<QString, QString> newProps;
......
......@@ -230,7 +230,6 @@ void TranscodeTask::run()
newProps.insert(QStringLiteral("resource"), destUrl);
newProps.insert(QStringLiteral("kdenlive:clipname"), QFileInfo(destUrl).fileName());
newProps.insert(QStringLiteral("_fullreload"), QStringLiteral("1"));
QString id = QString::number(m_owner.second);
pCore->bin()->slotEditClipCommand(binClip->clipId(), sourceProps, newProps);
if (m_checkProfile) {
QMetaObject::invokeMethod(pCore->bin(), "slotCheckProfile", Qt::QueuedConnection, Q_ARG(QString, QString::number(m_owner.second)));
......
......@@ -24,12 +24,16 @@ SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#include <KXMLGUIFactory>
#include <klocalizedstring.h>
static QMap <QString, QString> translatedLayoutNames;
LayoutManagement::LayoutManagement(QObject *parent)
: QObject(parent)
{
translatedLayoutNames = {{QStringLiteral("kdenlive_logging"), i18n("Logging")},{QStringLiteral("kdenlive_editing"), i18n("Editing")},{QStringLiteral("kdenlive_audio"), i18n("Audio")},{QStringLiteral("kdenlive_effects"), i18n("Effects")},{QStringLiteral("kdenlive_color"), i18n("Color")}};
m_translatedNames = {
{ QStringLiteral("kdenlive_logging"), i18n("Logging") },
{ QStringLiteral("kdenlive_editing"), i18n("Editing") },
{ QStringLiteral("kdenlive_audio"), i18n("Audio")},
{ QStringLiteral("kdenlive_effects"), i18n("Effects") },
{ QStringLiteral("kdenlive_color"), i18n("Color") }
};
// Prepare layout actions
KActionCategory *layoutActions = new KActionCategory(i18n("Layouts"), pCore->window()->actionCollection());
......@@ -149,10 +153,9 @@ void LayoutManagement::initializeLayouts()
load->setText(QString());
load->setIcon(QIcon());
} else {
QString translatedName = translatedLayoutNames.contains(layoutName) ? translatedLayoutNames.value(layoutName) : layoutName;
load->setText(i18n("Layout %1: %2", i, translatedName));
load->setText(i18n("Layout %1: %2", i, translatedName(layoutName)));
if (i < 6) {
auto *lab = new QPushButton(translatedName, m_container);
auto *lab = new QPushButton(translatedName(layoutName), m_container);
lab->setProperty("layoutid", layoutName);
lab->setFocusPolicy(Qt::NoFocus);
lab->setCheckable(true);
......@@ -239,12 +242,7 @@ bool LayoutManagement::loadLayout(const QString &layoutId, bool selectButton)
std::pair<QString, QString> LayoutManagement::saveLayout(QString layout, const QString suggestedName) {
QString visibleName;
if (translatedLayoutNames.contains(suggestedName)) {
visibleName = translatedLayoutNames.value(suggestedName);
} else {
visibleName = suggestedName;
}
QString visibleName = translatedName(suggestedName);
QString layoutName = QInputDialog::getText(pCore->window(), i18n("Save Layout"), i18n("Layout name:"), QLineEdit::Normal, visibleName);
if (layoutName.isEmpty()) {
......@@ -252,8 +250,8 @@ std::pair<QString, QString> LayoutManagement::saveLayout(QString layout, const Q
}
QString saveName;
if (translatedLayoutNames.values().contains(layoutName)) {
saveName = translatedLayoutNames.key(layoutName);
if (m_translatedNames.contains(layoutName)) {
saveName = m_translatedNames.key(layoutName);
} else {
saveName = layoutName;
}
......@@ -272,7 +270,7 @@ std::pair<QString, QString> LayoutManagement::saveLayout(QString layout, const Q
layouts.writeEntry(saveName, layout);
if (!order.entryMap().values().contains(saveName)) {
int pos = order.keyList().last().toInt() + 1;
int pos = order.keyList().constLast().toInt() + 1;
order.writeEntry(QString::number(pos), saveName);
}
return {layoutName, saveName};
......@@ -396,9 +394,9 @@ void LayoutManagement::slotManageLayouts()
// Re-add missing default layouts
for (const QString &name : qAsConst(defaultLayoutNames)) {
if (!currentNames.contains(name) && translatedLayoutNames.contains(name)) {
if (!currentNames.contains(name) && m_translatedNames.contains(name)) {
// Insert default layout
QListWidgetItem *item = new QListWidgetItem(translatedLayoutNames.value(name));
QListWidgetItem *item = new QListWidgetItem(translatedName(name));
item->setData(Qt::UserRole, name);
item->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
list.insertItem(pos, item);
......@@ -510,14 +508,8 @@ void LayoutManagement::slotManageLayouts()
l2->addStretch();
// Add layouts to list
QString visibleName;
for (const QString &name : qAsConst(names)) {
if (translatedLayoutNames.contains(name)) {
visibleName = translatedLayoutNames.value(name);
} else {
visibleName = name;
}
auto *item = new QListWidgetItem(visibleName, &list);
auto *item = new QListWidgetItem(translatedName(name), &list);
item->setData(Qt::UserRole, name);
item->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
}
......@@ -541,9 +533,9 @@ void LayoutManagement::slotManageLayouts()
for (int i = 0; i < list.count(); i++) {
QListWidgetItem *item = list.item(i);
QString layoutId = item->data(Qt::UserRole).toString();
if (translatedLayoutNames.contains(layoutId)) {
if (m_translatedNames.contains(layoutId)) {
// This is a default layout, no rename
if (item->text() != translatedLayoutNames.value(layoutId)) {
if (item->text() != translatedName(layoutId)) {
// A default layout was renamed
order.writeEntry(QString::number(i + 1), item->text());
layouts.writeEntry(item->text(), layouts.readEntry(layoutId));
......@@ -562,3 +554,7 @@ void LayoutManagement::slotManageLayouts()
config->reparseConfiguration();
initializeLayouts();
}
const QString LayoutManagement::translatedName(const QString &name) {
return m_translatedNames.contains(name) ? m_translatedNames.constFind(name).value() : name;
}
......@@ -9,6 +9,7 @@ SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#define LAYOUTMANAGEMENT_H
#include <QObject>
#include <QMap>
class KSelectAction;
class QAction;
......@@ -44,11 +45,13 @@ private:
std::pair<QString, QString> saveLayout(QString layout, QString suggestedName);
/** @brief Populates the "load layout" menu. */
void initializeLayouts();
const QString translatedName(const QString &name);
QWidget *m_container;
QButtonGroup *m_containerGrp;
QHBoxLayout *m_containerLayout;
KSelectAction *m_loadLayout;
QList <QAction *> m_layoutActions;
QMap <QString, QString> m_translatedNames;
signals:
/** @brief Layout changed, ensure title bars are correctly displayed. */
......
......@@ -481,7 +481,7 @@ void MainWindow::init(const QString &mltPath)
m_undoViewDock->close();
m_mixerDock->close();
/// Tabify Widgets
// Tabify Widgets
tabifyDockWidget(m_clipMonitorDock, m_projectMonitorDock);
tabifyDockWidget(m_compositionListDock, m_effectListDock);
tabifyDockWidget(m_effectStackDock, pCore->bin()->clipPropertiesDock());
......@@ -1824,8 +1824,7 @@ void MainWindow::setupActions()
KStandardAction::showMenubar(this, SLOT(showMenuBar(bool)), actionCollection());
act = KStandardAction::quit(this, SLOT(close()), actionCollection());
// act->setIcon(QIcon::fromTheme(QStringLiteral("application-exit")));
KStandardAction::quit(this, SLOT(close()), actionCollection());
KStandardAction::keyBindings(this, SLOT(slotEditKeys()), actionCollection());
KStandardAction::preferences(this, SLOT(slotPreferences()), actionCollection());
......@@ -3082,10 +3081,10 @@ void MainWindow::slotClipEnd()
void MainWindow::slotChangeTool(QAction *action)
{
ToolType::ProjectTool activeTool;
if (action == m_buttonSelectTool) {
activeTool = ToolType::SelectTool;
} else if (action == m_buttonRazorTool) {
ToolType::ProjectTool activeTool = ToolType::SelectTool;
// if(action == m_buttonSelectTool) covered by default value
if (action == m_buttonRazorTool) {
activeTool = ToolType::RazorTool;
} else if (action == m_buttonSpacerTool) {
activeTool = ToolType::SpacerTool;
......
......@@ -268,11 +268,7 @@ void MltConnection::refreshLumas()
QStringList fileFilters;
MainWindow::m_lumaFiles.clear();
fileFilters << QStringLiteral("*.png") << QStringLiteral("*.pgm");
QStringList customLumas = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("lumas"), QStandardPaths::LocateDirectory);
#ifdef Q_OS_WIN
// Windows: downloaded lumas are saved in AppLocalDataLocation
customLumas.append(QStandardPaths::locateAll(QStandardPaths::AppLocalDataLocation, QStringLiteral("lumas"), QStandardPaths::LocateDirectory));
#endif
QStringList customLumas = QStandardPaths::locateAll(QStandardPaths::AppLocalDataLocation, QStringLiteral("lumas"), QStandardPaths::LocateDirectory);
customLumas.append(QString(mlt_environment("MLT_DATA")) + QStringLiteral("/lumas"));
customLumas.removeDuplicates();
QStringList hdLumas;
......
......@@ -187,6 +187,7 @@ public:
private:
QTreeWidget *m_tree;
Q_DISABLE_COPY(ExtractionResult)
};
#endif
......
......@@ -1278,7 +1278,7 @@ void Monitor::slotExtractCurrentFrame(QString frameName, bool addToProject)
if (m_captureConnection) {
QObject::disconnect( m_captureConnection );
}
m_captureConnection = connect(m_glMonitor, &GLWidget::analyseFrame, [this, proxiedClips, selectedFile, existingProxies, addToProject, analysisStatus, previewScale](const QImage &img) {
m_captureConnection = connect(m_glMonitor, &GLWidget::analyseFrame, this, [this, proxiedClips, selectedFile, existingProxies, addToProject, analysisStatus, previewScale](const QImage &img) {
m_glMonitor->sendFrameForAnalysis = analysisStatus;
m_glMonitor->releaseAnalyse();
img.save(selectedFile);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment