From 87291d518beb131b5b80540d46d53b54c2366a9c Mon Sep 17 00:00:00 2001 From: Karim Pinter Date: Mon, 29 Nov 2010 14:21:23 +0200 Subject: Removes the reseting of the QMenu offset. On s60 when the qmenu is opened on the second time, it restores the position of the last activated menu, so there is no need to reset the offset when the popup() is called again. Task-number: QTBUG-9505 --- src/gui/widgets/qmenu.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 4bea6de..d9233f5 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -1795,10 +1795,14 @@ QSize QMenu::sizeHint() const void QMenu::popup(const QPoint &p, QAction *atAction) { Q_D(QMenu); +#ifndef Q_WS_S60 + //on S60 opens the menu at the same position it was activated last time + //there is no need to reset the offset fix for QTBUG-9505 if (d->scroll) { // reset scroll state from last popup d->scroll->scrollOffset = 0; d->scroll->scrollFlags = QMenuPrivate::QMenuScroller::ScrollNone; } +#endif d->tearoffHighlighted = 0; d->motions = 0; d->doChildEffects = true; -- cgit v0.12 From 4fb210b9e225fffafdaac26e0acb3c0b71087137 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 25 Nov 2010 12:33:14 +0200 Subject: Fix proxy reading from gconf so that it is only done once / session. Fixes: NB#194509 - Network access from a Qt app makes dbus daemon consume tons of cpu Task-number: QT-4220 --- src/plugins/bearer/icd/proxyconf.cpp | 18 ++++++++++++++---- src/plugins/bearer/icd/proxyconf.h | 1 + 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/plugins/bearer/icd/proxyconf.cpp b/src/plugins/bearer/icd/proxyconf.cpp index e5c8f4e..37501fb 100644 --- a/src/plugins/bearer/icd/proxyconf.cpp +++ b/src/plugins/bearer/icd/proxyconf.cpp @@ -142,16 +142,23 @@ QHash GConfItemFast::getEntries() const -class NetworkProxyFactory : QNetworkProxyFactory { +class NetworkProxyFactory : QNetworkProxyFactory +{ + ProxyConf proxy_conf; + bool proxy_data_read; + public: - NetworkProxyFactory() { } + NetworkProxyFactory() : proxy_data_read(false) { } QList queryProxy(const QNetworkProxyQuery &query = QNetworkProxyQuery()); }; QList NetworkProxyFactory::queryProxy(const QNetworkProxyQuery &query) { - ProxyConf proxy_conf; + if (proxy_data_read == false) { + proxy_data_read = true; + proxy_conf.readProxyData(); + } QList result = proxy_conf.flush(query); if (result.isEmpty()) @@ -377,10 +384,13 @@ ProxyConf::~ProxyConf() delete d_ptr; } +void ProxyConf::readProxyData() +{ + d_ptr->readProxyData(); +} QList ProxyConf::flush(const QNetworkProxyQuery &query) { - d_ptr->readProxyData(); return d_ptr->flush(query); } diff --git a/src/plugins/bearer/icd/proxyconf.h b/src/plugins/bearer/icd/proxyconf.h index 884cc5c..eedbbf2 100644 --- a/src/plugins/bearer/icd/proxyconf.h +++ b/src/plugins/bearer/icd/proxyconf.h @@ -58,6 +58,7 @@ public: virtual ~ProxyConf(); QList flush(const QNetworkProxyQuery &query = QNetworkProxyQuery()); // read the proxies from db + void readProxyData(); /* Note that for each update() call there should be corresponding * clear() call because the ProxyConf class implements a reference -- cgit v0.12 From 6ae84f1183e91c910ca92a55e37f8254ace805c0 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Mon, 6 Dec 2010 13:07:36 +0100 Subject: Fix QTextEdit::selectAll crash from textChanged() Doing selectAll() after the entire block of text has been removed will cause this crash, because we didn't check if the block we found is valid or not. Task-number: QTBUG-15857 Reviewed-by: Eskil --- src/gui/text/qtextcursor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp index 769ab2f..f73cc4b 100644 --- a/src/gui/text/qtextcursor.cpp +++ b/src/gui/text/qtextcursor.cpp @@ -363,6 +363,9 @@ bool QTextCursorPrivate::movePosition(QTextCursor::MoveOperation op, QTextCursor bool adjustX = true; QTextBlock blockIt = block(); + if (!blockIt.isValid()) + return false; + if (op >= QTextCursor::Left && op <= QTextCursor::WordRight && blockIt.textDirection() == Qt::RightToLeft) { if (op == QTextCursor::Left) -- cgit v0.12 From 700ce118e1f294148fbbd9b92672f9ff7ec21f8e Mon Sep 17 00:00:00 2001 From: Karim Pinter Date: Tue, 7 Dec 2010 11:46:55 +0200 Subject: Updating merge request 2512 Removing unnecessary comments and changing define to Q_OS_SYMBIAN. Task-number: QTBUG_9505 --- src/gui/widgets/qmenu.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index d9233f5..538df35 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -1795,9 +1795,7 @@ QSize QMenu::sizeHint() const void QMenu::popup(const QPoint &p, QAction *atAction) { Q_D(QMenu); -#ifndef Q_WS_S60 - //on S60 opens the menu at the same position it was activated last time - //there is no need to reset the offset fix for QTBUG-9505 +#ifndef Q_OS_SYMBIAN if (d->scroll) { // reset scroll state from last popup d->scroll->scrollOffset = 0; d->scroll->scrollFlags = QMenuPrivate::QMenuScroller::ScrollNone; -- cgit v0.12