Commit 635f9159 authored by Vincent Pinon's avatar Vincent Pinon
Browse files

fix some more warnings

parent c0243124
......@@ -124,9 +124,9 @@ void RenderJob::receivedStderr()
}
m_progress = progress;
if (m_args.contains(QStringLiteral("pass=1"))) {
m_progress /= 2.0;
m_progress /= 2;
} else if (m_args.contains(QStringLiteral("pass=2"))) {
m_progress = int(50 + m_progress / 2.0);
m_progress = 50 + m_progress / 2;
}
if ((m_kdenliveinterface != nullptr) && m_kdenliveinterface->isValid()) {
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QStringLiteral("setRenderingProgress"), {m_dest, m_progress, frame});
......
......@@ -443,7 +443,7 @@ double Core::getCurrentFps() const
QSize Core::getCurrentFrameDisplaySize() const
{
return {(int)(getCurrentProfile()->height() * getCurrentDar() + 0.5), getCurrentProfile()->height()};
return {int(getCurrentProfile()->height() * getCurrentDar() + 0.5), getCurrentProfile()->height()};
}
QSize Core::getCurrentFrameSize() const
......@@ -488,7 +488,6 @@ int Core::getItemPosition(const ObjectId &id)
case ObjectType::TimelineTrack:
case ObjectType::Master:
return 0;
break;
default:
qWarning() << "unhandled object type";
}
......@@ -515,7 +514,6 @@ int Core::getItemIn(const ObjectId &id)
case ObjectType::TimelineTrack:
case ObjectType::Master:
return 0;
break;
default:
qWarning() << "unhandled object type";
}
......@@ -533,15 +531,12 @@ PlaylistState::ClipState Core::getItemState(const ObjectId &id)
break;
case ObjectType::TimelineComposition:
return PlaylistState::VideoOnly;
break;
case ObjectType::BinClip:
return m_binWidget->getClipState(id.second);
break;
case ObjectType::TimelineTrack:
return m_mainWindow->getCurrentTimeline()->controller()->getModel()->isAudioTrack(id.second) ? PlaylistState::AudioOnly : PlaylistState::VideoOnly;
case ObjectType::Master:
return PlaylistState::Disabled;
break;
default:
qWarning() << "unhandled object type";
break;
......@@ -564,8 +559,7 @@ int Core::getItemDuration(const ObjectId &id)
}
break;
case ObjectType::BinClip:
return (int)m_binWidget->getClipDuration(id.second);
break;
return int(m_binWidget->getClipDuration(id.second));
case ObjectType::TimelineTrack:
case ObjectType::Master:
return m_mainWindow->getCurrentTimeline()->controller()->duration() - 1;
......@@ -594,7 +588,6 @@ QSize Core::getItemFrameSize(const ObjectId &id)
break;
case ObjectType::BinClip:
return m_binWidget->getFrameSize(id.second);
break;
case ObjectType::TimelineTrack:
case ObjectType::Master:
return pCore->getCurrentFrameSize();
......@@ -612,7 +605,6 @@ int Core::getItemTrack(const ObjectId &id)
case ObjectType::TimelineComposition:
case ObjectType::TimelineMix:
return m_mainWindow->getCurrentTimeline()->controller()->getModel()->getItemTrackId(id.second);
break;
default:
qWarning() << "unhandled object type";
}
......@@ -720,12 +712,12 @@ void Core::displayMessage(const QString &message, MessageType type, int timeout)
void Core::displayBinMessage(const QString &text, int type, const QList<QAction *> &actions, bool showClose, BinMessage::BinCategory messageCategory)
{
m_binWidget->doDisplayMessage(text, (KMessageWidget::MessageType)type, actions, showClose, messageCategory);
m_binWidget->doDisplayMessage(text, KMessageWidget::MessageType(type), actions, showClose, messageCategory);
}
void Core::displayBinLogMessage(const QString &text, int type, const QString &logInfo)
{
m_binWidget->doDisplayMessage(text, (KMessageWidget::MessageType)type, logInfo);
m_binWidget->doDisplayMessage(text, KMessageWidget::MessageType(type), logInfo);
}
void Core::clearAssetPanel(int itemId)
......@@ -737,14 +729,13 @@ std::shared_ptr<EffectStackModel> Core::getItemEffectStack(int itemType, int ite
{
if (!m_guiConstructed) return nullptr;
switch (itemType) {
case (int)ObjectType::TimelineClip:
case int(ObjectType::TimelineClip):
return m_mainWindow->getCurrentTimeline()->controller()->getModel()->getClipEffectStack(itemId);
case (int)ObjectType::TimelineTrack:
case int(ObjectType::TimelineTrack):
return m_mainWindow->getCurrentTimeline()->controller()->getModel()->getTrackEffectStackModel(itemId);
break;
case (int)ObjectType::BinClip:
case int(ObjectType::BinClip):
return m_binWidget->getClipEffectStack(itemId);
case (int)ObjectType::Master:
case int(ObjectType::Master):
return m_mainWindow->getCurrentTimeline()->controller()->getModel()->getMasterEffectStackModel();
default:
return nullptr;
......@@ -849,7 +840,7 @@ Mlt::Profile *Core::thumbProfile()
m_thumbProfile = std::make_unique<Mlt::Profile>(m_currentProfile.toStdString().c_str());
double factor = 144. / m_thumbProfile->height();
m_thumbProfile->set_height(144);
int width = m_thumbProfile->width() * factor + 0.5;
int width = int(m_thumbProfile->width() * factor + 0.5);
if (width % 2 > 0) {
width ++;
}
......
......@@ -223,7 +223,7 @@ void MainWindow::init()
/// Add Widgets
setDockOptions(dockOptions() | QMainWindow::AllowNestedDocks | QMainWindow::AllowTabbedDocks);
setDockOptions(dockOptions() | QMainWindow::GroupedDragging);
setTabPosition(Qt::AllDockWidgetAreas, (QTabWidget::TabPosition)KdenliveSettings::tabposition());
setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::TabPosition(KdenliveSettings::tabposition()));
m_timelineToolBar = toolBar(QStringLiteral("timelineToolBar"));
m_timelineToolBarContainer = new TimelineContainer(this);
auto *ctnLay = new QVBoxLayout;
......@@ -1837,7 +1837,7 @@ void MainWindow::setupActions()
QAction *ac = new QAction(QIcon(), i18n("Select Audio Track %1", i), this);
ac->setData(i - 1);
connect(ac, &QAction::triggered, this, &MainWindow::slotActivateAudioTrackSequence);
addAction(QString("activate_audio_%1").arg(i), ac, QKeySequence(Qt::ALT + keysequence[i-1]), timelineActions);
addAction(QString("activate_audio_%1").arg(i), ac, QKeySequence(int(Qt::ALT) + keysequence[i-1]), timelineActions);
QAction *ac2 = new QAction(QIcon(), i18n("Select Video Track %1", i), this);
ac2->setData(i - 1);
connect(ac2, &QAction::triggered, this, &MainWindow::slotActivateVideoTrackSequence);
......@@ -1886,9 +1886,9 @@ bool MainWindow::readOptions()
}
QFont ft = QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont);
// Default unit for timeline.qml objects size
int baseUnit = qMax(28, (int) (QFontInfo(ft).pixelSize() * 1.8 + 0.5));
int baseUnit = qMax(28, int(QFontInfo(ft).pixelSize() * 1.8 + 0.5));
if (KdenliveSettings::trackheight() == 0) {
int trackHeight = qMax(50, (int) (2.2 * baseUnit + 6));
int trackHeight = qMax(50, int(2.2 * baseUnit + 6));
KdenliveSettings::setTrackheight(trackHeight);
}
bool firstRun = false;
......
......@@ -144,7 +144,7 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
QList<Mlt::Transition *> compositions;
while ((service != nullptr) && service->is_valid()) {
if (service->type() == transition_type) {
Mlt::Transition t((mlt_transition)service->get_service());
Mlt::Transition t(mlt_transition(service->get_service()));
if (t.get_b_track() >= timeline->tractor()->count()) {
// Composition outside of available track, maybe because of a preview track
service.reset(service->producer());
......@@ -226,7 +226,7 @@ bool constructTrackFromMelt(const std::shared_ptr<TimelineItemModel> &timeline,
QList<Mlt::Transition *> compositions;
while ((service != nullptr) && service->is_valid()) {
if (service->type() == transition_type) {
Mlt::Transition t((mlt_transition)service->get_service());
Mlt::Transition t(mlt_transition(service->get_service()));
QString id(t.get("kdenlive_id"));
compositions << new Mlt::Transition(t);
if (id.isEmpty()) {
......
......@@ -295,7 +295,7 @@ bool PreviewManager::loadParams()
}*/
if (doc->getDocumentProperty(QStringLiteral("resizepreview")).toInt() != 0) {
int resizeWidth = doc->getDocumentProperty(QStringLiteral("previewheight")).toInt();
m_consumerParams << QStringLiteral("s=%1x%2").arg((int)(resizeWidth * pCore->getCurrentDar())).arg(resizeWidth);
m_consumerParams << QStringLiteral("s=%1x%2").arg(int(resizeWidth * pCore->getCurrentDar())).arg(resizeWidth);
}
m_consumerParams << QStringLiteral("an=1");
if (KdenliveSettings::gpu_accel()) {
......@@ -447,7 +447,7 @@ void PreviewManager::addPreviewRange(const QPoint zone, bool add)
{
int chunkSize = KdenliveSettings::timelinechunks();
int startChunk = zone.x() / chunkSize;
int endChunk = rintl(zone.y() / chunkSize);
int endChunk = int(rintl(zone.y() / chunkSize));
QList<int> toRemove;
qDebug() << " // / RESUQEST CHUNKS; " << startChunk << " = " << endChunk;
for (int i = startChunk; i <= endChunk; i++) {
......
......@@ -91,6 +91,6 @@ QImage ThumbnailProvider::makeThumbnail(const std::shared_ptr<Mlt::Producer> &pr
// TODO: cache these values ?
int imageHeight = pCore->thumbProfile()->height();
int imageWidth = pCore->thumbProfile()->width();
int fullWidth = imageHeight * pCore->getCurrentDar() + 0.5;
int fullWidth = int(imageHeight * pCore->getCurrentDar() + 0.5);
return KThumb::getFrame(frame.data(), imageWidth, imageHeight, fullWidth);
}
......@@ -92,7 +92,7 @@ void TransitionTreeModel::setFavorite(const QModelIndex &index, bool favorite, b
if (!index.isValid()) {
return;
}
std::shared_ptr<TreeItem> item = getItemById((int)index.internalId());
std::shared_ptr<TreeItem> item = getItemById(int(index.internalId()));
if (isEffect && item->depth() == 1) {
return;
}
......
......@@ -117,7 +117,7 @@ QStringList TransitionsRepository::assetDirs() const
void TransitionsRepository::parseType(QScopedPointer<Mlt::Properties> &metadata, Info &res)
{
Mlt::Properties tags((mlt_properties)metadata->get_data("tags"));
Mlt::Properties tags(mlt_properties(metadata->get_data("tags")));
bool audio = QString(tags.get(0)) == QLatin1String("Audio");
if (getSingleTrackTransitions().contains(res.id)) {
......
......@@ -120,7 +120,7 @@ QImage MltPreview::getFrame(std::shared_ptr<Mlt::Producer> producer, int framepo
return mltImage;
}
uint MltPreview::imageVariance(const QImage &image)
int MltPreview::imageVariance(const QImage &image)
{
if (image.isNull()) {
return 0;
......
......@@ -37,7 +37,7 @@ public:
Flags flags() const override;
protected:
static uint imageVariance(const QImage &image);
static int imageVariance(const QImage &image);
QImage getFrame(std::shared_ptr<Mlt::Producer> producer, int framepos, int width, int height);
};
......
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