ProjectExplorer: Fix context menu actions

Disable/Enable them correctly and give them the correct context.

Task-Nr: QTCREATORBUG-3078
This commit is contained in:
dt
2010-11-12 17:25:39 +01:00
parent c0a0c61050
commit 74d641a8d1
4 changed files with 98 additions and 80 deletions

View File

@@ -39,6 +39,8 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icontext.h>
#include <utils/qtcassert.h>
#include <utils/navigationtreeview.h>
@@ -69,7 +71,18 @@ public:
setEditTriggers(QAbstractItemView::EditKeyPressed);
setContextMenuPolicy(Qt::CustomContextMenu);
// setExpandsOnDoubleClick(false);
Core::Context context(Constants::C_PROJECT_TREE);
m_context = new Core::BaseContext(this, context);
Core::ICore::instance()->addContextObject(m_context);
}
~ProjectTreeView()
{
Core::ICore::instance()->removeContextObject(m_context);
delete m_context;
}
private:
Core::BaseContext *m_context;
};
/*!