diff options
24 files changed, 202 insertions, 249 deletions
diff --git a/doc/src/examples/diagramscene.qdoc b/doc/src/examples/diagramscene.qdoc index f4d6b0d..7c643c2 100644 --- a/doc/src/examples/diagramscene.qdoc +++ b/doc/src/examples/diagramscene.qdoc @@ -265,7 +265,8 @@ \snippet examples/graphicsview/diagramscene/mainwindow.cpp 3 - This slot deletes the selected item, if any, from the scene. If + This slot deletes the selected item, if any, from the scene. It + deletes the arrows first in order to avoid to delete them twice. If the item to be deleted is a \c DiagramItem, we also need to delete arrows connected to it; we don't want arrows in the scene that aren't connected to items in both ends. diff --git a/doc/src/template/style/narrow.css b/doc/src/template/style/narrow.css index e4ad135..349048f 100644 --- a/doc/src/template/style/narrow.css +++ b/doc/src/template/style/narrow.css @@ -54,7 +54,7 @@ .narrow .header .qtref a { - color: #363534; + color: #00732F; } .narrow .header .qtref span @@ -103,7 +103,7 @@ } .narrow .header #shortCut ul li a { - color: #44a51c; + color: #00732F; } .narrow .wrapper .hd diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 6a32e53..190c60a 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -1283,43 +1283,6 @@ -/* start of offline spec*/ - .offline .wrapper .hd - { - background: url(../images/page.png) no-repeat 0 -15px; - } - .offline .wrapper .bd - { - background: url(../images/bg_l_blank.png) repeat-y 0 0; - } - .offline .wrapper .ft - { - background: url(../images/page.png) no-repeat 0 -90px; - } - .offline .sidebar, - .offline .feedback, - .offline .t_button, - .offline #narrowsearch, - .offline #narrowmenu - { - display: none; - } - .offline .wrap - { - margin: 0 5px 0 5px; - } - .offline .wrap .breadcrumb - { - } - - .offline .wrap .content - { - padding-top: 15px; - } - - -/* end of offline spec*/ - /* start of creator spec*/ .creator { @@ -1339,9 +1302,9 @@ .creator #feedbackBox, .creator #feedback, .creator #blurpage, - .creator .indexbox .indexIcon span, + /*.creator .indexbox .indexIcon span,*/ .creator .wrapper .hd, - .creator .indexbox .indexIcon, +/* .creator .indexbox .indexIcon,*/ .creator .header #nav-logo, .creator #offlinemenu, .creator #offlinesearch, diff --git a/examples/graphicsview/diagramscene/mainwindow.cpp b/examples/graphicsview/diagramscene/mainwindow.cpp index f09c552..7d82df0 100644 --- a/examples/graphicsview/diagramscene/mainwindow.cpp +++ b/examples/graphicsview/diagramscene/mainwindow.cpp @@ -45,6 +45,7 @@ #include "diagramitem.h" #include "diagramscene.h" #include "diagramtextitem.h" +#include "arrow.h" const int InsertTextButton = 10; @@ -55,7 +56,7 @@ MainWindow::MainWindow() createToolBox(); createMenus(); - scene = new DiagramScene(itemMenu); + scene = new DiagramScene(itemMenu, this); scene->setSceneRect(QRectF(0, 0, 5000, 5000)); connect(scene, SIGNAL(itemInserted(DiagramItem*)), this, SLOT(itemInserted(DiagramItem*))); @@ -123,11 +124,22 @@ void MainWindow::buttonGroupClicked(int id) void MainWindow::deleteItem() { foreach (QGraphicsItem *item, scene->selectedItems()) { - if (item->type() == DiagramItem::Type) { - qgraphicsitem_cast<DiagramItem *>(item)->removeArrows(); + if (item->type() == Arrow::Type) { + scene->removeItem(item); + Arrow *arrow = qgraphicsitem_cast<Arrow *>(item); + arrow->startItem()->removeArrow(arrow); + arrow->endItem()->removeArrow(arrow); + delete item; } - scene->removeItem(item); } + + foreach (QGraphicsItem *item, scene->selectedItems()) { + if (item->type() == DiagramItem::Type) { + qgraphicsitem_cast<DiagramItem *>(item)->removeArrows(); + } + scene->removeItem(item); + delete item; + } } //! [3] @@ -313,7 +325,7 @@ void MainWindow::about() //! [21] void MainWindow::createToolBox() { - buttonGroup = new QButtonGroup; + buttonGroup = new QButtonGroup(this); buttonGroup->setExclusive(false); connect(buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(buttonGroupClicked(int))); @@ -345,7 +357,7 @@ void MainWindow::createToolBox() QWidget *itemWidget = new QWidget; itemWidget->setLayout(layout); - backgroundButtonGroup = new QButtonGroup; + backgroundButtonGroup = new QButtonGroup(this); connect(backgroundButtonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(backgroundButtonGroupClicked(QAbstractButton*))); @@ -460,7 +472,6 @@ void MainWindow::createToolbars() editToolBar->addAction(sendBackAction); fontCombo = new QFontComboBox(); - fontSizeCombo = new QComboBox(); connect(fontCombo, SIGNAL(currentFontChanged(QFont)), this, SLOT(currentFontChanged(QFont))); @@ -526,7 +537,7 @@ void MainWindow::createToolbars() linePointerButton->setCheckable(true); linePointerButton->setIcon(QIcon(":/images/linepointer.png")); - pointerTypeGroup = new QButtonGroup; + pointerTypeGroup = new QButtonGroup(this); pointerTypeGroup->addButton(pointerButton, int(DiagramScene::MoveItem)); pointerTypeGroup->addButton(linePointerButton, int(DiagramScene::InsertLine)); @@ -605,7 +616,7 @@ QMenu *MainWindow::createColorMenu(const char *slot, QColor defaultColor) names << tr("black") << tr("white") << tr("red") << tr("blue") << tr("yellow"); - QMenu *colorMenu = new QMenu; + QMenu *colorMenu = new QMenu(this); for (int i = 0; i < colors.count(); ++i) { QAction *action = new QAction(names.at(i), this); action->setData(colors.at(i)); diff --git a/src/3rdparty/libconninet/Makefile.am b/src/3rdparty/libconninet/Makefile.am deleted file mode 100644 index 250637a..0000000 --- a/src/3rdparty/libconninet/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -SUBDIRS = src tests - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = conninet.pc - -MAINTAINERCLEANFILES = \ - Makefile.in config.h.in configure \ - install-sh ltmain.sh missing mkinstalldirs \ - config.log config.status config.guess config.sub \ - build-stamp compile depcomp acinclude.m4 aclocal.m4 \ - debian/files \ - debian/libconninet0.postinst.debhelper \ - debian/libconninet0.postrm.debhelper \ - debian/libconninet0.substvars - -EXTRA_DIST = \ - debian/changelog \ - debian/compat \ - debian/control \ - debian/copyright \ - debian/libconninet0-dev.dirs \ - debian/libconninet0-dev.files \ - debian/libconninet0.dirs \ - debian/libconninet0.files \ - debian/rules - -# get rid of debian build dirs -maintainer-clean-local: - -rm -rf debian/build debian/tmp \ - debian/libconninet0 \ - debian/libconninet0-dev \ - debian/libconninet0-dbg - -if DOXYGEN_DOCS_ENABLED - DOXYGEN_LINE = $(DOXYGEN) doxygen.cfg -else - DOXYGEN_LINE = -endif - -.PHONY : doc - -doc: - $(DOXYGEN_LINE) - -deb: dist - -mkdir $(top_builddir)/debian-build - cd $(top_builddir)/debian-build && tar zxf ../$(top_builddir)/$(PACKAGE)-$(VERSION).tar.gz - cd $(top_builddir)/debian-build/$(PACKAGE)-$(VERSION) && dpkg-buildpackage -rfakeroot -sa -D - -rm -rf $(top_builddir)/debian-build/$(PACKAGE)-$(VERSION) diff --git a/src/3rdparty/libconninet/debian/changelog b/src/3rdparty/libconninet/debian/changelog index 436d318..4063317 100644 --- a/src/3rdparty/libconninet/debian/changelog +++ b/src/3rdparty/libconninet/debian/changelog @@ -1,9 +1,17 @@ -libconninet (0.41+0m6) unstable; urgency=low +libconninet (0.42+0m6) unstable; urgency=low * This entry has been added by BIFH queue processor - version has been changed to 0.41+0m6 + version has been changed to 0.42+0m6 - -- Qing Jin <ext-qing.1.jin@nokia.com> Thu, 15 Jul 2010 15:56:38 +0300 + -- Qing Jin <ext-qing.1.jin@nokia.com> Thu, 22 Jul 2010 14:04:58 +0300 + +libconninet (0.42) unstable; urgency=low + + * Fixes: NB#180536 - Uploads to online services are not working. + This is a regression caused by fix to bug 175098, the timeout was never + expiring when waiting reply from icd. + + -- Jukka Rissanen <jukka.rissanen@nokia.com> Mon, 19 Jul 2010 12:23:30 +0300 libconninet (0.41) unstable; urgency=low diff --git a/src/3rdparty/libconninet/src/Makefile.am b/src/3rdparty/libconninet/src/Makefile.am deleted file mode 100644 index be7a1e5..0000000 --- a/src/3rdparty/libconninet/src/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -DEFS = -DDBUS_API_SUBJECT_TO_CHANGE -DGCONF_DISABLE_DEPRECATED -INCLUDES = @GLIB_CFLAGS@ @DBUS_CFLAGS@ @GCONF_CFLAGS@ @OSSO_IC_CFLAGS@ @ICD_DEV_CFLAGS@ @QTCORE_CFLAGS@ @QTNETWORK_CFLAGS@ @QTDBUS_CFLAGS@ @QGCONF_CFLAGS@ @CONNSETTINGS_CFLAGS@ -LIBS = @GLIB_LIBS@ @DBUS_LIBS@ @GCONF_LIBS@ @OSSO_IC_LIBS@ @ICD_DEV_LIBS@ @QTCORE_LIBS@ @QTDBUS_LIBS@ @QTNETWORK_CFLAGS@ @QGCONF_LIBS@ @CONNSETTINGS_LIBS@ - -AM_CFLAGS = $(CONCFLAGS) - -lib_LTLIBRARIES = libconninet.la -libconninet_la_SOURCES = \ - maemo_icd.cpp \ - dbusdispatcher.cpp \ - iapconf.cpp \ - iapmonitor.cpp \ - proxyconf.cpp - -#libconninet_la_LDFLAGS = -version-info 0:0:0 - -conninetincludedir = $(includedir)/conninet -conninetinclude_HEADERS = \ - maemo_icd.h \ - dbusdispatcher.h \ - iapconf.h \ - iapmonitor.h \ - proxyconf.h - -nodist_libconninet_la_SOURCES = \ - moc_maemo_icd.cpp \ - moc_dbusdispatcher.cpp - -MAINTAINERCLEANFILES = Makefile.in - -# This rule lets GNU make create any moc_*.cpp from the equivalent *.h -moc_%.cpp: %.h - moc $< -o $@ - -# This line ensures that generated moc files are deleted when we make clean. -CLEANFILES = *_moc.cpp *.loT diff --git a/src/3rdparty/libconninet/src/dbusdispatcher.cpp b/src/3rdparty/libconninet/src/dbusdispatcher.cpp index f5b830a..7581982 100644 --- a/src/3rdparty/libconninet/src/dbusdispatcher.cpp +++ b/src/3rdparty/libconninet/src/dbusdispatcher.cpp @@ -31,7 +31,7 @@ namespace Maemo { /*! - \class Maemo::DBusDispatcher + \class DBusDispatcher \brief DBusDispatcher is a class, which is able to send DBUS method call messages and receive unicast signals from DBUS object. diff --git a/src/3rdparty/libconninet/src/maemo_icd.cpp b/src/3rdparty/libconninet/src/maemo_icd.cpp index bc84fbc..026241c 100644 --- a/src/3rdparty/libconninet/src/maemo_icd.cpp +++ b/src/3rdparty/libconninet/src/maemo_icd.cpp @@ -30,9 +30,30 @@ #include <dbus/dbus.h> #include <dbus/dbus-glib-lowlevel.h> +#include <sys/time.h> +#include <sys/types.h> +#include <unistd.h> namespace Maemo { +#undef PRINT_DEBUGINFO +#ifdef PRINT_DEBUGINFO + static FILE *fdebug = NULL; +#define PDEBUG(fmt, args...) \ + do { \ + struct timeval tv; \ + gettimeofday(&tv, 0); \ + fprintf(fdebug, "DEBUG[%d]:%ld.%ld:%s:%s():%d: " fmt, \ + getpid(), \ + tv.tv_sec, tv.tv_usec, \ + __FILE__, __FUNCTION__, __LINE__, args); \ + fflush(fdebug); \ + } while(0) +#else +#define PDEBUG(fmt...) +#endif + + /* Reference counting singleton class that creates a single connection * to icd so that icd reference counting works as expected. This is * needed because DBusDispatcher uses private dbus connections @@ -239,6 +260,13 @@ public: icd = myfriend; timeout = dbus_timeout; + +#ifdef PRINT_DEBUGINFO + if (!fdebug) { + fdebug = fopen("/tmp/maemoicd.log", "a+"); + } + PDEBUG("created %s\n", "IcdPrivate"); +#endif } void clearState() @@ -672,6 +700,8 @@ uint IcdPrivate::state_non_blocking(QList<IcdStateResult>& state_results) uint signals_left, total_signals; IcdStateResult result; + PDEBUG("%s\n", "non blocking state"); + clearState(); reply = mDBus->call(ICD_DBUS_API_STATE_REQ); if (reply.type() != QVariant::List) @@ -719,6 +749,7 @@ uint IcdPrivate::state_non_blocking(QList<IcdStateResult>& state_results) } timer.stop(); + PDEBUG("total_signals=%d\n", total_signals); return total_signals; } @@ -731,11 +762,14 @@ uint IcdPrivate::state_non_blocking(QList<IcdStateResult>& state_results) */ uint IcdPrivate::state(QList<IcdStateResult>& state_results) { - QTimer timer; QVariant reply; QVariantList vl; uint signals_left, total_signals; IcdStateResult result; + time_t started; + int timeout_secs = timeout / 1000; + + PDEBUG("%s\n", "state_results"); clearState(); reply = mDBus->call(ICD_DBUS_API_STATE_REQ); @@ -749,17 +783,16 @@ uint IcdPrivate::state(QList<IcdStateResult>& state_results) if (!signals_left) return 0; - timer.setSingleShot(true); - timer.start(timeout); + started = time(0); state_results.clear(); mError.clear(); while (signals_left) { mInterface.clear(); - while (timer.isActive() && mInterface.isEmpty()) { + while ((time(0)<=(started+timeout_secs)) && mInterface.isEmpty()) { mDBus->synchronousDispatch(1000); } - if (!timer.isActive()) { + if (time(0)>(started+timeout_secs)) { total_signals = 0; break; } @@ -782,8 +815,8 @@ uint IcdPrivate::state(QList<IcdStateResult>& state_results) break; } } - timer.stop(); + PDEBUG("total_signals=%d\n", total_signals); return total_signals; } @@ -956,11 +989,14 @@ static void get_addrinfo_all_result(QList<QVariant>& args, */ uint IcdPrivate::addrinfo(QList<IcdAddressInfoResult>& addr_results) { - QTimer timer; QVariant reply; QVariantList vl; uint signals_left, total_signals; IcdAddressInfoResult result; + time_t started; + int timeout_secs = timeout / 1000; + + PDEBUG("%s\n", "addr_results"); clearState(); reply = mDBus->call(ICD_DBUS_API_ADDRINFO_REQ); @@ -976,16 +1012,15 @@ uint IcdPrivate::addrinfo(QList<IcdAddressInfoResult>& addr_results) if (!signals_left) return 0; - timer.setSingleShot(true); - timer.start(timeout); + started = time(0); addr_results.clear(); while (signals_left) { mInterface.clear(); - while (timer.isActive() && mInterface.isEmpty()) { + while ((time(0)<=(started+timeout_secs)) && mInterface.isEmpty()) { mDBus->synchronousDispatch(1000); } - if (!timer.isActive()) { + if (time(0)>(started+timeout_secs)) { total_signals = 0; break; } @@ -1003,7 +1038,8 @@ uint IcdPrivate::addrinfo(QList<IcdAddressInfoResult>& addr_results) break; } } - timer.stop(); + + PDEBUG("total_signals=%d\n", total_signals); return total_signals; } @@ -1015,6 +1051,8 @@ uint IcdPrivate::addrinfo_non_blocking(QList<IcdAddressInfoResult>& addr_results uint signals_left, total_signals; IcdAddressInfoResult result; + PDEBUG("%s\n", "non blocking addrinfo"); + clearState(); reply = mDBus->call(ICD_DBUS_API_ADDRINFO_REQ); if (reply.type() != QVariant::List) @@ -1057,6 +1095,7 @@ uint IcdPrivate::addrinfo_non_blocking(QList<IcdAddressInfoResult>& addr_results } } timer.stop(); + PDEBUG("total_signals=%d\n", total_signals); return total_signals; } diff --git a/src/3rdparty/libconninet/tests/Makefile.am b/src/3rdparty/libconninet/tests/Makefile.am deleted file mode 100644 index f6f41ea..0000000 --- a/src/3rdparty/libconninet/tests/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -DEFS = -DDBUS_API_SUBJECT_TO_CHANGE -INCLUDES = @GLIB_CFLAGS@ @DBUS_CFLAGS@ @CONNSETTINGS_CFLAGS@ @OSSO_IC_CFLAGS@ @ICD_DEV_CFLAGS@ \ - @QTCORE_CFLAGS@ @QTDBUS_CFLAGS@ @QTCORE_CFLAGS@ @QTNETWORK_CFLAGS@ @QTTEST_CFLAGS@ \ - -I$(top_srcdir) \ - -I$(top_srcdir)/src - -LIBS = @GLIB_LIBS@ @DBUS_LIBS@ @CONNSETTINGS_LIBS@ @OSSO_IC_LIBS@ @ICD_DEV_LIBS@ \ - @QTCORE_LIBS@ @QTDBUS_LIBS@ @QTCORE_LIBS@ @QTNETWORK_LIBS@ @QTTEST_LIBS@ \ - $(top_builddir)/src/libconninet.la - -AM_CFLAGS = $(CONCFLAGS) -AM_LDFLAGS = -static - -bin_PROGRAMS = test_dbusdispatcher test_iapconf test_maemo_icd test_iapmonitor test_proxyconf - -test_dbusdispatcher_SOURCES = ut_dbusdispatcher.cpp -ut_dbusdispatcher.o: ut_dbusdispatcher.moc - -test_iapconf_SOURCES = ut_iapconf.cpp -ut_iapconf.o: ut_iapconf.moc - -test_maemo_icd_SOURCES = ut_maemo_icd.cpp -ut_maemo_icd.o: ut_maemo_icd.moc - -test_iapmonitor_SOURCES = ut_iapmonitor.cpp -ut_iapmonitor.o: ut_iapmonitor.moc - -test_proxyconf_SOURCES = ut_proxyconf.cpp -ut_proxyconf.o: ut_proxyconf.moc - - -MAINTAINERCLEANFILES = Makefile.in - -# This rule lets GNU make create any *.moc from the equivalent *.cpp -%.moc: %.cpp - moc $< -o $@ - -# This line ensures that generated moc files are deleted when we make clean. -CLEANFILES = *.moc diff --git a/src/gui/kernel/qcocoamenuloader_mac.mm b/src/gui/kernel/qcocoamenuloader_mac.mm index 8d65aa1..8d38f45 100644 --- a/src/gui/kernel/qcocoamenuloader_mac.mm +++ b/src/gui/kernel/qcocoamenuloader_mac.mm @@ -255,5 +255,10 @@ QT_USE_NAMESPACE qApp->quit(); } } + + - (void)orderFrontCharacterPalette:(id)sender + { + [NSApp orderFrontCharacterPalette:sender]; + } @end #endif // QT_MAC_USE_COCOA diff --git a/src/gui/kernel/qcocoamenuloader_mac_p.h b/src/gui/kernel/qcocoamenuloader_mac_p.h index a75ad0a..edacfa5 100644 --- a/src/gui/kernel/qcocoamenuloader_mac_p.h +++ b/src/gui/kernel/qcocoamenuloader_mac_p.h @@ -88,6 +88,7 @@ - (IBAction)hide:(id)sender; - (IBAction)qtDispatcherToQAction:(id)sender; - (void)qtUpdateMenubar; +- (void)orderFrontCharacterPalette:(id)sender; @end #endif // QT_MAC_USE_COCOA diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm index e26fbde..89f01d8 100644 --- a/src/gui/kernel/qeventdispatcher_mac.mm +++ b/src/gui/kernel/qeventdispatcher_mac.mm @@ -785,7 +785,7 @@ void QEventDispatcherMacPrivate::temporarilyStopAllModalSessions() // the stacking order of the windows while doing so, we put // up a block that is used in QCocoaWindow and QCocoaPanel: int stackSize = cocoaModalSessionStack.size(); - for (int i=stackSize-1; i>=0; --i) { + for (int i=0; i<stackSize; ++i) { QCocoaModalSessionInfo &info = cocoaModalSessionStack[i]; if (info.session) { [NSApp endModalSession:info.session]; @@ -822,12 +822,12 @@ NSModalSession QEventDispatcherMacPrivate::currentModalSession() QBoolBlocker block1(blockSendPostedEvents, true); info.nswindow = window; [(NSWindow*) info.nswindow retain]; - // When creating a modal session cocoa will rearrange the windows. - // In order to avoid windows to be put behind another we need to - // keep the window level. - int level = [window level]; + int levelBeforeEnterModal = [window level]; info.session = [NSApp beginModalSessionForWindow:window]; - [window setLevel:level]; + // Make sure we don't stack the window lower that it was before + // entering modal, in case it e.g. had the stays-on-top flag set: + if (levelBeforeEnterModal > [window level]) + [window setLevel:levelBeforeEnterModal]; } currentModalSessionCached = info.session; } diff --git a/src/gui/widgets/qcocoamenu_mac.mm b/src/gui/widgets/qcocoamenu_mac.mm index ce85919..15fae23 100644 --- a/src/gui/widgets/qcocoamenu_mac.mm +++ b/src/gui/widgets/qcocoamenu_mac.mm @@ -188,6 +188,18 @@ QT_USE_NAMESPACE return NO; } +- (NSInteger)indexOfItemWithTarget:(id)anObject andAction:(SEL)actionSelector +{ + NSInteger index = [super indexOfItemWithTarget:anObject andAction:actionSelector]; + static SEL selForOFCP = NSSelectorFromString(@"orderFrontCharacterPalette:"); + if (index == -1 && selForOFCP == actionSelector) { + // Check if the 'orderFrontCharacterPalette' SEL exists for QCocoaMenuLoader object + QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = [NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)]; + return [super indexOfItemWithTarget:loader andAction:actionSelector]; + } + return index; +} + @end QT_BEGIN_NAMESPACE diff --git a/src/gui/widgets/qcocoamenu_mac_p.h b/src/gui/widgets/qcocoamenu_mac_p.h index d6ac8c5..1a42642 100644 --- a/src/gui/widgets/qcocoamenu_mac_p.h +++ b/src/gui/widgets/qcocoamenu_mac_p.h @@ -76,6 +76,7 @@ QT_FORWARD_DECLARE_CLASS(QAction) } - (id)initWithQMenu:(QMenu*)menu; - (BOOL)menuHasKeyEquivalent:(NSMenu *)menu forEvent:(NSEvent *)event target:(id *)target action:(SEL *)action; +- (NSInteger)indexOfItemWithTarget:(id)anObject andAction:(SEL)actionSelector; @end #endif diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp index c4f7c00..dd174bf 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.cpp +++ b/src/network/bearer/qnetworkconfigmanager_p.cpp @@ -63,6 +63,7 @@ QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate() : pollTimer(0), mutex(QMutex::Recursive), forcedPolling(0), firstUpdate(true) { qRegisterMetaType<QNetworkConfiguration>("QNetworkConfiguration"); + qRegisterMetaType<QNetworkConfigurationPrivatePointer>("QNetworkConfigurationPrivatePointer"); moveToThread(QCoreApplicationPrivate::mainThread()); updateConfigurations(); diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp index 60851ac..3190a30 100644 --- a/src/network/bearer/qnetworkconfiguration.cpp +++ b/src/network/bearer/qnetworkconfiguration.cpp @@ -406,13 +406,6 @@ QList<QNetworkConfiguration> QNetworkConfiguration::children() const This function is deprecated. It is equivalent to calling bearerTypeName(), however bearerType() should be used in preference. */ -QString QNetworkConfiguration::bearerName() const -{ - // This function cannot be inline as it would break Qt Mobility. - // Qt Mobility uses the Qt header as well and since the Mobility Bearer library - // does not provide bearerTypeName() we cannot use an inline function. - return bearerTypeName(); -} /*! Returns the type of bearer used by this network configuration. diff --git a/src/network/bearer/qnetworkconfiguration.h b/src/network/bearer/qnetworkconfiguration.h index 18b92a9..593dbbe 100644 --- a/src/network/bearer/qnetworkconfiguration.h +++ b/src/network/bearer/qnetworkconfiguration.h @@ -103,6 +103,7 @@ public: Q_DECLARE_FLAGS(StateFlags, StateFlag) +#ifndef QT_MOBILITY_BEARER enum BearerType { BearerUnknown, BearerEthernet, @@ -114,17 +115,22 @@ public: BearerBluetooth, BearerWiMAX }; +#endif StateFlags state() const; Type type() const; Purpose purpose() const; - // Required to maintain source compatibility with Qt Mobility. +#ifndef QT_MOBILITY_BEARER #ifdef QT_DEPRECATED - QT_DEPRECATED QString bearerName() const; + // Required to maintain source compatibility with Qt Mobility. + QT_DEPRECATED inline QString bearerName() const { return bearerTypeName(); } #endif BearerType bearerType() const; QString bearerTypeName() const; +#else + QString bearerName() const; +#endif QString identifier() const; bool isRoamingAvailable() const; diff --git a/src/network/bearer/qnetworksession.h b/src/network/bearer/qnetworksession.h index e7fffac..0b40147 100644 --- a/src/network/bearer/qnetworksession.h +++ b/src/network/bearer/qnetworksession.h @@ -89,11 +89,7 @@ public: OperationNotSupportedError, InvalidConfigurationError }; -#ifndef QT_MOBILITY_BEARER - QNetworkSession(const QNetworkConfiguration& connConfig, QObject* parent =0); -#else explicit QNetworkSession(const QNetworkConfiguration& connConfig, QObject* parent =0); -#endif virtual ~QNetworkSession(); bool isOpen() const; diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp index 0900329..3264f15 100644 --- a/src/plugins/bearer/icd/qicdengine.cpp +++ b/src/plugins/bearer/icd/qicdengine.cpp @@ -275,6 +275,8 @@ void QIcdEngine::initialize() userChoiceConfigurations.insert(cpPriv->id, ptr); doRequestUpdate(); + + getIcdInitialState(); } static inline QString network_attrs_to_security(uint network_attrs) @@ -623,7 +625,11 @@ void QIcdEngine::doRequestUpdate(QList<Maemo::IcdScanResult> scanned) changed = true; } - if (ptr->state != QNetworkConfiguration::Discovered) { + /* If this config is the current active one, we do not set it + * to discovered. + */ + if ((ptr->state != QNetworkConfiguration::Discovered) && + (ptr->state != QNetworkConfiguration::Active)) { ptr->state = QNetworkConfiguration::Discovered; changed = true; } @@ -786,10 +792,48 @@ void QIcdEngine::startListeningStateSignalsForAllConnections() ICD_DBUS_API_INTERFACE, ICD_DBUS_API_STATE_SIG, this, SLOT(connectionStateSignalsSlot(QDBusMessage))); +} + +void QIcdEngine::getIcdInitialState() +{ + /* Instead of requesting ICD status asynchronously, we ask it synchronously. + * It ensures that we always get right icd status BEFORE initialize() ends. + * If not, initialize() might end before we got icd status and + * QNetworkConfigurationManager::updateConfigurations() + * call from user might also end before receiving icd status. + * In such case, we come up to a bug: + * QNetworkConfigurationManagerPrivate::isOnline() will be false even + * if we are connected. + */ + Maemo::Icd icd; + QList<Maemo::IcdStateResult> state_results; + QNetworkConfigurationPrivatePointer ptr; - // Calling ICD_DBUS_API_STATE_REQ makes sure that initial state will be updated immediately - m_gettingInitialConnectionState = true; - m_dbusInterface->call(ICD_DBUS_API_STATE_REQ); + if (icd.state(state_results) && !state_results.isEmpty()) { + + if (!(state_results.first().params.network_attrs == 0 && + state_results.first().params.network_id.isEmpty())) { + + switch (state_results.first().state) { + case ICD_STATE_CONNECTED: + m_onlineIapId = state_results.first().params.network_id; + + ptr = accessPointConfigurations.value(m_onlineIapId); + if (ptr) { + QMutexLocker configLocker(&ptr->mutex); + ptr->state = QNetworkConfiguration::Active; + configLocker.unlock(); + + mutex.unlock(); + emit configurationChanged(ptr); + mutex.lock(); + } + break; + default: + break; + } + } + } } void QIcdEngine::connectionStateSignalsSlot(QDBusMessage msg) @@ -814,12 +858,12 @@ void QIcdEngine::connectionStateSignalsSlot(QDBusMessage msg) ptr->type = QNetworkConfiguration::InternetAccessPoint; if (ptr->state != QNetworkConfiguration::Active) { ptr->state = QNetworkConfiguration::Active; - if (!m_gettingInitialConnectionState) { - configLocker.unlock(); - locker.unlock(); - emit configurationChanged(ptr); - locker.relock(); - } + + configLocker.unlock(); + locker.unlock(); + emit configurationChanged(ptr); + locker.relock(); + m_onlineIapId = iapid; } } else { @@ -840,22 +884,21 @@ void QIcdEngine::connectionStateSignalsSlot(QDBusMessage msg) ptr->type = QNetworkConfiguration::InternetAccessPoint; if (ptr->state == QNetworkConfiguration::Active) { ptr->state = QNetworkConfiguration::Discovered; - if (!m_gettingInitialConnectionState) { - configLocker.unlock(); - locker.unlock(); - emit configurationChanged(ptr); - locker.relock(); - // Note: If ICD switches used IAP from one to another: - // 1) new IAP is reported to be online first - // 2) old IAP is reported to be offline then - // => Device can be reported to be offline only - // if last known online IAP is reported to be disconnected - if (iapid == m_onlineIapId) { - // It's known that there is only one global ICD connection - // => Because ICD state was reported to be DISCONNECTED, Device is offline - m_onlineIapId.clear(); - } + configLocker.unlock(); + locker.unlock(); + emit configurationChanged(ptr); + locker.relock(); + + // Note: If ICD switches used IAP from one to another: + // 1) new IAP is reported to be online first + // 2) old IAP is reported to be offline then + // => Device can be reported to be offline only + // if last known online IAP is reported to be disconnected + if (iapid == m_onlineIapId) { + // It's known that there is only one global ICD connection + // => Because ICD state was reported to be DISCONNECTED, Device is offline + m_onlineIapId.clear(); } } } else { @@ -876,8 +919,6 @@ void QIcdEngine::connectionStateSignalsSlot(QDBusMessage msg) locker.unlock(); emit iapStateChanged(iapid, icd_connection_state); locker.relock(); - - m_gettingInitialConnectionState = false; } void QIcdEngine::requestUpdate() diff --git a/src/plugins/bearer/icd/qicdengine.h b/src/plugins/bearer/icd/qicdengine.h index a768d84..0d5ba27 100644 --- a/src/plugins/bearer/icd/qicdengine.h +++ b/src/plugins/bearer/icd/qicdengine.h @@ -152,6 +152,7 @@ private: void startListeningStateSignalsForAllConnections(); void doRequestUpdate(QList<Maemo::IcdScanResult> scanned = QList<Maemo::IcdScanResult>()); void cancelAsyncConfigurationUpdate(); + void getIcdInitialState(); private: IapMonitor *iapMonitor; @@ -162,7 +163,6 @@ private: QList<Maemo::IcdScanResult> m_scanResult; bool firstUpdate; - bool m_gettingInitialConnectionState; bool m_scanGoingOn; }; diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp index 2583b28..3170bf6 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.cpp +++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp @@ -339,8 +339,6 @@ void QNetworkSessionPrivateImpl::syncStateWithInterface() isOpen = false; opened = false; - connect(&manager, SIGNAL(updateCompleted()), this, SLOT(networkConfigurationsChanged())); - connect(engine, SIGNAL(iapStateChanged(const QString&, uint)), this, SLOT(iapStateChanged(const QString&, uint))); @@ -460,14 +458,15 @@ void QNetworkSessionPrivateImpl::syncStateWithInterface() else ptr->name = ptr->id; + const QString identifier = ptr->id; + + configLocker.unlock(); + // Add the new active configuration to manager or update the old config - if (!engine->hasIdentifier(ptr->id)) { - configLocker.unlock(); + if (!engine->hasIdentifier(identifier)) engine->addSessionConfiguration(ptr); - } else { - configLocker.unlock(); + else engine->changedSessionConfiguration(ptr); - } } break; diff --git a/src/s60installs/eabi/QtNetworku.def b/src/s60installs/eabi/QtNetworku.def index 2442ee8..6b34a19 100644 --- a/src/s60installs/eabi/QtNetworku.def +++ b/src/s60installs/eabi/QtNetworku.def @@ -1131,7 +1131,7 @@ EXPORTS _ZNK21QNetworkAccessManager13configurationEv @ 1130 NONAME _ZNK21QNetworkAccessManager17networkAccessibleEv @ 1131 NONAME _ZNK21QNetworkAccessManager19activeConfigurationEv @ 1132 NONAME - _ZNK21QNetworkConfiguration10bearerNameEv @ 1133 NONAME + _ZNK21QNetworkConfiguration10bearerNameEv @ 1133 NONAME ABSENT _ZNK21QNetworkConfiguration10identifierEv @ 1134 NONAME _ZNK21QNetworkConfiguration18isRoamingAvailableEv @ 1135 NONAME _ZNK21QNetworkConfiguration4nameEv @ 1136 NONAME diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index 56e3484..540ffa9 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -1963,8 +1963,8 @@ QString Tree::fullDocumentLocation(const Node *node) const if ((node->subType() == Node::QmlClass) || (node->subType() == Node::QmlBasicType)) { QString fb = node->fileBase(); - if (fb.startsWith(QLatin1String("QML:"))) - return node->fileBase() + ".html"; + if (fb.startsWith(QLatin1String("qml-"))) + return fb + ".html"; else return "qml-" + node->fileBase() + ".html"; } else @@ -1981,7 +1981,7 @@ QString Tree::fullDocumentLocation(const Node *node) const else if ((parentNode = node->parent())) { if (parentNode->subType() == Node::QmlPropertyGroup) { parentNode = parentNode->parent(); - parentName = "qml-" + parentNode->fileBase() + ".html"; + parentName = fullDocumentLocation(parentNode); } else parentName = fullDocumentLocation(node->parent()); |