mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kdeui: remove binary compatibility bits
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
d3a59e70b3
commit
2bf60e6475
4 changed files with 10 additions and 37 deletions
|
@ -307,18 +307,12 @@ void KRichTextEdit::switchToPlainText()
|
|||
{
|
||||
if (d->mMode == Rich) {
|
||||
d->mMode = Plain;
|
||||
// TODO: Warn the user about this?
|
||||
QMetaObject::invokeMethod(this, "insertPlainTextImplementation");
|
||||
document()->setPlainText(document()->toPlainText());
|
||||
setAcceptRichText(false);
|
||||
emit textModeChanged(d->mMode);
|
||||
}
|
||||
}
|
||||
|
||||
void KRichTextEdit::insertPlainTextImplementation()
|
||||
{
|
||||
document()->setPlainText(document()->toPlainText());
|
||||
}
|
||||
|
||||
void KRichTextEdit::setTextSuperScript(bool superscript)
|
||||
{
|
||||
QTextCharFormat fmt;
|
||||
|
|
|
@ -33,8 +33,6 @@ class KRichTextEditPrivate;
|
|||
|
||||
#include <kdeui_export.h>
|
||||
|
||||
#define HAVE_INSERTPLAINTEXT 1
|
||||
|
||||
/**
|
||||
* The KRichTextEdit class provides a widget to edit and display rich text.
|
||||
*
|
||||
|
@ -344,13 +342,6 @@ public Q_SLOTS:
|
|||
*/
|
||||
void setTextSubScript(bool subscript);
|
||||
|
||||
/**
|
||||
* @since 4.10
|
||||
* Because of binary compatibility constraints, insertPlainText
|
||||
* is not virtual. Therefore it must dynamically detect and call this slot.
|
||||
*/
|
||||
void insertPlainTextImplementation();
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
/**
|
||||
|
|
|
@ -670,9 +670,13 @@ void KTextEdit::contextMenuEvent(QContextMenuEvent *event)
|
|||
// Use standard context menu for already selected words, correctly spelled
|
||||
// words and words inside quotes.
|
||||
if (!wordIsMisspelled || selectedWordClicked || inQuote) {
|
||||
QMetaObject::invokeMethod(this, "mousePopupMenuImplementation", Q_ARG(QPoint, event->globalPos()));
|
||||
}
|
||||
else {
|
||||
QMenu *popup = mousePopupMenu();
|
||||
if (popup) {
|
||||
aboutToShowContextMenu(popup);
|
||||
popup->exec(event->globalPos());
|
||||
delete popup;
|
||||
}
|
||||
} else {
|
||||
QMenu menu; //don't use KMenu here we don't want auto management accelerator
|
||||
|
||||
//Add the suggestions to the menu
|
||||
|
@ -1153,14 +1157,4 @@ void KTextEdit::showAutoCorrectButton(bool show)
|
|||
d->showAutoCorrectionButton = show;
|
||||
}
|
||||
|
||||
void KTextEdit::mousePopupMenuImplementation(const QPoint& pos)
|
||||
{
|
||||
QMenu *popup = mousePopupMenu();
|
||||
if ( popup ) {
|
||||
aboutToShowContextMenu(popup);
|
||||
popup->exec( pos );
|
||||
delete popup;
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_ktextedit.cpp"
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#define HAVE_AUTOCORRECTFEATURE 1
|
||||
#define HAVE_FORCESPELLCHECKING 1
|
||||
#define HAVE_MOUSEPOPUPMENUIMPLEMENTATION 1
|
||||
|
||||
/**
|
||||
* This interface is a workaround to keep binary compatibility in KDE4, because
|
||||
* adding the virtual keyword to functions is not BC.
|
||||
|
@ -215,6 +216,7 @@ class KDEUI_EXPORT KTextEdit : public QTextEdit //krazy:exclude=qclasses
|
|||
/**
|
||||
* Return standard KTextEdit popupMenu
|
||||
* @since 4.1
|
||||
* @todo mark as virtual
|
||||
*/
|
||||
QMenu *mousePopupMenu();
|
||||
|
||||
|
@ -370,14 +372,6 @@ class KDEUI_EXPORT KTextEdit : public QTextEdit //krazy:exclude=qclasses
|
|||
*/
|
||||
void replace();
|
||||
|
||||
|
||||
/**
|
||||
* @since 4.10
|
||||
* Because of binary compatibility constraints, mousePopupMenu()
|
||||
* is not virtual. Therefore it must dynamically detect and call this slot.
|
||||
*/
|
||||
void mousePopupMenuImplementation(const QPoint& pos);
|
||||
|
||||
protected Q_SLOTS:
|
||||
/**
|
||||
* @since 4.1
|
||||
|
|
Loading…
Add table
Reference in a new issue