Commit 4ca765ed authored by hjk's avatar hjk
Browse files

Fixes: projectexplorer: use QAction::setData instead of a helper map

RevBy:    ossi
parent 6594529f
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
#include <coreplugin/iversioncontrol.h> #include <coreplugin/iversioncontrol.h>
#include <coreplugin/vcsmanager.h> #include <coreplugin/vcsmanager.h>
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <utils/listutils.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QtCore/QtPlugin> #include <QtCore/QtPlugin>
...@@ -1493,7 +1492,6 @@ void ProjectExplorerPlugin::updateRecentProjectMenu() ...@@ -1493,7 +1492,6 @@ void ProjectExplorerPlugin::updateRecentProjectMenu()
Core::ICore::instance()->actionManager()->actionContainer(Constants::M_RECENTPROJECTS); Core::ICore::instance()->actionManager()->actionContainer(Constants::M_RECENTPROJECTS);
QMenu *menu = aci->menu(); QMenu *menu = aci->menu();
menu->clear(); menu->clear();
m_recentProjectsActions.clear();
menu->setEnabled(!m_recentProjects.isEmpty()); menu->setEnabled(!m_recentProjects.isEmpty());
...@@ -1502,7 +1500,7 @@ void ProjectExplorerPlugin::updateRecentProjectMenu() ...@@ -1502,7 +1500,7 @@ void ProjectExplorerPlugin::updateRecentProjectMenu()
if (s.endsWith(".qws")) if (s.endsWith(".qws"))
continue; continue;
QAction *action = menu->addAction(s); QAction *action = menu->addAction(s);
m_recentProjectsActions.insert(action, s); action->setData(s);
connect(action, SIGNAL(triggered()), this, SLOT(openRecentProject())); connect(action, SIGNAL(triggered()), this, SLOT(openRecentProject()));
} }
} }
...@@ -1513,10 +1511,11 @@ void ProjectExplorerPlugin::openRecentProject() ...@@ -1513,10 +1511,11 @@ void ProjectExplorerPlugin::openRecentProject()
qDebug() << "ProjectExplorerPlugin::openRecentProject()"; qDebug() << "ProjectExplorerPlugin::openRecentProject()";
QAction *a = qobject_cast<QAction*>(sender()); QAction *a = qobject_cast<QAction*>(sender());
if (m_recentProjectsActions.contains(a)) { if (!a)
const QString fileName = m_recentProjectsActions.value(a); return;
QString fileName = a->data().toString();
if (!fileName.isEmpty())
openProject(fileName); openProject(fileName);
}
} }
void ProjectExplorerPlugin::invalidateProject(Project *project) void ProjectExplorerPlugin::invalidateProject(Project *project)
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include <coreplugin/icorelistener.h> #include <coreplugin/icorelistener.h>
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QMap>
#include <QtCore/QSharedPointer> #include <QtCore/QSharedPointer>
#include <QtCore/QList> #include <QtCore/QList>
#include <QtCore/QQueue> #include <QtCore/QQueue>
...@@ -248,7 +247,6 @@ private: ...@@ -248,7 +247,6 @@ private:
QStringList m_recentProjects; QStringList m_recentProjects;
static const int m_maxRecentProjects = 7; static const int m_maxRecentProjects = 7;
QMap<QAction*, QString> m_recentProjectsActions;
QString m_lastOpenDirectory; QString m_lastOpenDirectory;
QSharedPointer<RunConfiguration> m_delayedRunConfiguration; QSharedPointer<RunConfiguration> m_delayedRunConfiguration;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment