forked from qt-creator/qt-creator
Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include "cmakestep.h"
|
||||
#include "makestep.h"
|
||||
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <cpptools/cppmodelmanagerinterface.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -103,7 +104,7 @@ void CMakeProject::parseCMakeLists()
|
||||
} else {
|
||||
// TODO hmm?
|
||||
}
|
||||
if (newToolChain == m_toolChain) {
|
||||
if (ProjectExplorer::ToolChain::equals(newToolChain, m_toolChain)) {
|
||||
delete newToolChain;
|
||||
newToolChain = 0;
|
||||
} else {
|
||||
@@ -158,6 +159,21 @@ void CMakeProject::parseCMakeLists()
|
||||
}
|
||||
}
|
||||
|
||||
QString CMakeProject::buildParser(const QString &buildConfiguration) const
|
||||
{
|
||||
if (!m_toolChain)
|
||||
return QString::null;
|
||||
if (m_toolChain->type() == ProjectExplorer::ToolChain::GCC
|
||||
|| m_toolChain->type() == ProjectExplorer::ToolChain::LinuxICC
|
||||
|| m_toolChain->type() == ProjectExplorer::ToolChain::MinGW) {
|
||||
return ProjectExplorer::Constants::BUILD_PARSER_GCC;
|
||||
} else if (m_toolChain->type() == ProjectExplorer::ToolChain::MSVC
|
||||
|| m_toolChain->type() == ProjectExplorer::ToolChain::WINCE) {
|
||||
return ProjectExplorer::Constants::BUILD_PARSER_MSVC;
|
||||
}
|
||||
return QString::null;
|
||||
}
|
||||
|
||||
QStringList CMakeProject::targets() const
|
||||
{
|
||||
QStringList results;
|
||||
|
@@ -105,6 +105,7 @@ public:
|
||||
MakeStep *makeStep() const;
|
||||
CMakeStep *cmakeStep() const;
|
||||
QStringList targets() const;
|
||||
QString buildParser(const QString &buildConfiguration) const;
|
||||
|
||||
private:
|
||||
void parseCMakeLists();
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#include "makestep.h"
|
||||
#include "cmakeprojectconstants.h"
|
||||
#include "cmakeproject.h"
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <QtGui/QFormLayout>
|
||||
@@ -42,6 +43,11 @@
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QListWidget>
|
||||
|
||||
namespace {
|
||||
bool debug = false;
|
||||
}
|
||||
|
||||
|
||||
using namespace CMakeProjectManager;
|
||||
using namespace CMakeProjectManager::Internal;
|
||||
|
||||
@@ -52,10 +58,42 @@ MakeStep::MakeStep(CMakeProject *pro)
|
||||
|
||||
MakeStep::~MakeStep()
|
||||
{
|
||||
delete m_buildParser;
|
||||
m_buildParser = 0;
|
||||
}
|
||||
|
||||
bool MakeStep::init(const QString &buildConfiguration)
|
||||
{
|
||||
// TODO figure out the correct build parser
|
||||
delete m_buildParser;
|
||||
m_buildParser = 0;
|
||||
QString buildParser = m_pro->buildParser(buildConfiguration);
|
||||
QList<ProjectExplorer::IBuildParserFactory *> buildParserFactories =
|
||||
ExtensionSystem::PluginManager::instance()->getObjects<ProjectExplorer::IBuildParserFactory>();
|
||||
|
||||
foreach (ProjectExplorer::IBuildParserFactory * factory, buildParserFactories)
|
||||
if (factory->canCreate(buildParser)) {
|
||||
m_buildParser = factory->create(buildParser);
|
||||
break;
|
||||
}
|
||||
if (m_buildParser) {
|
||||
connect(m_buildParser, SIGNAL(addToOutputWindow(const QString &)),
|
||||
this, SIGNAL(addToOutputWindow(const QString &)),
|
||||
Qt::DirectConnection);
|
||||
connect(m_buildParser, SIGNAL(addToTaskWindow(const QString &, int, int, const QString &)),
|
||||
this, SLOT(slotAddToTaskWindow(const QString &, int, int, const QString &)),
|
||||
Qt::DirectConnection);
|
||||
connect(m_buildParser, SIGNAL(enterDirectory(const QString &)),
|
||||
this, SLOT(addDirectory(const QString &)),
|
||||
Qt::DirectConnection);
|
||||
connect(m_buildParser, SIGNAL(leaveDirectory(const QString &)),
|
||||
this, SLOT(removeDirectory(const QString &)),
|
||||
Qt::DirectConnection);
|
||||
}
|
||||
|
||||
m_openDirectories.clear();
|
||||
addDirectory(m_pro->buildDirectory(buildConfiguration));
|
||||
|
||||
setEnabled(buildConfiguration, true);
|
||||
setWorkingDirectory(buildConfiguration, m_pro->buildDirectory(buildConfiguration));
|
||||
setCommand(buildConfiguration, "make"); // TODO give full path here?
|
||||
@@ -89,6 +127,79 @@ bool MakeStep::immutable() const
|
||||
return true;
|
||||
}
|
||||
|
||||
void MakeStep::stdOut(const QString &line)
|
||||
{
|
||||
if (m_buildParser)
|
||||
m_buildParser->stdOutput(line);
|
||||
AbstractProcessStep::stdOut(line);
|
||||
}
|
||||
|
||||
void MakeStep::stdError(const QString &line)
|
||||
{
|
||||
if (m_buildParser)
|
||||
m_buildParser->stdError(line);
|
||||
AbstractProcessStep::stdError(line);
|
||||
}
|
||||
|
||||
void MakeStep::slotAddToTaskWindow(const QString & fn, int type, int linenumber, const QString & description)
|
||||
{
|
||||
QString filePath = fn;
|
||||
if (!filePath.isEmpty() && !QDir::isAbsolutePath(filePath)) {
|
||||
// We have no save way to decide which file in which subfolder
|
||||
// is meant. Therefore we apply following heuristics:
|
||||
// 1. Search for unique file in directories currently indicated as open by GNU make
|
||||
// (Enter directory xxx, Leave directory xxx...) + current directory
|
||||
// 3. Check if file is unique in whole project
|
||||
// 4. Otherwise give up
|
||||
|
||||
filePath = filePath.trimmed();
|
||||
|
||||
QList<QFileInfo> possibleFiles;
|
||||
foreach (const QString &dir, m_openDirectories) {
|
||||
QFileInfo candidate(dir + QLatin1Char('/') + filePath);
|
||||
if (debug)
|
||||
qDebug() << "Checking path " << candidate.filePath();
|
||||
if (candidate.exists()
|
||||
&& !possibleFiles.contains(candidate)) {
|
||||
if (debug)
|
||||
qDebug() << candidate.filePath() << "exists!";
|
||||
possibleFiles << candidate;
|
||||
}
|
||||
}
|
||||
if (possibleFiles.count() == 0) {
|
||||
if (debug)
|
||||
qDebug() << "No success. Trying all files in project ...";
|
||||
QString fileName = QFileInfo(filePath).fileName();
|
||||
foreach (const QString &file, project()->files(ProjectExplorer::Project::AllFiles)) {
|
||||
QFileInfo candidate(file);
|
||||
if (candidate.fileName() == fileName) {
|
||||
if (debug)
|
||||
qDebug() << "Found " << file;
|
||||
possibleFiles << candidate;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (possibleFiles.count() == 1)
|
||||
filePath = possibleFiles.first().filePath();
|
||||
else
|
||||
qWarning() << "Could not find absolute location of file " << filePath;
|
||||
}
|
||||
emit addToTaskWindow(filePath, type, linenumber, description);
|
||||
}
|
||||
|
||||
void MakeStep::addDirectory(const QString &dir)
|
||||
{
|
||||
if (!m_openDirectories.contains(dir))
|
||||
m_openDirectories.insert(dir);
|
||||
}
|
||||
|
||||
void MakeStep::removeDirectory(const QString &dir)
|
||||
{
|
||||
if (m_openDirectories.contains(dir))
|
||||
m_openDirectories.remove(dir);
|
||||
}
|
||||
|
||||
|
||||
CMakeProject *MakeStep::project() const
|
||||
{
|
||||
return m_pro;
|
||||
@@ -154,7 +265,6 @@ void MakeBuildStepConfigWidget::init(const QString &buildConfiguration)
|
||||
}
|
||||
// and connect again
|
||||
connect(m_targetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
|
@@ -64,8 +64,17 @@ public:
|
||||
CMakeProject *project() const;
|
||||
bool buildsTarget(const QString &buildConfiguration, const QString &target) const;
|
||||
void setBuildTarget(const QString &buildConfiguration, const QString &target, bool on);
|
||||
private slots:
|
||||
void slotAddToTaskWindow(const QString & fn, int type, int linenumber, const QString & description);
|
||||
void addDirectory(const QString &dir);
|
||||
void removeDirectory(const QString &dir);
|
||||
protected:
|
||||
virtual void stdOut(const QString &line);
|
||||
virtual void stdError(const QString &line);
|
||||
private:
|
||||
CMakeProject *m_pro;
|
||||
ProjectExplorer::BuildParserInterface *m_buildParser;
|
||||
QSet<QString> m_openDirectories;
|
||||
};
|
||||
|
||||
class MakeBuildStepConfigWidget :public ProjectExplorer::BuildStepConfigWidget
|
||||
|
@@ -475,10 +475,12 @@ void EditorManager::setCurrentEditor(IEditor *editor, bool ignoreNavigationHisto
|
||||
setCurrentView(0);
|
||||
if (m_d->m_currentEditor == editor)
|
||||
return;
|
||||
if (m_d->m_currentEditor)
|
||||
updateCurrentPositionInNavigationHistory();
|
||||
|
||||
m_d->m_currentEditor = editor;
|
||||
if (editor) {
|
||||
bool addToHistory = (!ignoreNavigationHistory && editor != currentEditor());
|
||||
bool addToHistory = (!ignoreNavigationHistory);
|
||||
if (addToHistory)
|
||||
addCurrentPositionToNavigationHistory(true);
|
||||
|
||||
@@ -678,8 +680,6 @@ bool EditorManager::closeEditors(const QList<IEditor*> editorsToClose, bool askA
|
||||
|
||||
QList<EditorView*> currentViews;
|
||||
EditorView *currentView = 0;
|
||||
if (currentEditor())
|
||||
addCurrentPositionToNavigationHistory(true);
|
||||
|
||||
// remove the editors
|
||||
foreach (IEditor *editor, acceptedEditors) {
|
||||
@@ -812,11 +812,7 @@ void EditorManager::activateEditor(Core::Internal::EditorView *view, Core::IEdit
|
||||
return;
|
||||
}
|
||||
|
||||
bool hasCurrent = (view->currentEditor() != 0);
|
||||
|
||||
editor = placeEditor(view, editor);
|
||||
if (!(flags & NoActivate) || !hasCurrent)
|
||||
view->setCurrentEditor(editor);
|
||||
|
||||
if (!(flags & NoActivate)) {
|
||||
setCurrentEditor(editor, (flags & IgnoreNavigationHistory));
|
||||
@@ -1349,6 +1345,7 @@ void EditorManager::addCurrentPositionToNavigationHistory(bool compress)
|
||||
return;
|
||||
if (!editor->file())
|
||||
return;
|
||||
|
||||
QString fileName = editor->file()->fileName();
|
||||
QByteArray state = editor->saveState();
|
||||
// cut existing
|
||||
@@ -1383,8 +1380,18 @@ void EditorManager::addCurrentPositionToNavigationHistory(bool compress)
|
||||
updateActions();
|
||||
}
|
||||
|
||||
void EditorManager::updateCurrentPositionInNavigationHistory()
|
||||
{
|
||||
if (!m_d->m_currentEditor
|
||||
|| m_d->currentNavigationHistoryPosition < 0
|
||||
|| m_d->m_navigationHistory.at(m_d->currentNavigationHistoryPosition)->editor != m_d->m_currentEditor)
|
||||
return;
|
||||
m_d->m_navigationHistory.at(m_d->currentNavigationHistoryPosition)->state = m_d->m_currentEditor->saveState();
|
||||
}
|
||||
|
||||
void EditorManager::goBackInNavigationHistory()
|
||||
{
|
||||
updateCurrentPositionInNavigationHistory();
|
||||
while (m_d->currentNavigationHistoryPosition > 0) {
|
||||
--m_d->currentNavigationHistoryPosition;
|
||||
EditorManagerPrivate::EditLocation *location = m_d->m_navigationHistory.at(m_d->currentNavigationHistoryPosition);
|
||||
@@ -1408,6 +1415,7 @@ void EditorManager::goBackInNavigationHistory()
|
||||
|
||||
void EditorManager::goForwardInNavigationHistory()
|
||||
{
|
||||
updateCurrentPositionInNavigationHistory();
|
||||
if (m_d->currentNavigationHistoryPosition >= m_d->m_navigationHistory.size()-1)
|
||||
return;
|
||||
++m_d->currentNavigationHistoryPosition;
|
||||
|
@@ -229,6 +229,8 @@ private:
|
||||
void emptyView(Core::Internal::EditorView *view);
|
||||
IEditor *pickUnusedEditor() const;
|
||||
|
||||
void updateCurrentPositionInNavigationHistory();
|
||||
|
||||
static EditorManager *m_instance;
|
||||
EditorManagerPrivate *m_d;
|
||||
|
||||
|
@@ -329,9 +329,11 @@ EditorView::~EditorView()
|
||||
|
||||
void EditorView::addEditor(IEditor *editor)
|
||||
{
|
||||
if (m_container->indexOf(editor->widget()) != -1)
|
||||
if (m_editors.contains(editor))
|
||||
return;
|
||||
|
||||
m_editors.append(editor);
|
||||
|
||||
m_container->addWidget(editor->widget());
|
||||
m_widgetEditorMap.insert(editor->widget(), editor);
|
||||
|
||||
@@ -348,7 +350,7 @@ void EditorView::addEditor(IEditor *editor)
|
||||
|
||||
bool EditorView::hasEditor(IEditor *editor) const
|
||||
{
|
||||
return (m_container->indexOf(editor->widget()) != -1);
|
||||
return m_editors.contains(editor);
|
||||
}
|
||||
|
||||
void EditorView::closeView()
|
||||
@@ -360,9 +362,14 @@ void EditorView::closeView()
|
||||
void EditorView::removeEditor(IEditor *editor)
|
||||
{
|
||||
QTC_ASSERT(editor, return);
|
||||
if (!m_editors.contains(editor))
|
||||
return;
|
||||
|
||||
const int index = m_container->indexOf(editor->widget());
|
||||
QTC_ASSERT((index != -1), return);
|
||||
bool wasCurrent = (index == m_container->currentIndex());
|
||||
if (index != -1) {
|
||||
m_editors.removeAll(editor);
|
||||
|
||||
m_container->removeWidget(editor->widget());
|
||||
m_widgetEditorMap.remove(editor->widget());
|
||||
editor->widget()->setParent(0);
|
||||
@@ -377,9 +384,8 @@ void EditorView::removeEditor(IEditor *editor)
|
||||
toolBar->setVisible(false);
|
||||
toolBar->setParent(0);
|
||||
}
|
||||
}
|
||||
if (wasCurrent)
|
||||
setCurrentEditor(currentEditor());
|
||||
if (wasCurrent && m_editors.count())
|
||||
setCurrentEditor(m_editors.last());
|
||||
}
|
||||
|
||||
IEditor *EditorView::currentEditor() const
|
||||
@@ -394,6 +400,8 @@ void EditorView::setCurrentEditor(IEditor *editor)
|
||||
if (!editor || m_container->count() <= 0
|
||||
|| m_container->indexOf(editor->widget()) == -1)
|
||||
return;
|
||||
m_editors.removeAll(editor);
|
||||
m_editors.append(editor);
|
||||
|
||||
const int idx = m_container->indexOf(editor->widget());
|
||||
QTC_ASSERT(idx >= 0, return);
|
||||
|
@@ -144,6 +144,7 @@ private:
|
||||
QToolButton *m_infoWidgetButton;
|
||||
IEditor *m_editorForInfoWidget;
|
||||
QSortFilterProxyModel m_proxyModel;
|
||||
QList<IEditor *>m_editors;
|
||||
QMap<QWidget *, IEditor *> m_widgetEditorMap;
|
||||
};
|
||||
|
||||
|
@@ -38,9 +38,13 @@ namespace Git {
|
||||
namespace Constants {
|
||||
|
||||
const char * const GIT_COMMAND_LOG_EDITOR_KIND = "Git Command Log Editor";
|
||||
const char * const C_GIT_COMMAND_LOG_EDITOR = "Git Command Log Editor";
|
||||
const char * const GIT_LOG_EDITOR_KIND = "Git File Log Editor";
|
||||
const char * const C_GIT_LOG_EDITOR = "Git File Log Editor";
|
||||
const char * const GIT_BLAME_EDITOR_KIND = "Git Annotation Editor";
|
||||
const char * const C_GIT_BLAME_EDITOR = "Git Annotation Editor";
|
||||
const char * const GIT_DIFF_EDITOR_KIND = "Git Diff Editor";
|
||||
const char * const C_GIT_DIFF_EDITOR = "Git Diff Editor";
|
||||
|
||||
const char * const C_GITSUBMITEDITOR = "Git Submit Editor";
|
||||
const char * const GITSUBMITEDITOR_KIND = "Git Submit Editor";
|
||||
|
@@ -73,22 +73,22 @@ static const VCSBase::VCSBaseEditorParameters editorParameters[] = {
|
||||
{
|
||||
VCSBase::RegularCommandOutput,
|
||||
Git::Constants::GIT_COMMAND_LOG_EDITOR_KIND,
|
||||
Core::Constants::C_GLOBAL,
|
||||
Git::Constants::C_GIT_COMMAND_LOG_EDITOR,
|
||||
"application/vnd.nokia.text.scs_git_commandlog",
|
||||
"gitlog"},
|
||||
{ VCSBase::LogOutput,
|
||||
Git::Constants::GIT_LOG_EDITOR_KIND,
|
||||
Core::Constants::C_GLOBAL,
|
||||
Git::Constants::C_GIT_LOG_EDITOR,
|
||||
"application/vnd.nokia.text.scs_git_filelog",
|
||||
"gitfilelog"},
|
||||
{ VCSBase::AnnotateOutput,
|
||||
Git::Constants::GIT_BLAME_EDITOR_KIND,
|
||||
Core::Constants::C_GLOBAL,
|
||||
Git::Constants::C_GIT_BLAME_EDITOR,
|
||||
"application/vnd.nokia.text.scs_git_annotation",
|
||||
"gitsannotate"},
|
||||
{ VCSBase::DiffOutput,
|
||||
Git::Constants::GIT_DIFF_EDITOR_KIND,
|
||||
Core::Constants::C_GLOBAL,
|
||||
Git::Constants::C_GIT_DIFF_EDITOR,
|
||||
"text/x-patch","diff"}
|
||||
};
|
||||
|
||||
|
@@ -33,11 +33,11 @@
|
||||
|
||||
#include "buildparserfactory.h"
|
||||
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "gccparser.h"
|
||||
#include "msvcparser.h"
|
||||
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
using namespace ProjectExplorer::Internal;
|
||||
|
||||
GccParserFactory::~GccParserFactory()
|
||||
{
|
@@ -36,14 +36,14 @@
|
||||
|
||||
#include <projectexplorer/buildparserinterface.h>
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
class GccParserFactory : public ProjectExplorer::IBuildParserFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
GccParserFactory() {};
|
||||
GccParserFactory() {}
|
||||
virtual ~GccParserFactory();
|
||||
virtual bool canCreate(const QString & name) const;
|
||||
virtual ProjectExplorer::BuildParserInterface * create(const QString & name) const;
|
||||
@@ -53,13 +53,13 @@ class MsvcParserFactory : public ProjectExplorer::IBuildParserFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MsvcParserFactory() {};
|
||||
MsvcParserFactory() {}
|
||||
virtual ~MsvcParserFactory();
|
||||
virtual bool canCreate(const QString & name) const;
|
||||
virtual ProjectExplorer::BuildParserInterface * create(const QString & name) const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Qt4ProjectManager
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
#endif // BUILDPARSERFACTORY_H
|
@@ -32,11 +32,11 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "gccparser.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
GccParser::GccParser()
|
||||
{
|
||||
@@ -56,7 +56,7 @@ GccParser::GccParser()
|
||||
|
||||
QString GccParser::name() const
|
||||
{
|
||||
return QLatin1String(Qt4ProjectManager::Constants::BUILD_PARSER_GCC);
|
||||
return QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_GCC);
|
||||
}
|
||||
|
||||
void GccParser::stdOutput(const QString & line)
|
@@ -34,11 +34,11 @@
|
||||
#ifndef GCCPARSER_H
|
||||
#define GCCPARSER_H
|
||||
|
||||
#include <projectexplorer/buildparserinterface.h>
|
||||
#include "buildparserinterface.h"
|
||||
|
||||
#include <QtCore/QRegExp>
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class GccParser : public ProjectExplorer::BuildParserInterface
|
||||
{
|
@@ -32,11 +32,11 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "msvcparser.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
MsvcParser::MsvcParser()
|
||||
{
|
||||
@@ -48,7 +48,7 @@ MsvcParser::MsvcParser()
|
||||
|
||||
QString MsvcParser::name() const
|
||||
{
|
||||
return QLatin1String(Qt4ProjectManager::Constants::BUILD_PARSER_MSVC);
|
||||
return QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_MSVC);
|
||||
}
|
||||
|
||||
void MsvcParser::stdError(const QString & line)
|
@@ -34,11 +34,11 @@
|
||||
#ifndef MSVCPARSER_H
|
||||
#define MSVCPARSER_H
|
||||
|
||||
#include <projectexplorer/buildparserinterface.h>
|
||||
#include "buildparserinterface.h"
|
||||
|
||||
#include <QtCore/QRegExp>
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class MsvcParser : public ProjectExplorer::BuildParserInterface
|
||||
{
|
@@ -59,6 +59,7 @@
|
||||
#include "scriptwrappers.h"
|
||||
#include "session.h"
|
||||
#include "sessiondialog.h"
|
||||
#include "buildparserfactory.h"
|
||||
|
||||
#include <coreplugin/basemode.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
@@ -233,6 +234,10 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
|
||||
addAutoReleasedObject(new ProjectFileWizardExtension);
|
||||
|
||||
// Build parsers
|
||||
addAutoReleasedObject(new GccParserFactory);
|
||||
addAutoReleasedObject(new MsvcParserFactory);
|
||||
|
||||
// context menus
|
||||
Core::ActionContainer *msessionContextMenu =
|
||||
am->createMenu(Constants::M_SESSIONCONTEXT);
|
||||
|
@@ -54,7 +54,10 @@ HEADERS += projectexplorer.h \
|
||||
projectmodels.h \
|
||||
currentprojectfind.h \
|
||||
toolchain.h \
|
||||
cesdkhandler.h
|
||||
cesdkhandler.h\
|
||||
buildparserfactory.h\
|
||||
gccparser.h\
|
||||
msvcparser.h
|
||||
SOURCES += projectexplorer.cpp \
|
||||
projectwindow.cpp \
|
||||
buildmanager.cpp \
|
||||
@@ -97,7 +100,10 @@ SOURCES += projectexplorer.cpp \
|
||||
projectmodels.cpp \
|
||||
currentprojectfind.cpp \
|
||||
toolchain.cpp \
|
||||
cesdkhandler.cpp
|
||||
cesdkhandler.cpp\
|
||||
buildparserfactory.cpp \
|
||||
gccparser.cpp\
|
||||
msvcparser.cpp
|
||||
FORMS += dependenciespanel.ui \
|
||||
buildsettingspropertiespage.ui \
|
||||
processstep.ui \
|
||||
|
@@ -176,6 +176,11 @@ const char * const CPP_HEADER_MIMETYPE = "text/x-c++hdr";
|
||||
const char * const FORM_MIMETYPE = "application/x-designer";
|
||||
const char * const RESOURCE_MIMETYPE = "application/vnd.nokia.xml.qt.resource";
|
||||
|
||||
// build parsers
|
||||
const char * const BUILD_PARSER_MSVC = "BuildParser.MSVC";
|
||||
const char * const BUILD_PARSER_GCC = "BuildParser.Gcc";
|
||||
|
||||
|
||||
} // namespace Constants
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
|
@@ -36,6 +36,8 @@
|
||||
#include "qt4project.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -71,9 +73,9 @@ ProjectExplorer::BuildParserInterface *MakeStep::buildParser(const QtVersion * c
|
||||
QString buildParser;
|
||||
ProjectExplorer::ToolChain::ToolChainType type = version->toolchainType();
|
||||
if ( type == ProjectExplorer::ToolChain::MSVC || type == ProjectExplorer::ToolChain::WINCE)
|
||||
buildParser = Constants::BUILD_PARSER_MSVC;
|
||||
buildParser = ProjectExplorer::Constants::BUILD_PARSER_MSVC;
|
||||
else
|
||||
buildParser = Constants::BUILD_PARSER_GCC;
|
||||
buildParser = ProjectExplorer::Constants::BUILD_PARSER_GCC;
|
||||
|
||||
QList<IBuildParserFactory *> buildParserFactories =
|
||||
ExtensionSystem::PluginManager::instance()->getObjects<ProjectExplorer::IBuildParserFactory>();
|
||||
|
@@ -28,9 +28,6 @@ HEADERS = qt4projectmanagerplugin.h \
|
||||
makestep.h \
|
||||
qmakestep.h \
|
||||
qmakebuildstepfactory.h \
|
||||
gccparser.h \
|
||||
msvcparser.h \
|
||||
buildparserfactory.h \
|
||||
deployhelper.h \
|
||||
embeddedpropertiespage.h \
|
||||
qt4runconfiguration.h \
|
||||
@@ -63,9 +60,6 @@ SOURCES = qt4projectmanagerplugin.cpp \
|
||||
makestep.cpp \
|
||||
qmakestep.cpp \
|
||||
qmakebuildstepfactory.cpp \
|
||||
gccparser.cpp \
|
||||
msvcparser.cpp \
|
||||
buildparserfactory.cpp \
|
||||
deployhelper.cpp \
|
||||
embeddedpropertiespage.cpp \
|
||||
qt4runconfiguration.cpp \
|
||||
|
@@ -79,10 +79,6 @@ const char * const GDBMACROSBUILDSTEP = "trolltech.qt4projectmanager.gdbmaros";
|
||||
const char * const QT4RUNSTEP = "trolltech.qt4projectmanager.qt4runstep";
|
||||
const char * const DEPLOYHELPERRUNSTEP = "trolltech.qt4projectmanager.deployhelperrunstep";
|
||||
|
||||
// build parsers
|
||||
const char * const BUILD_PARSER_MSVC = "BuildParser.MSVC";
|
||||
const char * const BUILD_PARSER_GCC = "BuildParser.Gcc";
|
||||
|
||||
// views
|
||||
const char * const VIEW_DETAILED = "Qt4.View.Detailed";
|
||||
const char * const VIEW_PROFILESONLY = "Qt4.View.ProjectHierarchy";
|
||||
|
@@ -41,7 +41,6 @@
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qt4project.h"
|
||||
#include "qmakebuildstepfactory.h"
|
||||
#include "buildparserfactory.h"
|
||||
#include "qtversionmanager.h"
|
||||
#include "embeddedpropertiespage.h"
|
||||
#include "qt4runconfiguration.h"
|
||||
@@ -133,9 +132,6 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
||||
addAutoReleasedObject(new MakeBuildStepFactory);
|
||||
addAutoReleasedObject(new GdbMacrosBuildStepFactory);
|
||||
|
||||
addAutoReleasedObject(new GccParserFactory);
|
||||
addAutoReleasedObject(new MsvcParserFactory);
|
||||
|
||||
m_qtVersionManager = new QtVersionManager;
|
||||
addObject(m_qtVersionManager);
|
||||
|
||||
|
@@ -70,13 +70,6 @@ void QtScriptEditorActionHandler::createActions()
|
||||
}
|
||||
|
||||
|
||||
void QtScriptEditorActionHandler::updateActions(UpdateMode um)
|
||||
{
|
||||
TextEditor::TextEditorActionHandler::updateActions(um);
|
||||
if (m_runAction)
|
||||
m_runAction->setEnabled(um != NoEditor);
|
||||
}
|
||||
|
||||
void QtScriptEditorActionHandler::run()
|
||||
{
|
||||
typedef Core::ScriptManager::Stack Stack;
|
||||
|
@@ -48,7 +48,6 @@ public:
|
||||
|
||||
private:
|
||||
virtual void createActions();
|
||||
virtual void updateActions(UpdateMode um);
|
||||
|
||||
private slots:
|
||||
void run();
|
||||
|
@@ -103,23 +103,23 @@ const char * const SubversionPlugin::DESCRIBE = "Subversion.Describe";
|
||||
static const VCSBase::VCSBaseEditorParameters editorParameters[] = {
|
||||
{
|
||||
VCSBase::RegularCommandOutput,
|
||||
"Subversion Command Log Editor",
|
||||
Core::Constants::C_GLOBAL,
|
||||
"Subversion Command Log Editor", // kind
|
||||
"Subversion Command Log Editor", // context
|
||||
"application/vnd.nokia.text.scs_svn_commandlog",
|
||||
"scslog"},
|
||||
{ VCSBase::LogOutput,
|
||||
"Subversion File Log Editor",
|
||||
Core::Constants::C_GLOBAL,
|
||||
"Subversion File Log Editor", // kind
|
||||
"Subversion File Log Editor", // context
|
||||
"application/vnd.nokia.text.scs_svn_filelog",
|
||||
"scsfilelog"},
|
||||
{ VCSBase::AnnotateOutput,
|
||||
"Subversion Annotation Editor",
|
||||
Core::Constants::C_GLOBAL,
|
||||
"Subversion Annotation Editor", // kind
|
||||
"Subversion Annotation Editor", // context
|
||||
"application/vnd.nokia.text.scs_svn_annotation",
|
||||
"scsannotate"},
|
||||
{ VCSBase::DiffOutput,
|
||||
"Subversion Diff Editor",
|
||||
Core::Constants::C_GLOBAL,
|
||||
"Subversion Diff Editor", // kind
|
||||
"Subversion Diff Editor", // context
|
||||
"text/x-patch","diff"}
|
||||
};
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
**
|
||||
** Alternatively, this file may be used under the terms of the GNU General
|
||||
** Public License versions 2.0 or 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the packaging
|
||||
** Foundation and appearing` in the file LICENSE.GPL included in the packaging
|
||||
** of this file. Please review the following information to ensure GNU
|
||||
** General Public Licensing requirements will be met:
|
||||
**
|
||||
@@ -91,8 +91,8 @@ TextEditorActionHandler::TextEditorActionHandler(const QString &context,
|
||||
|
||||
m_contextId << Core::UniqueIDManager::instance()->uniqueIdentifier(context);
|
||||
|
||||
connect(Core::ICore::instance(), SIGNAL(contextAboutToChange(Core::IContext *)),
|
||||
this, SLOT(updateCurrentEditor(Core::IContext *)));
|
||||
connect(Core::ICore::instance()->editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)),
|
||||
this, SLOT(updateCurrentEditor(Core::IEditor *)));
|
||||
}
|
||||
|
||||
void TextEditorActionHandler::setupActions(BaseTextEditor *editor)
|
||||
@@ -282,48 +282,30 @@ QAction *TextEditorActionHandler::registerNewAction(const QString &id,
|
||||
|
||||
TextEditorActionHandler::UpdateMode TextEditorActionHandler::updateMode() const
|
||||
{
|
||||
if (!m_currentEditor)
|
||||
return NoEditor;
|
||||
Q_ASSERT(m_currentEditor != 0);
|
||||
return m_currentEditor->file()->isReadOnly() ? ReadOnlyMode : WriteMode;
|
||||
}
|
||||
|
||||
void TextEditorActionHandler::updateActions()
|
||||
{
|
||||
if (!m_currentEditor || !m_initialized)
|
||||
return;
|
||||
updateActions(updateMode());
|
||||
}
|
||||
|
||||
void TextEditorActionHandler::updateActions(UpdateMode um)
|
||||
{
|
||||
if (!m_initialized)
|
||||
return;
|
||||
m_pasteAction->setEnabled(um != NoEditor);
|
||||
m_selectAllAction->setEnabled(um != NoEditor);
|
||||
m_gotoAction->setEnabled(um != NoEditor);
|
||||
m_selectEncodingAction->setEnabled(um != NoEditor);
|
||||
m_printAction->setEnabled(um != NoEditor);
|
||||
m_formatAction->setEnabled((m_optionalActions & Format) && um != NoEditor);
|
||||
m_unCommentSelectionAction->setEnabled((m_optionalActions & UnCommentSelection) && um != NoEditor);
|
||||
m_collapseAction->setEnabled(um != NoEditor);
|
||||
m_expandAction->setEnabled(um != NoEditor);
|
||||
m_unCollapseAllAction->setEnabled((m_optionalActions & UnCollapseAll) && um != NoEditor);
|
||||
m_decreaseFontSizeAction->setEnabled(um != NoEditor);
|
||||
m_increaseFontSizeAction->setEnabled(um != NoEditor);
|
||||
m_gotoBlockStartAction->setEnabled(um != NoEditor);
|
||||
m_gotoBlockStartWithSelectionAction->setEnabled(um != NoEditor);
|
||||
m_gotoBlockEndAction->setEnabled(um != NoEditor);
|
||||
m_gotoBlockEndWithSelectionAction->setEnabled(um != NoEditor);
|
||||
m_selectBlockUpAction->setEnabled(um != NoEditor);
|
||||
m_selectBlockDownAction->setEnabled(um != NoEditor);
|
||||
m_moveLineUpAction->setEnabled(um != NoEditor);
|
||||
m_moveLineDownAction->setEnabled(um != NoEditor);
|
||||
m_pasteAction->setEnabled(um != ReadOnlyMode);
|
||||
m_formatAction->setEnabled((m_optionalActions & Format) && um != ReadOnlyMode);
|
||||
m_unCommentSelectionAction->setEnabled((m_optionalActions & UnCommentSelection) && um != ReadOnlyMode);
|
||||
m_moveLineUpAction->setEnabled(um != ReadOnlyMode);
|
||||
m_moveLineDownAction->setEnabled(um != ReadOnlyMode);
|
||||
|
||||
m_visualizeWhitespaceAction->setEnabled(um != NoEditor);
|
||||
if (m_currentEditor)
|
||||
m_formatAction->setEnabled((m_optionalActions & Format));
|
||||
m_unCommentSelectionAction->setEnabled((m_optionalActions & UnCommentSelection));
|
||||
m_unCollapseAllAction->setEnabled((m_optionalActions & UnCollapseAll));
|
||||
m_visualizeWhitespaceAction->setChecked(m_currentEditor->displaySettings().m_visualizeWhitespace);
|
||||
m_cleanWhitespaceAction->setEnabled(um != NoEditor);
|
||||
if (m_textWrappingAction) {
|
||||
m_textWrappingAction->setEnabled(um != NoEditor);
|
||||
if (m_currentEditor)
|
||||
m_textWrappingAction->setChecked(m_currentEditor->displaySettings().m_textWrapping);
|
||||
}
|
||||
|
||||
@@ -349,9 +331,10 @@ void TextEditorActionHandler::updateCopyAction()
|
||||
const bool hasCopyableText = m_currentEditor && m_currentEditor->textCursor().hasSelection();
|
||||
if (m_cutAction)
|
||||
m_cutAction->setEnabled(hasCopyableText && updateMode() == WriteMode);
|
||||
if (m_copyAction)
|
||||
if (m_copyAction) {
|
||||
m_copyAction->setEnabled(hasCopyableText);
|
||||
}
|
||||
}
|
||||
|
||||
void TextEditorActionHandler::gotoAction()
|
||||
{
|
||||
@@ -422,38 +405,20 @@ FUNCTION(selectBlockDown)
|
||||
FUNCTION(moveLineUp)
|
||||
FUNCTION(moveLineDown)
|
||||
|
||||
void TextEditorActionHandler::updateCurrentEditor(Core::IContext *object)
|
||||
void TextEditorActionHandler::updateCurrentEditor(Core::IEditor *editor)
|
||||
{
|
||||
do {
|
||||
if (!object) {
|
||||
if (!m_currentEditor)
|
||||
m_currentEditor = 0;
|
||||
|
||||
if (!editor)
|
||||
return;
|
||||
|
||||
m_currentEditor = 0;
|
||||
break;
|
||||
}
|
||||
BaseTextEditor *editor = qobject_cast<BaseTextEditor *>(object->widget());
|
||||
if (!editor) {
|
||||
if (!m_currentEditor)
|
||||
return;
|
||||
BaseTextEditor *baseEditor = qobject_cast<BaseTextEditor *>(editor->widget());
|
||||
|
||||
m_currentEditor = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (editor == m_currentEditor)
|
||||
return;
|
||||
|
||||
if (editor->actionHack() != this) {
|
||||
m_currentEditor = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
m_currentEditor = editor;
|
||||
|
||||
} while (false);
|
||||
if (baseEditor && baseEditor->actionHack() == this) {
|
||||
m_currentEditor = baseEditor;
|
||||
updateActions();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const QPointer<BaseTextEditor> &TextEditorActionHandler::currentEditor() const
|
||||
|
@@ -78,7 +78,7 @@ protected:
|
||||
QAction *registerNewAction(const QString &id, QObject *receiver, const char *slot,
|
||||
const QString &title = QString());
|
||||
|
||||
enum UpdateMode { NoEditor , ReadOnlyMode, WriteMode };
|
||||
enum UpdateMode { ReadOnlyMode, WriteMode };
|
||||
UpdateMode updateMode() const;
|
||||
|
||||
virtual void createActions();
|
||||
@@ -114,7 +114,7 @@ private slots:
|
||||
void selectBlockDown();
|
||||
void moveLineUp();
|
||||
void moveLineDown();
|
||||
void updateCurrentEditor(Core::IContext *object);
|
||||
void updateCurrentEditor(Core::IEditor *editor);
|
||||
|
||||
private:
|
||||
QAction *m_undoAction;
|
||||
|
@@ -56,7 +56,7 @@ BaseVCSEditorFactoryPrivate::BaseVCSEditorFactoryPrivate(const VCSBaseEditorPara
|
||||
m_type(t),
|
||||
m_kind(QLatin1String(t->kind)),
|
||||
m_mimeTypes(QStringList(QLatin1String(t->mimeType))),
|
||||
m_editorHandler(new TextEditor::TextEditorActionHandler(t->kind))
|
||||
m_editorHandler(new TextEditor::TextEditorActionHandler(t->context))
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user