Fix Opening .ui file from "Recent Files" to go to 'Design' mode.

On that occasion, rename Designer to show up as 'Form Editor'
instead of Xml Editor in 'Open With'.

Task-number: QTCREATORBUG-2246
This commit is contained in:
Friedemann Kleint
2010-09-03 08:59:20 +02:00
parent df8fc5a9d1
commit faf34c3ae6
2 changed files with 5 additions and 8 deletions

View File

@@ -1269,13 +1269,10 @@ void MainWindow::aboutToShowRecentFiles()
void MainWindow::openRecentFile()
{
QAction *action = qobject_cast<QAction*>(sender());
if (!action)
return;
QString fileName = action->data().toString();
if (!fileName.isEmpty()) {
if (const QAction *action = qobject_cast<const QAction*>(sender())) {
const QString fileName = action->data().toString();
if (!fileName.isEmpty())
editorManager()->openEditor(fileName);
editorManager()->ensureEditorManagerVisible();
}
}

View File

@@ -39,7 +39,7 @@ const char * const INFO_READ_ONLY = "DesignerXmlEditor.ReadOnly";
const char * const K_DESIGNER_XML_EDITOR_ID = "FormEditor.DesignerXmlEditor";
const char * const C_DESIGNER_XML_EDITOR = "Designer Xml Editor";
const char * const DESIGNER_XML_EDITOR_ID ="DesignerXmlEditor";
const char * const C_DESIGNER_XML_DISPLAY_NAME = QT_TRANSLATE_NOOP("Designer", "Xml Editor");
const char * const C_DESIGNER_XML_DISPLAY_NAME = QT_TRANSLATE_NOOP("Designer", "Form Editor");
const char * const SETTINGS_CATEGORY = "P.Designer";
const char * const SETTINGS_CATEGORY_ICON = ":/core/images/category_design.png";