Commit cbaf84de authored by Julius Künzel's avatar Julius Künzel 💬
Browse files

Drop getMainTimeline(), use getCurrentTimeline() instead

parent df004bad
Pipeline #254149 failed with stage
in 17 minutes and 32 seconds
......@@ -1171,7 +1171,7 @@ bool Core::enableMultiTrack(bool enable)
}
bool isMultiTrack = pCore->monitorManager()->isMultiTrack();
if (isMultiTrack || enable) {
pCore->window()->getMainTimeline()->controller()->slotMultitrackView(enable, true);
pCore->window()->getCurrentTimeline()->controller()->slotMultitrackView(enable, true);
return true;
}
return false;
......@@ -1197,7 +1197,7 @@ void Core::addGuides(const QList<int> &guides)
void Core::temporaryUnplug(const QList<int> &clipIds, bool hide)
{
window()->getMainTimeline()->controller()->temporaryUnplug(clipIds, hide);
window()->getCurrentTimeline()->controller()->temporaryUnplug(clipIds, hide);
}
void Core::transcodeFile(const QString &url)
......@@ -1258,10 +1258,10 @@ void Core::cleanup()
if (timeRemapWidget()) {
timeRemapWidget()->selectedClip(-1);
}
if (m_mainWindow && m_mainWindow->getMainTimeline()) {
disconnect(m_mainWindow->getMainTimeline()->controller(), &TimelineController::durationChanged, m_projectManager,
if (m_mainWindow && m_mainWindow->getCurrentTimeline()) {
disconnect(m_mainWindow->getCurrentTimeline()->controller(), &TimelineController::durationChanged, m_projectManager,
&ProjectManager::adjustProjectDuration);
m_mainWindow->getMainTimeline()->controller()->clipActions.clear();
m_mainWindow->getCurrentTimeline()->controller()->clipActions.clear();
}
}
......@@ -1283,5 +1283,5 @@ void Core::addBin(const QString &id)
void Core::loadTimelinePreview(const QString &chunks, const QString &dirty, int enablePreview, Mlt::Playlist &playlist)
{
pCore->window()->getMainTimeline()->controller()->loadPreview(chunks, dirty, enablePreview, playlist);
pCore->window()->getCurrentTimeline()->controller()->loadPreview(chunks, dirty, enablePreview, playlist);
}
......@@ -249,7 +249,7 @@ void KdenliveSettingsDialog::initMiscPage()
if (m_configMisc.preferredcomposite->currentText() != KdenliveSettings::preferredcomposite()) {
KdenliveSettings::setPreferredcomposite(m_configMisc.preferredcomposite->currentText());
int mode = pCore->currentDoc()->getDocumentProperty(QStringLiteral("compositing")).toInt();
pCore->window()->getMainTimeline()->controller()->switchCompositing(mode);
pCore->window()->getCurrentTimeline()->controller()->switchCompositing(mode);
pCore->currentDoc()->setModified();
}
});
......@@ -1179,7 +1179,7 @@ void KdenliveSettingsDialog::updateSettings()
m_configColors.kcfg_thumbColor2->color() != KdenliveSettings::thumbColor2()) {
KdenliveSettings::setThumbColor1(m_configColors.kcfg_thumbColor1->color());
KdenliveSettings::setThumbColor2(m_configColors.kcfg_thumbColor2->color());
emit pCore->window()->getMainTimeline()->controller()->colorsChanged();
emit pCore->window()->getCurrentTimeline()->controller()->colorsChanged();
pCore->getMonitor(Kdenlive::ClipMonitor)->refreshAudioThumbs();
}
......@@ -1250,7 +1250,7 @@ void KdenliveSettingsDialog::updateSettings()
if (m_configTimeline.kcfg_scrollvertically->isChecked() != KdenliveSettings::scrollvertically()) {
KdenliveSettings::setScrollvertically(m_configTimeline.kcfg_scrollvertically->isChecked());
emit pCore->window()->getMainTimeline()->controller()->scrollVerticallyChanged();
emit pCore->window()->getCurrentTimeline()->controller()->scrollVerticallyChanged();
}
// Mimes
......
......@@ -1068,7 +1068,7 @@ void TextBasedEdit::insertToTimeline()
return;
}
for (auto &zone : zones) {
pCore->window()->getMainTimeline()->controller()->insertZone(m_binId, zone, false);
pCore->window()->getCurrentTimeline()->controller()->insertZone(m_binId, zone, false);
}
}
......
This diff is collapsed.
......@@ -125,9 +125,6 @@ public:
/** @brief Returns true if mixer widget is tabbed */
bool isMixedTabbed() const;
/** @brief Returns a ptr to the main timeline widget of the project */
TimelineWidget *getMainTimeline() const;
/** @brief Returns a pointer to the current timeline */
TimelineWidget *getCurrentTimeline() const;
......
......@@ -327,7 +327,7 @@ bool ProjectManager::closeCurrentDocument(bool saveChanges, bool quit)
if (!quit && !qApp->isSavingSession()) {
pCore->bin()->abortOperations();
}
pCore->window()->getMainTimeline()->unsetModel();
pCore->window()->getCurrentTimeline()->unsetModel();
pCore->window()->resetSubtitles();
if (m_mainTimelineModel) {
m_mainTimelineModel->prepareClose();
......@@ -374,7 +374,7 @@ bool ProjectManager::saveFileAs(const QString &outputFileName, bool saveACopy)
}
QUrl url = QUrl::fromLocalFile(outputFileName);
// Save timeline thumbnails
std::unordered_map<QString, std::vector<int>> thumbKeys = pCore->window()->getMainTimeline()->controller()->getThumbKeys();
std::unordered_map<QString, std::vector<int>> thumbKeys = pCore->window()->getCurrentTimeline()->controller()->getThumbKeys();
pCore->projectItemModel()->updateCacheThumbnail(thumbKeys);
// Remove duplicates
for (auto p : thumbKeys) {
......@@ -825,28 +825,28 @@ QString ProjectManager::projectSceneList(const QString &outputFolder, const QStr
{
// Disable multitrack view and overlay
bool isMultiTrack = pCore->monitorManager()->isMultiTrack();
bool hasPreview = pCore->window()->getMainTimeline()->controller()->hasPreviewTrack();
bool hasPreview = pCore->window()->getCurrentTimeline()->controller()->hasPreviewTrack();
bool isTrimming = pCore->monitorManager()->isTrimming();
if (isMultiTrack) {
pCore->window()->getMainTimeline()->controller()->slotMultitrackView(false, false);
pCore->window()->getCurrentTimeline()->controller()->slotMultitrackView(false, false);
}
if (hasPreview) {
pCore->window()->getMainTimeline()->controller()->updatePreviewConnection(false);
pCore->window()->getCurrentTimeline()->controller()->updatePreviewConnection(false);
}
if (isTrimming) {
pCore->window()->getMainTimeline()->controller()->requestEndTrimmingMode();
pCore->window()->getCurrentTimeline()->controller()->requestEndTrimmingMode();
}
pCore->mixer()->pauseMonitoring(true);
QString scene = m_mainTimelineModel->sceneList(outputFolder, QString(), overlayData);
pCore->mixer()->pauseMonitoring(false);
if (isMultiTrack) {
pCore->window()->getMainTimeline()->controller()->slotMultitrackView(true, false);
pCore->window()->getCurrentTimeline()->controller()->slotMultitrackView(true, false);
}
if (hasPreview) {
pCore->window()->getMainTimeline()->controller()->updatePreviewConnection(true);
pCore->window()->getCurrentTimeline()->controller()->updatePreviewConnection(true);
}
if (isTrimming) {
pCore->window()->getMainTimeline()->controller()->requestStartTrimmingMode();
pCore->window()->getCurrentTimeline()->controller()->requestStartTrimmingMode();
}
return scene;
}
......@@ -883,7 +883,7 @@ void ProjectManager::slotAddTextNote(const QString &text)
void ProjectManager::prepareSave()
{
pCore->projectItemModel()->saveDocumentProperties(pCore->window()->getMainTimeline()->controller()->documentProperties(), m_project->metadata(),
pCore->projectItemModel()->saveDocumentProperties(pCore->window()->getCurrentTimeline()->controller()->documentProperties(), m_project->metadata(),
m_project->getGuideModel());
pCore->bin()->saveFolderState();
pCore->projectItemModel()->saveProperty(QStringLiteral("kdenlive:documentnotes"), documentNotes());
......@@ -929,42 +929,42 @@ void ProjectManager::slotDisableTimelineEffects(bool disable)
void ProjectManager::slotSwitchTrackDisabled()
{
pCore->window()->getMainTimeline()->controller()->switchTrackDisabled();
pCore->window()->getCurrentTimeline()->controller()->switchTrackDisabled();
}
void ProjectManager::slotSwitchTrackLock()
{
pCore->window()->getMainTimeline()->controller()->switchTrackLock();
pCore->window()->getCurrentTimeline()->controller()->switchTrackLock();
}
void ProjectManager::slotSwitchTrackActive()
{
pCore->window()->getMainTimeline()->controller()->switchTrackActive();
pCore->window()->getCurrentTimeline()->controller()->switchTrackActive();
}
void ProjectManager::slotSwitchAllTrackActive()
{
pCore->window()->getMainTimeline()->controller()->switchAllTrackActive();
pCore->window()->getCurrentTimeline()->controller()->switchAllTrackActive();
}
void ProjectManager::slotMakeAllTrackActive()
{
pCore->window()->getMainTimeline()->controller()->makeAllTrackActive();
pCore->window()->getCurrentTimeline()->controller()->makeAllTrackActive();
}
void ProjectManager::slotRestoreTargetTracks()
{
pCore->window()->getMainTimeline()->controller()->restoreTargetTracks();
pCore->window()->getCurrentTimeline()->controller()->restoreTargetTracks();
}
void ProjectManager::slotSwitchAllTrackLock()
{
pCore->window()->getMainTimeline()->controller()->switchTrackLock(true);
pCore->window()->getCurrentTimeline()->controller()->switchTrackLock(true);
}
void ProjectManager::slotSwitchTrackTarget()
{
pCore->window()->getMainTimeline()->controller()->switchTargetTrack();
pCore->window()->getCurrentTimeline()->controller()->switchTargetTrack();
}
QString ProjectManager::getDefaultProjectFormat()
......@@ -1033,7 +1033,7 @@ void ProjectManager::slotMoveFinished(KJob *job)
void ProjectManager::requestBackup(const QString &errorMessage)
{
KMessageBox::ButtonCode res = KMessageBox::warningContinueCancel(qApp->activeWindow(), errorMessage);
pCore->window()->getMainTimeline()->loading = false;
pCore->window()->getCurrentTimeline()->loading = false;
m_project->setModified(false);
if (res == KMessageBox::Continue) {
// Try opening backup
......@@ -1062,7 +1062,7 @@ bool ProjectManager::updateTimeline(int pos, const QString &chunks, const QStrin
// Add snap point at project start
m_mainTimelineModel->addSnap(0);
if (pCore->window()) {
pCore->window()->getMainTimeline()->setModel(m_mainTimelineModel, pCore->monitorManager()->projectMonitor()->getControllerProxy());
pCore->window()->getCurrentTimeline()->setModel(m_mainTimelineModel, pCore->monitorManager()->projectMonitor()->getControllerProxy());
}
bool projectErrors = false;
m_project->cleanupTimelinePreview(documentDate);
......@@ -1109,7 +1109,7 @@ void ProjectManager::activateAsset(const QVariantMap &effectData)
if (effectData.contains(QStringLiteral("kdenlive/effect"))) {
pCore->window()->addEffect(effectData.value(QStringLiteral("kdenlive/effect")).toString());
} else {
pCore->window()->getMainTimeline()->controller()->addAsset(effectData);
pCore->window()->getCurrentTimeline()->controller()->addAsset(effectData);
}
}
......@@ -1265,7 +1265,7 @@ void ProjectManager::saveWithUpdatedProfile(const QString &updatedProfile)
int length = Xml::getXmlProperty(e, QStringLiteral("length")).toInt(&ok);
if (ok && length > 0) {
// calculate updated length
Xml::setXmlProperty(e, QStringLiteral("length"), pCore->window()->getMainTimeline()->controller()->framesToClock(length));
Xml::setXmlProperty(e, QStringLiteral("length"), pCore->window()->getCurrentTimeline()->controller()->framesToClock(length));
}
}
if (QFile::exists(convertedFile)) {
......@@ -1299,10 +1299,10 @@ void ProjectManager::saveWithUpdatedProfile(const QString &updatedProfile)
QPair<int, int> ProjectManager::avTracksCount()
{
return pCore->window()->getMainTimeline()->controller()->getAvTracksCount();
return pCore->window()->getCurrentTimeline()->controller()->getAvTracksCount();
}
void ProjectManager::addAudioTracks(int tracksCount)
{
pCore->window()->getMainTimeline()->controller()->addTracks(0, tracksCount);
pCore->window()->getCurrentTimeline()->controller()->addTracks(0, tracksCount);
}
......@@ -532,7 +532,7 @@ void PreviewManager::startPreviewRender()
m_errorLog.clear();
const QString sceneList = m_cacheDir.absoluteFilePath(QStringLiteral("preview.mlt"));
if (!KdenliveSettings::proxypreview() && pCore->currentDoc()->useProxy()) {
const QString playlist = pCore->window()->getMainTimeline()->model()->sceneList(m_cacheDir.absolutePath());
const QString playlist = pCore->window()->getCurrentTimeline()->model()->sceneList(m_cacheDir.absolutePath());
QDomDocument doc;
doc.setContent(playlist);
pCore->currentDoc()->useOriginals(doc);
......@@ -548,7 +548,7 @@ void PreviewManager::startPreviewRender()
return;
}
} else {
pCore->window()->getMainTimeline()->model()->sceneList(m_cacheDir.absolutePath(), sceneList);
pCore->window()->getCurrentTimeline()->model()->sceneList(m_cacheDir.absolutePath(), sceneList);
}
m_previewTimer.stop();
doPreviewRender(sceneList);
......
......@@ -48,14 +48,9 @@ TimelineTabs::~TimelineTabs()
m_mainTimeline->setSource(QUrl());
}
TimelineWidget *TimelineTabs::getMainTimeline() const
{
return m_mainTimeline;
}
TimelineWidget *TimelineTabs::getCurrentTimeline() const
{
return static_cast<TimelineWidget *>(currentWidget());
return m_mainTimeline;
}
void TimelineTabs::connectTimeline(TimelineWidget *timeline)
......
......@@ -33,8 +33,6 @@ public:
/** @brief Construct the tabs as well as the widget for the main timeline */
TimelineTabs(QWidget *parent);
~TimelineTabs() override;
/** @brief Returns a pointer to the main timeline */
TimelineWidget *getMainTimeline() const;
/** @brief Returns a pointer to the current timeline */
TimelineWidget *getCurrentTimeline() const;
......
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