aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/views/mtexteditview.cpp7
-rw-r--r--src/views/mtexteditview_p.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/src/views/mtexteditview.cpp b/src/views/mtexteditview.cpp
index a3d2a4a1..b66a2087 100644
--- a/src/views/mtexteditview.cpp
+++ b/src/views/mtexteditview.cpp
@@ -59,7 +59,7 @@ namespace
// Default icon name for informational banner about failed paste
const char *const DefaultPasteBannerIcon = "icon-m-framework-close";
- // How long notification will stay visible
+ // Upper limit for how long notification will stay visible, may be closed earlier automatically
const int NotificationDuration = 3000;
const int BinaryTextVariantSeparator = 0x9c;
}
@@ -109,6 +109,7 @@ MTextEditViewPrivate::MTextEditViewPrivate(MTextEdit *control, MTextEditView *q)
maskTimer->setInterval(MaskedTimeInterval);
hideInfoBannerTimer->setSingleShot(true);
+ QObject::connect(hideInfoBannerTimer, SIGNAL(timeout()), q, SLOT(hideInfoBanner()));
QObject::connect(longPressTimer, SIGNAL(timeout()), q, SLOT(handleLongPress()));
QObject::connect(scrollTimer, SIGNAL(timeout()), this, SLOT(scrolling()));
@@ -1184,8 +1185,6 @@ void MTextEditView::informPasteFailed()
{
Q_D(MTextEditView);
- d->hideInfoBannerTimer->start();
-
if (d->infoBanner) {
return;
}
@@ -1212,7 +1211,7 @@ void MTextEditView::informPasteFailed()
d->controller->sceneManager()->appearSceneWindow(d->infoBanner, MSceneWindow::DestroyWhenDone);
d->hideInfoBannerTimer->setInterval(duration);
- connect(d->hideInfoBannerTimer, SIGNAL(timeout()), this, SLOT(hideInfoBanner()));
+ d->hideInfoBannerTimer->start();
}
void MTextEditView::handleLongPress()
diff --git a/src/views/mtexteditview_p.h b/src/views/mtexteditview_p.h
index 7ba46b21..cf959899 100644
--- a/src/views/mtexteditview_p.h
+++ b/src/views/mtexteditview_p.h
@@ -125,7 +125,7 @@ protected:
bool inAutoSelectionClick;
- MInfoBanner *infoBanner;
+ QPointer<MInfoBanner> infoBanner;
bool editActive; // true if editing started and having focus