Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

removed unused codes

shun_iwasawa1d1a1187fe13
diff --git a/toonz/sources/include/toonzqt/flipconsoleowner.h b/toonz/sources/include/toonzqt/flipconsoleowner.h
index 97e3546d5..b3eec23a6 100644
--- a/toonz/sources/include/toonzqt/flipconsoleowner.h
+++ b/toonz/sources/include/toonzqt/flipconsoleowner.h
@@ -18,8 +18,6 @@ public:
virtual void onDrawFrame(int frame,
const ImagePainter::VisualSettings &settings) = 0;
- // return true if the frmae is in cache. reimplemented only in Flipbook
- virtual bool isFrameAlreadyCached(int frame) { return true; };
virtual void swapBuffers(){};
virtual void changeSwapBehavior(bool enable){};
};
diff --git a/toonz/sources/toonz/comboviewerpane.cpp b/toonz/sources/toonz/comboviewerpane.cpp
index f85084e95..6349f47d4 100644
--- a/toonz/sources/toonz/comboviewerpane.cpp
+++ b/toonz/sources/toonz/comboviewerpane.cpp
@@ -411,35 +411,12 @@ void ComboViewerPanel::showEvent(QShowEvent *event) {
void ComboViewerPanel::hideEvent(QHideEvent *event) {
StyleShortcutSwitchablePanel::hideEvent(event);
- TApp *app = TApp::instance();
- TFrameHandle *frameHandle = app->getCurrentFrame();
- TSceneHandle *sceneHandle = app->getCurrentScene();
- TXshLevelHandle *levelHandle = app->getCurrentLevel();
- TObjectHandle *objectHandle = app->getCurrentObject();
- TXsheetHandle *xshHandle = app->getCurrentXsheet();
-
- disconnect(xshHandle, SIGNAL(xsheetChanged()), this, SLOT(onSceneChanged()));
-
- disconnect(sceneHandle, SIGNAL(sceneChanged()), this, SLOT(onSceneChanged()));
- disconnect(sceneHandle, SIGNAL(nameSceneChanged()), this,
- SLOT(changeWindowTitle()));
- disconnect(sceneHandle, SIGNAL(sceneSwitched()), this,
- SLOT(onSceneChanged()));
- disconnect(levelHandle, SIGNAL(xshLevelSwitched(TXshLevel *)), this,
- SLOT(onXshLevelSwitched(TXshLevel *)));
- disconnect(levelHandle, SIGNAL(xshLevelChanged()), this,
- SLOT(changeWindowTitle()));
- disconnect(levelHandle, SIGNAL(xshLevelTitleChanged()), this,
- SLOT(changeWindowTitle()));
- disconnect(levelHandle, SIGNAL(xshLevelChanged()), this,
- SLOT(updateFrameRange()));
-
- disconnect(frameHandle, SIGNAL(frameSwitched()), this,
- SLOT(changeWindowTitle()));
- disconnect(frameHandle, SIGNAL(frameSwitched()), this,
- SLOT(onFrameChanged()));
- disconnect(frameHandle, SIGNAL(frameTypeChanged()), this,
- SLOT(onFrameTypeChanged()));
+ TApp *app = TApp::instance();
+ disconnect(app->getCurrentFrame(), 0, this, 0);
+ disconnect(app->getCurrentScene(), 0, this, 0);
+ disconnect(app->getCurrentLevel(), 0, this, 0);
+ disconnect(app->getCurrentObject(), 0, this, 0);
+ disconnect(app->getCurrentXsheet(), 0, this, 0);
disconnect(app->getCurrentTool(), SIGNAL(toolSwitched()), m_sceneViewer,
SLOT(onToolSwitched()));
@@ -737,14 +714,6 @@ void ComboViewerPanel::onSceneChanged() {
int frameIndex = fh->getFrameIndex();
int maxFrameIndex = fh->getMaxFrameIndex();
if (frameIndex > maxFrameIndex) maxFrameIndex = frameIndex;
-
- // set the FPS for new scene
- m_flipConsole->setFrameRate(TApp::instance()
- ->getCurrentScene()
- ->getScene()
- ->getProperties()
- ->getOutputProperties()
- ->getFrameRate());
// update the frame slider's range with new frameHandle
m_flipConsole->setFrameRange(1, maxFrameIndex + 1, 1, frameIndex + 1);
@@ -767,6 +736,13 @@ void ComboViewerPanel::onSceneSwitched() {
enableFlipConsoleForCamerastand(false);
m_sceneViewer->enablePreview(SceneViewer::NO_PREVIEW);
m_flipConsole->setChecked(FlipConsole::eDefineSubCamera, false);
+ // set the FPS for new scene
+ m_flipConsole->setFrameRate(TApp::instance()
+ ->getCurrentScene()
+ ->getScene()
+ ->getProperties()
+ ->getOutputProperties()
+ ->getFrameRate());
m_sceneViewer->setEditPreviewSubcamera(false);
onSceneChanged();
}
@@ -819,16 +795,6 @@ void ComboViewerPanel::onFrameTypeChanged() {
//-----------------------------------------------------------------------------
-bool ComboViewerPanel::isFrameAlreadyCached(int frame) {
- if (m_sceneViewer->isPreviewEnabled()) {
- class Previewer *pr = Previewer::instance();
- return pr->isFrameReady(frame - 1);
- } else
- return true;
-}
-
-//-----------------------------------------------------------------------------
-
void ComboViewerPanel::onPreferenceChanged(const QString &prefName) {
m_flipConsole->onPreferenceChanged(prefName);
StyleShortcutSwitchablePanel::onPreferenceChanged(prefName);
diff --git a/toonz/sources/toonz/comboviewerpane.h b/toonz/sources/toonz/comboviewerpane.h
index 14f26e820..b12bef6fc 100644
--- a/toonz/sources/toonz/comboviewerpane.h
+++ b/toonz/sources/toonz/comboviewerpane.h
@@ -89,9 +89,6 @@ public:
void onDrawFrame(int frame,
const ImagePainter::VisualSettings &settings) override;
- // reimplementation of FlipConsoleOwner::isFrameAlreadyCached
- bool isFrameAlreadyCached(int frame) override;
-
protected:
void showEvent(QShowEvent *) override;
void hideEvent(QHideEvent *) override;
diff --git a/toonz/sources/toonz/viewerpane.cpp b/toonz/sources/toonz/viewerpane.cpp
index 55d882acc..2f28f4bb2 100644
--- a/toonz/sources/toonz/viewerpane.cpp
+++ b/toonz/sources/toonz/viewerpane.cpp
@@ -600,12 +600,6 @@ void SceneViewerPanel::onSceneChanged() {
TApp *app = TApp::instance();
ToonzScene *scene = app->getCurrentScene()->getScene();
assert(scene);
- m_flipConsole->setFrameRate(TApp::instance()
- ->getCurrentScene()
- ->getScene()
- ->getProperties()
- ->getOutputProperties()
- ->getFrameRate());
// vinz: perche veniva fatto?
// m_flipConsole->updateCurrentFPS(scene->getProperties()->getOutputProperties()->getFrameRate());
@@ -623,6 +617,12 @@ void SceneViewerPanel::onSceneSwitched() {
enableFlipConsoleForCamerastand(false);
m_sceneViewer->enablePreview(SceneViewer::NO_PREVIEW);
m_flipConsole->setChecked(FlipConsole::eDefineSubCamera, false);
+ m_flipConsole->setFrameRate(TApp::instance()
+ ->getCurrentScene()
+ ->getScene()
+ ->getProperties()
+ ->getOutputProperties()
+ ->getFrameRate());
m_sceneViewer->setEditPreviewSubcamera(false);
onSceneChanged();
}
@@ -668,16 +668,6 @@ void SceneViewerPanel::onFrameTypeChanged() {
//-----------------------------------------------------------------------------
-bool SceneViewerPanel::isFrameAlreadyCached(int frame) {
- if (m_sceneViewer->isPreviewEnabled()) {
- class Previewer *pr = Previewer::instance();
- return pr->isFrameReady(frame - 1);
- } else
- return true;
-}
-
-//-----------------------------------------------------------------------------
-
void SceneViewerPanel::onPreferenceChanged(const QString &prefName) {
m_flipConsole->onPreferenceChanged(prefName);
StyleShortcutSwitchablePanel::onPreferenceChanged(prefName);
diff --git a/toonz/sources/toonz/viewerpane.h b/toonz/sources/toonz/viewerpane.h
index 62c8af259..327c130e8 100644
--- a/toonz/sources/toonz/viewerpane.h
+++ b/toonz/sources/toonz/viewerpane.h
@@ -60,8 +60,6 @@ public:
bool widgetInThisPanelIsFocused() override {
return m_sceneViewer->hasFocus();
}
- // reimplementation of FlipConsoleOwner::isFrameAlreadyCached
- bool isFrameAlreadyCached(int frame) override;
protected:
void showEvent(QShowEvent *) override;