Commit e9a1a0d4 authored by Nicolas Carion's avatar Nicolas Carion

Switch to managed pointer for undostack and split it in separate file

parent 38f932a7
......@@ -34,6 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "project/jobs/jobmanager.h"
#include "monitor/monitor.h"
#include "doc/kdenlivedoc.h"
#include "doc/docundostack.hpp"
#include "dialogs/clipcreationdialog.h"
#include "ui_qtextclip_ui.h"
#include "titler/titlewidget.h"
......
......@@ -64,7 +64,7 @@ class InvalidDialog;
namespace Mlt
{
class Producer;
};
}
class MyListView: public QListView
{
......@@ -170,7 +170,7 @@ public:
double factor = (double) opt.decorationSize.height() / r1.height();
int decoWidth = 2 * textMargin;
int mid = 0;
if (factor != 0) {
if (qAbs(factor) < 1e-4) {
decoWidth += opt.decorationSize.width() / factor;
}
if (type == AbstractProjectItem::ClipItem || type == AbstractProjectItem::SubClipItem) {
......@@ -241,7 +241,7 @@ public:
if (type == AbstractProjectItem::ClipItem || type == AbstractProjectItem::SubClipItem) {
double factor = (double) opt.decorationSize.height() / r1.height();
int decoWidth = 2 * textMargin;
if (factor != 0) {
if (qAbs(factor) < 1e-4) {
r.setWidth(opt.decorationSize.width() / factor);
// Draw thumbnail
opt.icon.paint(painter, r);
......@@ -316,7 +316,7 @@ public:
// Folder or Folder Up items
double factor = (double) opt.decorationSize.height() / r1.height();
int decoWidth = 2 * textMargin;
if (factor != 0) {
if (qAbs(factor) < 1e-4) {
r.setWidth(opt.decorationSize.width() / factor);
// Draw thumbnail
opt.icon.paint(painter, r);
......
......@@ -42,7 +42,7 @@ namespace Mlt
{
class Producer;
class Properties;
};
}
/**
* @class ProjectClip
......
......@@ -31,7 +31,7 @@ class QDomElement;
namespace Mlt
{
};
}
/**
* @class ProjectSubClip
......
......@@ -19,6 +19,8 @@ the Free Software Foundation, either version 3 of the License, or
#include <QCoreApplication>
#include "kdenlive_debug.h"
#include "timeline2/view/timelinewidget.h"
#include "doc/kdenlivedoc.h"
#include "doc/docundostack.hpp"
#include <locale>
#ifdef Q_OS_MAC
......@@ -81,7 +83,7 @@ void Core::initialize()
//TODO
/*connect(m_producerQueue, SIGNAL(removeInvalidProxy(QString,bool)), m_binWidget, SLOT(slotRemoveInvalidProxy(QString,bool)));*/
m_timelineWidget = new TimelineWidget(m_mainWindow);
m_timelineWidget = new TimelineWidget(m_projectManager->current()->commandStack(), m_mainWindow);
emit coreIsReady();
}
......
......@@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "clipcreationdialog.h"
#include "kdenlivesettings.h"
#include "doc/kdenlivedoc.h"
#include "doc/docundostack.hpp"
#include "bin/bin.h"
#include "bin/bincommands.h"
#include "bin/projectclip.h"
......
......@@ -49,7 +49,7 @@ void createClipsCommand(KdenliveDoc *doc, const QList<QUrl> &urls, const QString
void createClipsCommand(Bin *bin, const QDomElement &producer, const QString &id, QUndoCommand *command);
void createClipsCommand(KdenliveDoc *doc, const QStringList &groupInfo, Bin *bin);
void addXmlProperties(QDomElement &producer, QMap<QString, QString> &properties);
};
}
#endif
......@@ -3,5 +3,6 @@ set(kdenlive_SRCS
doc/documentchecker.cpp
doc/documentvalidator.cpp
doc/kdenlivedoc.cpp
doc/docundostack.cpp
PARENT_SCOPE)
/***************************************************************************
* Copyright (C) 2017 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "docundostack.hpp"
#include <QUndoGroup>
#include <QUndoCommand>
DocUndoStack::DocUndoStack(QUndoGroup *parent) : QUndoStack(parent)
{
}
//TODO: custom undostack everywhere do that
void DocUndoStack::push(QUndoCommand *cmd)
{
if (index() < count()) {
emit invalidate();
}
QUndoStack::push(cmd);
}
/***************************************************************************
* Copyright (C) 2017 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <QUndoCommand>
class QUndoGroup;
class QUndoCommand;
class DocUndoStack: public QUndoStack
{
Q_OBJECT
public:
explicit DocUndoStack(QUndoGroup *parent = Q_NULLPTR);
void push(QUndoCommand *cmd);
signals:
void invalidate();
};
......@@ -35,6 +35,7 @@
#include "project/notesplugin.h"
#include "project/dialogs/noteswidget.h"
#include "core.h"
#include "docundostack.hpp"
#include "bin/bin.h"
#include "bin/projectclip.h"
#include "utils/KoIconUtils.h"
......@@ -67,19 +68,6 @@
#include <xlocale.h>
#endif
DocUndoStack::DocUndoStack(QUndoGroup *parent) : QUndoStack(parent)
{
}
//TODO: custom undostack everywhere do that
void DocUndoStack::push(QUndoCommand *cmd)
{
if (index() < count()) {
emit invalidate();
}
QUndoStack::push(cmd);
}
const double DOCUMENTVERSION = 0.95;
KdenliveDoc::KdenliveDoc(const QUrl &url, const QString &projectFolder, QUndoGroup *undoGroup, const QString &profileName, const QMap<QString, QString> &properties, const QMap<QString, QString> &metadata, const QPoint &tracks, Render *render, NotesPlugin *notes, bool *openBackup, MainWindow *parent) :
......@@ -94,7 +82,7 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, const QString &projectFolder, QUndoGro
m_projectFolder(projectFolder)
{
// init m_profile struct
m_commandStack = new DocUndoStack(undoGroup);
m_commandStack = std::make_shared<DocUndoStack>(undoGroup);
m_profile.frame_rate_num = 0;
m_profile.frame_rate_den = 0;
m_profile.width = 0;
......@@ -109,8 +97,8 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, const QString &projectFolder, QUndoGro
connect(m_clipManager, SIGNAL(displayMessage(QString, int)), parent, SLOT(slotGotProgressInfo(QString, int)));
connect(this, SIGNAL(updateCompositionMode(int)), parent, SLOT(slotUpdateCompositeAction(int)));
bool success = false;
connect(m_commandStack, &QUndoStack::indexChanged, this, &KdenliveDoc::slotModified);
connect(m_commandStack, &DocUndoStack::invalidate, this, &KdenliveDoc::checkPreviewStack);
connect(m_commandStack.get(), &QUndoStack::indexChanged, this, &KdenliveDoc::slotModified);
connect(m_commandStack.get(), &DocUndoStack::invalidate, this, &KdenliveDoc::checkPreviewStack);
connect(m_render, &Render::setDocumentNotes, this, &KdenliveDoc::slotSetDocumentNotes);
connect(pCore->producerQueue(), &ProducerQueue::switchProfile, this, &KdenliveDoc::switchProfile);
//connect(m_commandStack, SIGNAL(cleanChanged(bool)), this, SLOT(setModified(bool)));
......@@ -302,7 +290,6 @@ KdenliveDoc::~KdenliveDoc()
}
}
}
delete m_commandStack;
//qCDebug(KDENLIVE_LOG) << "// DEL CLP MAN";
delete m_clipManager;
//qCDebug(KDENLIVE_LOG) << "// DEL CLP MAN done";
......@@ -826,7 +813,7 @@ double KdenliveDoc::dar() const
return (double) m_profile.display_aspect_num / m_profile.display_aspect_den;
}
DocUndoStack *KdenliveDoc::commandStack()
std::shared_ptr<DocUndoStack> KdenliveDoc::commandStack()
{
return m_commandStack;
}
......@@ -1521,7 +1508,7 @@ void KdenliveDoc::updateProjectProfile(bool reloadProducers)
return;
}
emit updateFps(fpsChanged);
if (fpsChanged != 1.0) {
if (qAbs(fpsChanged - 1.0) < 1e-4) {
pCore->bin()->reloadAllProducers();
}
}
......@@ -1612,17 +1599,17 @@ void KdenliveDoc::switchProfile(MltVideoProfile profile, const QString &id, cons
profile.frame_rate_den = 1;
} else {
// Check for 23.98, 29.97, 59.94
if (fps_int == 23.0) {
if (qAbs(fps_int - 23.0) < 1e-5) {
if (qAbs(fps - 23.98) < 0.01) {
profile.frame_rate_num = 24000;
profile.frame_rate_den = 1001;
}
} else if (fps_int == 29.0) {
} else if (qAbs(fps_int - 29.0) < 1e-5) {
if (qAbs(fps - 29.97) < 0.01) {
profile.frame_rate_num = 30000;
profile.frame_rate_den = 1001;
}
} else if (fps_int == 59.0) {
} else if (qAbs(fps_int - 59.0) < 1e-5) {
if (qAbs(fps - 59.94) < 0.01) {
profile.frame_rate_num = 60000;
profile.frame_rate_den = 1001;
......@@ -1632,7 +1619,7 @@ void KdenliveDoc::switchProfile(MltVideoProfile profile, const QString &id, cons
adjustMessage = i18n("\nWarning: unknown non integer fps, might cause incorrect duration display.");
}
}
if ((double)profile.frame_rate_num / profile.frame_rate_den != fps) {
if (qAbs((double)profile.frame_rate_num / profile.frame_rate_den - fps) < 1e-4) {
adjustMessage = i18n("\nProfile fps adjusted from original %1", QString::number(fps, 'f', 4));
}
if (KMessageBox::warningContinueCancel(QApplication::activeWindow(), i18n("No profile found for your clip.\nCreate and switch to new profile (%1x%2, %3fps)?%4", profile.width, profile.height, QString::number((double)profile.frame_rate_num / profile.frame_rate_den, 'f', 2), adjustMessage)) == KMessageBox::Continue) {
......
......@@ -25,6 +25,7 @@
#ifndef KDENLIVEDOC_H
#define KDENLIVEDOC_H
#include <memory>
#include <QtXml/qdom.h>
#include <QMap>
#include <QList>
......@@ -35,7 +36,6 @@
#include <kautosavefile.h>
#include <KDirWatch>
#include <QUndoStack>
#include "gentime.h"
#include "timecode.h"
......@@ -54,23 +54,14 @@ class ClipController;
class QTextEdit;
class QUndoGroup;
class QTimer;
class QUndoGroup;
class QUndoCommand;
class DocUndoStack;
namespace Mlt
{
class Profile;
}
class DocUndoStack: public QUndoStack
{
Q_OBJECT
public:
explicit DocUndoStack(QUndoGroup *parent = Q_NULLPTR);
void push(QUndoCommand *cmd);
signals:
void invalidate();
};
class KdenliveDoc: public QObject
{
Q_OBJECT
......@@ -86,7 +77,7 @@ public:
KAutoSaveFile *m_autosave;
Timecode timecode() const;
QDomDocument toXml();
DocUndoStack *commandStack();
std::shared_ptr<DocUndoStack> commandStack();
Render *renderer();
ClipManager *clipManager();
QString groupsXml() const;
......@@ -192,7 +183,7 @@ private:
Timecode m_timecode;
Render *m_render;
QTextEdit *m_notesWidget;
DocUndoStack *m_commandStack;
std::shared_ptr<DocUndoStack> m_commandStack;
ClipManager *m_clipManager;
MltVideoProfile m_profile;
QString m_searchFolder;
......
......@@ -43,6 +43,6 @@ QImage getFrame(Mlt::Frame *frame, int width, int height);
* @return an integer between 0 and 100. 0 means no variance, eg. black image while bigger values mean contrasted image
* */
uint imageVariance(const QImage &image);
};
}
#endif
......@@ -35,6 +35,7 @@
#include "monitor/recmonitor.h"
#include "monitor/monitormanager.h"
#include "doc/kdenlivedoc.h"
#include "doc/docundostack.hpp"
#include "timeline/timeline.h"
#include "timeline/track.h"
#include "timeline/customtrackview.h"
......@@ -2025,7 +2026,7 @@ void MainWindow::connectDocument()
m_renderWidget->setRenderProfile(project->getRenderProperties());
}
m_zoomSlider->setValue(project->zoom().x());
m_commandStack->setActiveStack(project->commandStack());
m_commandStack->setActiveStack(project->commandStack().get());
KdenliveSettings::setProject_display_ratio(project->dar());
setWindowTitle(project->description());
......
......@@ -23,6 +23,7 @@
#include "doc/kthumb.h"
#include "bin/bincommands.h"
#include "doc/kdenlivedoc.h"
#include "doc/docundostack.hpp"
#include "project/projectmanager.h"
#include "timeline/abstractclipitem.h"
#include "timeline/abstractgroupitem.h"
......@@ -251,7 +252,7 @@ void ClipManager::slotAddTextTemplateClip(const QString &titleName, const QUrl &
doc.appendChild(prod);
prod.setAttribute(QStringLiteral("name"), titleName);
prod.setAttribute(QStringLiteral("resource"), path.toLocalFile());
uint id = pCore->bin()->getFreeClipId();
int id = pCore->bin()->getFreeClipId();
prod.setAttribute(QStringLiteral("id"), QString::number(id));
if (!group.isEmpty()) {
prod.setAttribute(QStringLiteral("groupname"), group);
......
......@@ -17,6 +17,7 @@ the Free Software Foundation, either version 3 of the License, or
#include "kdenlivesettings.h"
#include "monitor/monitormanager.h"
#include "doc/kdenlivedoc.h"
#include "doc/docundostack.hpp"
#include "timeline/timeline.h"
#include "project/dialogs/projectsettings.h"
#include "timeline/customtrackview.h"
......
......@@ -21,6 +21,7 @@
#include "timeline.h"
#include "track.h"
#include "clipitem.h"
#include "doc/docundostack.hpp"
#include "timelinecommands.h"
#include "transition.h"
#include "markerdialog.h"
......
......@@ -451,7 +451,7 @@ private:
OperationType m_moveOpMode;
AbstractClipItem *m_dragItem;
Guide *m_dragGuide;
DocUndoStack *m_commandStack;
std::shared_ptr<DocUndoStack> m_commandStack;
QGraphicsItem *m_visualTip;
QGraphicsItemAnimation *m_keyProperties;
QTimeLine *m_keyPropertiesTimer;
......
......@@ -19,8 +19,9 @@
#include "abstracttoolmanager.h"
#include "timeline/customtrackview.h"
#include "doc/docundostack.hpp"
AbstractToolManager::AbstractToolManager(ToolManagerType type, CustomTrackView *view, DocUndoStack *commandStack) : QObject()
AbstractToolManager::AbstractToolManager(ToolManagerType type, CustomTrackView *view, std::shared_ptr<DocUndoStack> commandStack) : QObject()
, m_managerType(type)
, m_view(view)
, m_commandStack(commandStack)
......
......@@ -27,6 +27,7 @@
#include "definitions.h"
#include <QObject>
#include <memory>
class CustomTrackView;
class DocUndoStack;
......@@ -46,7 +47,7 @@ public:
SelectType,
GuideType
};
explicit AbstractToolManager(ToolManagerType type, CustomTrackView *view, DocUndoStack *commandStack = Q_NULLPTR);
explicit AbstractToolManager(ToolManagerType type, CustomTrackView *view, std::shared_ptr<DocUndoStack> commandStack);
virtual bool mousePress(QMouseEvent *event, const ItemInfo &info = ItemInfo(), const QList<QGraphicsItem *> &list = QList<QGraphicsItem *>()) = 0;
virtual bool mouseMove(QMouseEvent *event, int pos = 0, int track = -1);
virtual void mouseRelease(QMouseEvent *event, GenTime pos = GenTime()) = 0;
......@@ -66,7 +67,7 @@ public slots:
protected:
ToolManagerType m_managerType;
CustomTrackView *m_view;
DocUndoStack *m_commandStack;
std::shared_ptr<DocUndoStack> m_commandStack;
};
#endif
......@@ -21,11 +21,12 @@
#include "timeline/customtrackview.h"
#include "timeline/timelinecommands.h"
#include "timeline/abstractclipitem.h"
#include "doc/docundostack.hpp"
#include <QMouseEvent>
#include <QGraphicsItem>
GuideManager::GuideManager(CustomTrackView *view, DocUndoStack *commandStack) : AbstractToolManager(GuideType, view, commandStack)
GuideManager::GuideManager(CustomTrackView *view, std::shared_ptr<DocUndoStack> commandStack) : AbstractToolManager(GuideType, view, commandStack)
, m_dragGuide(nullptr)
{
}
......
......@@ -26,6 +26,7 @@ class QGraphicsItem;
class QMouseEvent;
class CustomTrackView;
class Guide;
class DocUndoStack;
/**
* @namespace GuideManager
......@@ -37,7 +38,7 @@ class GuideManager : public AbstractToolManager
Q_OBJECT
public:
explicit GuideManager(CustomTrackView *view, DocUndoStack *commandStack = Q_NULLPTR);
explicit GuideManager(CustomTrackView *view, std::shared_ptr<DocUndoStack> commandStack);
bool mousePress(QMouseEvent *event, const ItemInfo &info = ItemInfo(), const QList<QGraphicsItem *> &list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
void mouseRelease(QMouseEvent *event, GenTime pos = GenTime()) Q_DECL_OVERRIDE;
bool mouseMove(QMouseEvent *event, int pos, int) Q_DECL_OVERRIDE;
......
......@@ -25,13 +25,14 @@
#include "timeline/timelinecommands.h"
#include "timeline/abstractgroupitem.h"
#include "timeline/transitionhandler.h"
#include "doc/docundostack.hpp"
#include <KLocalizedString>
#include <QScrollBar>
#include <QFontMetrics>
#include <QApplication>
MoveManager::MoveManager(TransitionHandler *handler, CustomTrackView *view, DocUndoStack *commandStack) : AbstractToolManager(MoveType, view, commandStack)
MoveManager::MoveManager(TransitionHandler *handler, CustomTrackView *view, std::shared_ptr<DocUndoStack> commandStack) : AbstractToolManager(MoveType, view, commandStack)
, m_transitionHandler(handler)
, m_scrollOffset(0)
, m_scrollTrigger(QFontMetrics(view->font()).averageCharWidth() * 3)
......
......@@ -37,7 +37,7 @@ class MoveManager : public AbstractToolManager
Q_OBJECT
public:
explicit MoveManager(TransitionHandler *handler, CustomTrackView *view, DocUndoStack *commandStack = Q_NULLPTR);
explicit MoveManager(TransitionHandler *handler, CustomTrackView *view, std::shared_ptr<DocUndoStack> commandStack);
bool mousePress(QMouseEvent *event, const ItemInfo &info = ItemInfo(), const QList<QGraphicsItem *> &list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
void mouseRelease(QMouseEvent *event, GenTime pos = GenTime()) Q_DECL_OVERRIDE;
bool mouseMove(QMouseEvent *event, int pos, int) Q_DECL_OVERRIDE;
......
......@@ -21,6 +21,7 @@
#include "../customruler.h"
#include "kdenlivesettings.h"
#include "doc/kdenlivedoc.h"
#include "doc/docundostack.hpp"
#include <KLocalizedString>
#include <QtConcurrent>
......
......@@ -24,6 +24,7 @@
#include "timeline/abstractgroupitem.h"
#include "timeline/timelinecommands.h"
#include "utils/KoIconUtils.h"
#include "doc/docundostack.hpp"
#include <QMouseEvent>
#include <QIcon>
......@@ -31,7 +32,7 @@
#include <QGraphicsLineItem>
#include <klocalizedstring.h>
RazorManager::RazorManager(CustomTrackView *view, DocUndoStack *commandStack) : AbstractToolManager(RazorType, view, commandStack)
RazorManager::RazorManager(CustomTrackView *view, std::shared_ptr<DocUndoStack> commandStack) : AbstractToolManager(RazorType, view, commandStack)
, m_cutLine(nullptr)
{
QIcon razorIcon = KoIconUtils::themedIcon(QStringLiteral("edit-cut"));
......
......@@ -39,7 +39,7 @@ class RazorManager : public AbstractToolManager
Q_OBJECT
public:
explicit RazorManager(CustomTrackView *view, DocUndoStack *commandStack = Q_NULLPTR);
explicit RazorManager(CustomTrackView *view, std::shared_ptr<DocUndoStack> commandStack);
bool mousePress(QMouseEvent *event, const ItemInfo &info = ItemInfo(), const QList<QGraphicsItem *> &list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
bool mouseMove(QMouseEvent *event, int pos = 0, int track = -1) Q_DECL_OVERRIDE;
void mouseRelease(QMouseEvent *event, GenTime pos = GenTime()) Q_DECL_OVERRIDE;
......
......@@ -24,10 +24,11 @@
#include "timeline/transition.h"
#include "timeline/timelinecommands.h"
#include "timeline/abstractgroupitem.h"
#include "doc/docundostack.hpp"
#include <KLocalizedString>
ResizeManager::ResizeManager(CustomTrackView *view, DocUndoStack *commandStack) : AbstractToolManager(ResizeType, view, commandStack)
ResizeManager::ResizeManager(CustomTrackView *view, std::shared_ptr<DocUndoStack> commandStack) : AbstractToolManager(ResizeType, view, commandStack)
{
}
......
......@@ -32,7 +32,7 @@ class ResizeManager : public AbstractToolManager
Q_OBJECT
public:
explicit ResizeManager(CustomTrackView *view, DocUndoStack *commandStack = Q_NULLPTR);
explicit ResizeManager(CustomTrackView *view, std::shared_ptr<DocUndoStack> commandStack);
bool mousePress(QMouseEvent *event, const ItemInfo &info = ItemInfo(), const QList<QGraphicsItem *> &list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
bool mouseMove(QMouseEvent *event, int pos = 0, int track = -1) Q_DECL_OVERRIDE;
void mouseRelease(QMouseEvent *event, GenTime pos = GenTime()) Q_DECL_OVERRIDE;
......
......@@ -24,6 +24,7 @@
#include "kdenlivesettings.h"
#include "mainwindow.h"
#include "timeline/timelinecommands.h"
#include "doc/docundostack.hpp"
#include <KLocalizedString>
#include <QGraphicsItem>
......@@ -32,7 +33,7 @@
#include "klocalizedstring.h"
SelectManager::SelectManager(CustomTrackView *view, DocUndoStack *commandStack) : AbstractToolManager(SelectType, view, commandStack)
SelectManager::SelectManager(CustomTrackView *view, std::shared_ptr<DocUndoStack> commandStack) : AbstractToolManager(SelectType, view, commandStack)
, m_dragMoved(false)
{
}
......
......@@ -37,7 +37,7 @@ class SelectManager : public AbstractToolManager
Q_OBJECT
public:
explicit SelectManager(CustomTrackView *view, DocUndoStack *commandStack = Q_NULLPTR);
explicit SelectManager(CustomTrackView *view, std::shared_ptr<DocUndoStack> commandStack);
bool mousePress(QMouseEvent *event, const ItemInfo &info = ItemInfo(), const QList<QGraphicsItem *> &list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
void mouseRelease(QMouseEvent *event, GenTime pos = GenTime()) Q_DECL_OVERRIDE;
bool mouseMove(QMouseEvent *event, int pos, int) Q_DECL_OVERRIDE;
......
......@@ -25,7 +25,7 @@
#include <QGraphicsItem>
#include <QApplication>
SpacerManager::SpacerManager(CustomTrackView *view, DocUndoStack *commandStack) : AbstractToolManager(SpacerType, view, commandStack)
SpacerManager::SpacerManager(CustomTrackView *view, std::shared_ptr<DocUndoStack> commandStack) : AbstractToolManager(SpacerType, view, commandStack)
, m_track(0)
, m_dragMoved(false)
{
......
......@@ -32,7 +32,7 @@ class SpacerManager : public AbstractToolManager
Q_OBJECT
public:
explicit SpacerManager(CustomTrackView *view, DocUndoStack *commandStack = Q_NULLPTR);
explicit SpacerManager(CustomTrackView *view, std::shared_ptr<DocUndoStack> commandStack);
bool mousePress(QMouseEvent *event, const ItemInfo &info = ItemInfo(), const QList<QGraphicsItem *> &list = QList<QGraphicsItem *>()) Q_DECL_OVERRIDE;
bool mouseMove(QMouseEvent *event, int pos = 0, int track = -1) Q_DECL_OVERRIDE;
void mouseRelease(QMouseEvent *event, GenTime pos = GenTime()) Q_DECL_OVERRIDE;
......
......@@ -21,13 +21,14 @@
#include "kdenlivesettings.h"
#include "timeline/customtrackview.h"
#include "timeline/clipitem.h"
#include "doc/docundostack.hpp"
#include "renderer.h"
#include <KLocalizedString>
#include <QStandardPaths>
#include <mlt++/MltPlaylist.h>