Commit f5915243 authored by Dominik Haumann's avatar Dominik Haumann

remove convenience View::setSelection()

remove:
bool KTE::View::setSelection(const Cursor &position, int length, bool
wrap);

It was never fully implemented anyways.
parent f1e6678d
......@@ -445,13 +445,8 @@ The following interfaces were merged, in order:
\section kte_port_rename Interface Changes
The following interfaces were renamed:
- \p KTextEditor::CodeCompletionInterface was changed to support several
clients at once. A client registers a so-called
KTextEditor::CompletionProvider that provides its own completion and argument
hint da.
- \p CompletionEntry was renamed to KTextEditor::CompletionItem
- signal \p modifiedOnDisc() was renamed to
KTextEditor::ModificationInterface::modifiedOnDisk()
- \p KTextEditor::View::setSelection(const Cursor &position, int length, bool wrap);
was removed in favour of the Range based KTextEditor::View::setSelection()
\section kte_port_new New Interfaces
The following interfaces are new:
......
......@@ -113,25 +113,6 @@ bool View::isActiveView() const
return this == document()->activeView();
}
// TODO ### KDE5: remove in favour of Range based setSelection()
bool View::setSelection(const Cursor& position, int length,bool wrap)
{
KTextEditor::Document *doc=document();
if (!document()) return false;
if (length==0) return false;
if (!doc->cursorInText(position)) return false;
Cursor end=Cursor(position.line(),position.column());
if (!wrap) {
int col=end.column()+length;
if (col<0) col=0;
if (col>doc->lineLength(end.line())) col=doc->lineLength(end.line());
end.setColumn(col);
} else {
kDebug()<<"KTextEditor::View::setSelection(pos,len,true) not implemented yet";
}
return setSelection(Range(position,end));
}
bool View::insertText (const QString &text )
{
KTextEditor::Document *doc=document();
......
......@@ -506,25 +506,6 @@ class KTEXTEDITOR_EXPORT View : public QWidget, public KXMLGUIClient
*/
virtual bool setSelection ( const Range &range ) = 0;
/**
* This is an overloaded member function, provided for convenience, it
* differs from the above function only in what argument(s) it accepts.
* An existing old selection will be discarded. If possible you should
* reimplement the default implementation with a more efficient one.
* \param position start or end position of the selection, depending
* on the \p length parameter
* \param length if >0 \p position defines the start of the selection,
* if <0 \p position specifies the end
* \param wrap if \e false the selection does not wrap lines and reaches
* only to start/end of the cursors line. Default: \e true.
* Warning: \e true was never implemented in KDE 4.
* \see selectionRange(), selection()
* \todo remove in KDE5 in favour of Range based setSelection()
*/
virtual bool setSelection ( const Cursor &position,
int length,
bool wrap = true );
/**
* Query the view whether it has selected text, i.e. whether a selection
* exists.
......
......@@ -248,10 +248,6 @@ class KATEPART_TESTS_EXPORT KateView : public KTextEditor::View,
public Q_SLOTS:
virtual bool setSelection ( const KTextEditor::Range &selection );
// unhide method...
bool setSelection (const KTextEditor::Cursor &c, int i, bool b)
{ return KTextEditor::View::setSelection (c, i, b); }
virtual bool removeSelection () { return clearSelection(); }
virtual bool removeSelectionText () { return removeSelectedText(); }
......
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