Commit 88de3bb2 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

QmlDesigner: Avoid repetitive calls



Change-Id: Id33e46f925c94a970b001e7f34b7deb56224cc97
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent caf29650
......@@ -90,14 +90,15 @@ ResizeControllerData::ResizeControllerData(const ResizeControllerData &other)
ResizeControllerData::~ResizeControllerData()
{
if (layerItem) {
layerItem->scene()->removeItem(topLeftItem.data());
layerItem->scene()->removeItem(topRightItem.data());
layerItem->scene()->removeItem(bottomLeftItem.data());
layerItem->scene()->removeItem(bottomRightItem.data());
layerItem->scene()->removeItem(topItem.data());
layerItem->scene()->removeItem(leftItem.data());
layerItem->scene()->removeItem(rightItem.data());
layerItem->scene()->removeItem(bottomItem.data());
QGraphicsScene *scene = layerItem->scene();
scene->removeItem(topLeftItem.data());
scene->removeItem(topRightItem.data());
scene->removeItem(bottomLeftItem.data());
scene->removeItem(bottomRightItem.data());
scene->removeItem(topItem.data());
scene->removeItem(leftItem.data());
scene->removeItem(rightItem.data());
scene->removeItem(bottomItem.data());
}
}
......
......@@ -173,15 +173,18 @@ void ShortCutManager::updateActions(Core::IEditor* currentEditor)
{
int openedCount = Core::DocumentModel::documentCount();
m_saveAction.setEnabled(currentEditor != 0 && currentEditor->document()->isModified());
m_saveAsAction.setEnabled(currentEditor != 0 && currentEditor->document()->isSaveAsAllowed());
m_revertToSavedAction.setEnabled(currentEditor != 0
&& !currentEditor->document()->filePath().isEmpty()
&& currentEditor->document()->isModified());
Core::IDocument *document = 0;
if (currentEditor)
document = currentEditor->document();
m_saveAction.setEnabled(document && document->isModified());
m_saveAsAction.setEnabled(document && document->isSaveAsAllowed());
m_revertToSavedAction.setEnabled(document
&& !document->filePath().isEmpty()
&& document->isModified());
QString quotedName;
if (currentEditor)
quotedName = '"' + currentEditor->document()->displayName() + '"';
quotedName = '"' + document->displayName() + '"';
m_saveAsAction.setText(tr("Save %1 As...").arg(quotedName));
m_saveAction.setText(tr("&Save %1").arg(quotedName));
......
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