Skip to content
Snippets Groups Projects
Commit 09c009c9 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Wrapped overly long line

parent 2c25f5ed
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,7 @@ QVariant StatesEditorModel::data(const QModelIndex &index, int role) const ...@@ -79,7 +79,7 @@ QVariant StatesEditorModel::data(const QModelIndex &index, int role) const
break; break;
} }
case StateImageSourceRole: { case StateImageSourceRole: {
if (!m_statesView.isNull()) if (!m_statesView.isNull())
return QString("image://qmldesigner_stateseditor/%1-%2").arg(index.row()).arg(m_updateCounter); return QString("image://qmldesigner_stateseditor/%1-%2").arg(index.row()).arg(m_updateCounter);
break; break;
} }
...@@ -118,7 +118,10 @@ void StatesEditorModel::renameState(int i, const QString &newName) ...@@ -118,7 +118,10 @@ void StatesEditorModel::renameState(int i, const QString &newName)
if (m_stateNames[i] != newName) { if (m_stateNames[i] != newName) {
if (m_stateNames.contains(newName) || newName.isEmpty()) { if (m_stateNames.contains(newName) || newName.isEmpty()) {
QMessageBox::warning(0, tr("Invalid state name"), newName.isEmpty()?tr("The empty string as a name is reserved for the base state."):tr("Name already used in another state")); QMessageBox::warning(0, tr("Invalid state name"),
newName.isEmpty() ?
tr("The empty string as a name is reserved for the base state.") :
tr("Name already used in another state"));
} else { } else {
m_stateNames.replace(i, newName); m_stateNames.replace(i, newName);
m_statesView->renameState(i,newName); m_statesView->renameState(i,newName);
...@@ -132,10 +135,10 @@ void StatesEditorModel::updateState(int i) ...@@ -132,10 +135,10 @@ void StatesEditorModel::updateState(int i)
{ {
Q_ASSERT(i >= 0 && i < m_stateNames.count()); Q_ASSERT(i >= 0 && i < m_stateNames.count());
// QML images with the same URL are always cached, so this changes the URL each // QML images with the same URL are always cached, so this changes the URL each
// time to ensure the image is loaded from the StatesImageProvider and not the // time to ensure the image is loaded from the StatesImageProvider and not the
// cache. // cache.
// TODO: only increase imageId when the scene has changed so that we can load // TODO: only increase imageId when the scene has changed so that we can load
// from the cache instead where possible. // from the cache instead where possible.
if (++m_updateCounter == INT_MAX) if (++m_updateCounter == INT_MAX)
m_updateCounter = 0; m_updateCounter = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment