forked from qt-creator/qt-creator
Revert "Code model: Update on changes from the versioning system."
This reverts commit 7aa2411693
.
It breaks the code model updates completely. So reverting this change
until we have the right thing.
Reviewed-by: Roberto Raggi
This commit is contained in:
@@ -106,10 +106,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual bool vcsDelete(const QString &filename) = 0;
|
virtual bool vcsDelete(const QString &filename) = 0;
|
||||||
|
|
||||||
signals:
|
|
||||||
void repositoryChanged(const QString &repository);
|
|
||||||
void filesChanged(const QStringList &files);
|
|
||||||
|
|
||||||
// TODO: ADD A WAY TO DETECT WHETHER A FILE IS MANAGED, e.g
|
// TODO: ADD A WAY TO DETECT WHETHER A FILE IS MANAGED, e.g
|
||||||
// virtual bool sccManaged(const QString &filename) = 0;
|
// virtual bool sccManaged(const QString &filename) = 0;
|
||||||
};
|
};
|
||||||
|
@@ -126,7 +126,7 @@ MainWindow::MainWindow() :
|
|||||||
m_progressManager(new ProgressManagerPrivate()),
|
m_progressManager(new ProgressManagerPrivate()),
|
||||||
m_scriptManager(new ScriptManagerPrivate(this)),
|
m_scriptManager(new ScriptManagerPrivate(this)),
|
||||||
m_variableManager(new VariableManager(this)),
|
m_variableManager(new VariableManager(this)),
|
||||||
m_vcsManager(new VCSManager),
|
m_vcsManager(new VCSManager()),
|
||||||
m_viewManager(0),
|
m_viewManager(0),
|
||||||
m_modeManager(0),
|
m_modeManager(0),
|
||||||
m_mimeDatabase(new MimeDatabase),
|
m_mimeDatabase(new MimeDatabase),
|
||||||
@@ -346,7 +346,6 @@ void MainWindow::extensionsInitialized()
|
|||||||
OutputPaneManager::instance()->init();
|
OutputPaneManager::instance()->init();
|
||||||
|
|
||||||
m_actionManager->initialize();
|
m_actionManager->initialize();
|
||||||
m_vcsManager->extensionsInitialized();
|
|
||||||
readSettings();
|
readSettings();
|
||||||
updateContext();
|
updateContext();
|
||||||
|
|
||||||
|
@@ -57,8 +57,7 @@ struct VCSManagerPrivate {
|
|||||||
QMap<QString, IVersionControl *> m_cachedMatches;
|
QMap<QString, IVersionControl *> m_cachedMatches;
|
||||||
};
|
};
|
||||||
|
|
||||||
VCSManager::VCSManager(QObject *parent) :
|
VCSManager::VCSManager() :
|
||||||
QObject(parent),
|
|
||||||
m_d(new VCSManagerPrivate)
|
m_d(new VCSManagerPrivate)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -68,17 +67,6 @@ VCSManager::~VCSManager()
|
|||||||
delete m_d;
|
delete m_d;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VCSManager::extensionsInitialized()
|
|
||||||
{
|
|
||||||
// Change signal connections
|
|
||||||
foreach (IVersionControl *versionControl, allVersionControls()) {
|
|
||||||
connect(versionControl, SIGNAL(filesChanged(QStringList)),
|
|
||||||
this, SIGNAL(filesChanged(QStringList)));
|
|
||||||
connect(versionControl, SIGNAL(repositoryChanged(QString)),
|
|
||||||
this, SIGNAL(repositoryChanged(QString)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void VCSManager::setVCSEnabled(const QString &directory)
|
void VCSManager::setVCSEnabled(const QString &directory)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
|
@@ -33,7 +33,6 @@
|
|||||||
#include "core_global.h"
|
#include "core_global.h"
|
||||||
|
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
#include <QtCore/QObject>
|
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
@@ -50,16 +49,13 @@ class IVersionControl;
|
|||||||
// for the topmost directory it manages. This information is cached and
|
// for the topmost directory it manages. This information is cached and
|
||||||
// VCSManager thus knows pretty fast which IVersionControl * is responsible.
|
// VCSManager thus knows pretty fast which IVersionControl * is responsible.
|
||||||
|
|
||||||
class CORE_EXPORT VCSManager : public QObject
|
class CORE_EXPORT VCSManager
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
|
||||||
Q_DISABLE_COPY(VCSManager)
|
Q_DISABLE_COPY(VCSManager)
|
||||||
public:
|
public:
|
||||||
explicit VCSManager(QObject *parent = 0);
|
VCSManager();
|
||||||
virtual ~VCSManager();
|
virtual ~VCSManager();
|
||||||
|
|
||||||
void extensionsInitialized();
|
|
||||||
|
|
||||||
IVersionControl *findVersionControlForDirectory(const QString &directory);
|
IVersionControl *findVersionControlForDirectory(const QString &directory);
|
||||||
|
|
||||||
// Enable the VCS managing a certain directory only. This should
|
// Enable the VCS managing a certain directory only. This should
|
||||||
@@ -73,10 +69,6 @@ public:
|
|||||||
// if a failure occurs
|
// if a failure occurs
|
||||||
bool showDeleteDialog(const QString &fileName);
|
bool showDeleteDialog(const QString &fileName);
|
||||||
|
|
||||||
signals:
|
|
||||||
void repositoryChanged(const QString &repository);
|
|
||||||
void filesChanged(const QStringList &files);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
VCSManagerPrivate *m_d;
|
VCSManagerPrivate *m_d;
|
||||||
};
|
};
|
||||||
|
@@ -41,10 +41,8 @@ const char * const SWITCH_DECLARATION_DEFINITION = "CppEditor.SwitchDeclarationD
|
|||||||
const char * const RENAME_SYMBOL_UNDER_CURSOR = "CppEditor.RenameSymbolUnderCursor";
|
const char * const RENAME_SYMBOL_UNDER_CURSOR = "CppEditor.RenameSymbolUnderCursor";
|
||||||
const char * const FIND_USAGES = "CppEditor.FindUsages";
|
const char * const FIND_USAGES = "CppEditor.FindUsages";
|
||||||
const char * const SEPARATOR = "CppEditor.Separator";
|
const char * const SEPARATOR = "CppEditor.Separator";
|
||||||
const char * const SEPARATOR2 = "CppEditor.Separator2";
|
|
||||||
const char * const FIND_REFERENCES = "CppEditor.FindReferences";
|
const char * const FIND_REFERENCES = "CppEditor.FindReferences";
|
||||||
const char * const JUMP_TO_DEFINITION = "CppEditor.JumpToDefinition";
|
const char * const JUMP_TO_DEFINITION = "CppEditor.JumpToDefinition";
|
||||||
const char * const UPDATE_CODEMODEL = "CppEditor.UpdateCodeModel";
|
|
||||||
|
|
||||||
const char * const HEADER_FILE_TYPE = "CppHeaderFiles";
|
const char * const HEADER_FILE_TYPE = "CppHeaderFiles";
|
||||||
const char * const SOURCE_FILE_TYPE = "CppSourceFiles";
|
const char * const SOURCE_FILE_TYPE = "CppSourceFiles";
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <cpptools/cppmodelmanagerinterface.h>
|
#include <coreplugin/progressmanager/progressmanager.h>
|
||||||
#include <texteditor/completionsupport.h>
|
#include <texteditor/completionsupport.h>
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
#include <texteditor/storagesettings.h>
|
#include <texteditor/storagesettings.h>
|
||||||
@@ -112,11 +112,7 @@ CppPlugin *CppPlugin::m_instance = 0;
|
|||||||
|
|
||||||
CppPlugin::CppPlugin() :
|
CppPlugin::CppPlugin() :
|
||||||
m_actionHandler(0),
|
m_actionHandler(0),
|
||||||
m_sortedMethodOverview(false),
|
m_sortedMethodOverview(false)
|
||||||
m_renameSymbolUnderCursorAction(0),
|
|
||||||
m_findUsagesAction(0),
|
|
||||||
m_updateCodeModelAction(0)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
m_instance = this;
|
m_instance = this;
|
||||||
}
|
}
|
||||||
@@ -162,17 +158,6 @@ bool CppPlugin::sortedMethodOverview() const
|
|||||||
return m_sortedMethodOverview;
|
return m_sortedMethodOverview;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline
|
|
||||||
Core::Command *createSeparator(Core::ActionManager *am,
|
|
||||||
QObject *parent,
|
|
||||||
const QList<int> &context,
|
|
||||||
const char *id)
|
|
||||||
{
|
|
||||||
QAction *separator = new QAction(parent);
|
|
||||||
separator->setSeparator(true);
|
|
||||||
return am->registerAction(separator, QLatin1String(id), context);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage)
|
bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage)
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::ICore *core = Core::ICore::instance();
|
||||||
@@ -207,7 +192,6 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
|
|||||||
Core::ActionContainer *contextMenu= am->createMenu(CppEditor::Constants::M_CONTEXT);
|
Core::ActionContainer *contextMenu= am->createMenu(CppEditor::Constants::M_CONTEXT);
|
||||||
|
|
||||||
Core::Command *cmd;
|
Core::Command *cmd;
|
||||||
Core::ActionContainer *cppToolsMenu = am->actionContainer(QLatin1String(CppTools::Constants::M_TOOLS_CPP));
|
|
||||||
|
|
||||||
QAction *jumpToDefinition = new QAction(tr("Follow Symbol under Cursor"), this);
|
QAction *jumpToDefinition = new QAction(tr("Follow Symbol under Cursor"), this);
|
||||||
cmd = am->registerAction(jumpToDefinition,
|
cmd = am->registerAction(jumpToDefinition,
|
||||||
@@ -216,7 +200,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
|
|||||||
connect(jumpToDefinition, SIGNAL(triggered()),
|
connect(jumpToDefinition, SIGNAL(triggered()),
|
||||||
this, SLOT(jumpToDefinition()));
|
this, SLOT(jumpToDefinition()));
|
||||||
contextMenu->addAction(cmd);
|
contextMenu->addAction(cmd);
|
||||||
cppToolsMenu->addAction(cmd);
|
am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd);
|
||||||
|
|
||||||
QAction *switchDeclarationDefinition = new QAction(tr("Switch between Method Declaration/Definition"), this);
|
QAction *switchDeclarationDefinition = new QAction(tr("Switch between Method Declaration/Definition"), this);
|
||||||
cmd = am->registerAction(switchDeclarationDefinition,
|
cmd = am->registerAction(switchDeclarationDefinition,
|
||||||
@@ -225,14 +209,14 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
|
|||||||
connect(switchDeclarationDefinition, SIGNAL(triggered()),
|
connect(switchDeclarationDefinition, SIGNAL(triggered()),
|
||||||
this, SLOT(switchDeclarationDefinition()));
|
this, SLOT(switchDeclarationDefinition()));
|
||||||
contextMenu->addAction(cmd);
|
contextMenu->addAction(cmd);
|
||||||
cppToolsMenu->addAction(cmd);
|
am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd);
|
||||||
|
|
||||||
m_findUsagesAction = new QAction(tr("Find Usages"), this);
|
m_findUsagesAction = new QAction(tr("Find Usages"), this);
|
||||||
cmd = am->registerAction(m_findUsagesAction, Constants::FIND_USAGES, context);
|
cmd = am->registerAction(m_findUsagesAction, Constants::FIND_USAGES, context);
|
||||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+U")));
|
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+U")));
|
||||||
connect(m_findUsagesAction, SIGNAL(triggered()), this, SLOT(findUsages()));
|
connect(m_findUsagesAction, SIGNAL(triggered()), this, SLOT(findUsages()));
|
||||||
contextMenu->addAction(cmd);
|
contextMenu->addAction(cmd);
|
||||||
cppToolsMenu->addAction(cmd);
|
am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd);
|
||||||
|
|
||||||
m_renameSymbolUnderCursorAction = new QAction(tr("Rename Symbol under Cursor"), this);
|
m_renameSymbolUnderCursorAction = new QAction(tr("Rename Symbol under Cursor"), this);
|
||||||
cmd = am->registerAction(m_renameSymbolUnderCursorAction,
|
cmd = am->registerAction(m_renameSymbolUnderCursorAction,
|
||||||
@@ -240,17 +224,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
|
|||||||
cmd->setDefaultKeySequence(QKeySequence("CTRL+SHIFT+R"));
|
cmd->setDefaultKeySequence(QKeySequence("CTRL+SHIFT+R"));
|
||||||
connect(m_renameSymbolUnderCursorAction, SIGNAL(triggered()), this, SLOT(renameSymbolUnderCursor()));
|
connect(m_renameSymbolUnderCursorAction, SIGNAL(triggered()), this, SLOT(renameSymbolUnderCursor()));
|
||||||
contextMenu->addAction(cmd);
|
contextMenu->addAction(cmd);
|
||||||
cppToolsMenu->addAction(cmd);
|
am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd);
|
||||||
|
|
||||||
// Update context in global context
|
|
||||||
QList<int> globalContext;
|
|
||||||
globalContext.append(Core::Constants::C_GLOBAL_ID);
|
|
||||||
cppToolsMenu->addAction(createSeparator(am, this, globalContext, CppEditor::Constants::SEPARATOR2));
|
|
||||||
m_updateCodeModelAction = new QAction(tr("Update code model"), this);
|
|
||||||
cmd = am->registerAction(m_updateCodeModelAction, QLatin1String(Constants::UPDATE_CODEMODEL), globalContext);
|
|
||||||
CppTools::CppModelManagerInterface *cppModelManager = CppTools::CppModelManagerInterface::instance();
|
|
||||||
connect(m_updateCodeModelAction, SIGNAL(triggered()), cppModelManager, SLOT(updateModifiedSourceFiles()));
|
|
||||||
cppToolsMenu->addAction(cmd);
|
|
||||||
|
|
||||||
m_actionHandler = new TextEditor::TextEditorActionHandler(CppEditor::Constants::C_CPPEDITOR,
|
m_actionHandler = new TextEditor::TextEditorActionHandler(CppEditor::Constants::C_CPPEDITOR,
|
||||||
TextEditor::TextEditorActionHandler::Format
|
TextEditor::TextEditorActionHandler::Format
|
||||||
@@ -259,7 +233,10 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
|
|||||||
|
|
||||||
m_actionHandler->initializeActions();
|
m_actionHandler->initializeActions();
|
||||||
|
|
||||||
contextMenu->addAction(createSeparator(am, this, context, CppEditor::Constants::SEPARATOR));
|
QAction *separator = new QAction(this);
|
||||||
|
separator->setSeparator(true);
|
||||||
|
cmd = am->registerAction(separator, CppEditor::Constants::SEPARATOR, context);
|
||||||
|
contextMenu->addAction(cmd);
|
||||||
|
|
||||||
cmd = am->command(TextEditor::Constants::AUTO_INDENT_SELECTION);
|
cmd = am->command(TextEditor::Constants::AUTO_INDENT_SELECTION);
|
||||||
contextMenu->addAction(cmd);
|
contextMenu->addAction(cmd);
|
||||||
@@ -267,8 +244,10 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
|
|||||||
cmd = am->command(TextEditor::Constants::UN_COMMENT_SELECTION);
|
cmd = am->command(TextEditor::Constants::UN_COMMENT_SELECTION);
|
||||||
contextMenu->addAction(cmd);
|
contextMenu->addAction(cmd);
|
||||||
|
|
||||||
connect(cppModelManager, SIGNAL(indexingStarted()), this, SLOT(onCppModelIndexingStarted()));
|
connect(core->progressManager(), SIGNAL(taskStarted(QString)),
|
||||||
connect(cppModelManager, SIGNAL(indexingFinished()), this, SLOT(onCppModelIndexingFinished()));
|
this, SLOT(onTaskStarted(QString)));
|
||||||
|
connect(core->progressManager(), SIGNAL(allTasksFinished(QString)),
|
||||||
|
this, SLOT(onAllTasksFinished(QString)));
|
||||||
readSettings();
|
readSettings();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -324,18 +303,20 @@ void CppPlugin::findUsages()
|
|||||||
editor->findUsages();
|
editor->findUsages();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppPlugin::onCppModelIndexingStarted()
|
void CppPlugin::onTaskStarted(const QString &type)
|
||||||
{
|
{
|
||||||
|
if (type == CppTools::Constants::TASK_INDEX) {
|
||||||
m_renameSymbolUnderCursorAction->setEnabled(false);
|
m_renameSymbolUnderCursorAction->setEnabled(false);
|
||||||
m_findUsagesAction->setEnabled(false);
|
m_findUsagesAction->setEnabled(false);
|
||||||
m_updateCodeModelAction->setEnabled(false);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppPlugin::onCppModelIndexingFinished()
|
void CppPlugin::onAllTasksFinished(const QString &type)
|
||||||
{
|
{
|
||||||
|
if (type == CppTools::Constants::TASK_INDEX) {
|
||||||
m_renameSymbolUnderCursorAction->setEnabled(true);
|
m_renameSymbolUnderCursorAction->setEnabled(true);
|
||||||
m_findUsagesAction->setEnabled(true);
|
m_findUsagesAction->setEnabled(true);
|
||||||
m_updateCodeModelAction->setEnabled(true);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN(CppPlugin)
|
Q_EXPORT_PLUGIN(CppPlugin)
|
||||||
|
@@ -75,8 +75,8 @@ private slots:
|
|||||||
void switchDeclarationDefinition();
|
void switchDeclarationDefinition();
|
||||||
void jumpToDefinition();
|
void jumpToDefinition();
|
||||||
void renameSymbolUnderCursor();
|
void renameSymbolUnderCursor();
|
||||||
void onCppModelIndexingStarted();
|
void onTaskStarted(const QString &type);
|
||||||
void onCppModelIndexingFinished();
|
void onAllTasksFinished(const QString &type);
|
||||||
void findUsages();
|
void findUsages();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -90,7 +90,6 @@ private:
|
|||||||
bool m_sortedMethodOverview;
|
bool m_sortedMethodOverview;
|
||||||
QAction *m_renameSymbolUnderCursorAction;
|
QAction *m_renameSymbolUnderCursorAction;
|
||||||
QAction *m_findUsagesAction;
|
QAction *m_findUsagesAction;
|
||||||
QAction *m_updateCodeModelAction;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CppEditorFactory : public Core::IEditorFactory
|
class CppEditorFactory : public Core::IEditorFactory
|
||||||
|
@@ -595,8 +595,6 @@ Document::Ptr CppPreprocessor::switchDocument(Document::Ptr doc)
|
|||||||
|
|
||||||
void CppTools::CppModelManagerInterface::updateModifiedSourceFiles()
|
void CppTools::CppModelManagerInterface::updateModifiedSourceFiles()
|
||||||
{
|
{
|
||||||
if (isIndexing())
|
|
||||||
return;
|
|
||||||
const Snapshot snapshot = this->snapshot();
|
const Snapshot snapshot = this->snapshot();
|
||||||
QStringList sourceFiles;
|
QStringList sourceFiles;
|
||||||
|
|
||||||
@@ -632,8 +630,7 @@ CppTools::CppModelManagerInterface *CppTools::CppModelManagerInterface::instance
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
CppModelManager::CppModelManager(QObject *parent)
|
CppModelManager::CppModelManager(QObject *parent)
|
||||||
: CppModelManagerInterface(parent),
|
: CppModelManagerInterface(parent)
|
||||||
m_indexing(false)
|
|
||||||
{
|
{
|
||||||
m_findReferences = new CppFindReferences(this);
|
m_findReferences = new CppFindReferences(this);
|
||||||
|
|
||||||
@@ -678,11 +675,6 @@ CppModelManager::CppModelManager(QObject *parent)
|
|||||||
|
|
||||||
connect(m_core->editorManager(), SIGNAL(editorAboutToClose(Core::IEditor *)),
|
connect(m_core->editorManager(), SIGNAL(editorAboutToClose(Core::IEditor *)),
|
||||||
this, SLOT(editorAboutToClose(Core::IEditor *)));
|
this, SLOT(editorAboutToClose(Core::IEditor *)));
|
||||||
|
|
||||||
connect(m_core->progressManager(), SIGNAL(taskStarted(QString)),
|
|
||||||
this, SLOT(onTaskStarted(QString)));
|
|
||||||
connect(m_core->progressManager(), SIGNAL(allTasksFinished(QString)),
|
|
||||||
this, SLOT(onAllTasksFinished(QString)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CppModelManager::~CppModelManager()
|
CppModelManager::~CppModelManager()
|
||||||
@@ -879,7 +871,7 @@ QStringList CppModelManager::includesInPath(const QString &path) const
|
|||||||
|
|
||||||
QFuture<void> CppModelManager::refreshSourceFiles(const QStringList &sourceFiles)
|
QFuture<void> CppModelManager::refreshSourceFiles(const QStringList &sourceFiles)
|
||||||
{
|
{
|
||||||
if (!m_indexing && !sourceFiles.isEmpty() && qgetenv("QTCREATOR_NO_CODE_INDEXER").isNull()) {
|
if (! sourceFiles.isEmpty() && qgetenv("QTCREATOR_NO_CODE_INDEXER").isNull()) {
|
||||||
const QMap<QString, QString> workingCopy = buildWorkingCopyList();
|
const QMap<QString, QString> workingCopy = buildWorkingCopyList();
|
||||||
|
|
||||||
CppPreprocessor *preproc = new CppPreprocessor(this);
|
CppPreprocessor *preproc = new CppPreprocessor(this);
|
||||||
@@ -1399,31 +1391,4 @@ void CppModelManager::GC()
|
|||||||
protectSnapshot.unlock();
|
protectSnapshot.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CppModelManager::isIndexing() const
|
|
||||||
{
|
|
||||||
return m_indexing;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CppModelManager::setIndexing(bool v)
|
|
||||||
{
|
|
||||||
if (m_indexing == v)
|
|
||||||
return;
|
|
||||||
m_indexing = v;
|
|
||||||
if (v) {
|
|
||||||
emit indexingStarted();
|
|
||||||
} else {
|
|
||||||
emit indexingFinished();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CppModelManager::onTaskStarted(const QString &type)
|
|
||||||
{
|
|
||||||
if (type == QLatin1String(CppTools::Constants::TASK_INDEX))
|
|
||||||
setIndexing(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CppModelManager::onAllTasksFinished(const QString &type)
|
|
||||||
{
|
|
||||||
if (type == QLatin1String(CppTools::Constants::TASK_INDEX))
|
|
||||||
setIndexing(false);
|
|
||||||
}
|
|
||||||
|
@@ -111,8 +111,6 @@ public:
|
|||||||
void setHeaderSuffixes(const QStringList &suffixes)
|
void setHeaderSuffixes(const QStringList &suffixes)
|
||||||
{ m_headerSuffixes = suffixes; }
|
{ m_headerSuffixes = suffixes; }
|
||||||
|
|
||||||
virtual bool isIndexing() const;
|
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void projectPathChanged(const QString &projectPath);
|
void projectPathChanged(const QString &projectPath);
|
||||||
|
|
||||||
@@ -131,8 +129,6 @@ private Q_SLOTS:
|
|||||||
void onProjectAdded(ProjectExplorer::Project *project);
|
void onProjectAdded(ProjectExplorer::Project *project);
|
||||||
void postEditorUpdate();
|
void postEditorUpdate();
|
||||||
void updateEditorSelections();
|
void updateEditorSelections();
|
||||||
void onTaskStarted(const QString &type);
|
|
||||||
void onAllTasksFinished(const QString &type);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMap<QString, QString> buildWorkingCopyList();
|
QMap<QString, QString> buildWorkingCopyList();
|
||||||
@@ -179,13 +175,10 @@ private:
|
|||||||
CppPreprocessor *preproc,
|
CppPreprocessor *preproc,
|
||||||
QStringList files);
|
QStringList files);
|
||||||
|
|
||||||
void setIndexing(bool);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Core::ICore *m_core;
|
Core::ICore *m_core;
|
||||||
CPlusPlus::Snapshot m_snapshot;
|
CPlusPlus::Snapshot m_snapshot;
|
||||||
|
|
||||||
bool m_indexing;
|
|
||||||
// cache
|
// cache
|
||||||
bool m_dirty;
|
bool m_dirty;
|
||||||
QStringList m_projectFiles;
|
QStringList m_projectFiles;
|
||||||
|
@@ -102,12 +102,6 @@ public:
|
|||||||
virtual void renameUsages(CPlusPlus::Symbol *symbol) = 0;
|
virtual void renameUsages(CPlusPlus::Symbol *symbol) = 0;
|
||||||
virtual void findUsages(CPlusPlus::Symbol *symbol) = 0;
|
virtual void findUsages(CPlusPlus::Symbol *symbol) = 0;
|
||||||
|
|
||||||
virtual bool isIndexing() const = 0;
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void indexingStarted();
|
|
||||||
void indexingFinished();
|
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void updateModifiedSourceFiles();
|
void updateModifiedSourceFiles();
|
||||||
virtual void updateSourceFiles(const QStringList &sourceFiles) = 0;
|
virtual void updateSourceFiles(const QStringList &sourceFiles) = 0;
|
||||||
|
@@ -47,7 +47,6 @@
|
|||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/progressmanager/progressmanager.h>
|
#include <coreplugin/progressmanager/progressmanager.h>
|
||||||
#include <coreplugin/vcsmanager.h>
|
|
||||||
#include <cppeditor/cppeditorconstants.h>
|
#include <cppeditor/cppeditorconstants.h>
|
||||||
|
|
||||||
#include <QtCore/QtConcurrentRun>
|
#include <QtCore/QtConcurrentRun>
|
||||||
@@ -98,11 +97,6 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
|
|||||||
|
|
||||||
// Objects
|
// Objects
|
||||||
m_modelManager = new CppModelManager(this);
|
m_modelManager = new CppModelManager(this);
|
||||||
Core::VCSManager *vcsManager = core->vcsManager();
|
|
||||||
connect(vcsManager, SIGNAL(repositoryChanged(QString)),
|
|
||||||
m_modelManager, SLOT(updateModifiedSourceFiles()));
|
|
||||||
connect(vcsManager, SIGNAL(filesChanged(QStringList)),
|
|
||||||
m_modelManager, SLOT(updateModifiedSourceFiles()));
|
|
||||||
addAutoReleasedObject(m_modelManager);
|
addAutoReleasedObject(m_modelManager);
|
||||||
|
|
||||||
m_completion = new CppCodeCompletion(m_modelManager);
|
m_completion = new CppCodeCompletion(m_modelManager);
|
||||||
|
@@ -96,14 +96,3 @@ QString CVSControl::findTopLevelForDirectory(const QString &directory) const
|
|||||||
{
|
{
|
||||||
return m_plugin->findTopLevelForDirectory(directory);
|
return m_plugin->findTopLevelForDirectory(directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVSControl::emitRepositoryChanged(const QString &s)
|
|
||||||
{
|
|
||||||
emit repositoryChanged(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CVSControl::emitFilesChanged(const QStringList &l)
|
|
||||||
{
|
|
||||||
emit filesChanged(l);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@@ -56,9 +56,6 @@ public:
|
|||||||
virtual bool vcsAdd(const QString &fileName);
|
virtual bool vcsAdd(const QString &fileName);
|
||||||
virtual bool vcsDelete(const QString &filename);
|
virtual bool vcsDelete(const QString &filename);
|
||||||
|
|
||||||
void emitRepositoryChanged(const QString &s);
|
|
||||||
void emitFilesChanged(const QStringList &l);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void enabledChanged(bool);
|
void enabledChanged(bool);
|
||||||
|
|
||||||
|
@@ -551,11 +551,9 @@ void CVSPlugin::revertCurrentFile()
|
|||||||
QStringList args(QLatin1String("update"));
|
QStringList args(QLatin1String("update"));
|
||||||
args.push_back(QLatin1String("-C"));
|
args.push_back(QLatin1String("-C"));
|
||||||
|
|
||||||
const QStringList files = QStringList(file);
|
const CVSResponse revertResponse = runCVS(args, QStringList(file), cvsShortTimeOut, true);
|
||||||
const CVSResponse revertResponse = runCVS(args, files, cvsShortTimeOut, true);
|
|
||||||
if (revertResponse.result == CVSResponse::Ok) {
|
if (revertResponse.result == CVSResponse::Ok) {
|
||||||
fcb.setModifiedReload(true);
|
fcb.setModifiedReload(true);
|
||||||
m_versionControl->emitFilesChanged(files);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -736,10 +734,7 @@ void CVSPlugin::updateProject()
|
|||||||
if (!topLevels.empty()) {
|
if (!topLevels.empty()) {
|
||||||
QStringList args(QLatin1String("update"));
|
QStringList args(QLatin1String("update"));
|
||||||
args.push_back(QLatin1String("-dR"));
|
args.push_back(QLatin1String("-dR"));
|
||||||
const CVSResponse response = runCVS(args, topLevels, cvsLongTimeOut, true);
|
runCVS(args, topLevels, cvsLongTimeOut, true);
|
||||||
if (response.result == CVSResponse::Ok)
|
|
||||||
foreach(const QString &topLevel, topLevels)
|
|
||||||
m_versionControl->emitRepositoryChanged(topLevel);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -59,7 +59,6 @@ namespace CVS {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CVSSubmitEditor;
|
class CVSSubmitEditor;
|
||||||
class CVSControl;
|
|
||||||
|
|
||||||
struct CVSResponse
|
struct CVSResponse
|
||||||
{
|
{
|
||||||
@@ -154,7 +153,7 @@ private:
|
|||||||
void cleanCommitMessageFile();
|
void cleanCommitMessageFile();
|
||||||
|
|
||||||
CVSSettings m_settings;
|
CVSSettings m_settings;
|
||||||
CVSControl *m_versionControl;
|
Core::IVersionControl *m_versionControl;
|
||||||
QString m_commitMessageFileName;
|
QString m_commitMessageFileName;
|
||||||
|
|
||||||
ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer;
|
ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer;
|
||||||
|
@@ -34,7 +34,6 @@
|
|||||||
#include "gitconstants.h"
|
#include "gitconstants.h"
|
||||||
#include "gitplugin.h"
|
#include "gitplugin.h"
|
||||||
#include "gitsubmiteditor.h"
|
#include "gitsubmiteditor.h"
|
||||||
#include "gitversioncontrol.h"
|
|
||||||
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
@@ -44,9 +43,6 @@
|
|||||||
#include <coreplugin/progressmanager/progressmanager.h>
|
#include <coreplugin/progressmanager/progressmanager.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
#include <coreplugin/uniqueidmanager.h>
|
||||||
#include <coreplugin/filemanager.h>
|
#include <coreplugin/filemanager.h>
|
||||||
#include <coreplugin/filemanager.h>
|
|
||||||
#include <coreplugin/iversioncontrol.h>
|
|
||||||
|
|
||||||
#include <texteditor/itexteditor.h>
|
#include <texteditor/itexteditor.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <vcsbase/vcsbaseeditor.h>
|
#include <vcsbase/vcsbaseeditor.h>
|
||||||
@@ -59,7 +55,6 @@
|
|||||||
#include <QtCore/QTime>
|
#include <QtCore/QTime>
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtCore/QSignalMapper>
|
|
||||||
|
|
||||||
#include <QtGui/QMainWindow> // for msg box parent
|
#include <QtGui/QMainWindow> // for msg box parent
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtGui/QMessageBox>
|
||||||
@@ -107,8 +102,7 @@ static QString formatCommand(const QString &binary, const QStringList &args)
|
|||||||
GitClient::GitClient(GitPlugin* plugin)
|
GitClient::GitClient(GitPlugin* plugin)
|
||||||
: m_msgWait(tr("Waiting for data...")),
|
: m_msgWait(tr("Waiting for data...")),
|
||||||
m_plugin(plugin),
|
m_plugin(plugin),
|
||||||
m_core(Core::ICore::instance()),
|
m_core(Core::ICore::instance())
|
||||||
m_repositoryChangedSignalMapper(0)
|
|
||||||
{
|
{
|
||||||
if (QSettings *s = m_core->settings()) {
|
if (QSettings *s = m_core->settings()) {
|
||||||
m_settings.fromSettings(s);
|
m_settings.fromSettings(s);
|
||||||
@@ -323,8 +317,7 @@ void GitClient::checkoutBranch(const QString &workingDirectory, const QString &b
|
|||||||
{
|
{
|
||||||
QStringList arguments(QLatin1String("checkout"));
|
QStringList arguments(QLatin1String("checkout"));
|
||||||
arguments << branch;
|
arguments << branch;
|
||||||
GitCommand *cmd = executeGit(workingDirectory, arguments, 0, true);
|
executeGit(workingDirectory, arguments, 0, true);
|
||||||
connectRepositoryChanged(workingDirectory, cmd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitClient::checkout(const QString &workingDirectory, const QString &fileName)
|
void GitClient::checkout(const QString &workingDirectory, const QString &fileName)
|
||||||
@@ -348,8 +341,7 @@ void GitClient::hardReset(const QString &workingDirectory, const QString &commit
|
|||||||
if (!commit.isEmpty())
|
if (!commit.isEmpty())
|
||||||
arguments << commit;
|
arguments << commit;
|
||||||
|
|
||||||
GitCommand *cmd = executeGit(workingDirectory, arguments, 0, true);
|
executeGit(workingDirectory, arguments, 0, true);
|
||||||
connectRepositoryChanged(workingDirectory, cmd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitClient::addFile(const QString &workingDirectory, const QString &fileName)
|
void GitClient::addFile(const QString &workingDirectory, const QString &fileName)
|
||||||
@@ -508,7 +500,7 @@ GitCommand *GitClient::createCommand(const QString &workingDirectory,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Execute a single command
|
// Execute a single command
|
||||||
GitCommand *GitClient::executeGit(const QString &workingDirectory,
|
void GitClient::executeGit(const QString &workingDirectory,
|
||||||
const QStringList &arguments,
|
const QStringList &arguments,
|
||||||
VCSBase::VCSBaseEditor* editor,
|
VCSBase::VCSBaseEditor* editor,
|
||||||
bool outputToWindow,
|
bool outputToWindow,
|
||||||
@@ -520,7 +512,6 @@ GitCommand *GitClient::executeGit(const QString &workingDirectory,
|
|||||||
command->addJob(arguments, m_settings.timeout);
|
command->addJob(arguments, m_settings.timeout);
|
||||||
command->setTerminationReportMode(tm);
|
command->setTerminationReportMode(tm);
|
||||||
command->execute();
|
command->execute();
|
||||||
return command;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return fixed arguments required to run
|
// Return fixed arguments required to run
|
||||||
@@ -912,8 +903,6 @@ void GitClient::revert(const QStringList &files)
|
|||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
switch (revertI(files, &isDirectory, &errorMessage)) {
|
switch (revertI(files, &isDirectory, &errorMessage)) {
|
||||||
case RevertOk:
|
case RevertOk:
|
||||||
m_plugin->versionControl()->emitFilesChanged(files);
|
|
||||||
break;
|
|
||||||
case RevertCanceled:
|
case RevertCanceled:
|
||||||
break;
|
break;
|
||||||
case RevertUnchanged: {
|
case RevertUnchanged: {
|
||||||
@@ -929,8 +918,7 @@ void GitClient::revert(const QStringList &files)
|
|||||||
|
|
||||||
void GitClient::pull(const QString &workingDirectory)
|
void GitClient::pull(const QString &workingDirectory)
|
||||||
{
|
{
|
||||||
GitCommand *cmd = executeGit(workingDirectory, QStringList(QLatin1String("pull")), 0, true, GitCommand::ReportStderr);
|
executeGit(workingDirectory, QStringList(QLatin1String("pull")), 0, true, GitCommand::ReportStderr);
|
||||||
connectRepositoryChanged(workingDirectory, cmd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitClient::push(const QString &workingDirectory)
|
void GitClient::push(const QString &workingDirectory)
|
||||||
@@ -964,8 +952,7 @@ void GitClient::stashPop(const QString &workingDirectory)
|
|||||||
{
|
{
|
||||||
QStringList arguments(QLatin1String("stash"));
|
QStringList arguments(QLatin1String("stash"));
|
||||||
arguments << QLatin1String("pop");
|
arguments << QLatin1String("pop");
|
||||||
GitCommand *cmd = executeGit(workingDirectory, arguments, 0, true);
|
executeGit(workingDirectory, arguments, 0, true);
|
||||||
connectRepositoryChanged(workingDirectory, cmd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitClient::branchList(const QString &workingDirectory)
|
void GitClient::branchList(const QString &workingDirectory)
|
||||||
@@ -1013,16 +1000,3 @@ void GitClient::setSettings(const GitSettings &s)
|
|||||||
m_binaryPath = m_settings.gitBinaryPath();
|
m_binaryPath = m_settings.gitBinaryPath();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitClient::connectRepositoryChanged(const QString & repository, GitCommand *cmd)
|
|
||||||
{
|
|
||||||
// Bind command success termination with repository to changed signal
|
|
||||||
if (!m_repositoryChangedSignalMapper) {
|
|
||||||
m_repositoryChangedSignalMapper = new QSignalMapper(this);
|
|
||||||
connect(m_repositoryChangedSignalMapper, SIGNAL(mapped(QString)),
|
|
||||||
m_plugin->versionControl(), SIGNAL(repositoryChanged(QString)));
|
|
||||||
}
|
|
||||||
m_repositoryChangedSignalMapper->setMapping(cmd, repository);
|
|
||||||
connect(cmd, SIGNAL(success()), m_repositoryChangedSignalMapper, SLOT(map()),
|
|
||||||
Qt::QueuedConnection);
|
|
||||||
}
|
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
#include "gitsettings.h"
|
#include "gitsettings.h"
|
||||||
#include "gitcommand.h"
|
#include "gitcommand.h"
|
||||||
|
|
||||||
|
#include <coreplugin/iversioncontrol.h>
|
||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
|
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
@@ -40,7 +41,6 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QErrorMessage;
|
class QErrorMessage;
|
||||||
class QSignalMapper;
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
@@ -158,7 +158,7 @@ private:
|
|||||||
bool outputToWindow = false,
|
bool outputToWindow = false,
|
||||||
int editorLineNumber = -1);
|
int editorLineNumber = -1);
|
||||||
|
|
||||||
GitCommand *executeGit(const QString &workingDirectory,
|
void executeGit(const QString &workingDirectory,
|
||||||
const QStringList &arguments,
|
const QStringList &arguments,
|
||||||
VCSBase::VCSBaseEditor* editor = 0,
|
VCSBase::VCSBaseEditor* editor = 0,
|
||||||
bool outputToWindow = false,
|
bool outputToWindow = false,
|
||||||
@@ -173,14 +173,12 @@ private:
|
|||||||
|
|
||||||
enum RevertResult { RevertOk, RevertUnchanged, RevertCanceled, RevertFailed };
|
enum RevertResult { RevertOk, RevertUnchanged, RevertCanceled, RevertFailed };
|
||||||
RevertResult revertI(QStringList files, bool *isDirectory, QString *errorMessage);
|
RevertResult revertI(QStringList files, bool *isDirectory, QString *errorMessage);
|
||||||
void connectRepositoryChanged(const QString & repository, GitCommand *cmd);
|
|
||||||
|
|
||||||
const QString m_msgWait;
|
const QString m_msgWait;
|
||||||
GitPlugin *m_plugin;
|
GitPlugin *m_plugin;
|
||||||
Core::ICore *m_core;
|
Core::ICore *m_core;
|
||||||
GitSettings m_settings;
|
GitSettings m_settings;
|
||||||
QString m_binaryPath;
|
QString m_binaryPath;
|
||||||
QSignalMapper *m_repositoryChangedSignalMapper;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -177,8 +177,6 @@ void GitCommand::run()
|
|||||||
emit errorText(error);
|
emit errorText(error);
|
||||||
|
|
||||||
emit finished(ok, m_cookie);
|
emit finished(ok, m_cookie);
|
||||||
if (ok)
|
|
||||||
emit success();
|
|
||||||
// As it is used asynchronously, we need to delete ourselves
|
// As it is used asynchronously, we need to delete ourselves
|
||||||
this->deleteLater();
|
this->deleteLater();
|
||||||
}
|
}
|
||||||
|
@@ -73,7 +73,6 @@ Q_SIGNALS:
|
|||||||
void outputData(const QByteArray&);
|
void outputData(const QByteArray&);
|
||||||
void errorText(const QString&);
|
void errorText(const QString&);
|
||||||
void finished(bool ok, const QVariant &cookie);
|
void finished(bool ok, const QVariant &cookie);
|
||||||
void success();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct Job {
|
struct Job {
|
||||||
|
@@ -142,7 +142,6 @@ GitPlugin::GitPlugin() :
|
|||||||
m_stashListAction(0),
|
m_stashListAction(0),
|
||||||
m_branchListAction(0),
|
m_branchListAction(0),
|
||||||
m_gitClient(0),
|
m_gitClient(0),
|
||||||
m_versionControl(0),
|
|
||||||
m_changeSelectionDialog(0),
|
m_changeSelectionDialog(0),
|
||||||
m_submitActionTriggered(false)
|
m_submitActionTriggered(false)
|
||||||
{
|
{
|
||||||
@@ -216,8 +215,8 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
|
|
||||||
addAutoReleasedObject(new GitSubmitEditorFactory(&submitParameters));
|
addAutoReleasedObject(new GitSubmitEditorFactory(&submitParameters));
|
||||||
|
|
||||||
m_versionControl = new GitVersionControl(m_gitClient);
|
GitVersionControl *versionControl = new GitVersionControl(m_gitClient);
|
||||||
addAutoReleasedObject(m_versionControl);
|
addAutoReleasedObject(versionControl);
|
||||||
|
|
||||||
addAutoReleasedObject(new CloneWizard);
|
addAutoReleasedObject(new CloneWizard);
|
||||||
addAutoReleasedObject(new Gitorious::Internal::GitoriousCloneWizard);
|
addAutoReleasedObject(new Gitorious::Internal::GitoriousCloneWizard);
|
||||||
@@ -233,8 +232,8 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
gitContainer->menu()->setTitle(tr("&Git"));
|
gitContainer->menu()->setTitle(tr("&Git"));
|
||||||
toolsContainer->addMenu(gitContainer);
|
toolsContainer->addMenu(gitContainer);
|
||||||
if (QAction *ma = gitContainer->menu()->menuAction()) {
|
if (QAction *ma = gitContainer->menu()->menuAction()) {
|
||||||
ma->setEnabled(m_versionControl->isEnabled());
|
ma->setEnabled(versionControl->isEnabled());
|
||||||
connect(m_versionControl, SIGNAL(enabledChanged(bool)), ma, SLOT(setVisible(bool)));
|
connect(versionControl, SIGNAL(enabledChanged(bool)), ma, SLOT(setVisible(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Command *command;
|
Core::Command *command;
|
||||||
@@ -399,11 +398,6 @@ void GitPlugin::extensionsInitialized()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
GitVersionControl *GitPlugin::versionControl() const
|
|
||||||
{
|
|
||||||
return m_versionControl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GitPlugin::submitEditorDiff(const QStringList &unstaged, const QStringList &staged)
|
void GitPlugin::submitEditorDiff(const QStringList &unstaged, const QStringList &staged)
|
||||||
{
|
{
|
||||||
m_gitClient->diff(m_submitRepository, QStringList(), unstaged, staged);
|
m_gitClient->diff(m_submitRepository, QStringList(), unstaged, staged);
|
||||||
|
@@ -59,7 +59,6 @@ namespace Git {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class GitPlugin;
|
class GitPlugin;
|
||||||
class GitVersionControl;
|
|
||||||
class GitClient;
|
class GitClient;
|
||||||
class ChangeSelectionDialog;
|
class ChangeSelectionDialog;
|
||||||
class GitSubmitEditor;
|
class GitSubmitEditor;
|
||||||
@@ -97,7 +96,6 @@ public:
|
|||||||
void setSettings(const GitSettings &s);
|
void setSettings(const GitSettings &s);
|
||||||
|
|
||||||
GitClient *gitClient() const;
|
GitClient *gitClient() const;
|
||||||
GitVersionControl *versionControl() const;
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void updateActions();
|
void updateActions();
|
||||||
@@ -161,7 +159,6 @@ private:
|
|||||||
QAction *m_branchListAction;
|
QAction *m_branchListAction;
|
||||||
|
|
||||||
GitClient *m_gitClient;
|
GitClient *m_gitClient;
|
||||||
GitVersionControl *m_versionControl;
|
|
||||||
ChangeSelectionDialog *m_changeSelectionDialog;
|
ChangeSelectionDialog *m_changeSelectionDialog;
|
||||||
QString m_submitRepository;
|
QString m_submitRepository;
|
||||||
QStringList m_submitOrigCommitFiles;
|
QStringList m_submitOrigCommitFiles;
|
||||||
|
@@ -96,10 +96,5 @@ QString GitVersionControl::findTopLevelForDirectory(const QString &directory) co
|
|||||||
return GitClient::findRepositoryForDirectory(directory);
|
return GitClient::findRepositoryForDirectory(directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitVersionControl::emitFilesChanged(const QStringList &l)
|
|
||||||
{
|
|
||||||
emit filesChanged(l);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // Internal
|
} // Internal
|
||||||
} // Git
|
} // Git
|
||||||
|
@@ -57,8 +57,6 @@ public:
|
|||||||
virtual bool vcsAdd(const QString &fileName);
|
virtual bool vcsAdd(const QString &fileName);
|
||||||
virtual bool vcsDelete(const QString &filename);
|
virtual bool vcsDelete(const QString &filename);
|
||||||
|
|
||||||
void emitFilesChanged(const QStringList &);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void enabledChanged(bool);
|
void enabledChanged(bool);
|
||||||
|
|
||||||
|
@@ -454,8 +454,6 @@ void PerforcePlugin::revertCurrentFile()
|
|||||||
Core::FileChangeBlocker fcb(fileName);
|
Core::FileChangeBlocker fcb(fileName);
|
||||||
fcb.setModifiedReload(true);
|
fcb.setModifiedReload(true);
|
||||||
PerforceResponse result2 = runP4Cmd(QStringList() << QLatin1String("revert") << fileName, QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow);
|
PerforceResponse result2 = runP4Cmd(QStringList() << QLatin1String("revert") << fileName, QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow);
|
||||||
if (!result2.error)
|
|
||||||
m_versionControl->emitFilesChanged(QStringList(fileName));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PerforcePlugin::diffCurrentFile()
|
void PerforcePlugin::diffCurrentFile()
|
||||||
@@ -516,10 +514,7 @@ void PerforcePlugin::updateCheckout(const QStringList &dirs)
|
|||||||
{
|
{
|
||||||
QStringList args(QLatin1String("sync"));
|
QStringList args(QLatin1String("sync"));
|
||||||
args.append(dirs);
|
args.append(dirs);
|
||||||
const PerforceResponse resp = runP4Cmd(args, QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow);
|
runP4Cmd(args, QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow);
|
||||||
if (!dirs.empty())
|
|
||||||
foreach(const QString &dir, dirs)
|
|
||||||
m_versionControl->emitRepositoryChanged(dir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PerforcePlugin::printOpenedFileList()
|
void PerforcePlugin::printOpenedFileList()
|
||||||
|
@@ -94,15 +94,5 @@ QString PerforceVersionControl::findTopLevelForDirectory(const QString &director
|
|||||||
return m_plugin->findTopLevelForDirectory(directory);
|
return m_plugin->findTopLevelForDirectory(directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PerforceVersionControl::emitRepositoryChanged(const QString &s)
|
|
||||||
{
|
|
||||||
emit repositoryChanged(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PerforceVersionControl::emitFilesChanged(const QStringList &l)
|
|
||||||
{
|
|
||||||
emit filesChanged(l);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // Internal
|
} // Internal
|
||||||
} // Perforce
|
} // Perforce
|
||||||
|
@@ -56,9 +56,6 @@ public:
|
|||||||
virtual bool vcsAdd(const QString &fileName);
|
virtual bool vcsAdd(const QString &fileName);
|
||||||
virtual bool vcsDelete(const QString &filename);
|
virtual bool vcsDelete(const QString &filename);
|
||||||
|
|
||||||
void emitRepositoryChanged(const QString &s);
|
|
||||||
void emitFilesChanged(const QStringList &l);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void enabledChanged(bool);
|
void enabledChanged(bool);
|
||||||
|
|
||||||
|
@@ -96,13 +96,3 @@ QString SubversionControl::findTopLevelForDirectory(const QString &directory) co
|
|||||||
{
|
{
|
||||||
return m_plugin->findTopLevelForDirectory(directory);
|
return m_plugin->findTopLevelForDirectory(directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubversionControl::emitRepositoryChanged(const QString &s)
|
|
||||||
{
|
|
||||||
emit repositoryChanged(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SubversionControl::emitFilesChanged(const QStringList &l)
|
|
||||||
{
|
|
||||||
emit filesChanged(l);
|
|
||||||
}
|
|
||||||
|
@@ -56,9 +56,6 @@ public:
|
|||||||
virtual bool vcsAdd(const QString &fileName);
|
virtual bool vcsAdd(const QString &fileName);
|
||||||
virtual bool vcsDelete(const QString &filename);
|
virtual bool vcsDelete(const QString &filename);
|
||||||
|
|
||||||
void emitRepositoryChanged(const QString &);
|
|
||||||
void emitFilesChanged(const QStringList &);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void enabledChanged(bool);
|
void enabledChanged(bool);
|
||||||
|
|
||||||
|
@@ -574,7 +574,6 @@ void SubversionPlugin::revertCurrentFile()
|
|||||||
const SubversionResponse revertResponse = runSvn(args, subversionShortTimeOut, true);
|
const SubversionResponse revertResponse = runSvn(args, subversionShortTimeOut, true);
|
||||||
if (!revertResponse.error) {
|
if (!revertResponse.error) {
|
||||||
fcb.setModifiedReload(true);
|
fcb.setModifiedReload(true);
|
||||||
m_versionControl->emitFilesChanged(QStringList(file));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -751,10 +750,7 @@ void SubversionPlugin::updateProject()
|
|||||||
QStringList args(QLatin1String("update"));
|
QStringList args(QLatin1String("update"));
|
||||||
args.push_back(QLatin1String(nonInteractiveOptionC));
|
args.push_back(QLatin1String(nonInteractiveOptionC));
|
||||||
args.append(topLevels);
|
args.append(topLevels);
|
||||||
const SubversionResponse response = runSvn(args, subversionLongTimeOut, true);
|
runSvn(args, subversionLongTimeOut, true);
|
||||||
if (!response.error)
|
|
||||||
foreach(const QString &repo, topLevels)
|
|
||||||
m_versionControl->emitRepositoryChanged(repo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubversionPlugin::annotateCurrentFile()
|
void SubversionPlugin::annotateCurrentFile()
|
||||||
|
@@ -56,7 +56,6 @@ namespace Subversion {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class SubversionSubmitEditor;
|
class SubversionSubmitEditor;
|
||||||
class SubversionControl;
|
|
||||||
|
|
||||||
struct SubversionResponse
|
struct SubversionResponse
|
||||||
{
|
{
|
||||||
@@ -132,7 +131,7 @@ private:
|
|||||||
const QStringList m_svnDirectories;
|
const QStringList m_svnDirectories;
|
||||||
|
|
||||||
SubversionSettings m_settings;
|
SubversionSettings m_settings;
|
||||||
SubversionControl *m_versionControl;
|
Core::IVersionControl *m_versionControl;
|
||||||
QString m_commitMessageFileName;
|
QString m_commitMessageFileName;
|
||||||
|
|
||||||
ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer;
|
ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer;
|
||||||
|
Reference in New Issue
Block a user