| 1746 | } |
| 1747 | |
| 1748 | void GitPlugin::setupCommitMessageEditor(const QUrl& localLocation, KTextEdit* editor) const |
| 1749 | { |
| 1750 | new GitMessageHighlighter(editor); |
| 1751 | QFile mergeMsgFile(dotGitDirectory(localLocation).filePath(QStringLiteral(".git/MERGE_MSG"))); |
| 1752 | // Some limit on the file size should be set since whole content is going to be read into |
| 1753 | // the memory. 1Mb seems to be good value since it's rather strange to have so huge commit |
| 1754 | // message. |
| 1755 | static const qint64 maxMergeMsgFileSize = 1024*1024; |
| 1756 | if (mergeMsgFile.size() > maxMergeMsgFileSize || !mergeMsgFile.open(QIODevice::ReadOnly)) |
| 1757 | return; |
| 1758 | |
| 1759 | QString mergeMsg = QString::fromLocal8Bit(mergeMsgFile.read(maxMergeMsgFileSize)); |
| 1760 | editor->setPlainText(mergeMsg); |
| 1761 | } |
| 1762 | |
| 1763 | class GitVcsLocationWidget : public KDevelop::StandardVcsLocationWidget |
| 1764 | { |
nothing calls this directly
no test coverage detected