DiffEditor: Modernize

* Use member init
* Use nullptr
* Use range-for
* omit QLatin1{String|Char} where possible

Change-Id: Ib231b747cdd9073b3d4fc6779b8e0afb2b404a31
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Andre Hartmann
2017-12-06 21:30:57 +01:00
committed by André Hartmann
parent 53a151074a
commit aae3056b33
21 changed files with 436 additions and 474 deletions

View File

@@ -33,20 +33,20 @@ namespace Internal {
class DiffSelection
{
public:
DiffSelection() : start(-1), end(-1), format(0) {}
DiffSelection(QTextCharFormat *f) : start(-1), end(-1), format(f) {}
DiffSelection() {}
DiffSelection(QTextCharFormat *f) : format(f) {}
DiffSelection(int s, int e, QTextCharFormat *f) : start(s), end(e), format(f) {}
int start;
int end;
QTextCharFormat *format;
int start = -1;
int end = -1;
QTextCharFormat *format = nullptr;
};
class SelectableTextEditorWidget : public TextEditor::TextEditorWidget
{
Q_OBJECT
public:
SelectableTextEditorWidget(Core::Id id, QWidget *parent = 0);
SelectableTextEditorWidget(Core::Id id, QWidget *parent = nullptr);
~SelectableTextEditorWidget() override;
void setSelections(const QMap<int, QList<DiffSelection> > &selections);