Fixes to edit format handling.

- Close window after last tab has been removed.
- Remove type name from tab title (results in too-long tab titles
  for templates).

Change-Id: If4b55423261ed4992b8a7e983704006fdda86843
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Friedemann Kleint
2012-12-28 18:52:47 +01:00
committed by hjk
parent 03fd7266ac
commit 7bc0818d7a

View File

@@ -1624,8 +1624,11 @@ void WatchHandler::removeSeparateWidget(QObject *o)
{
const int index = o && o->isWidgetType() && !m_separateWindow.isNull() ?
indexOf(m_separateWindow, static_cast<QWidget *>(o)) : -1;
if (index != -1)
if (index != -1) {
m_separateWindow->removeTab(index);
if (!m_separateWindow->count())
m_separateWindow->hide();
}
}
void WatchHandler::showSeparateWidget(QWidget *w)
@@ -1713,9 +1716,7 @@ void WatchHandler::showEditValue(const WatchData &data)
str = QString::fromLatin1(ba.constData(), ba.size());
else if (data.editformat == DisplayUtf8String)
str = QString::fromUtf8(ba.constData(), ba.size());
t->setWindowTitle(QString::fromLatin1("%1 (%2)").
arg(data.name, data.displayedType.isEmpty() ?
QLatin1String(data.type) : data.displayedType));
t->setWindowTitle(data.name);
t->setText(str);
showSeparateWidget(t);
}