Commit aa17f239 authored by Laurent Montel's avatar Laurent Montel 😁

Fix memory leak. Minor optimization

parent 0c14e626
......@@ -35,16 +35,18 @@ NotesWidget::NotesWidget(QWidget * parent) :
void NotesWidget::slotFillNotesMenu(QMenu *menu)
{
QAction *a = new QAction(i18n("Insert current timecode"), this);
QAction *a = new QAction(i18n("Insert current timecode"), menu);
connect(a, SIGNAL(triggered(bool)), this, SIGNAL(insertNotesTimecode()));
menu->insertAction(menu->actions().at(0), a);
}
void NotesWidget::mouseMoveEvent( QMouseEvent * e )
{
QString anchor = anchorAt(e->pos());
if (anchor.isEmpty()) viewport()->setCursor(Qt::IBeamCursor);
else viewport()->setCursor(Qt::PointingHandCursor);
const QString anchor = anchorAt(e->pos());
if (anchor.isEmpty())
viewport()->setCursor(Qt::IBeamCursor);
else
viewport()->setCursor(Qt::PointingHandCursor);
KTextEdit::mouseMoveEvent(e);
}
......
......@@ -38,8 +38,8 @@ public:
~NotesWidget();
protected:
virtual void mouseMoveEvent ( QMouseEvent * e );
virtual void mousePressEvent ( QMouseEvent * e );
void mouseMoveEvent ( QMouseEvent * e );
void mousePressEvent ( QMouseEvent * e );
private slots:
void slotFillNotesMenu(QMenu *menu);
......
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