• R/O
  • HTTP
  • SSH
  • HTTPS

qt-creator-jp: Commit

Qt Creator 日本語化プロジェクトのgitリポジトリです。
git://labs.trolltech.com/creator をcloneして
ひとまず1.0.0-jpブランチを作成して作業していきます。


Commit MetaInfo

Revision9ad4df1382b861ded0c64af623a83292b48bc9ef (tree)
Time2012-04-20 20:17:51
AuthorTobias Hunger <tobias.hunger@noki...>
CommiterTobias Hunger

Log Message

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>

Change Summary

Incremental Difference

--- a/src/plugins/cppeditor/cpptypehierarchy.cpp
+++ b/src/plugins/cppeditor/cpptypehierarchy.cpp
@@ -95,8 +95,8 @@ namespace Internal {
9595 class CppClassLabel : public QLabel
9696 {
9797 public:
98- CppClassLabel(CPPEditorWidget *editor, QWidget *parent)
99- : QLabel(parent), m_editor(editor)
98+ CppClassLabel(QWidget *parent)
99+ : QLabel(parent)
100100 {}
101101
102102 void setup(CppClass *cppClass)
@@ -108,10 +108,15 @@ public:
108108 private:
109109 void mousePressEvent(QMouseEvent *)
110110 {
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);
112118 }
113119
114- CPPEditorWidget *m_editor;
115120 CPPEditorWidget::Link m_link;
116121 };
117122
@@ -133,7 +138,7 @@ CppTypeHierarchyWidget::CppTypeHierarchyWidget(Core::IEditor *editor) :
133138 if (CPPEditor *cppEditor = qobject_cast<CPPEditor *>(editor)) {
134139 m_cppEditor = static_cast<CPPEditorWidget *>(cppEditor->widget());
135140
136- m_inspectedClass = new CppClassLabel(m_cppEditor, this);
141+ m_inspectedClass = new CppClassLabel(this);
137142 m_inspectedClass->setMargin(5);
138143 layout->addWidget(m_inspectedClass);
139144 m_model = new QStandardItemModel(this);
Show on old repository browser