Qt Creator 日本語化プロジェクトのgitリポジトリです。
git://labs.trolltech.com/creator をcloneして
ひとまず1.0.0-jpブランチを作成して作業していきます。
Revision | 9ad4df1382b861ded0c64af623a83292b48bc9ef (tree) |
---|---|
Time | 2012-04-20 20:17:51 |
Author | Tobias Hunger <tobias.hunger@noki...> |
Commiter | Tobias Hunger |
Fix crash in CPP Type Hierarchy
Fix crash happening when closing the editor containing a class that
is viewed in the Type Hierarchy.
Task-number: QTCREATORBUG-7327
Change-Id: I87298b7e0b271b9a5063d48999a37e8a0e78ba48
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Reviewed-by: David Schulz <david.schulz@nokia.com>
@@ -95,8 +95,8 @@ namespace Internal { | ||
95 | 95 | class CppClassLabel : public QLabel |
96 | 96 | { |
97 | 97 | public: |
98 | - CppClassLabel(CPPEditorWidget *editor, QWidget *parent) | |
99 | - : QLabel(parent), m_editor(editor) | |
98 | + CppClassLabel(QWidget *parent) | |
99 | + : QLabel(parent) | |
100 | 100 | {} |
101 | 101 | |
102 | 102 | void setup(CppClass *cppClass) |
@@ -108,10 +108,15 @@ public: | ||
108 | 108 | private: |
109 | 109 | void mousePressEvent(QMouseEvent *) |
110 | 110 | { |
111 | - m_editor->openLink(m_link); | |
111 | + if (m_link.fileName.isEmpty()) | |
112 | + return; | |
113 | + | |
114 | + TextEditor::BaseTextEditorWidget::openEditorAt(m_link.fileName, | |
115 | + m_link.line, | |
116 | + m_link.column, | |
117 | + Constants::CPPEDITOR_ID); | |
112 | 118 | } |
113 | 119 | |
114 | - CPPEditorWidget *m_editor; | |
115 | 120 | CPPEditorWidget::Link m_link; |
116 | 121 | }; |
117 | 122 |
@@ -133,7 +138,7 @@ CppTypeHierarchyWidget::CppTypeHierarchyWidget(Core::IEditor *editor) : | ||
133 | 138 | if (CPPEditor *cppEditor = qobject_cast<CPPEditor *>(editor)) { |
134 | 139 | m_cppEditor = static_cast<CPPEditorWidget *>(cppEditor->widget()); |
135 | 140 | |
136 | - m_inspectedClass = new CppClassLabel(m_cppEditor, this); | |
141 | + m_inspectedClass = new CppClassLabel(this); | |
137 | 142 | m_inspectedClass->setMargin(5); |
138 | 143 | layout->addWidget(m_inspectedClass); |
139 | 144 | m_model = new QStandardItemModel(this); |