Commit 704d23a2 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Make the CommitMessageEditor a KTextEdit

Simplifies the adoption of a spell checking system.
parent c92f3250
......@@ -30,7 +30,6 @@
#include <QFileInfo>
#include <QDir>
#include <QDateTime>
#include <QtGui/QTextEdit>
#include <interfaces/icore.h>
#include <interfaces/iprojectcontroller.h>
......@@ -50,6 +49,7 @@
#include "stashmanagerdialog.h"
#include <KMessageBox>
#include <KStandardDirs>
#include <KTextEdit>
#include "gitjob.h"
#include "gitmessagehighlighter.h"
......@@ -1233,7 +1233,7 @@ VcsJob* GitPlugin::update(const KUrl::List& localLocations, const KDevelop::VcsR
}
}
void GitPlugin::setupCommitMessageEditor(const KUrl& localLocation, QTextEdit* editor) const
void GitPlugin::setupCommitMessageEditor(const KUrl& localLocation, KTextEdit* editor) const
{
new GitMessageHighlighter(editor);
QFile mergeMsgFile(dotGitDirectory(localLocation).filePath(".git/MERGE_MSG"));
......
......@@ -88,7 +88,7 @@ public:
virtual KDevelop::VcsJob* resolve(const KUrl::List& localLocations, RecursionMode recursion);
virtual KDevelop::VcsJob* update(const KUrl::List& localLocations, const KDevelop::VcsRevision& rev, RecursionMode recursion);
KDevelop::VcsLocationWidget* vcsLocation(QWidget* parent) const;
virtual void setupCommitMessageEditor(const KUrl& localLocation, QTextEdit* editor) const;
virtual void setupCommitMessageEditor(const KUrl& localLocation, KTextEdit* editor) const;
//End of
KDevelop::VcsJob* add(const KUrl::List& localLocations,
......
......@@ -18,8 +18,10 @@
* 02110-1301, USA.
*/
#include "ibasicversioncontrol.h"
#include <KTextEdit>
/// Default empty implementation
void KDevelop::IBasicVersionControl::setupCommitMessageEditor(const KUrl&, QTextEdit*) const
void KDevelop::IBasicVersionControl::setupCommitMessageEditor(const KUrl&, KTextEdit* edit) const
{
edit->setCheckSpellingEnabled(true);
}
......@@ -27,7 +27,7 @@
#include "../vcsdiff.h"
class QString;
class QTextEdit;
class KTextEdit;
namespace KDevelop
{
......@@ -255,7 +255,7 @@ public:
* Overwrite this to set e.g. a default commit message or to setup highlighting or validation.
* The default implementation does nothing.
*/
virtual void setupCommitMessageEditor(const KUrl& localLocation, QTextEdit *editor) const;
virtual void setupCommitMessageEditor(const KUrl&, KTextEdit* edit) const;
};
}
......
......@@ -29,6 +29,7 @@
#include "vcsdiff.h"
#include <interfaces/iplugincontroller.h>
#include <KComboBox>
#include <KTextEdit>
#include <interfaces/isession.h>
#include <interfaces/ibasicversioncontrol.h>
......@@ -43,7 +44,7 @@ VCSCommitDiffPatchSource::VCSCommitDiffPatchSource(VCSDiffUpdater* updater)
m_commitMessageWidget = new QWidget;
QVBoxLayout* layout = new QVBoxLayout(m_commitMessageWidget.data());
m_commitMessageEdit = new QTextEdit;
m_commitMessageEdit = new KTextEdit;
m_commitMessageEdit.data()->setFont( KGlobalSettings::fixedFont() );
m_commitMessageEdit.data()->setLineWrapMode(QTextEdit::NoWrap);
m_vcs->setupCommitMessageEditor(m_base, m_commitMessageEdit.data());
......
......@@ -25,13 +25,14 @@
#include <ktemporaryfile.h>
#include <qtextstream.h>
#include <qtextedit.h>
#include <QSharedPointer>
#include <kdebug.h>
#include <interfaces/ipatchsource.h>
#include "vcs/vcsstatusinfo.h"
#include "../vcsexport.h"
class KTextEdit;
class KComboBox;
namespace KDevelop {
class VcsCommitDialog;
......@@ -116,7 +117,7 @@ Q_SIGNALS:
void reviewCancelled(QString message);
public:
QWeakPointer<QWidget> m_commitMessageWidget;
QWeakPointer<QTextEdit> m_commitMessageEdit;
QWeakPointer<KTextEdit> m_commitMessageEdit;
KDevelop::IBasicVersionControl* m_vcs;
KComboBox* m_oldMessages;
public slots:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment