forked from qt-creator/qt-creator
Perforce: singleton cleanup
Task-number: QTCREATORBUG-9763 Change-Id: I8dbf3c1e5b7e1bea525123bf02a7e9952c94abe2 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -59,8 +59,7 @@ namespace Internal {
|
|||||||
PerforceEditor::PerforceEditor(const VcsBase::VcsBaseEditorParameters *type,
|
PerforceEditor::PerforceEditor(const VcsBase::VcsBaseEditorParameters *type,
|
||||||
QWidget *parent) :
|
QWidget *parent) :
|
||||||
VcsBase::VcsBaseEditorWidget(type, parent),
|
VcsBase::VcsBaseEditorWidget(type, parent),
|
||||||
m_changeNumberPattern(QLatin1String("^\\d+$")),
|
m_changeNumberPattern(QLatin1String("^\\d+$"))
|
||||||
m_plugin(PerforcePlugin::perforcePluginInstance())
|
|
||||||
{
|
{
|
||||||
QTC_CHECK(m_changeNumberPattern.isValid());
|
QTC_CHECK(m_changeNumberPattern.isValid());
|
||||||
// Diff format:
|
// Diff format:
|
||||||
@@ -119,7 +118,7 @@ VcsBase::BaseAnnotationHighlighter *PerforceEditor::createAnnotationHighlighter(
|
|||||||
QString PerforceEditor::findDiffFile(const QString &f) const
|
QString PerforceEditor::findDiffFile(const QString &f) const
|
||||||
{
|
{
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
const QString fileName = m_plugin->fileNameFromPerforceName(f.trimmed(), false, &errorMessage);
|
const QString fileName = PerforcePlugin::fileNameFromPerforceName(f.trimmed(), false, &errorMessage);
|
||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
qWarning("%s", qPrintable(errorMessage));
|
qWarning("%s", qPrintable(errorMessage));
|
||||||
return fileName;
|
return fileName;
|
||||||
|
@@ -55,7 +55,6 @@ private:
|
|||||||
QStringList annotationPreviousVersions(const QString &v) const;
|
QStringList annotationPreviousVersions(const QString &v) const;
|
||||||
|
|
||||||
mutable QRegExp m_changeNumberPattern;
|
mutable QRegExp m_changeNumberPattern;
|
||||||
PerforcePlugin *m_plugin;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Perforce
|
} // namespace Perforce
|
||||||
|
@@ -165,7 +165,7 @@ PerforceResponse::PerforceResponse() :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
PerforcePlugin *PerforcePlugin::m_perforcePluginInstance = NULL;
|
PerforcePlugin *PerforcePlugin::m_instance = NULL;
|
||||||
|
|
||||||
PerforcePlugin::PerforcePlugin() :
|
PerforcePlugin::PerforcePlugin() :
|
||||||
m_commandLocator(0),
|
m_commandLocator(0),
|
||||||
@@ -215,7 +215,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
|
|||||||
|
|
||||||
if (!Core::ICore::mimeDatabase()->addMimeTypes(QLatin1String(":/trolltech.perforce/Perforce.mimetypes.xml"), errorMessage))
|
if (!Core::ICore::mimeDatabase()->addMimeTypes(QLatin1String(":/trolltech.perforce/Perforce.mimetypes.xml"), errorMessage))
|
||||||
return false;
|
return false;
|
||||||
m_perforcePluginInstance = this;
|
m_instance = this;
|
||||||
|
|
||||||
m_settings.fromSettings(Core::ICore::settings());
|
m_settings.fromSettings(Core::ICore::settings());
|
||||||
|
|
||||||
@@ -920,19 +920,21 @@ bool PerforcePlugin::vcsMove(const QString &workingDir, const QString &from, con
|
|||||||
|
|
||||||
// Write extra args to temporary file
|
// Write extra args to temporary file
|
||||||
QSharedPointer<Utils::TempFileSaver>
|
QSharedPointer<Utils::TempFileSaver>
|
||||||
PerforcePlugin::createTemporaryArgumentFile(const QStringList &extraArgs,
|
PerforcePlugin::createTemporaryArgumentFile(const QStringList &extraArgs,
|
||||||
QString *errorString) const
|
QString *errorString)
|
||||||
{
|
{
|
||||||
if (extraArgs.isEmpty())
|
if (extraArgs.isEmpty())
|
||||||
return QSharedPointer<Utils::TempFileSaver>();
|
return QSharedPointer<Utils::TempFileSaver>();
|
||||||
// create pattern
|
// create pattern
|
||||||
if (m_tempFilePattern.isEmpty()) {
|
QString pattern = m_instance->m_tempFilePattern;
|
||||||
m_tempFilePattern = QDir::tempPath();
|
if (pattern.isEmpty()) {
|
||||||
if (!m_tempFilePattern.endsWith(QDir::separator()))
|
pattern = QDir::tempPath();
|
||||||
m_tempFilePattern += QDir::separator();
|
if (!pattern.endsWith(QDir::separator()))
|
||||||
m_tempFilePattern += QLatin1String("qtc_p4_XXXXXX.args");
|
pattern += QDir::separator();
|
||||||
|
pattern += QLatin1String("qtc_p4_XXXXXX.args");
|
||||||
|
m_instance->m_tempFilePattern = pattern;
|
||||||
}
|
}
|
||||||
QSharedPointer<Utils::TempFileSaver> rc(new Utils::TempFileSaver(m_tempFilePattern));
|
QSharedPointer<Utils::TempFileSaver> rc(new Utils::TempFileSaver(pattern));
|
||||||
rc->setAutoRemove(true);
|
rc->setAutoRemove(true);
|
||||||
const int last = extraArgs.size() - 1;
|
const int last = extraArgs.size() - 1;
|
||||||
for (int i = 0; i <= last; i++) {
|
for (int i = 0; i <= last; i++) {
|
||||||
@@ -972,14 +974,14 @@ PerforceResponse PerforcePlugin::synchronousProcess(const QString &workingDir,
|
|||||||
const QStringList &args,
|
const QStringList &args,
|
||||||
unsigned flags,
|
unsigned flags,
|
||||||
const QByteArray &stdInput,
|
const QByteArray &stdInput,
|
||||||
QTextCodec *outputCodec) const
|
QTextCodec *outputCodec)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(stdInput.isEmpty(), return PerforceResponse()); // Not supported here
|
QTC_ASSERT(stdInput.isEmpty(), return PerforceResponse()); // Not supported here
|
||||||
|
|
||||||
VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance();
|
VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance();
|
||||||
// Run, connect stderr to the output window
|
// Run, connect stderr to the output window
|
||||||
Utils::SynchronousProcess process;
|
Utils::SynchronousProcess process;
|
||||||
const int timeOut = (flags & LongTimeOut) ? m_settings.longTimeOutMS() : m_settings.timeOutMS();
|
const int timeOut = (flags & LongTimeOut) ? settings().longTimeOutMS() : settings().timeOutMS();
|
||||||
process.setTimeout(timeOut);
|
process.setTimeout(timeOut);
|
||||||
process.setCodec(outputCodec);
|
process.setCodec(outputCodec);
|
||||||
if (flags & OverrideDiffEnvironment)
|
if (flags & OverrideDiffEnvironment)
|
||||||
@@ -1001,7 +1003,7 @@ PerforceResponse PerforcePlugin::synchronousProcess(const QString &workingDir,
|
|||||||
if (Perforce::Constants::debug)
|
if (Perforce::Constants::debug)
|
||||||
qDebug() << "PerforcePlugin::run syncp actual args [" << process.workingDirectory() << ']' << args;
|
qDebug() << "PerforcePlugin::run syncp actual args [" << process.workingDirectory() << ']' << args;
|
||||||
process.setTimeOutMessageBoxEnabled(true);
|
process.setTimeOutMessageBoxEnabled(true);
|
||||||
const Utils::SynchronousProcessResponse sp_resp = process.run(m_settings.p4BinaryPath(), args);
|
const Utils::SynchronousProcessResponse sp_resp = process.run(settings().p4BinaryPath(), args);
|
||||||
if (Perforce::Constants::debug)
|
if (Perforce::Constants::debug)
|
||||||
qDebug() << sp_resp;
|
qDebug() << sp_resp;
|
||||||
|
|
||||||
@@ -1022,7 +1024,7 @@ PerforceResponse PerforcePlugin::synchronousProcess(const QString &workingDir,
|
|||||||
response.message = msgCrash();
|
response.message = msgCrash();
|
||||||
break;
|
break;
|
||||||
case Utils::SynchronousProcessResponse::StartFailed:
|
case Utils::SynchronousProcessResponse::StartFailed:
|
||||||
response.message = msgNotStarted(m_settings.p4BinaryPath());
|
response.message = msgNotStarted(settings().p4BinaryPath());
|
||||||
break;
|
break;
|
||||||
case Utils::SynchronousProcessResponse::Hang:
|
case Utils::SynchronousProcessResponse::Hang:
|
||||||
response.message = msgCrash();
|
response.message = msgCrash();
|
||||||
@@ -1036,7 +1038,7 @@ PerforceResponse PerforcePlugin::fullySynchronousProcess(const QString &workingD
|
|||||||
const QStringList &args,
|
const QStringList &args,
|
||||||
unsigned flags,
|
unsigned flags,
|
||||||
const QByteArray &stdInput,
|
const QByteArray &stdInput,
|
||||||
QTextCodec *outputCodec) const
|
QTextCodec *outputCodec)
|
||||||
{
|
{
|
||||||
QProcess process;
|
QProcess process;
|
||||||
|
|
||||||
@@ -1049,13 +1051,13 @@ PerforceResponse PerforcePlugin::fullySynchronousProcess(const QString &workingD
|
|||||||
qDebug() << "PerforcePlugin::run fully syncp actual args [" << process.workingDirectory() << ']' << args;
|
qDebug() << "PerforcePlugin::run fully syncp actual args [" << process.workingDirectory() << ']' << args;
|
||||||
|
|
||||||
PerforceResponse response;
|
PerforceResponse response;
|
||||||
process.start(m_settings.p4BinaryPath(), args);
|
process.start(settings().p4BinaryPath(), args);
|
||||||
if (stdInput.isEmpty())
|
if (stdInput.isEmpty())
|
||||||
process.closeWriteChannel();
|
process.closeWriteChannel();
|
||||||
|
|
||||||
if (!process.waitForStarted(3000)) {
|
if (!process.waitForStarted(3000)) {
|
||||||
response.error = true;
|
response.error = true;
|
||||||
response.message = msgNotStarted(m_settings.p4BinaryPath());
|
response.message = msgNotStarted(settings().p4BinaryPath());
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
if (!stdInput.isEmpty()) {
|
if (!stdInput.isEmpty()) {
|
||||||
@@ -1063,7 +1065,7 @@ PerforceResponse PerforcePlugin::fullySynchronousProcess(const QString &workingD
|
|||||||
Utils::SynchronousProcess::stopProcess(process);
|
Utils::SynchronousProcess::stopProcess(process);
|
||||||
response.error = true;
|
response.error = true;
|
||||||
response.message = tr("Unable to write input data to process %1: %2").
|
response.message = tr("Unable to write input data to process %1: %2").
|
||||||
arg(QDir::toNativeSeparators(m_settings.p4BinaryPath()),
|
arg(QDir::toNativeSeparators(settings().p4BinaryPath()),
|
||||||
process.errorString());
|
process.errorString());
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@@ -1072,7 +1074,7 @@ PerforceResponse PerforcePlugin::fullySynchronousProcess(const QString &workingD
|
|||||||
|
|
||||||
QByteArray stdOut;
|
QByteArray stdOut;
|
||||||
QByteArray stdErr;
|
QByteArray stdErr;
|
||||||
const int timeOut = (flags & LongTimeOut) ? m_settings.longTimeOutMS() : m_settings.timeOutMS();
|
const int timeOut = (flags & LongTimeOut) ? settings().longTimeOutMS() : settings().timeOutMS();
|
||||||
if (!Utils::SynchronousProcess::readDataFromProcess(process, timeOut, &stdOut, &stdErr, true)) {
|
if (!Utils::SynchronousProcess::readDataFromProcess(process, timeOut, &stdOut, &stdErr, true)) {
|
||||||
Utils::SynchronousProcess::stopProcess(process);
|
Utils::SynchronousProcess::stopProcess(process);
|
||||||
response.error = true;
|
response.error = true;
|
||||||
@@ -1106,20 +1108,20 @@ PerforceResponse PerforcePlugin::runP4Cmd(const QString &workingDir,
|
|||||||
unsigned flags,
|
unsigned flags,
|
||||||
const QStringList &extraArgs,
|
const QStringList &extraArgs,
|
||||||
const QByteArray &stdInput,
|
const QByteArray &stdInput,
|
||||||
QTextCodec *outputCodec) const
|
QTextCodec *outputCodec)
|
||||||
{
|
{
|
||||||
if (Perforce::Constants::debug)
|
if (Perforce::Constants::debug)
|
||||||
qDebug() << "PerforcePlugin::runP4Cmd [" << workingDir << ']' << args << extraArgs << stdInput << debugCodec(outputCodec);
|
qDebug() << "PerforcePlugin::runP4Cmd [" << workingDir << ']' << args << extraArgs << stdInput << debugCodec(outputCodec);
|
||||||
|
|
||||||
VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance();
|
VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance();
|
||||||
if (!m_settings.isValid()) {
|
if (!settings().isValid()) {
|
||||||
PerforceResponse invalidConfigResponse;
|
PerforceResponse invalidConfigResponse;
|
||||||
invalidConfigResponse.error = true;
|
invalidConfigResponse.error = true;
|
||||||
invalidConfigResponse.message = tr("Perforce is not correctly configured.");
|
invalidConfigResponse.message = tr("Perforce is not correctly configured.");
|
||||||
outputWindow->appendError(invalidConfigResponse.message);
|
outputWindow->appendError(invalidConfigResponse.message);
|
||||||
return invalidConfigResponse;
|
return invalidConfigResponse;
|
||||||
}
|
}
|
||||||
QStringList actualArgs = m_settings.commonP4Arguments(workingDir);
|
QStringList actualArgs = settings().commonP4Arguments(workingDir);
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
QSharedPointer<Utils::TempFileSaver> tempFile = createTemporaryArgumentFile(extraArgs, &errorMessage);
|
QSharedPointer<Utils::TempFileSaver> tempFile = createTemporaryArgumentFile(extraArgs, &errorMessage);
|
||||||
if (!tempFile.isNull()) {
|
if (!tempFile.isNull()) {
|
||||||
@@ -1133,7 +1135,7 @@ PerforceResponse PerforcePlugin::runP4Cmd(const QString &workingDir,
|
|||||||
actualArgs.append(args);
|
actualArgs.append(args);
|
||||||
|
|
||||||
if (flags & CommandToWindow)
|
if (flags & CommandToWindow)
|
||||||
outputWindow->appendCommand(workingDir, m_settings.p4BinaryPath(), actualArgs);
|
outputWindow->appendCommand(workingDir, settings().p4BinaryPath(), actualArgs);
|
||||||
|
|
||||||
if (flags & ShowBusyCursor)
|
if (flags & ShowBusyCursor)
|
||||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||||
@@ -1414,17 +1416,17 @@ PerforcePlugin::~PerforcePlugin()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
const PerforceSettings& PerforcePlugin::settings() const
|
const PerforceSettings& PerforcePlugin::settings()
|
||||||
{
|
{
|
||||||
return m_settings;
|
return m_instance->m_settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PerforcePlugin::setSettings(const Settings &newSettings)
|
void PerforcePlugin::setSettings(const Settings &newSettings)
|
||||||
{
|
{
|
||||||
if (newSettings != m_settings.settings()) {
|
if (newSettings != m_instance->m_settings.settings()) {
|
||||||
m_settings.setSettings(newSettings);
|
m_instance->m_settings.setSettings(newSettings);
|
||||||
m_managedDirectoryCache.clear();
|
m_instance->m_managedDirectoryCache.clear();
|
||||||
m_settings.toSettings(Core::ICore::settings());
|
m_instance->m_settings.toSettings(Core::ICore::settings());
|
||||||
getTopLevel();
|
getTopLevel();
|
||||||
perforceVersionControl()->emitConfigurationChanged();
|
perforceVersionControl()->emitConfigurationChanged();
|
||||||
}
|
}
|
||||||
@@ -1441,7 +1443,7 @@ static inline QString msgWhereFailed(const QString & file, const QString &why)
|
|||||||
// Map a perforce name "//xx" to its real name in the file system
|
// Map a perforce name "//xx" to its real name in the file system
|
||||||
QString PerforcePlugin::fileNameFromPerforceName(const QString& perforceName,
|
QString PerforcePlugin::fileNameFromPerforceName(const QString& perforceName,
|
||||||
bool quiet,
|
bool quiet,
|
||||||
QString *errorMessage) const
|
QString *errorMessage)
|
||||||
{
|
{
|
||||||
// All happy, already mapped
|
// All happy, already mapped
|
||||||
if (!perforceName.startsWith(QLatin1String("//")))
|
if (!perforceName.startsWith(QLatin1String("//")))
|
||||||
@@ -1452,7 +1454,7 @@ QString PerforcePlugin::fileNameFromPerforceName(const QString& perforceName,
|
|||||||
unsigned flags = RunFullySynchronous;
|
unsigned flags = RunFullySynchronous;
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
flags |= CommandToWindow|StdErrToWindow|ErrorToWindow;
|
flags |= CommandToWindow|StdErrToWindow|ErrorToWindow;
|
||||||
const PerforceResponse response = runP4Cmd(m_settings.topLevelSymLinkTarget(), args, flags);
|
const PerforceResponse response = runP4Cmd(settings().topLevelSymLinkTarget(), args, flags);
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
*errorMessage = msgWhereFailed(perforceName, response.message);
|
*errorMessage = msgWhereFailed(perforceName, response.message);
|
||||||
return QString();
|
return QString();
|
||||||
@@ -1470,21 +1472,15 @@ QString PerforcePlugin::fileNameFromPerforceName(const QString& perforceName,
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
const QString p4fileSpec = output.mid(output.lastIndexOf(QLatin1Char(' ')) + 1);
|
const QString p4fileSpec = output.mid(output.lastIndexOf(QLatin1Char(' ')) + 1);
|
||||||
const QString rc = m_settings.mapToFileSystem(p4fileSpec);
|
const QString rc = m_instance->m_settings.mapToFileSystem(p4fileSpec);
|
||||||
if (Perforce::Constants::debug)
|
if (Perforce::Constants::debug)
|
||||||
qDebug() << "fileNameFromPerforceName" << perforceName << p4fileSpec << rc;
|
qDebug() << "fileNameFromPerforceName" << perforceName << p4fileSpec << rc;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
PerforcePlugin *PerforcePlugin::perforcePluginInstance()
|
PerforceVersionControl *PerforcePlugin::perforceVersionControl()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_perforcePluginInstance, return 0);
|
return static_cast<PerforceVersionControl *>(m_instance->versionControl());
|
||||||
return m_perforcePluginInstance;
|
|
||||||
}
|
|
||||||
|
|
||||||
PerforceVersionControl *PerforcePlugin::perforceVersionControl() const
|
|
||||||
{
|
|
||||||
return static_cast<PerforceVersionControl *>(versionControl());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PerforcePlugin::slotTopLevelFound(const QString &t)
|
void PerforcePlugin::slotTopLevelFound(const QString &t)
|
||||||
@@ -1507,14 +1503,14 @@ void PerforcePlugin::slotTopLevelFailed(const QString &errorMessage)
|
|||||||
void PerforcePlugin::getTopLevel()
|
void PerforcePlugin::getTopLevel()
|
||||||
{
|
{
|
||||||
// Run a new checker
|
// Run a new checker
|
||||||
if (m_settings.p4BinaryPath().isEmpty())
|
if (m_instance->m_settings.p4BinaryPath().isEmpty())
|
||||||
return;
|
return;
|
||||||
PerforceChecker *checker = new PerforceChecker(this);
|
PerforceChecker *checker = new PerforceChecker(m_instance);
|
||||||
connect(checker, SIGNAL(failed(QString)), this, SLOT(slotTopLevelFailed(QString)));
|
connect(checker, SIGNAL(failed(QString)), m_instance, SLOT(slotTopLevelFailed(QString)));
|
||||||
connect(checker, SIGNAL(failed(QString)), checker, SLOT(deleteLater()));
|
connect(checker, SIGNAL(failed(QString)), checker, SLOT(deleteLater()));
|
||||||
connect(checker, SIGNAL(succeeded(QString)), this, SLOT(slotTopLevelFound(QString)));
|
connect(checker, SIGNAL(succeeded(QString)), m_instance, SLOT(slotTopLevelFound(QString)));
|
||||||
connect(checker, SIGNAL(succeeded(QString)),checker, SLOT(deleteLater()));
|
connect(checker, SIGNAL(succeeded(QString)),checker, SLOT(deleteLater()));
|
||||||
checker->start(m_settings.p4BinaryPath(), m_settings.commonP4Arguments(QString()), 30000);
|
checker->start(settings().p4BinaryPath(), settings().commonP4Arguments(QString()), 30000);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
|
@@ -95,15 +95,13 @@ public:
|
|||||||
|
|
||||||
Core::IEditor *openPerforceSubmitEditor(const QString &fileName, const QStringList &depotFileNames);
|
Core::IEditor *openPerforceSubmitEditor(const QString &fileName, const QStringList &depotFileNames);
|
||||||
|
|
||||||
static PerforcePlugin *perforcePluginInstance();
|
static const PerforceSettings& settings();
|
||||||
|
static void setSettings(const Settings &s);
|
||||||
const PerforceSettings& settings() const;
|
|
||||||
void setSettings(const Settings &s);
|
|
||||||
|
|
||||||
// Map a perforce name "//xx" to its real name in the file system
|
// Map a perforce name "//xx" to its real name in the file system
|
||||||
QString fileNameFromPerforceName(const QString& perforceName,
|
static QString fileNameFromPerforceName(const QString& perforceName,
|
||||||
bool quiet,
|
bool quiet,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void describe(const QString &source, const QString &n);
|
void describe(const QString &source, const QString &n);
|
||||||
@@ -165,24 +163,24 @@ private:
|
|||||||
|
|
||||||
// args are passed as command line arguments
|
// args are passed as command line arguments
|
||||||
// extra args via a tempfile and the option -x "temp-filename"
|
// extra args via a tempfile and the option -x "temp-filename"
|
||||||
PerforceResponse runP4Cmd(const QString &workingDir,
|
static PerforceResponse runP4Cmd(const QString &workingDir,
|
||||||
const QStringList &args,
|
const QStringList &args,
|
||||||
unsigned flags = CommandToWindow|StdErrToWindow|ErrorToWindow,
|
unsigned flags = CommandToWindow|StdErrToWindow|ErrorToWindow,
|
||||||
const QStringList &extraArgs = QStringList(),
|
const QStringList &extraArgs = QStringList(),
|
||||||
const QByteArray &stdInput = QByteArray(),
|
const QByteArray &stdInput = QByteArray(),
|
||||||
QTextCodec *outputCodec = 0) const;
|
QTextCodec *outputCodec = 0);
|
||||||
|
|
||||||
inline PerforceResponse synchronousProcess(const QString &workingDir,
|
static PerforceResponse synchronousProcess(const QString &workingDir,
|
||||||
const QStringList &args,
|
const QStringList &args,
|
||||||
unsigned flags,
|
unsigned flags,
|
||||||
const QByteArray &stdInput,
|
const QByteArray &stdInput,
|
||||||
QTextCodec *outputCodec) const;
|
QTextCodec *outputCodec);
|
||||||
|
|
||||||
inline PerforceResponse fullySynchronousProcess(const QString &workingDir,
|
static PerforceResponse fullySynchronousProcess(const QString &workingDir,
|
||||||
const QStringList &args,
|
const QStringList &args,
|
||||||
unsigned flags,
|
unsigned flags,
|
||||||
const QByteArray &stdInput,
|
const QByteArray &stdInput,
|
||||||
QTextCodec *outputCodec) const;
|
QTextCodec *outputCodec);
|
||||||
|
|
||||||
QString clientFilePath(const QString &serverFilePath);
|
QString clientFilePath(const QString &serverFilePath);
|
||||||
void annotate(const QString &workingDir, const QString &fileName,
|
void annotate(const QString &workingDir, const QString &fileName,
|
||||||
@@ -191,9 +189,9 @@ private:
|
|||||||
bool enableAnnotationContextMenu = false);
|
bool enableAnnotationContextMenu = false);
|
||||||
void cleanCommitMessageFile();
|
void cleanCommitMessageFile();
|
||||||
bool isCommitEditorOpen() const;
|
bool isCommitEditorOpen() const;
|
||||||
QSharedPointer<Utils::TempFileSaver> createTemporaryArgumentFile(const QStringList &extraArgs,
|
static QSharedPointer<Utils::TempFileSaver> createTemporaryArgumentFile(const QStringList &extraArgs,
|
||||||
QString *errorString) const;
|
QString *errorString);
|
||||||
void getTopLevel();
|
static void getTopLevel();
|
||||||
QString pendingChangesData();
|
QString pendingChangesData();
|
||||||
|
|
||||||
void updateCheckout(const QString &workingDir = QString(),
|
void updateCheckout(const QString &workingDir = QString(),
|
||||||
@@ -201,7 +199,7 @@ private:
|
|||||||
bool revertProject(const QString &workingDir, const QStringList &args, bool unchangedOnly);
|
bool revertProject(const QString &workingDir, const QStringList &args, bool unchangedOnly);
|
||||||
bool managesDirectoryFstat(const QString &directory);
|
bool managesDirectoryFstat(const QString &directory);
|
||||||
|
|
||||||
inline PerforceVersionControl *perforceVersionControl() const;
|
static PerforceVersionControl *perforceVersionControl();
|
||||||
|
|
||||||
Locator::CommandLocator *m_commandLocator;
|
Locator::CommandLocator *m_commandLocator;
|
||||||
Utils::ParameterAction *m_editAction;
|
Utils::ParameterAction *m_editAction;
|
||||||
@@ -235,7 +233,7 @@ private:
|
|||||||
QAction *m_redoAction;
|
QAction *m_redoAction;
|
||||||
QAction *m_menuAction;
|
QAction *m_menuAction;
|
||||||
|
|
||||||
static PerforcePlugin *m_perforcePluginInstance;
|
static PerforcePlugin *m_instance;
|
||||||
|
|
||||||
PerforceSettings m_settings;
|
PerforceSettings m_settings;
|
||||||
ManagedDirectoryCache m_managedDirectoryCache;
|
ManagedDirectoryCache m_managedDirectoryCache;
|
||||||
|
@@ -145,7 +145,7 @@ SettingsPage::SettingsPage()
|
|||||||
QWidget *SettingsPage::createPage(QWidget *parent)
|
QWidget *SettingsPage::createPage(QWidget *parent)
|
||||||
{
|
{
|
||||||
m_widget = new SettingsPageWidget(parent);
|
m_widget = new SettingsPageWidget(parent);
|
||||||
m_widget->setSettings(PerforcePlugin::perforcePluginInstance()->settings());
|
m_widget->setSettings(PerforcePlugin::settings());
|
||||||
if (m_searchKeywords.isEmpty())
|
if (m_searchKeywords.isEmpty())
|
||||||
m_searchKeywords = m_widget->searchKeywords();
|
m_searchKeywords = m_widget->searchKeywords();
|
||||||
return m_widget;
|
return m_widget;
|
||||||
@@ -153,7 +153,7 @@ QWidget *SettingsPage::createPage(QWidget *parent)
|
|||||||
|
|
||||||
void SettingsPage::apply()
|
void SettingsPage::apply()
|
||||||
{
|
{
|
||||||
PerforcePlugin::perforcePluginInstance()->setSettings(m_widget->settings());
|
PerforcePlugin::setSettings(m_widget->settings());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SettingsPage::matches(const QString &s) const
|
bool SettingsPage::matches(const QString &s) const
|
||||||
|
Reference in New Issue
Block a user