aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannu Koivisto <hannu.koivisto@vincit.fi>2011-01-20 14:43:45 +0200
committerPekka Vuorela <pekka.ta.vuorela@nokia.com>2011-01-25 15:55:40 +0200
commitaabdec99f5222009b36e0f46dc07aa2eb118b5ac (patch)
tree55392a678d4c6997e4faa71fbbfc00fbeaa7543d
parentb645655e35e19d2630cc69f1548350315810b3eb (diff)
Fixes: NB#210695, Widgets gallery is crashing when tapped on the paste button in a scenario
RevBy: Michael Hasselmann Details: MInfoBanner is removed automatically (not documented).
-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