void PreviewToggleCommand::disable() { CleanupSettingsModel *model = CleanupSettingsModel::instance(); model->detach(CleanupSettingsModel::LISTENER | CleanupSettingsModel::PREVIEWER); bool ret = true; ret = ret && disconnect(model, SIGNAL(previewDataChanged()), this, SLOT(onPreviewDataChanged())); ret = ret && disconnect(model, SIGNAL(modelChanged(bool)), this, SLOT(onModelChanged(bool))); ret = ret && disconnect(&m_timer, SIGNAL(timeout()), this, SLOT(postProcess())); // Cleanup palette changes all falls under post-processing stuff. And do not // involve the model. TPaletteHandle *ph = TApp::instance()->getPaletteController()->getCurrentCleanupPalette(); ret = ret && disconnect(ph, SIGNAL(colorStyleChanged()), &m_timer, SLOT(start())); ret = ret && disconnect(ph, SIGNAL(paletteChanged()), &m_timer, SLOT(start())); assert(ret); clean(); TApp::instance()->getCurrentLevel()->notifyLevelChange(); }
void CameraTestToggleCommand::disable() { CleanupSettingsModel *model = CleanupSettingsModel::instance(); model->detach(CleanupSettingsModel::LISTENER | CleanupSettingsModel::CAMERATEST); bool ret = true; ret = ret && disconnect(model, SIGNAL(previewDataChanged()), this, SLOT(onPreviewDataChanged())); assert(ret); clean(); TApp::instance()->getCurrentLevel()->notifyLevelChange(); TApp::instance()->getCurrentTool()->setTool( QString::fromStdString(m_oldTool->getName())); m_oldTool = 0; }