forked from qt-creator/qt-creator
QmlDesigner: Avoid repetitive calls
Change-Id: Id33e46f925c94a970b001e7f34b7deb56224cc97 Reviewed-by: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
caf296500d
commit
88de3bb21d
@@ -90,14 +90,15 @@ ResizeControllerData::ResizeControllerData(const ResizeControllerData &other)
|
|||||||
ResizeControllerData::~ResizeControllerData()
|
ResizeControllerData::~ResizeControllerData()
|
||||||
{
|
{
|
||||||
if (layerItem) {
|
if (layerItem) {
|
||||||
layerItem->scene()->removeItem(topLeftItem.data());
|
QGraphicsScene *scene = layerItem->scene();
|
||||||
layerItem->scene()->removeItem(topRightItem.data());
|
scene->removeItem(topLeftItem.data());
|
||||||
layerItem->scene()->removeItem(bottomLeftItem.data());
|
scene->removeItem(topRightItem.data());
|
||||||
layerItem->scene()->removeItem(bottomRightItem.data());
|
scene->removeItem(bottomLeftItem.data());
|
||||||
layerItem->scene()->removeItem(topItem.data());
|
scene->removeItem(bottomRightItem.data());
|
||||||
layerItem->scene()->removeItem(leftItem.data());
|
scene->removeItem(topItem.data());
|
||||||
layerItem->scene()->removeItem(rightItem.data());
|
scene->removeItem(leftItem.data());
|
||||||
layerItem->scene()->removeItem(bottomItem.data());
|
scene->removeItem(rightItem.data());
|
||||||
|
scene->removeItem(bottomItem.data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -173,15 +173,18 @@ void ShortCutManager::updateActions(Core::IEditor* currentEditor)
|
|||||||
{
|
{
|
||||||
int openedCount = Core::DocumentModel::documentCount();
|
int openedCount = Core::DocumentModel::documentCount();
|
||||||
|
|
||||||
m_saveAction.setEnabled(currentEditor != 0 && currentEditor->document()->isModified());
|
Core::IDocument *document = 0;
|
||||||
m_saveAsAction.setEnabled(currentEditor != 0 && currentEditor->document()->isSaveAsAllowed());
|
if (currentEditor)
|
||||||
m_revertToSavedAction.setEnabled(currentEditor != 0
|
document = currentEditor->document();
|
||||||
&& !currentEditor->document()->filePath().isEmpty()
|
m_saveAction.setEnabled(document && document->isModified());
|
||||||
&& currentEditor->document()->isModified());
|
m_saveAsAction.setEnabled(document && document->isSaveAsAllowed());
|
||||||
|
m_revertToSavedAction.setEnabled(document
|
||||||
|
&& !document->filePath().isEmpty()
|
||||||
|
&& document->isModified());
|
||||||
|
|
||||||
QString quotedName;
|
QString quotedName;
|
||||||
if (currentEditor)
|
if (currentEditor)
|
||||||
quotedName = '"' + currentEditor->document()->displayName() + '"';
|
quotedName = '"' + document->displayName() + '"';
|
||||||
|
|
||||||
m_saveAsAction.setText(tr("Save %1 As...").arg(quotedName));
|
m_saveAsAction.setText(tr("Save %1 As...").arg(quotedName));
|
||||||
m_saveAction.setText(tr("&Save %1").arg(quotedName));
|
m_saveAction.setText(tr("&Save %1").arg(quotedName));
|
||||||
|
|||||||
Reference in New Issue
Block a user