forked from qt-creator/qt-creator
Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
Conflicts: src/plugins/perforce/perforceplugin.cpp
This commit is contained in:
@@ -97,10 +97,10 @@ static QString formatCommand(const QString &binary, const QStringList &args)
|
||||
}
|
||||
|
||||
// ---------------- GitClient
|
||||
GitClient::GitClient(GitPlugin* plugin, Core::ICore *core) :
|
||||
m_msgWait(tr("Waiting for data...")),
|
||||
GitClient::GitClient(GitPlugin* plugin)
|
||||
: m_msgWait(tr("Waiting for data...")),
|
||||
m_plugin(plugin),
|
||||
m_core(core)
|
||||
m_core(Core::ICore::instance())
|
||||
{
|
||||
if (QSettings *s = m_core->settings())
|
||||
m_settings.fromSettings(s);
|
||||
@@ -178,7 +178,7 @@ VCSBase::VCSBaseEditor
|
||||
QTC_ASSERT(rc, return 0);
|
||||
rc->setSource(source);
|
||||
if (setSourceCodec)
|
||||
rc->setCodec(VCSBase::VCSBaseEditor::getCodec(m_core, source));
|
||||
rc->setCodec(VCSBase::VCSBaseEditor::getCodec(source));
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class GitClient : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GitClient(GitPlugin *plugin, Core::ICore *core);
|
||||
explicit GitClient(GitPlugin *plugin);
|
||||
~GitClient();
|
||||
|
||||
bool managesDirectory(const QString &) const { return false; }
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QProcess>
|
||||
@@ -83,8 +84,7 @@ void GitCommand::execute()
|
||||
QFuture<void> task = QtConcurrent::run(this, &GitCommand::run);
|
||||
const QString taskName = QLatin1String("Git ") + m_jobs.front().arguments.at(0);
|
||||
|
||||
Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
core->progressManager()->addTask(task, taskName,
|
||||
Core::ICore::instance()->progressManager()->addTask(task, taskName,
|
||||
QLatin1String("Git.action"),
|
||||
Core::ProgressManager::CloseOnSuccess);
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -56,11 +57,11 @@
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QTemporaryFile>
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QFileDialog>
|
||||
@@ -231,8 +232,8 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
|
||||
Q_UNUSED(arguments);
|
||||
Q_UNUSED(error_message);
|
||||
|
||||
m_core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
|
||||
m_gitClient = new GitClient(this, m_core);
|
||||
m_core = Core::ICore::instance();
|
||||
m_gitClient = new GitClient(this);
|
||||
// Create the globalcontext list to register actions accordingly
|
||||
QList<int> globalcontext;
|
||||
globalcontext << m_core->uniqueIDManager()->
|
||||
@@ -249,7 +250,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
|
||||
static const char *describeSlot = SLOT(show(QString,QString));
|
||||
const int editorCount = sizeof(editorParameters)/sizeof(VCSBase::VCSBaseEditorParameters);
|
||||
for (int i = 0; i < editorCount; i++) {
|
||||
m_editorFactories.push_back(new GitEditorFactory(editorParameters + i, m_core, m_gitClient, describeSlot));
|
||||
m_editorFactories.push_back(new GitEditorFactory(editorParameters + i, m_gitClient, describeSlot));
|
||||
addObject(m_editorFactories.back());
|
||||
}
|
||||
|
||||
@@ -621,7 +622,7 @@ void GitPlugin::startCommit()
|
||||
|
||||
Core::IEditor *GitPlugin::openSubmitEditor(const QString &fileName, const CommitData &cd)
|
||||
{
|
||||
Core::IEditor *editor = m_core->editorManager()->openEditor(fileName, QLatin1String(Constants::GITSUBMITEDITOR_KIND));
|
||||
Core::IEditor *editor = m_core->editorManager()->openEditor(fileName, QLatin1String(Constants::GITSUBMITEDITOR_KIND));
|
||||
if (Git::Constants::debug)
|
||||
qDebug() << Q_FUNC_INFO << fileName << editor;
|
||||
m_core->editorManager()->ensureEditorManagerVisible();
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
|
||||
#include <coreplugin/editormanager/ieditorfactory.h>
|
||||
#include <coreplugin/icorelistener.h>
|
||||
#include <projectexplorer/ProjectExplorerInterfaces>
|
||||
#include <extensionsystem/iplugin.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QProcess>
|
||||
@@ -53,20 +53,20 @@ class QTemporaryFile;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
class IEditorFactory;
|
||||
class ICore;
|
||||
class IVersionControl;
|
||||
}
|
||||
class IEditorFactory;
|
||||
class ICore;
|
||||
class IVersionControl;
|
||||
} // namespace Core
|
||||
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
class GitPlugin;
|
||||
class GitClient;
|
||||
class ChangeSelectionDialog;
|
||||
class GitSubmitEditor;
|
||||
struct CommitData;
|
||||
struct GitSettings;
|
||||
class GitPlugin;
|
||||
class GitClient;
|
||||
class ChangeSelectionDialog;
|
||||
class GitSubmitEditor;
|
||||
struct CommitData;
|
||||
struct GitSettings;
|
||||
|
||||
// Just a proxy for GitPlugin
|
||||
class CoreListener : public Core::ICoreListener
|
||||
@@ -85,83 +85,83 @@ class GitPlugin : public ExtensionSystem::IPlugin
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GitPlugin();
|
||||
~GitPlugin();
|
||||
GitPlugin();
|
||||
~GitPlugin();
|
||||
|
||||
static GitPlugin *instance();
|
||||
|
||||
bool initialize(const QStringList &arguments
|
||||
, QString *error_message);
|
||||
void extensionsInitialized();
|
||||
bool initialize(const QStringList &arguments, QString *error_message);
|
||||
void extensionsInitialized();
|
||||
|
||||
QString getWorkingDirectory();
|
||||
QString getWorkingDirectory();
|
||||
|
||||
GitOutputWindow *outputWindow() const;
|
||||
GitOutputWindow *outputWindow() const;
|
||||
|
||||
|
||||
GitSettings settings() const;
|
||||
GitSettings settings() const;
|
||||
void setSettings(const GitSettings &s);
|
||||
|
||||
public slots:
|
||||
void updateActions();
|
||||
bool editorAboutToClose(Core::IEditor *editor);
|
||||
void updateActions();
|
||||
bool editorAboutToClose(Core::IEditor *editor);
|
||||
|
||||
private slots:
|
||||
void diffCurrentFile();
|
||||
void diffCurrentProject();
|
||||
void submitEditorDiff(const QStringList &unstaged, const QStringList &staged);
|
||||
void submitCurrentLog();
|
||||
void statusFile();
|
||||
void statusProject();
|
||||
void logFile();
|
||||
void blameFile();
|
||||
void logProject();
|
||||
void undoFileChanges();
|
||||
void undoProjectChanges();
|
||||
void stageFile();
|
||||
void unstageFile();
|
||||
void revertFile();
|
||||
void diffCurrentFile();
|
||||
void diffCurrentProject();
|
||||
void submitEditorDiff(const QStringList &unstaged, const QStringList &staged);
|
||||
void submitCurrentLog();
|
||||
void statusFile();
|
||||
void statusProject();
|
||||
void logFile();
|
||||
void blameFile();
|
||||
void logProject();
|
||||
void undoFileChanges();
|
||||
void undoProjectChanges();
|
||||
void stageFile();
|
||||
void unstageFile();
|
||||
void revertFile();
|
||||
|
||||
void showCommit();
|
||||
void startCommit();
|
||||
void stash();
|
||||
void stashPop();
|
||||
void branchList();
|
||||
void stashList();
|
||||
void pull();
|
||||
void push();
|
||||
void showCommit();
|
||||
void startCommit();
|
||||
void stash();
|
||||
void stashPop();
|
||||
void branchList();
|
||||
void stashList();
|
||||
void pull();
|
||||
void push();
|
||||
|
||||
private:
|
||||
QFileInfo currentFile() const;
|
||||
Core::IEditor *openSubmitEditor(const QString &fileName, const CommitData &cd);
|
||||
void cleanChangeTmpFile();
|
||||
QFileInfo currentFile() const;
|
||||
Core::IEditor *openSubmitEditor(const QString &fileName, const CommitData &cd);
|
||||
void cleanChangeTmpFile();
|
||||
|
||||
static GitPlugin *m_instance;
|
||||
Core::ICore *m_core;
|
||||
QAction *m_diffAction;
|
||||
QAction *m_diffProjectAction;
|
||||
QAction *m_statusAction;
|
||||
QAction *m_statusProjectAction;
|
||||
QAction *m_logAction;
|
||||
QAction *m_blameAction;
|
||||
QAction *m_logProjectAction;
|
||||
QAction *m_undoFileAction;
|
||||
QAction *m_undoProjectAction;
|
||||
QAction *m_showAction;
|
||||
QAction *m_stageAction;
|
||||
QAction *m_unstageAction;
|
||||
QAction *m_revertAction;
|
||||
QAction *m_commitAction;
|
||||
QAction *m_pullAction;
|
||||
QAction *m_pushAction;
|
||||
static GitPlugin *m_instance;
|
||||
Core::ICore *m_core;
|
||||
QAction *m_diffAction;
|
||||
QAction *m_diffProjectAction;
|
||||
QAction *m_statusAction;
|
||||
QAction *m_statusProjectAction;
|
||||
QAction *m_logAction;
|
||||
QAction *m_blameAction;
|
||||
QAction *m_logProjectAction;
|
||||
QAction *m_undoFileAction;
|
||||
QAction *m_undoProjectAction;
|
||||
QAction *m_showAction;
|
||||
QAction *m_stageAction;
|
||||
QAction *m_unstageAction;
|
||||
QAction *m_revertAction;
|
||||
QAction *m_commitAction;
|
||||
QAction *m_pullAction;
|
||||
QAction *m_pushAction;
|
||||
|
||||
QAction *m_submitCurrentAction;
|
||||
QAction *m_diffSelectedFilesAction;
|
||||
QAction *m_undoAction;
|
||||
QAction *m_redoAction;
|
||||
QAction *m_stashAction;
|
||||
QAction *m_stashPopAction;
|
||||
QAction *m_stashListAction;
|
||||
QAction *m_branchListAction;
|
||||
QAction *m_submitCurrentAction;
|
||||
QAction *m_diffSelectedFilesAction;
|
||||
QAction *m_undoAction;
|
||||
QAction *m_redoAction;
|
||||
QAction *m_stashAction;
|
||||
QAction *m_stashPopAction;
|
||||
QAction *m_stashListAction;
|
||||
QAction *m_branchListAction;
|
||||
|
||||
ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer;
|
||||
GitClient *m_gitClient;
|
||||
|
||||
Reference in New Issue
Block a user