forked from qt-creator/qt-creator
ExternalEditors: Remove direct dependency on qmake
Change-Id: I3f7193c43fcb0b02e3621fc03b08962b534f441e Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -28,11 +28,10 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "externaleditors.h"
|
#include "externaleditors.h"
|
||||||
#include "qmakeproject.h"
|
|
||||||
#include "qmakeprojectmanagerconstants.h"
|
|
||||||
|
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/session.h>
|
#include <projectexplorer/session.h>
|
||||||
@@ -51,15 +50,6 @@ enum { debug = 0 };
|
|||||||
namespace QmakeProjectManager {
|
namespace QmakeProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
// Figure out the qmake project used by the file if any
|
|
||||||
static QmakeProject *qmakeProjectFor(const QString &fileName)
|
|
||||||
{
|
|
||||||
if (ProjectExplorer::Project *baseProject = ProjectExplorer::SessionManager::projectForFile(fileName))
|
|
||||||
if (QmakeProject *project = qobject_cast<QmakeProject*>(baseProject))
|
|
||||||
return project;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------ Messages
|
// ------------ Messages
|
||||||
static inline QString msgStartFailed(const QString &binary, QStringList arguments)
|
static inline QString msgStartFailed(const QString &binary, QStringList arguments)
|
||||||
{
|
{
|
||||||
@@ -138,7 +128,7 @@ bool ExternalQtEditor::getEditorLaunchData(const QString &fileName,
|
|||||||
QString *errorMessage) const
|
QString *errorMessage) const
|
||||||
{
|
{
|
||||||
// Get the binary either from the current Qt version of the project or Path
|
// Get the binary either from the current Qt version of the project or Path
|
||||||
if (const QmakeProject *project = qmakeProjectFor(fileName)) {
|
if (ProjectExplorer::Project *project = ProjectExplorer::SessionManager::projectForFile(fileName)) {
|
||||||
if (const ProjectExplorer::Target *target = project->activeTarget()) {
|
if (const ProjectExplorer::Target *target = project->activeTarget()) {
|
||||||
if (const QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(target->kit())) {
|
if (const QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(target->kit())) {
|
||||||
data->binary = (qtVersion->*commandAccessor)();
|
data->binary = (qtVersion->*commandAccessor)();
|
||||||
|
|||||||
Reference in New Issue
Block a user