Commit 7ca22b50 authored by Vincent Pinon's avatar Vincent Pinon
Browse files

fix warnings

parent 9b945e75
......@@ -640,14 +640,14 @@ QVariant AssetParameterModel::parseAttribute(const ObjectId &owner, const QStrin
double sourceDar = frameSize.width() / frameSize.height();
if (sourceDar > pCore->getCurrentDar()) {
// Fit to width
double factor = (double)width / frameSize.width() * pCore->getCurrentSar();
contentHeight = (int)(height * factor + 0.5);
double factor = double(width) / frameSize.width() * pCore->getCurrentSar();
contentHeight = int(height * factor + 0.5);
contentWidth = width;
} else {
// Fit to height
double factor = (double)height / frameSize.height();
double factor = double(height) / frameSize.height();
contentHeight = height;
contentWidth =(int)(frameSize.width() / pCore->getCurrentSar() * factor + 0.5);
contentWidth =int(frameSize.width() / pCore->getCurrentSar() * factor + 0.5);
}
// Center
content = QString("%1 %2 %3 %4").arg((width - contentWidth) / 2).arg((height - contentHeight) / 2).arg(contentWidth).arg(contentHeight);
......@@ -757,7 +757,7 @@ bool AssetParameterModel::isActive() const
QVector<QPair<QString, QVariant>> AssetParameterModel::getAllParameters() const
{
QVector<QPair<QString, QVariant>> res;
res.reserve((int)m_fixedParams.size() + (int)m_params.size());
res.reserve(int(m_fixedParams.size() + m_params.size()));
for (const auto &fixed : m_fixedParams) {
res.push_back(QPair<QString, QVariant>(fixed.first, fixed.second));
}
......
......@@ -993,16 +993,14 @@ void ProjectItemModel::loadBinPlaylist(Mlt::Tractor *documentTractor, Mlt::Tract
{
QWriteLocker locker(&m_lock);
clean();
Mlt::Properties retainList((mlt_properties)documentTractor->get_data("xml_retain"));
Mlt::Properties retainList(mlt_properties(documentTractor->get_data("xml_retain")));
if (retainList.is_valid()) {
Mlt::Playlist playlist((mlt_playlist)retainList.get_data(BinPlaylist::binPlaylistId.toUtf8().constData()));
Mlt::Playlist playlist(mlt_playlist(retainList.get_data(BinPlaylist::binPlaylistId.toUtf8().constData())));
if (playlist.is_valid() && playlist.type() == playlist_type) {
if (progressDialog == nullptr && playlist.count() > 0) {
// Display message on splash screen
emit pCore->loadingMessageUpdated(i18n("Loading project clips..."));
}
// Load bin clips
auto currentLocale = strdup(setlocale(MLT_LC_CATEGORY, nullptr));
// Load folders
Mlt::Properties folderProperties;
Mlt::Properties playlistProps(playlist.get_properties());
......
......@@ -83,8 +83,8 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QMap<QString, QString> mappable_a
: KConfigDialog(parent, QStringLiteral("settings"), KdenliveSettings::self())
, m_modified(false)
, m_shuttleModified(false)
, m_mappable_actions(std::move(mappable_actions))
, m_voskUpdated(false)
, m_mappable_actions(std::move(mappable_actions))
{
KdenliveSettings::setV4l_format(0);
QWidget *p1 = new QWidget;
......
......@@ -865,7 +865,9 @@ void TextBasedEdit::startRecognition()
qApp->processEvents();
m_tCodeJob = std::make_unique<QProcess>(this);
m_tCodeJob->setProcessChannelMode(QProcess::MergedChannels);
connect(m_tCodeJob.get(), static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), [this, language, pyExec, speechScript, clipName, modelDirectory, endPos](int code, QProcess::ExitStatus status) {
connect(m_tCodeJob.get(), static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
[this, language, pyExec, speechScript, clipName, modelDirectory, endPos](int code, QProcess::ExitStatus status) {
Q_UNUSED(code)
qDebug()<<"++++++++++++++++++++++ TCODE JOB FINISHED\n";
if (status == QProcess::CrashExit) {
showMessage(i18n("Audio extract failed."), KMessageWidget::Warning);
......
......@@ -663,6 +663,7 @@ int CollapsibleEffectView::effectIndex() const
void CollapsibleEffectView::updateWidget(const ItemInfo &info, const QDomElement &effect)
{
Q_UNUSED(info)
// cleanup
/*
delete m_paramWidget;
......
......@@ -454,8 +454,10 @@ bool LoadJob::startJob()
QMimeDatabase db;
const QString mime = db.mimeTypeForFile(m_resource).name();
const bool isGif = mime.contains(QLatin1String("image/gif"));
if (duration == 0 && (type == ClipType::Color || type == ClipType::Text || type == ClipType::TextTemplate || type == ClipType::QText || type == ClipType::Image ||
type == ClipType::SlideShow) || (isGif && mltService == QLatin1String("qimage"))) {
if ((duration == 0 && (
type == ClipType::Text || type == ClipType::TextTemplate || type == ClipType::QText
|| type == ClipType::Color || type == ClipType::Image || type == ClipType::SlideShow))
|| (isGif && mltService == QLatin1String("qimage"))) {
int length;
if (m_xml.hasAttribute(QStringLiteral("length"))) {
length = m_xml.attribute(QStringLiteral("length")).toInt();
......
......@@ -66,12 +66,10 @@ bool TranscodeJob::startJob()
int fileCount = 1;
QString num = QString::number(fileCount).rightJustified(4, '0', false);
QString path = fileName + num + transcoderExt;
bool updatedPath = false;
while (dir.exists(path)) {
++fileCount;
num = QString::number(fileCount).rightJustified(4, '0', false);
path = fileName + num + transcoderExt;
updatedPath = true;
}
m_destUrl = dir.absoluteFilePath(fileName);
m_destUrl.append(QString::number(fileCount).rightJustified(4, '0', false));
......@@ -142,7 +140,7 @@ bool TranscodeJob::startJob()
m_done = true;
return false;
}
m_jobDuration = (int)binClip->duration().seconds();
m_jobDuration = int(binClip->duration().seconds());
parameters << QStringLiteral("-y");
if (m_inPoint > -1) {
parameters << QStringLiteral("-ss") << QString::number(GenTime(m_inPoint, pCore->getCurrentFps()).seconds());
......@@ -208,7 +206,7 @@ void TranscodeJob::processLogInfo()
if (numbers.size() < 3) {
return;
}
m_jobDuration = (int)(numbers.at(0).toInt() * 3600 + numbers.at(1).toInt() * 60 + numbers.at(2).toDouble());
m_jobDuration = int(numbers.at(0).toInt() * 3600 + numbers.at(1).toInt() * 60 + numbers.at(2).toDouble());
}
}
} else if (buffer.contains(QLatin1String("time="))) {
......@@ -216,15 +214,15 @@ void TranscodeJob::processLogInfo()
if (!time.isEmpty()) {
QStringList numbers = time.split(QLatin1Char(':'));
if (numbers.size() < 3) {
progress = (int)time.toDouble();
progress = int(time.toDouble());
if (progress == 0) {
return;
}
} else {
progress = numbers.at(0).toInt() * 3600 + numbers.at(1).toInt() * 60 + numbers.at(2).toDouble();
progress = int(numbers.at(0).toInt() * 3600 + numbers.at(1).toInt() * 60 + numbers.at(2).toDouble());
}
}
emit jobProgress((int)(100.0 * progress / m_jobDuration));
emit jobProgress(int(100.0 * progress / m_jobDuration));
}
} else {
// Parse MLT output
......
......@@ -28,7 +28,7 @@ static void mlt_log_handler(void *service, int mlt_level, const char *format, va
if (mlt_level > mlt_log_get_level())
return;
QString message;
mlt_properties properties = service? MLT_SERVICE_PROPERTIES((mlt_service) service) : nullptr;
mlt_properties properties = service? MLT_SERVICE_PROPERTIES(mlt_service(service)) : nullptr;
if (properties) {
char *mlt_type = mlt_properties_get(properties, "mlt_type");
char *service_name = mlt_properties_get(properties, "mlt_service");
......@@ -67,9 +67,9 @@ MltConnection::MltConnection(const QString &mltPath)
m_repository = std::unique_ptr<Mlt::Repository>(Mlt::Factory::init());
#ifdef Q_OS_FREEBSD
auto locale = strdup(setlocale(MLT_LC_CATEGORY, nullptr));
setlocale(MLT_LC_CATEGORY, nullptr);
#else
auto locale = strdup(std::setlocale(MLT_LC_CATEGORY, nullptr));
std::setlocale(MLT_LC_CATEGORY, nullptr);
#endif
locateMeltAndProfilesPath(mltPath);
......
......@@ -111,6 +111,6 @@ void TransitionTreeModel::deleteEffect(const QModelIndex &)
{
}
void TransitionTreeModel::editCustomAsset(const QString newName, const QString newDescription, const QModelIndex &index)
void TransitionTreeModel::editCustomAsset(const QString, const QString, const QModelIndex &)
{
}
......@@ -104,11 +104,11 @@ void TransitionListWidget::downloadNewLumas()
}
}
void TransitionListWidget::reloadCustomEffectIx(const QModelIndex &path)
void TransitionListWidget::reloadCustomEffectIx(const QModelIndex &)
{
}
void TransitionListWidget::editCustomAsset(const QModelIndex &index)
void TransitionListWidget::editCustomAsset(const QModelIndex &)
{
}
Markdown is supported
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