Commit 849b91e5 authored by Kai Koehne's avatar Kai Koehne
Browse files

Merge branch 'master' of scm.dev.nokia.troll.no:creator/mainline

Merge latest changes of master into merge :)

Conflicts:
	doc/qtcreator.qdoc
parents ef1e52df c8279624
......@@ -4685,7 +4685,7 @@
with Qt Creator, but they enhance the user's ability to quickly
examine complex data significantly.
\section1 Debugging Helpers Based on C++
\section1 Debugging Helpers based on C++
This is the first and original approach to display complex data
types. While it has been superseded on most platforms by the more
......@@ -4704,7 +4704,7 @@
library is built for each Qt version.
\section1 Debugging Helpers Based on Python
\section1 Debugging Helpers based on Python
On platforms featuring a Python-enabled version of the gdb debugger,
the data extraction is done by a Python script. This is more robust
......
......@@ -30,6 +30,7 @@ for(deploymentfolder, DEPLOYMENTFOLDERS) {
}
symbian {
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -leiksrv -lcone
contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
} else:win32 {
......
......@@ -142,6 +142,7 @@ struct SubmitEditorWidgetPrivate
bool m_filesChecked;
int m_fileNameColumn;
int m_activatedRow;
bool m_emptyFileListEnabled;
QList<AdditionalContextMenuAction> descriptionEditContextMenuActions;
QVBoxLayout *m_fieldLayout;
......@@ -154,6 +155,7 @@ SubmitEditorWidgetPrivate::SubmitEditorWidgetPrivate() :
m_filesChecked(false),
m_fileNameColumn(1),
m_activatedRow(-1),
m_emptyFileListEnabled(false),
m_fieldLayout(0),
m_lineWidth(defaultLineWidth)
{
......@@ -446,7 +448,7 @@ void SubmitEditorWidget::updateActions()
void SubmitEditorWidget::updateSubmitAction()
{
const unsigned checkedCount = checkedFilesCount();
const bool newFilesCheckedState = checkedCount;
const bool newFilesCheckedState = m_d->m_emptyFileListEnabled || checkedCount > 0;
// Emit signal to update action
if (m_d->m_filesChecked != newFilesCheckedState) {
m_d->m_filesChecked = newFilesCheckedState;
......@@ -581,6 +583,19 @@ void SubmitEditorWidget::fileListCustomContextMenuRequested(const QPoint & pos)
}
}
bool SubmitEditorWidget::isEmptyFileListEnabled() const
{
return m_d->m_emptyFileListEnabled;
}
void SubmitEditorWidget::setEmptyFileListEnabled(bool e)
{
if (e != m_d->m_emptyFileListEnabled) {
m_d->m_emptyFileListEnabled = e;
updateSubmitAction();
}
}
} // namespace Utils
#include "submiteditorwidget.moc"
......@@ -76,6 +76,8 @@ class QTCREATOR_UTILS_EXPORT SubmitEditorWidget : public QWidget
Q_PROPERTY(QAbstractItemView::SelectionMode fileListSelectionMode READ fileListSelectionMode WRITE setFileListSelectionMode DESIGNABLE true)
Q_PROPERTY(bool lineWrap READ lineWrap WRITE setLineWrap DESIGNABLE true)
Q_PROPERTY(int lineWrapWidth READ lineWrapWidth WRITE setLineWrapWidth DESIGNABLE true)
Q_PROPERTY(bool emptyFileListEnabled READ isEmptyFileListEnabled WRITE setEmptyFileListEnabled DESIGNABLE true)
public:
explicit SubmitEditorWidget(QWidget *parent = 0);
virtual ~SubmitEditorWidget();
......@@ -91,6 +93,10 @@ public:
QString descriptionText() const;
void setDescriptionText(const QString &text);
// 'Commit' action enabled despite empty file list
bool isEmptyFileListEnabled() const;
void setEmptyFileListEnabled(bool e);
int fileNameColumn() const;
void setFileNameColumn(int c);
......
......@@ -34,6 +34,7 @@
#include <QtCore/QDebug>
#include <QtCore/QFile>
#include <QtCore/QTime>
#include <QtGui/QAction>
#include <QtGui/QHBoxLayout>
......@@ -411,6 +412,9 @@ void DebuggerOutputWindow::showOutput(int channel, const QString &output)
QTextCursor cursor = oldCursor;
cursor.movePosition(QTextCursor::End);
bool atEnd = oldCursor.position() == cursor.position();
if (theDebuggerBoolSetting(LogTimeStamps))
m_combinedText->appendPlainText(charForChannel(LogTime) + logTimeStamp());
foreach (QString line, output.split('\n')) {
// FIXME: QTextEdit asserts on really long lines...
const int n = 30000;
......@@ -431,6 +435,8 @@ void DebuggerOutputWindow::showOutput(int channel, const QString &output)
void DebuggerOutputWindow::showInput(int channel, const QString &input)
{
Q_UNUSED(channel)
if (theDebuggerBoolSetting(LogTimeStamps))
m_inputText->appendPlainText(logTimeStamp());
m_inputText->appendPlainText(input);
QTextCursor cursor = m_inputText->textCursor();
cursor.movePosition(QTextCursor::End);
......@@ -461,4 +467,27 @@ QString DebuggerOutputWindow::inputContents() const
return m_inputText->toPlainText();
}
QString DebuggerOutputWindow::logTimeStamp()
{
// Cache the last log time entry by ms. If time progresses,
// report the difference to the last time stamp in ms.
static const QString logTimeFormat(QLatin1String("hh:mm:ss.zzz"));
static QTime lastTime = QTime::currentTime();
static QString lastTimeStamp = lastTime.toString(logTimeFormat);
const QTime currentTime = QTime::currentTime();
if (currentTime != lastTime) {
const int elapsedMS = lastTime.msecsTo(currentTime);
lastTime = currentTime;
lastTimeStamp = lastTime.toString(logTimeFormat);
// Append time elapsed
QString rc = lastTimeStamp;
rc += QLatin1String(" [");
rc += QString::number(elapsedMS);
rc += QLatin1String("ms]");
return rc;
}
return lastTimeStamp;
}
#include "debuggeroutputwindow.moc"
......@@ -46,20 +46,15 @@ class DebuggerOutputWindow : public QWidget
Q_OBJECT
public:
DebuggerOutputWindow(QWidget *parent = 0);
explicit DebuggerOutputWindow(QWidget *parent = 0);
QWidget *outputWidget(QWidget *) { return this; }
QList<QWidget*> toolBarWidgets() const { return QList<QWidget *>(); }
QString name() const { return windowTitle(); }
void visibilityChanged(bool /*visible*/) {}
void bringPaneToForeground() { emit showPage(); }
void setCursor(const QCursor &cursor);
QString combinedContents() const;
QString inputContents() const;
static QString logTimeStamp();
public slots:
void clearContents();
void showOutput(int channel, const QString &output);
......
......@@ -66,6 +66,7 @@
#include "sourcefileswindow.h"
#include "debuggerdialogs.h"
#include "debuggeroutputwindow.h"
#include <utils/qtcassert.h>
#include <utils/fancymainwindow.h>
......@@ -312,25 +313,19 @@ void GdbEngine::readDebugeeOutput(const QByteArray &data)
void GdbEngine::handleResponse(const QByteArray &buff)
{
static QTime lastTime;
if (theDebuggerBoolSetting(LogTimeStamps))
showMessage(currentTime(), LogTime);
showMessage(QString::fromLocal8Bit(buff, buff.length()), LogOutput);
#if 0
static QTime lastTime;
qDebug() // << "#### start response handling #### "
<< currentTime()
<< lastTime.msecsTo(QTime::currentTime()) << "ms,"
<< "buf:" << buff.left(1500) << "..."
//<< "buf:" << buff
<< "size:" << buff.size();
lastTime = QTime::currentTime();
#else
//qDebug() << "buf:" << buff;
#endif
lastTime = QTime::currentTime();
if (buff.isEmpty() || buff == "(gdb) ")
return;
......@@ -2013,7 +2008,7 @@ void GdbEngine::setTokenBarrier()
PENDING_DEBUG("\n--- token barrier ---\n");
showMessage(_("--- token barrier ---"), LogMiscInput);
if (theDebuggerBoolSetting(LogTimeStamps))
showMessage(currentTime(), LogMiscInput);
showMessage(DebuggerOutputWindow::logTimeStamp(), LogMiscInput);
m_oldestAcceptableToken = currentToken();
}
......@@ -3369,7 +3364,7 @@ void GdbEngine::rebuildWatchModel()
m_processedNames.clear();
PENDING_DEBUG("REBUILDING MODEL" << count);
if (theDebuggerBoolSetting(LogTimeStamps))
showMessage(currentTime(), LogMiscInput);
showMessage(DebuggerOutputWindow::logTimeStamp(), LogMiscInput);
showMessage(_("<Rebuild Watchmodel %1>").arg(count), LogMiscInput);
showStatusMessage(tr("Finished retrieving data"), 400);
watchHandler()->endCycle();
......
......@@ -71,13 +71,13 @@ FormClassWizardPage::~FormClassWizardPage()
}
// Retrieve settings of CppTools plugin.
static bool inline lowerCaseFiles(const Core::ICore *core)
bool FormClassWizardPage::lowercaseHeaderFiles()
{
QString lowerCaseSettingsKey = QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP);
lowerCaseSettingsKey += QLatin1Char('/');
lowerCaseSettingsKey += QLatin1String(CppTools::Constants::LOWERCASE_CPPFILES_KEY);
const bool lowerCaseDefault = CppTools::Constants::lowerCaseFilesDefault;
return core->settings()->value(lowerCaseSettingsKey, QVariant(lowerCaseDefault)).toBool();
return Core::ICore::instance()->settings()->value(lowerCaseSettingsKey, QVariant(lowerCaseDefault)).toBool();
}
// Set up new class widget from settings
......@@ -87,7 +87,7 @@ void FormClassWizardPage::initFileGenerationSettings()
const Core::MimeDatabase *mdb = core->mimeDatabase();
m_ui->newClassWidget->setHeaderExtension(mdb->preferredSuffixByType(QLatin1String(CppTools::Constants::CPP_HEADER_MIMETYPE)));
m_ui->newClassWidget->setSourceExtension(mdb->preferredSuffixByType(QLatin1String(CppTools::Constants::CPP_SOURCE_MIMETYPE)));
m_ui->newClassWidget->setLowerCaseFiles(lowerCaseFiles(core));
m_ui->newClassWidget->setLowerCaseFiles(lowercaseHeaderFiles());
}
// Pop up settings dialog for generation settings
......
......@@ -63,6 +63,8 @@ public:
FormClassWizardGenerationParameters generationParameters() const;
void setGenerationParameters(const FormClassWizardGenerationParameters &gp);
static bool lowercaseHeaderFiles();
public slots:
void setClassName(const QString &suggestedClassName);
void setPath(const QString &);
......
......@@ -29,6 +29,7 @@
#include "formeditorplugin.h"
#include "formwindoweditor.h"
#include "formclasswizardpage.h"
#include "qtcreatorintegration.h"
#include "formeditorw.h"
#include "editordata.h"
......@@ -36,6 +37,7 @@
#include <widgethost.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <cpptools/cpptoolsconstants.h>
#include <cplusplus/InsertionPointLocator.h>
#include <cplusplus/Symbols.h>
#include <cplusplus/Overview.h>
......@@ -47,6 +49,7 @@
#include <cplusplus/Control.h>
#include <cplusplus/TranslationUnit.h>
#include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/editormanager/editormanager.h>
#include <extensionsystem/pluginmanager.h>
#include <texteditor/basetexteditor.h>
......@@ -98,6 +101,9 @@ QtCreatorIntegration::QtCreatorIntegration(QDesignerFormEditorInterface *core, F
this, SLOT(slotNavigateToSlot(QString, QString, QStringList)));
connect(this, SIGNAL(helpRequested(QString,QString)),
this, SLOT(slotDesignerHelpRequested(QString,QString)));
slotSyncSettingsToDesigner();
connect(Core::ICore::instance(), SIGNAL(saveSettingsRequested()),
this, SLOT(slotSyncSettingsToDesigner()));
}
void QtCreatorIntegration::slotDesignerHelpRequested(const QString &manual, const QString &document)
......@@ -552,3 +558,13 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
return true;
}
void QtCreatorIntegration::slotSyncSettingsToDesigner()
{
#if QT_VERSION >= 0x040800
// Set promotion-relevant parameters on integration.
const Core::MimeDatabase *mdb = Core::ICore::instance()->mimeDatabase();
setHeaderSuffix(mdb->preferredSuffixByType(QLatin1String(CppTools::Constants::CPP_HEADER_MIMETYPE)));
setHeaderLowercase(FormClassWizardPage::lowercaseHeaderFiles());
#endif
}
......@@ -59,6 +59,7 @@ public slots:
private slots:
void slotNavigateToSlot(const QString &objectName, const QString &signalSignature, const QStringList &parameterNames);
void slotDesignerHelpRequested(const QString &manual, const QString &document);
void slotSyncSettingsToDesigner();
private:
bool navigateToSlot(const QString &objectName,
......
......@@ -82,6 +82,7 @@ void CommitData::clear()
{
panelInfo.clear();
panelData.clear();
amendSHA1.clear();
stagedFiles.clear();
unstagedFiles.clear();
......
......@@ -80,6 +80,7 @@ struct CommitData
QStringList stagedFileNames(const QString &stateFilter = QString()) const;
QStringList unstagedFileNames(const QString &stateFilter = QString()) const;
QString amendSHA1;
GitSubmitEditorPanelInfo panelInfo;
GitSubmitEditorPanelData panelData;
......
......@@ -1336,14 +1336,15 @@ void GitClient::launchGitK(const QString &workingDirectory)
}
bool GitClient::getCommitData(const QString &workingDirectory,
bool amend,
QString *commitTemplate,
CommitData *d,
CommitData *commitData,
QString *errorMessage)
{
if (Git::Constants::debug)
qDebug() << Q_FUNC_INFO << workingDirectory;
d->clear();
commitData->clear();
// Find repo
const QString repoDirectory = GitClient::findRepositoryForDirectory(workingDirectory);
......@@ -1352,7 +1353,7 @@ bool GitClient::getCommitData(const QString &workingDirectory,
return false;
}
d->panelInfo.repository = repoDirectory;
commitData->panelInfo.repository = repoDirectory;
QDir gitDir(repoDirectory);
if (!gitDir.cd(QLatin1String(kGitDirectoryC))) {
......@@ -1365,13 +1366,14 @@ bool GitClient::getCommitData(const QString &workingDirectory,
if (QFileInfo(descriptionFile).isFile()) {
QFile file(descriptionFile);
if (file.open(QIODevice::ReadOnly|QIODevice::Text))
d->panelInfo.description = commandOutputFromLocal8Bit(file.readAll()).trimmed();
commitData->panelInfo.description = commandOutputFromLocal8Bit(file.readAll()).trimmed();
}
// Run status. Note that it has exitcode 1 if there are no added files.
bool onBranch;
QString output;
switch (gitStatus(repoDirectory, true, &output, errorMessage, &onBranch)) {
const StatusResult status = gitStatus(repoDirectory, true, &output, errorMessage, &onBranch);
switch (status) {
case StatusChanged:
if (!onBranch) {
*errorMessage = tr("You did not checkout a branch.");
......@@ -1379,6 +1381,8 @@ bool GitClient::getCommitData(const QString &workingDirectory,
}
break;
case StatusUnchanged:
if (amend)
break;
*errorMessage = msgNoChangedFiles();
return false;
case StatusFailed:
......@@ -1403,42 +1407,71 @@ bool GitClient::getCommitData(const QString &workingDirectory,
// #
// # list of files...
if (!d->parseFilesFromStatus(output)) {
*errorMessage = msgParseFilesFailed();
return false;
}
// Filter out untracked files that are not part of the project
VCSBase::VCSBaseSubmitEditor::filterUntrackedFilesOfProject(repoDirectory, &d->untrackedFiles);
if (d->filesEmpty()) {
*errorMessage = msgNoChangedFiles();
return false;
if (status != StatusUnchanged) {
if (!commitData->parseFilesFromStatus(output)) {
*errorMessage = msgParseFilesFailed();
return false;
}
// Filter out untracked files that are not part of the project
VCSBase::VCSBaseSubmitEditor::filterUntrackedFilesOfProject(repoDirectory, &commitData->untrackedFiles);
if (commitData->filesEmpty()) {
*errorMessage = msgNoChangedFiles();
return false;
}
}
d->panelData.author = readConfigValue(workingDirectory, QLatin1String("user.name"));
d->panelData.email = readConfigValue(workingDirectory, QLatin1String("user.email"));
commitData->panelData.author = readConfigValue(workingDirectory, QLatin1String("user.name"));
commitData->panelData.email = readConfigValue(workingDirectory, QLatin1String("user.email"));
// Get the commit template
QString templateFilename = readConfigValue(workingDirectory, QLatin1String("commit.template"));
if (!templateFilename.isEmpty()) {
// Make relative to repository
const QFileInfo templateFileInfo(templateFilename);
if (templateFileInfo.isRelative())
templateFilename = repoDirectory + QLatin1Char('/') + templateFilename;
QFile templateFile(templateFilename);
if (templateFile.open(QIODevice::ReadOnly|QIODevice::Text)) {
*commitTemplate = QString::fromLocal8Bit(templateFile.readAll());
} else {
qWarning("Unable to read commit template %s: %s",
qPrintable(templateFilename),
qPrintable(templateFile.errorString()));
// Get the commit template or the last commit message
if (amend) {
// Amend: get last commit data as "SHA1@message". TODO: Figure out codec.
QStringList args(QLatin1String("log"));
args << QLatin1String("--max-count=1") << QLatin1String("--pretty=format:%h@%B");
const Utils::SynchronousProcessResponse sp = synchronousGit(repoDirectory, args);
if (sp.result != Utils::SynchronousProcessResponse::Finished) {
*errorMessage = tr("Unable to retrieve the last commit data from %1.").arg(repoDirectory);
return false;
}
const int separatorPos = sp.stdOut.indexOf(QLatin1Char('@'));
QTC_ASSERT(separatorPos != -1, return false)
commitData->amendSHA1= sp.stdOut.left(separatorPos);
*commitTemplate = sp.stdOut.mid(separatorPos + 1);
} else {
// Commit: Get the commit template
QString templateFilename = readConfigValue(workingDirectory, QLatin1String("commit.template"));
if (!templateFilename.isEmpty()) {
// Make relative to repository
const QFileInfo templateFileInfo(templateFilename);
if (templateFileInfo.isRelative())
templateFilename = repoDirectory + QLatin1Char('/') + templateFilename;
QFile templateFile(templateFilename);
if (templateFile.open(QIODevice::ReadOnly|QIODevice::Text)) {
*commitTemplate = QString::fromLocal8Bit(templateFile.readAll());
} else {
qWarning("Unable to read commit template %s: %s",
qPrintable(templateFilename),
qPrintable(templateFile.errorString()));
}
}
}
return true;
}
// Log message for commits/amended commits to go to output window
static inline QString msgCommitted(const QString &amendSHA1, int fileCount)
{
if (amendSHA1.isEmpty())
return GitClient::tr("Committed %n file(s).\n", 0, fileCount);
if (fileCount)
return GitClient::tr("Amended %1 (%n file(s)).\n", 0, fileCount).arg(amendSHA1);
return GitClient::tr("Amended %1.").arg(amendSHA1);
}
// addAndCommit:
bool GitClient::addAndCommit(const QString &repositoryDirectory,
const GitSubmitEditorPanelData &data,
const QString &amendSHA1,
const QString &messageFile,
const QStringList &checkedFiles,
const QStringList &origCommitFiles,
......@@ -1447,6 +1480,7 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
if (Git::Constants::debug)
qDebug() << "GitClient::addAndCommit:" << repositoryDirectory << checkedFiles << origCommitFiles;
const QString renamedSeparator = QLatin1String(" -> ");
const bool amend = !amendSHA1.isEmpty();
// Do we need to reset any files that had been added before
// (did the user uncheck any previously added files)
......@@ -1483,7 +1517,8 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
QStringList args;
args << QLatin1String("commit")
<< QLatin1String("-F") << QDir::toNativeSeparators(messageFile);
if (amend)
args << QLatin1String("--amend");
const QString &authorString = data.authorString();
if (!authorString.isEmpty())
args << QLatin1String("--author") << authorString;
......@@ -1492,7 +1527,7 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
QByteArray errorText;
const bool rc = fullySynchronousGit(repositoryDirectory, args, &outputText, &errorText);
if (rc) {
outputWindow()->append(tr("Committed %n file(s).\n", 0, checkedFiles.size()));
outputWindow()->append(msgCommitted(amendSHA1, checkedFiles.size()));
} else {
outputWindow()->appendError(tr("Unable to commit %n file(s): %1\n", 0, checkedFiles.size()).arg(commandOutputFromLocal8Bit(errorText)));
}
......
......@@ -185,13 +185,13 @@ public:
StashResult ensureStash(const QString &workingDirectory, QString *errorMessage);
StashResult ensureStash(const QString &workingDirectory);
bool getCommitData(const QString &workingDirectory,
QString *commitTemplate,
CommitData *d,
bool getCommitData(const QString &workingDirectory, bool amend,
QString *commitTemplate, CommitData *commitData,
QString *errorMessage);
bool addAndCommit(const QString &workingDirectory,
const GitSubmitEditorPanelData &data,
const QString &amendSHA1,
const QString &messageFile,
const QStringList &checkedFiles,
const QStringList &origCommitFiles,
......
......@@ -451,6 +451,10 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
globalcontext, true, SLOT(startCommit()));
actionCommand.second->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+C")));
createRepositoryAction(actionManager, gitContainer,
tr("Amend Last Commit..."), QLatin1String("Git.AmendCommit"),
globalcontext, true, SLOT(startAmendCommit()));
actionCommand = createRepositoryAction(actionManager, gitContainer,
tr("Push"), QLatin1String("Git.Push"),
globalcontext, true, SLOT(push()));
......@@ -610,8 +614,19 @@ void GitPlugin::unstageFile()
m_gitClient->synchronousReset(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()));
}
void GitPlugin::startAmendCommit()
{
startCommit(true);
}
void GitPlugin::startCommit()
{
startCommit(false);
}
void GitPlugin::startCommit(bool amend)
{
if (VCSBase::VCSBaseSubmitEditor::raiseSubmitEditor())
return;
if (isCommitEditorOpen()) {
......@@ -624,7 +639,7 @@ void GitPlugin::startCommit()
QString errorMessage, commitTemplate;
CommitData data;
if (!m_gitClient->getCommitData(state.topLevel(), &commitTemplate, &data, &errorMessage)) {
if (!m_gitClient->getCommitData(state.topLevel(), amend, &commitTemplate, &data, &errorMessage)) {
VCSBase::VCSBaseOutputWindow::instance()->append(errorMessage);
return;
}
......@@ -632,6 +647,7 @@ void GitPlugin::startCommit()
// Store repository for diff and the original list of
// files to be able to unstage files the user unchecks
m_submitRepository = data.panelInfo.repository;
m_commitAmendSHA1 = data.amendSHA1;
m_submitOrigCommitFiles = data.stagedFileNames();
m_submitOrigDeleteFiles = data.stagedFileNames("deleted");
......@@ -651,10 +667,10 @@ void GitPlugin::startCommit()
// Keep the file alive, else it removes self and forgets
// its name
changeTmpFile.close();
openSubmitEditor(m_commitMessageFileName, data);
openSubmitEditor(m_commitMessageFileName, data, amend);
}
Core::IEditor *GitPlugin::openSubmitEditor(const QString &fileName, const CommitData &cd)
Core::IEditor *GitPlugin::openSubmitEditor(const QString &fileName, const CommitData &cd, bool amend)
{
Core::IEditor *editor = m_core->editorManager()->openEditor(fileName, QLatin1String(Constants::GITSUBMITEDITOR_ID));
if (Git::Constants::debug)
......@@ -667,6 +683,10 @@ Core::IEditor *GitPlugin::openSubmitEditor(const QString &fileName, const Commit
submitEditor->registerActions(m_undoAction, m_redoAction, m_submitCurrentAction, m_diffSelectedFilesAction);
submitEditor->setCommitData(cd);
submitEditor->setCheckScriptWorkingDirectory(m_submitRepository);
const QString title = amend ? tr("Amend %1").arg(cd.amendSHA1) : tr("Git Commit");
submitEditor->setDisplayName(title);
if (amend) // Allow for just correcting the message
submitEditor->setEmptyFileListEnabled(true);
connect(submitEditor, SIGNAL(diff(QStringList,QStringList)), this, SLOT(submitEditorDiff(QStringList,QStringList)));
return editor;
}
......@@ -721,7 +741,7 @@ bool GitPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEdi
if (Git::Constants::debug)
qDebug() << Q_FUNC_INFO << fileList;
bool closeEditor = true;
if (!fileList.empty()) {