summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@nokia.com>2010-08-03 19:14:44 (GMT)
committerLorn Potter <lorn.potter@nokia.com>2010-08-03 19:14:44 (GMT)
commitbe83848d31513dfbfffb1e0c43d32b7c27dcefce (patch)
treec8b965626afcb18cfaca0f26e39596ac4dd6f0a8 /src
parent7a2d31989f0f50a34550be846a6f632c2f9e3f59 (diff)
parent11ad3b195d98b0a2234105da24d1faffd7ef95d6 (diff)
downloadQt-be83848d31513dfbfffb1e0c43d32b7c27dcefce.zip
Qt-be83848d31513dfbfffb1e0c43d32b7c27dcefce.tar.gz
Qt-be83848d31513dfbfffb1e0c43d32b7c27dcefce.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Conflicts: src/plugins/bearer/connman/qconnmanengine.cpp
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/libconninet/src/dbusdispatcher.cpp2
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.cpp28
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.h6
-rw-r--r--src/3rdparty/phonon/mmf/abstractplayer.h4
-rw-r--r--src/3rdparty/phonon/mmf/abstractvideoplayer.cpp6
-rw-r--r--src/3rdparty/phonon/mmf/abstractvideoplayer.h1
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.cpp6
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.h1
-rw-r--r--src/3rdparty/phonon/mmf/dummyplayer.cpp2
-rw-r--r--src/3rdparty/phonon/mmf/dummyplayer.h2
-rw-r--r--src/3rdparty/phonon/mmf/mediaobject.cpp75
-rw-r--r--src/3rdparty/phonon/mmf/mediaobject.h11
-rw-r--r--src/3rdparty/phonon/phonon/mediasource.cpp1
-rw-r--r--src/corelib/global/qglobal.cpp4
-rw-r--r--src/corelib/io/qfilesystemwatcher_kqueue.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp26
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp75
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativetranslate.cpp8
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp63
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp5
-rw-r--r--src/declarative/util/qdeclarativeopenmetaobject.cpp12
-rw-r--r--src/declarative/util/qdeclarativeopenmetaobject_p.h1
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp33
-rw-r--r--src/declarative/util/qdeclarativestate.cpp19
-rw-r--r--src/gui/image/qimage.cpp76
-rw-r--r--src/gui/inputmethod/qinputcontextfactory.cpp2
-rw-r--r--src/gui/kernel/qapplication.cpp7
-rw-r--r--src/gui/kernel/qpalette.cpp4
-rw-r--r--src/gui/kernel/qt_cocoa_helpers_mac.mm24
-rw-r--r--src/gui/kernel/qt_cocoa_helpers_mac_p.h1
-rw-r--r--src/gui/painting/qpaintengine_x11.cpp22
-rw-r--r--src/gui/s60framework/qs60maindocument.cpp6
-rw-r--r--src/gui/s60framework/qs60maindocument.h2
-rw-r--r--src/gui/styles/qs60style_s60.cpp6
-rw-r--r--src/gui/text/qfontengine_mac.mm32
-rw-r--r--src/gui/text/qstatictext.cpp7
-rw-r--r--src/gui/util/qdesktopservices_x11.cpp12
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp24
-rw-r--r--src/network/bearer/qnetworkconfiguration.cpp117
-rw-r--r--src/network/bearer/qnetworkconfiguration.h19
-rw-r--r--src/network/bearer/qnetworkconfiguration_p.h9
-rw-r--r--src/plugins/bearer/connman/qconnmanengine.cpp92
-rw-r--r--src/plugins/bearer/connman/qconnmanengine.h4
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.h2
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.mm6
-rw-r--r--src/plugins/bearer/generic/qgenericengine.cpp28
-rw-r--r--src/plugins/bearer/generic/qgenericengine.h2
-rw-r--r--src/plugins/bearer/icd/qicdengine.cpp18
-rw-r--r--src/plugins/bearer/icd/qicdengine.h14
-rw-r--r--src/plugins/bearer/icd/qnetworksession_impl.cpp3
-rw-r--r--src/plugins/bearer/nativewifi/qnativewifiengine.cpp7
-rw-r--r--src/plugins/bearer/nativewifi/qnativewifiengine.h2
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp34
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.h2
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp158
-rw-r--r--src/plugins/bearer/nla/qnlaengine.cpp47
-rw-r--r--src/plugins/bearer/nla/qnlaengine.h2
-rw-r--r--src/plugins/bearer/symbian/3_1/3_1.pro6
-rw-r--r--src/plugins/bearer/symbian/symbian.pri10
-rw-r--r--src/plugins/bearer/symbian/symbian_3/symbian_3.pro6
-rw-r--r--src/plugins/bearer/symbian/symbianengine.cpp90
-rw-r--r--src/plugins/bearer/symbian/symbianengine.h16
-rw-r--r--src/s60installs/bwins/QtGuiu.def3
-rw-r--r--src/s60installs/bwins/QtNetworku.def2
-rw-r--r--src/s60installs/eabi/QtGuiu.def3
-rw-r--r--src/s60installs/eabi/QtNetworku.def4
-rw-r--r--src/s60installs/s60installs.pro4
-rw-r--r--src/script/api/qscriptcontext.cpp10
-rw-r--r--src/script/api/qscriptcontextinfo.cpp11
-rw-r--r--src/script/api/qscriptcontextinfo.h4
-rw-r--r--src/script/api/qscriptengine.cpp15
-rw-r--r--src/script/api/qscriptengineagent.cpp7
-rw-r--r--src/src.pro1
75 files changed, 824 insertions, 566 deletions
diff --git a/src/3rdparty/libconninet/src/dbusdispatcher.cpp b/src/3rdparty/libconninet/src/dbusdispatcher.cpp
index 7581982..f5b830a 100644
--- a/src/3rdparty/libconninet/src/dbusdispatcher.cpp
+++ b/src/3rdparty/libconninet/src/dbusdispatcher.cpp
@@ -31,7 +31,7 @@
namespace Maemo {
/*!
- \class DBusDispatcher
+ \class Maemo::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/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
index be2a568..3702560 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
@@ -16,6 +16,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <QResource>
#include <QUrl>
#include "abstractmediaplayer.h"
@@ -216,9 +217,10 @@ void MMF::AbstractMediaPlayer::doSetTickInterval(qint32 interval)
TRACE_EXIT_0();
}
-void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file)
+void MMF::AbstractMediaPlayer::open()
{
- TRACE_CONTEXT(AbstractMediaPlayer::setFileSource, EAudioApi);
+ TRACE_CONTEXT(AbstractMediaPlayer::open, EAudioApi);
+ const MediaSource source = m_parent->source();
TRACE_ENTRY("state %d source.type %d", privateState(), source.type());
close();
@@ -229,7 +231,9 @@ void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file)
switch (source.type()) {
case MediaSource::LocalFile: {
- symbianErr = openFile(file);
+ RFile *const file = m_parent->file();
+ Q_ASSERT(file);
+ symbianErr = openFile(*file);
if (KErrNone != symbianErr)
errorMessage = tr("Error opening file");
break;
@@ -237,9 +241,10 @@ void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file)
case MediaSource::Url: {
const QUrl url(source.url());
-
if (url.scheme() == QLatin1String("file")) {
- symbianErr = openFile(file);
+ RFile *const file = m_parent->file();
+ Q_ASSERT(file);
+ symbianErr = openFile(*file);
if (KErrNone != symbianErr)
errorMessage = tr("Error opening file");
} else {
@@ -251,6 +256,19 @@ void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file)
break;
}
+ case MediaSource::Stream: {
+ QResource *const resource = m_parent->resource();
+ if (resource) {
+ m_buffer.Set(resource->data(), resource->size());
+ symbianErr = openDescriptor(m_buffer);
+ if (KErrNone != symbianErr)
+ errorMessage = tr("Error opening resource");
+ } else {
+ errorMessage = tr("Error opening source: resource not opened");
+ }
+ break;
+ }
+
// Other source types are handled in MediaObject::createPlayer
// Protection against adding new media types and forgetting to update this switch
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
index 7d28caf..e795ecb 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
@@ -47,7 +47,7 @@ protected:
AbstractMediaPlayer(MediaObject *parent, const AbstractPlayer *player);
public:
- virtual void open(const Phonon::MediaSource&, RFile&);
+ virtual void open();
// MediaObjectInterface
virtual void play();
@@ -70,6 +70,7 @@ protected:
virtual int setDeviceVolume(int mmfVolume) = 0;
virtual int openFile(RFile& file) = 0;
virtual int openUrl(const QString& url) = 0;
+ virtual int openDescriptor(const TDesC8 &des) = 0;
virtual int bufferStatus() const = 0;
void updateMetaData();
@@ -123,6 +124,9 @@ private:
bool m_prefinishMarkSent;
bool m_aboutToFinishSent;
+ // Used for playback of resource files
+ TPtrC8 m_buffer;
+
QMultiMap<QString, QString> m_metaData;
};
diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h
index 30d5243..dd98c7c 100644
--- a/src/3rdparty/phonon/mmf/abstractplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractplayer.h
@@ -26,8 +26,6 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "abstractvideooutput.h"
-class RFile;
-
QT_BEGIN_NAMESPACE
namespace Phonon
@@ -54,7 +52,7 @@ class AbstractPlayer : public QObject
public:
AbstractPlayer(const AbstractPlayer *player);
- virtual void open(const Phonon::MediaSource&, RFile&) = 0;
+ virtual void open() = 0;
virtual void close() = 0;
// MediaObjectInterface (implemented)
diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
index 9ea4d18..fb20bea 100644
--- a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
@@ -144,6 +144,12 @@ int MMF::AbstractVideoPlayer::openUrl(const QString &url)
return err;
}
+int MMF::AbstractVideoPlayer::openDescriptor(const TDesC8 &des)
+{
+ TRAPD(err, m_player->OpenDesL(des));
+ return err;
+}
+
int MMF::AbstractVideoPlayer::bufferStatus() const
{
int result = 0;
diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.h b/src/3rdparty/phonon/mmf/abstractvideoplayer.h
index d854793..3ff3c75 100644
--- a/src/3rdparty/phonon/mmf/abstractvideoplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.h
@@ -66,6 +66,7 @@ public:
virtual int setDeviceVolume(int mmfVolume);
virtual int openFile(RFile &file);
virtual int openUrl(const QString &url);
+ virtual int openDescriptor(const TDesC8 &des);
virtual int bufferStatus() const;
virtual void close();
diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp
index f49e898..7c8b9bd 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.cpp
+++ b/src/3rdparty/phonon/mmf/audioplayer.cpp
@@ -137,6 +137,12 @@ int MMF::AudioPlayer::openUrl(const QString& /*url*/)
return 0;
}
+int MMF::AudioPlayer::openDescriptor(const TDesC8 &des)
+{
+ TRAPD(err, m_player->OpenDesL(des));
+ return err;
+}
+
int MMF::AudioPlayer::bufferStatus() const
{
int result = 0;
diff --git a/src/3rdparty/phonon/mmf/audioplayer.h b/src/3rdparty/phonon/mmf/audioplayer.h
index 0eb8bb7..e43cadd 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.h
+++ b/src/3rdparty/phonon/mmf/audioplayer.h
@@ -67,6 +67,7 @@ typedef CMdaAudioPlayerUtility NativePlayer;
virtual int setDeviceVolume(int mmfVolume);
virtual int openFile(RFile& file);
virtual int openUrl(const QString& url);
+ virtual int openDescriptor(const TDesC8 &des);
virtual int bufferStatus() const;
virtual void close();
diff --git a/src/3rdparty/phonon/mmf/dummyplayer.cpp b/src/3rdparty/phonon/mmf/dummyplayer.cpp
index d39ef76..ba75b02 100644
--- a/src/3rdparty/phonon/mmf/dummyplayer.cpp
+++ b/src/3rdparty/phonon/mmf/dummyplayer.cpp
@@ -92,7 +92,7 @@ qint64 MMF::DummyPlayer::totalTime() const
return 0;
}
-void MMF::DummyPlayer::open(const Phonon::MediaSource &, RFile &)
+void MMF::DummyPlayer::open()
{
}
diff --git a/src/3rdparty/phonon/mmf/dummyplayer.h b/src/3rdparty/phonon/mmf/dummyplayer.h
index 9d45696..5b00411 100644
--- a/src/3rdparty/phonon/mmf/dummyplayer.h
+++ b/src/3rdparty/phonon/mmf/dummyplayer.h
@@ -57,7 +57,7 @@ public:
virtual qint64 totalTime() const;
// AbstractPlayer
- virtual void open(const Phonon::MediaSource&, RFile&);
+ virtual void open();
virtual void close();
virtual void doSetTickInterval(qint32 interval);
};
diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp
index d264377..98326b8 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.cpp
+++ b/src/3rdparty/phonon/mmf/mediaobject.cpp
@@ -34,6 +34,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "mediaobject.h"
#include <QDir>
+#include <QResource>
#include <QUrl>
QT_BEGIN_NAMESPACE
@@ -52,6 +53,8 @@ using namespace Phonon::MMF;
MMF::MediaObject::MediaObject(QObject *parent) : MMF::MediaNode::MediaNode(parent)
, m_recognizerOpened(false)
, m_nextSourceSet(false)
+ , m_file(0)
+ , m_resource(0)
{
m_player.reset(new DummyPlayer());
@@ -68,7 +71,12 @@ MMF::MediaObject::~MediaObject()
TRACE_CONTEXT(MediaObject::~MediaObject, EAudioApi);
TRACE_ENTRY_0();
- m_file.Close();
+ delete m_resource;
+
+ if (m_file)
+ m_file->Close();
+ delete m_file;
+
m_fileServer.Close();
m_recognizer.Close();
@@ -122,12 +130,13 @@ MMF::MediaType MMF::MediaObject::fileMediaType
const QHBufC fileNameSymbian(QDir::toNativeSeparators(fileName));
- m_file.Close();
- TInt err = m_file.Open(m_fileServer, *fileNameSymbian, EFileRead | EFileShareReadersOnly);
+ Q_ASSERT(!m_file);
+ m_file = new RFile;
+ TInt err = m_file->Open(m_fileServer, *fileNameSymbian, EFileRead | EFileShareReadersOnly);
if (KErrNone == err) {
TDataRecognitionResult recognizerResult;
- err = m_recognizer.RecognizeData(m_file, recognizerResult);
+ err = m_recognizer.RecognizeData(*m_file, recognizerResult);
if (KErrNone == err) {
const TPtrC mimeType = recognizerResult.iDataType.Des();
result = Utils::mimeTypeToMediaType(mimeType);
@@ -142,6 +151,23 @@ MMF::MediaType MMF::MediaObject::fileMediaType
return result;
}
+MMF::MediaType MMF::MediaObject::bufferMediaType(const uchar *data, qint64 size)
+{
+ TRACE_CONTEXT(MediaObject::bufferMediaType, EAudioInternal);
+ MediaType result = MediaTypeUnknown;
+ if (openRecognizer()) {
+ TDataRecognitionResult recognizerResult;
+ const TPtrC8 des(data, size);
+ const TInt err = m_recognizer.RecognizeData(KNullDesC, des, recognizerResult);
+ if (KErrNone == err) {
+ const TPtrC mimeType = recognizerResult.iDataType.Des();
+ result = Utils::mimeTypeToMediaType(mimeType);
+ } else {
+ TRACE("RApaLsSession::RecognizeData error %d", err);
+ }
+ }
+ return result;
+}
//-----------------------------------------------------------------------------
// MediaObjectInterface
@@ -228,9 +254,17 @@ void MMF::MediaObject::setSource(const MediaSource &source)
void MMF::MediaObject::switchToSource(const MediaSource &source)
{
+ if (m_file)
+ m_file->Close();
+ delete m_file;
+ m_file = 0;
+
+ delete m_resource;
+ m_resource = 0;
+
createPlayer(source);
m_source = source;
- m_player->open(m_source, m_file);
+ m_player->open();
emit currentSourceChanged(m_source);
}
@@ -272,10 +306,29 @@ void MMF::MediaObject::createPlayer(const MediaSource &source)
case MediaSource::Invalid:
case MediaSource::Disc:
- case MediaSource::Stream:
errorMessage = tr("Error opening source: type not supported");
break;
+ case MediaSource::Stream:
+ {
+ const QString fileName = source.url().toLocalFile();
+ if (fileName.startsWith(QLatin1String(":/")) || fileName.startsWith(QLatin1String("qrc://"))) {
+ Q_ASSERT(!m_resource);
+ m_resource = new QResource(fileName);
+ if (m_resource->isValid()) {
+ if (m_resource->isCompressed())
+ errorMessage = tr("Error opening source: resource is compressed");
+ else
+ mediaType = bufferMediaType(m_resource->data(), m_resource->size());
+ } else {
+ errorMessage = tr("Error opening source: resource not valid");
+ }
+ } else {
+ errorMessage = tr("Error opening source: type not supported");
+ }
+ }
+ break;
+
case MediaSource::Empty:
TRACE_0("Empty media source");
break;
@@ -374,6 +427,16 @@ void MMF::MediaObject::volumeChanged(qreal volume)
m_player->volumeChanged(volume);
}
+RFile* MMF::MediaObject::file() const
+{
+ return m_file;
+}
+
+QResource* MMF::MediaObject::resource() const
+{
+ return m_resource;
+}
+
//-----------------------------------------------------------------------------
// MediaNode
//-----------------------------------------------------------------------------
diff --git a/src/3rdparty/phonon/mmf/mediaobject.h b/src/3rdparty/phonon/mmf/mediaobject.h
index f15eb21..5399e27 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.h
+++ b/src/3rdparty/phonon/mmf/mediaobject.h
@@ -33,6 +33,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
QT_BEGIN_NAMESPACE
+class QResource;
+
namespace Phonon
{
namespace MMF
@@ -87,6 +89,9 @@ public:
void setVideoOutput(AbstractVideoOutput* videoOutput);
+ RFile* file() const;
+ QResource* resource() const;
+
public Q_SLOTS:
void volumeChanged(qreal volume);
void switchToNextSource();
@@ -117,6 +122,7 @@ private:
// Audio / video media type recognition
MediaType fileMediaType(const QString& fileName);
+ MediaType bufferMediaType(const uchar *data, qint64 size);
// TODO: urlMediaType function
static qint64 toMilliSeconds(const TTimeIntervalMicroSeconds &);
@@ -132,9 +138,8 @@ private:
MediaSource m_nextSource;
bool m_nextSourceSet;
- // Storing the file handle here to work around KErrInUse error
- // from MMF player utility OpenFileL functions
- RFile m_file;
+ RFile* m_file;
+ QResource* m_resource;
QScopedPointer<AbstractPlayer> m_player;
diff --git a/src/3rdparty/phonon/phonon/mediasource.cpp b/src/3rdparty/phonon/phonon/mediasource.cpp
index 11d2428..d70b38b 100644
--- a/src/3rdparty/phonon/phonon/mediasource.cpp
+++ b/src/3rdparty/phonon/phonon/mediasource.cpp
@@ -58,6 +58,7 @@ MediaSource::MediaSource(const QString &filename)
d->type = Stream;
d->ioDevice = new QFile(filename);
d->setStream(new IODeviceStream(d->ioDevice, d->ioDevice));
+ d->url = QUrl::fromLocalFile(fileInfo.absoluteFilePath());
#else
d->type = Invalid;
#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 861d77d..0e3a8d3 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1877,9 +1877,9 @@ QSysInfo::SymbianVersion QSysInfo::symbianVersion()
case SV_S60_5_0:
return SV_9_4;
case SV_S60_5_1:
- return SV_9_4;
+ return SV_SF_2;
case SV_S60_5_2:
- return SV_9_4;
+ return SV_SF_3;
default:
return SV_Unknown;
}
diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp
index 99c165e..378ad20 100644
--- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp
+++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp
@@ -295,12 +295,12 @@ void QKqueueFileSystemWatcherEngine::run()
path = idToPath.value(id);
if (path.isEmpty()) {
DEBUG() << "QKqueueFileSystemWatcherEngine: received a kevent for a file we're not watching";
- continue;
+ goto process_next_event;
}
}
if (kev.filter != EVFILT_VNODE) {
DEBUG() << "QKqueueFileSystemWatcherEngine: received a kevent with the wrong filter";
- continue;
+ goto process_next_event;
}
if ((kev.fflags & (NOTE_DELETE | NOTE_REVOKE | NOTE_RENAME)) != 0) {
@@ -337,6 +337,7 @@ void QKqueueFileSystemWatcherEngine::run()
}
// are there any more?
+process_next_event:
r = kevent(kqfd, 0, 0, &kev, 1, &ZeroTimeout);
} while (r > 0);
}
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 998b33a..19cabdd 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -681,12 +681,15 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
if (newY < maxY && maxY - minY <= 0)
newY = maxY + (newY - maxY) / 2;
if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && (newY > minY || newY < maxY)) {
- if (newY > minY)
- newY = minY;
- else if (newY < maxY)
+ rejectY = true;
+ if (newY < maxY) {
newY = maxY;
- else
- rejectY = true;
+ rejectY = false;
+ }
+ if (newY > minY) {
+ newY = minY;
+ rejectY = false;
+ }
}
if (!rejectY && stealMouse) {
vData.move.setValue(qRound(newY));
@@ -708,12 +711,15 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
if (newX < maxX && maxX - minX <= 0)
newX = maxX + (newX - maxX) / 2;
if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && (newX > minX || newX < maxX)) {
- if (newX > minX)
- newX = minX;
- else if (newX < maxX)
+ rejectX = true;
+ if (newX < maxX) {
newX = maxX;
- else
- rejectX = true;
+ rejectX = false;
+ }
+ if (newX > minX) {
+ newX = minX;
+ rejectX = false;
+ }
}
if (!rejectX && stealMouse) {
hData.move.setValue(qRound(newX));
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index f02ef6b..68a4c64 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -1278,6 +1278,11 @@ void QDeclarativeGridView::setDelegate(QDeclarativeComponent *delegate)
if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model)) {
dataModel->setDelegate(delegate);
if (isComponentComplete()) {
+ for (int i = 0; i < d->visibleItems.count(); ++i)
+ d->releaseItem(d->visibleItems.at(i));
+ d->visibleItems.clear();
+ d->releaseItem(d->currentItem);
+ d->currentItem = 0;
refill();
d->moveReason = QDeclarativeGridViewPrivate::SetIndex;
d->updateCurrent(d->currentIndex);
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 2c295cd..50998eb 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -1432,11 +1432,6 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec
*/
/*!
- \fn void QDeclarativeItem::childrenChanged()
- \internal
-*/
-
-/*!
\fn void QDeclarativeItem::focusChanged(bool)
\internal
*/
@@ -2855,6 +2850,41 @@ void QDeclarativeItem::setSmooth(bool smooth)
}
/*!
+ \property QDeclarativeItem::anchors
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::left
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::right
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::horizontalCenter
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::top
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::bottom
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::verticalCenter
+ \internal
+*/
+
+/*!
\property QDeclarativeItem::focus
\internal
*/
@@ -2875,6 +2905,41 @@ void QDeclarativeItem::setSmooth(bool smooth)
*/
/*!
+ \property QDeclarativeItem::baseline
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::data
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::resources
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::state
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::states
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::transformOriginPoint
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::transitions
+ \internal
+*/
+
+/*!
\internal
Return the width of the item
*/
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index b0a11b9..82b3e1c 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -575,9 +575,11 @@ FxListItem *QDeclarativeListViewPrivate::createItem(int modelIndex)
listItem->attached->m_prevSection = item->attached->section();
else
listItem->attached->m_prevSection = sectionAt(modelIndex-1);
+ }
+ if (modelIndex < model->count()-1) {
if (FxListItem *item = visibleItem(modelIndex+1))
listItem->attached->m_nextSection = item->attached->section();
- else if (modelIndex < model->count()-1)
+ else
listItem->attached->m_nextSection = sectionAt(modelIndex+1);
}
}
@@ -1618,6 +1620,8 @@ void QDeclarativeListView::setDelegate(QDeclarativeComponent *delegate)
for (int i = 0; i < d->visibleItems.count(); ++i)
d->releaseItem(d->visibleItems.at(i));
d->visibleItems.clear();
+ d->releaseItem(d->currentItem);
+ d->currentItem = 0;
refill();
d->moveReason = QDeclarativeListViewPrivate::SetIndex;
d->updateCurrent(d->currentIndex);
diff --git a/src/declarative/graphicsitems/qdeclarativetranslate.cpp b/src/declarative/graphicsitems/qdeclarativetranslate.cpp
index be9b3f3..0bae0cd 100644
--- a/src/declarative/graphicsitems/qdeclarativetranslate.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetranslate.cpp
@@ -125,12 +125,4 @@ void QDeclarativeTranslate::applyTo(QMatrix4x4 *matrix) const
matrix->translate(d->x, d->y, 0);
}
-/*!
- \fn QDeclarativeTranslate::positionChanged()
-
- QDeclarativeTranslate emits this signal when its position changes.
-
- \sa QDeclarativeTranslate::x, QDeclarativeTranslate::y
-*/
-
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index 7952b97..ceb1961 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -78,7 +78,7 @@ public:
static void children_append(QDeclarativeListProperty<QDeclarativeItem> *prop, QDeclarativeItem *item) {
QDeclarative_setParent_noEvent(item, prop->object);
- static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->children.append(item);
+ static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->children.append(Item(item));
static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->itemAppended();
static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->emitChildrenChanged();
}
@@ -88,12 +88,12 @@ public:
}
static QDeclarativeItem *children_at(QDeclarativeListProperty<QDeclarativeItem> *prop, int index) {
- return static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->children.at(index);
+ return static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->children.at(index).item;
}
void itemAppended() {
Q_Q(QDeclarativeVisualItemModel);
- QDeclarativeVisualItemModelAttached *attached = QDeclarativeVisualItemModelAttached::properties(children.last());
+ QDeclarativeVisualItemModelAttached *attached = QDeclarativeVisualItemModelAttached::properties(children.last().item);
attached->setIndex(children.count()-1);
emit q->itemsInserted(children.count()-1, 1);
emit q->countChanged();
@@ -104,7 +104,25 @@ public:
emit q->childrenChanged();
}
- QList<QDeclarativeItem *> children;
+ int indexOf(QDeclarativeItem *item) const {
+ for (int i = 0; i < children.count(); ++i)
+ if (children.at(i).item == item)
+ return i;
+ return -1;
+ }
+
+ class Item {
+ public:
+ Item(QDeclarativeItem *i) : item(i), ref(0) {}
+
+ void addRef() { ++ref; }
+ bool deref() { return --ref == 0; }
+
+ QDeclarativeItem *item;
+ int ref;
+ };
+
+ QList<Item> children;
};
@@ -182,14 +200,22 @@ bool QDeclarativeVisualItemModel::isValid() const
QDeclarativeItem *QDeclarativeVisualItemModel::item(int index, bool)
{
Q_D(QDeclarativeVisualItemModel);
- return d->children.at(index);
+ QDeclarativeVisualItemModelPrivate::Item &item = d->children[index];
+ item.addRef();
+ return item.item;
}
QDeclarativeVisualModel::ReleaseFlags QDeclarativeVisualItemModel::release(QDeclarativeItem *item)
{
- if (item->scene())
- item->scene()->removeItem(item);
- QDeclarative_setParent_noEvent(item, this);
+ Q_D(QDeclarativeVisualItemModel);
+ int idx = d->indexOf(item);
+ if (idx >= 0) {
+ if (d->children[idx].deref()) {
+ if (item->scene())
+ item->scene()->removeItem(item);
+ QDeclarative_setParent_noEvent(item, this);
+ }
+ }
return 0;
}
@@ -208,7 +234,7 @@ QString QDeclarativeVisualItemModel::stringValue(int index, const QString &name)
Q_D(QDeclarativeVisualItemModel);
if (index < 0 || index >= d->children.count())
return QString();
- return QDeclarativeEngine::contextForObject(d->children.at(index))->contextProperty(name).toString();
+ return QDeclarativeEngine::contextForObject(d->children.at(index).item)->contextProperty(name).toString();
}
QVariant QDeclarativeVisualItemModel::evaluate(int index, const QString &expression, QObject *objectContext)
@@ -218,7 +244,7 @@ QVariant QDeclarativeVisualItemModel::evaluate(int index, const QString &express
return QVariant();
QDeclarativeContext *ccontext = qmlContext(this);
QDeclarativeContext *ctxt = new QDeclarativeContext(ccontext);
- ctxt->setContextObject(d->children.at(index));
+ ctxt->setContextObject(d->children.at(index).item);
QDeclarativeExpression e(ctxt, objectContext, expression);
QVariant value = e.evaluate();
delete ctxt;
@@ -228,7 +254,7 @@ QVariant QDeclarativeVisualItemModel::evaluate(int index, const QString &express
int QDeclarativeVisualItemModel::indexOf(QDeclarativeItem *item, QObject *) const
{
Q_D(const QDeclarativeVisualItemModel);
- return d->children.indexOf(item);
+ return d->indexOf(item);
}
QDeclarativeVisualItemModelAttached *QDeclarativeVisualItemModel::qmlAttachedProperties(QObject *obj)
@@ -418,6 +444,9 @@ public:
int propForRole(int) const;
void setValue(int, const QVariant &);
+ bool hasValue(int id) const {
+ return m_meta->hasValue(id);
+ }
void ensureProperties();
@@ -1190,11 +1219,13 @@ void QDeclarativeVisualDataModel::_q_itemsChanged(int index, int count,
int role = roles.at(roleIdx);
int propId = data->propForRole(role);
if (propId != -1) {
- if (d->m_listModelInterface) {
- data->setValue(propId, d->m_listModelInterface->data(idx, QList<int>() << role).value(role));
- } else if (d->m_abstractItemModel) {
- QModelIndex index = d->m_abstractItemModel->index(idx, 0, d->m_root);
- data->setValue(propId, d->m_abstractItemModel->data(index, role));
+ if (data->hasValue(propId)) {
+ if (d->m_listModelInterface) {
+ data->setValue(propId, d->m_listModelInterface->data(idx, QList<int>() << role).value(role));
+ } else if (d->m_abstractItemModel) {
+ QModelIndex index = d->m_abstractItemModel->index(idx, 0, d->m_root);
+ data->setValue(propId, d->m_abstractItemModel->data(index, role));
+ }
}
} else {
QString roleName;
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index e8cb36e..3822373 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -206,10 +206,9 @@ Text {
\section1 Enums
-The Qt object contains all enums in the Qt namespace. For example, you can
-access the \c AlignLeft member of the \c Qt::AlignmentFlag enum with \c Qt.AlignLeft.
+The Qt object contains enums that declared into Qt's Meta-Object System. For example, you can access
+the \c Leftbutton member of the \c Qt::MouseButton enum with \c Qt.LeftButton.
-For a full list of enums, see the \l{Qt Namespace} documentation.
\section1 Types
The Qt object also contains helper functions for creating objects of specific
diff --git a/src/declarative/util/qdeclarativeopenmetaobject.cpp b/src/declarative/util/qdeclarativeopenmetaobject.cpp
index ba5d534..40485bd 100644
--- a/src/declarative/util/qdeclarativeopenmetaobject.cpp
+++ b/src/declarative/util/qdeclarativeopenmetaobject.cpp
@@ -161,6 +161,12 @@ public:
prop.second = true;
}
+ inline bool hasData(int idx) const {
+ if (idx >= data.count())
+ return false;
+ return data[idx].second;
+ }
+
bool autoCreate;
QDeclarativeOpenMetaObject *q;
QAbstractDynamicMetaObject *parent;
@@ -295,6 +301,12 @@ void QDeclarativeOpenMetaObject::setValue(const QByteArray &name, const QVariant
activate(d->object, id + d->type->d->signalOffset, 0);
}
+// returns true if this value has been initialized by a call to either value() or setValue()
+bool QDeclarativeOpenMetaObject::hasValue(int id) const
+{
+ return d->hasData(id);
+}
+
void QDeclarativeOpenMetaObject::setCached(bool c)
{
if (c == d->cacheProperties || !d->type->d->engine)
diff --git a/src/declarative/util/qdeclarativeopenmetaobject_p.h b/src/declarative/util/qdeclarativeopenmetaobject_p.h
index 9bb4c34..c18fa3d 100644
--- a/src/declarative/util/qdeclarativeopenmetaobject_p.h
+++ b/src/declarative/util/qdeclarativeopenmetaobject_p.h
@@ -91,6 +91,7 @@ public:
void setValue(int, const QVariant &);
QVariant &operator[](const QByteArray &);
QVariant &operator[](int);
+ bool hasValue(int) const;
int count() const;
QByteArray name(int) const;
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
index a83cac8..9ced14f 100644
--- a/src/declarative/util/qdeclarativepixmapcache.cpp
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -70,6 +70,16 @@
QT_BEGIN_NAMESPACE
+// The cache limit describes the maximum "junk" in the cache.
+// These are the same defaults as QPixmapCache
+#if defined(Q_OS_SYMBIAN)
+static int cache_limit = 1024 * 1024; // 1048 KB cache limit for symbian
+#elif defined(Q_WS_QWS) || defined(Q_WS_WINCE)
+static int cache_limit = 2048 * 1024; // 2048 KB cache limit for embedded
+#else
+static int cache_limit = 10240 * 1024; // 10 MB cache limit for desktop
+#endif
+
class QDeclarativePixmapReader;
class QDeclarativePixmapData;
class QDeclarativePixmapReply : public QObject
@@ -580,6 +590,8 @@ public:
QHash<QDeclarativePixmapKey, QDeclarativePixmapData *> m_cache;
private:
+ void shrinkCache(int remove);
+
QDeclarativePixmapData *m_unreferencedPixmaps;
QDeclarativePixmapData *m_lastUnreferencedPixmap;
@@ -613,7 +625,9 @@ void QDeclarativePixmapStore::unreferencePixmap(QDeclarativePixmapData *data)
m_unreferencedCost += data->cost();
- if (m_timerId == -1)
+ shrinkCache(-1); // Shrink the cache incase it has become larger than cache_limit
+
+ if (m_timerId == -1 && m_unreferencedPixmaps)
m_timerId = startTimer(CACHE_EXPIRE_TIME * 1000);
}
@@ -636,11 +650,9 @@ void QDeclarativePixmapStore::referencePixmap(QDeclarativePixmapData *data)
m_unreferencedCost -= data->cost();
}
-void QDeclarativePixmapStore::timerEvent(QTimerEvent *)
+void QDeclarativePixmapStore::shrinkCache(int remove)
{
- int removalCost = m_unreferencedCost / CACHE_REMOVAL_FRACTION;
-
- while (removalCost > 0 && m_lastUnreferencedPixmap) {
+ while ((remove > 0 || m_unreferencedCost > cache_limit) && m_lastUnreferencedPixmap) {
QDeclarativePixmapData *data = m_lastUnreferencedPixmap;
Q_ASSERT(data->nextUnreferenced == 0);
@@ -649,10 +661,17 @@ void QDeclarativePixmapStore::timerEvent(QTimerEvent *)
data->prevUnreferencedPtr = 0;
data->prevUnreferenced = 0;
- removalCost -= data->cost();
+ remove -= data->cost();
data->removeFromCache();
delete data;
}
+}
+
+void QDeclarativePixmapStore::timerEvent(QTimerEvent *)
+{
+ int removalCost = m_unreferencedCost / CACHE_REMOVAL_FRACTION;
+
+ shrinkCache(removalCost);
if (m_unreferencedPixmaps == 0) {
killTimer(m_timerId);
@@ -702,7 +721,7 @@ bool QDeclarativePixmapReply::event(QEvent *event)
int QDeclarativePixmapData::cost() const
{
- return pixmap.width() * pixmap.height() * pixmap.depth();
+ return (pixmap.width() * pixmap.height() * pixmap.depth()) / 8;
}
void QDeclarativePixmapData::addref()
diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp
index 9f4cc39..0d43d21 100644
--- a/src/declarative/util/qdeclarativestate.cpp
+++ b/src/declarative/util/qdeclarativestate.cpp
@@ -229,20 +229,7 @@ bool QDeclarativeState::isWhenKnown() const
be applied. For example, the following \l Rectangle changes in and out of the "hidden"
state when the \l MouseArea is pressed:
- \qml
- Rectangle {
- id: myRect
- width: 100; height: 100
- color: "red"
-
- MouseArea { id: mouseArea; anchors.fill: parent }
-
- states: State {
- name: "hidden"; when: mouseArea.pressed
- PropertyChanges { target: myRect; opacity: 0 }
- }
- }
- \endqml
+ \snippet doc/src/snippets/declarative/state-when.qml 0
If multiple states in a group have \c when clauses that evaluate to \c true at the same time,
the first matching state will be applied. For example, in the following snippet
@@ -358,8 +345,10 @@ QDeclarativeStatePrivate::generateActionList(QDeclarativeStateGroup *group) cons
if (!extends.isEmpty()) {
QList<QDeclarativeState *> states = group->states();
for (int ii = 0; ii < states.count(); ++ii)
- if (states.at(ii)->name() == extends)
+ if (states.at(ii)->name() == extends) {
+ qmlExecuteDeferred(states.at(ii));
applyList = static_cast<QDeclarativeStatePrivate*>(states.at(ii)->d_func())->generateActionList(group);
+ }
}
foreach(QDeclarativeStateOperation *op, operations)
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 30cf758..cb834c0 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -4829,7 +4829,7 @@ QImage QImage::rgbSwapped() const
QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
uint *q = (uint*)res.scanLine(i);
- uint *p = (uint*)scanLine(i);
+ uint *p = (uint*)constScanLine(i);
uint *end = p + d->width;
while (p < end) {
*q = ((*p << 16) & 0xff0000) | ((*p >> 16) & 0xff) | (*p & 0xff00ff00);
@@ -4843,7 +4843,7 @@ QImage QImage::rgbSwapped() const
QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
ushort *q = (ushort*)res.scanLine(i);
- const ushort *p = (const ushort*)scanLine(i);
+ const ushort *p = (const ushort*)constScanLine(i);
const ushort *end = p + d->width;
while (p < end) {
*q = ((*p << 11) & 0xf800) | ((*p >> 11) & 0x1f) | (*p & 0x07e0);
@@ -4856,12 +4856,15 @@ QImage QImage::rgbSwapped() const
res = QImage(d->width, d->height, d->format);
QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
- quint8 *p = (quint8*)scanLine(i);
+ const quint8 *p = constScanLine(i);
+ quint8 *q = res.scanLine(i);
const quint8 *end = p + d->width * sizeof(qargb8565);
while (p < end) {
- quint16 *q = reinterpret_cast<quint16*>(p + 1);
- *q = ((*q << 11) & 0xf800) | ((*q >> 11) & 0x1f) | (*q & 0x07e0);
+ q[0] = p[0];
+ q[1] = (p[1] & 0xe0) | (p[2] >> 3);
+ q[2] = (p[2] & 0x07) | (p[1] << 3);
p += sizeof(qargb8565);
+ q += sizeof(qargb8565);
}
}
break;
@@ -4870,7 +4873,7 @@ QImage QImage::rgbSwapped() const
QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
qrgb666 *q = reinterpret_cast<qrgb666*>(res.scanLine(i));
- const qrgb666 *p = reinterpret_cast<const qrgb666*>(scanLine(i));
+ const qrgb666 *p = reinterpret_cast<const qrgb666*>(constScanLine(i));
const qrgb666 *end = p + d->width;
while (p < end) {
const QRgb rgb = quint32(*p++);
@@ -4882,12 +4885,15 @@ QImage QImage::rgbSwapped() const
res = QImage(d->width, d->height, d->format);
QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
- qargb6666 *q = reinterpret_cast<qargb6666*>(res.scanLine(i));
- const qargb6666 *p = reinterpret_cast<const qargb6666*>(scanLine(i));
- const qargb6666 *end = p + d->width;
+ const quint8 *p = constScanLine(i);
+ const quint8 *end = p + d->width * sizeof(qargb6666);
+ quint8 *q = res.scanLine(i);
while (p < end) {
- const QRgb rgb = quint32(*p++);
- *q++ = qRgba(qBlue(rgb), qGreen(rgb), qRed(rgb), qAlpha(rgb));
+ q[0] = (p[1] >> 4) | ((p[2] & 0x3) << 4) | (p[0] & 0xc0);
+ q[1] = (p[1] & 0xf) | (p[0] << 4);
+ q[2] = (p[2] & 0xfc) | ((p[0] >> 4) & 0x3);
+ p += sizeof(qargb6666);
+ q += sizeof(qargb6666);
}
}
break;
@@ -4895,11 +4901,11 @@ QImage QImage::rgbSwapped() const
res = QImage(d->width, d->height, d->format);
QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
- ushort *q = (ushort*)res.scanLine(i);
- const ushort *p = (const ushort*)scanLine(i);
- const ushort *end = p + d->width;
+ quint16 *q = (quint16*)res.scanLine(i);
+ const quint16 *p = (const quint16*)constScanLine(i);
+ const quint16 *end = p + d->width;
while (p < end) {
- *q = ((*p << 10) & 0x7800) | ((*p >> 10) & 0x1f) | (*p & 0x83e0);
+ *q = ((*p << 10) & 0x7c00) | ((*p >> 10) & 0x1f) | (*p & 0x3e0);
p++;
q++;
}
@@ -4909,12 +4915,15 @@ QImage QImage::rgbSwapped() const
res = QImage(d->width, d->height, d->format);
QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
- quint8 *p = (quint8*)scanLine(i);
+ const quint8 *p = constScanLine(i);
+ quint8 *q = res.scanLine(i);
const quint8 *end = p + d->width * sizeof(qargb8555);
while (p < end) {
- quint16 *q = reinterpret_cast<quint16*>(p + 1);
- *q = ((*q << 10) & 0x7800) | ((*q >> 10) & 0x1f) | (*q & 0x83e0);
+ q[0] = p[0];
+ q[1] = (p[1] & 0xe0) | (p[2] >> 2);
+ q[2] = (p[2] & 0x03) | ((p[1] << 2) & 0x7f);
p += sizeof(qargb8555);
+ q += sizeof(qargb8555);
}
}
break;
@@ -4922,8 +4931,8 @@ QImage QImage::rgbSwapped() const
res = QImage(d->width, d->height, d->format);
QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
- quint8 *q = reinterpret_cast<quint8*>(res.scanLine(i));
- const quint8 *p = reinterpret_cast<const quint8*>(scanLine(i));
+ quint8 *q = res.scanLine(i);
+ const quint8 *p = constScanLine(i);
const quint8 *end = p + d->width * sizeof(qrgb888);
while (p < end) {
q[0] = p[2];
@@ -4935,32 +4944,17 @@ QImage QImage::rgbSwapped() const
}
break;
case Format_RGB444:
- res = QImage(d->width, d->height, d->format);
- QIMAGE_SANITYCHECK_MEMORY(res);
- for (int i = 0; i < d->height; i++) {
- quint8 *q = reinterpret_cast<quint8*>(res.scanLine(i));
- const quint8 *p = reinterpret_cast<const quint8*>(scanLine(i));
- const quint8 *end = p + d->width * sizeof(qrgb444);
- while (p < end) {
- q[0] = (p[0] & 0xf0) | ((p[1] & 0x0f) << 8);
- q[1] = ((p[0] & 0x0f) >> 8) | (p[1] & 0xf0);
- q += sizeof(qrgb444);
- p += sizeof(qrgb444);
- }
- }
- break;
case Format_ARGB4444_Premultiplied:
res = QImage(d->width, d->height, d->format);
QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
- quint8 *q = reinterpret_cast<quint8*>(res.scanLine(i));
- const quint8 *p = reinterpret_cast<const quint8*>(scanLine(i));
- const quint8 *end = p + d->width * sizeof(qargb4444);
+ quint16 *q = reinterpret_cast<quint16*>(res.scanLine(i));
+ const quint16 *p = reinterpret_cast<const quint16*>(constScanLine(i));
+ const quint16 *end = p + d->width;
while (p < end) {
- q[0] = (p[0] & 0xf0) | ((p[1] & 0x0f) << 8);
- q[1] = ((p[0] & 0x0f) >> 8) | (p[1] & 0xf0);
- q += sizeof(qargb4444);
- p += sizeof(qargb4444);
+ *q = (*p & 0xf0f0) | ((*p & 0x0f) << 8) | ((*p & 0xf00) >> 8);
+ p++;
+ q++;
}
}
break;
diff --git a/src/gui/inputmethod/qinputcontextfactory.cpp b/src/gui/inputmethod/qinputcontextfactory.cpp
index ec8d8e2..865c1b2 100644
--- a/src/gui/inputmethod/qinputcontextfactory.cpp
+++ b/src/gui/inputmethod/qinputcontextfactory.cpp
@@ -73,7 +73,7 @@
#endif
#ifdef Q_WS_S60
#include "qcoefepinputcontext_p.h"
-#include "akninputlanguageinfo.h"
+#include "AknInputLanguageInfo.h"
#endif
#include "private/qfactoryloader_p.h"
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 5c333b0..3303800 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -2540,6 +2540,13 @@ void QApplication::setActiveWindow(QWidget* act)
sendSpontaneousEvent(w, &activationChange);
}
+#ifdef QT_MAC_USE_COCOA
+ // In case the user clicked on a child window, we need to
+ // reestablish the stacking order of the window so
+ // it pops in front of other child windows in cocoa:
+ qt_cocoaStackChildWindowOnTopOfOtherChildren(window);
+#endif
+
for(int i = 0; i < toBeDeactivated.size(); ++i) {
QWidget *w = toBeDeactivated.at(i);
sendSpontaneousEvent(w, &windowDeactivate);
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index 38ec806..55d5727 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -872,7 +872,7 @@ void QPalette::detach()
\note The current ColorGroup is not taken into account when
comparing palettes
- \sa operator==
+ \sa operator==()
*/
/*!
@@ -882,7 +882,7 @@ void QPalette::detach()
\note The current ColorGroup is not taken into account when
comparing palettes
- \sa operator!=
+ \sa operator!=()
*/
bool QPalette::operator==(const QPalette &p) const
{
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm
index 3fc27f4..7d23abf 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac.mm
+++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm
@@ -685,9 +685,11 @@ bool qt_dispatchKeyEvent(void * /*NSEvent * */ keyEvent, QWidget *widgetToGetEve
unsigned int info = 0;
if ([event type] == NSKeyDown) {
NSString *characters = [event characters];
- unichar value = [characters characterAtIndex:0];
- qt_keymapper_private()->updateKeyMap(0, key_event, (void *)&value);
- info = value;
+ if ([characters length]) {
+ unichar value = [characters characterAtIndex:0];
+ qt_keymapper_private()->updateKeyMap(0, key_event, (void *)&value);
+ info = value;
+ }
}
// Redirect keys to alien widgets.
@@ -1527,6 +1529,22 @@ void macSyncDrawingOnFirstInvocation(void * /*OSWindowRef */window)
[theWindow display];
}
}
+
+void qt_cocoaStackChildWindowOnTopOfOtherChildren(QWidget *childWidget)
+{
+ if (!childWidget)
+ return;
+
+ QWidget *parent = childWidget->parentWidget();
+ if (childWidget->isWindow() && parent) {
+ if ([[qt_mac_window_for(parent) childWindows] containsObject:qt_mac_window_for(childWidget)]) {
+ QWidgetPrivate *d = qt_widget_private(childWidget);
+ d->setSubWindowStacking(false);
+ d->setSubWindowStacking(true);
+ }
+ }
+}
+
#endif // QT_MAC_USE_COCOA
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac_p.h b/src/gui/kernel/qt_cocoa_helpers_mac_p.h
index 44fb4f0..c6c2db2 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac_p.h
+++ b/src/gui/kernel/qt_cocoa_helpers_mac_p.h
@@ -148,6 +148,7 @@ void qt_cocoaChangeOverrideCursor(const QCursor &cursor);
// These methods exists only for supporting unified mode.
void macDrawRectOnTop(void * /*OSWindowRef */ window);
void macSyncDrawingOnFirstInvocation(void * /*OSWindowRef */window);
+void qt_cocoaStackChildWindowOnTopOfOtherChildren(QWidget *widget);
#endif
void qt_mac_menu_collapseSeparators(void * /*NSMenu */ menu, bool collapse);
bool qt_dispatchKeyEvent(void * /*NSEvent * */ keyEvent, QWidget *widgetToGetEvent);
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp
index 910b2df..e521e01 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -696,11 +696,10 @@ void QX11PaintEngine::drawLines(const QLine *lines, int lineCount)
linef = d->matrix.map(QLineF(lines[i]));
}
if (clipLine(&linef, d->polygonClipper.boundingRect())) {
- int x1 = qRound(linef.x1() + aliasedCoordinateDelta);
- int y1 = qRound(linef.y1() + aliasedCoordinateDelta);
- int x2 = qRound(linef.x2() + aliasedCoordinateDelta);
- int y2 = qRound(linef.y2() + aliasedCoordinateDelta);
-
+ int x1 = qFloor(linef.x1() + aliasedCoordinateDelta);
+ int y1 = qFloor(linef.y1() + aliasedCoordinateDelta);
+ int x2 = qFloor(linef.x2() + aliasedCoordinateDelta);
+ int y2 = qFloor(linef.y2() + aliasedCoordinateDelta);
XDrawLine(d->dpy, d->hd, d->gc, x1, y1, x2, y2);
}
}
@@ -730,11 +729,10 @@ void QX11PaintEngine::drawLines(const QLineF *lines, int lineCount)
for (int i = 0; i < lineCount; ++i) {
QLineF linef = d->matrix.map(lines[i]);
if (clipLine(&linef, d->polygonClipper.boundingRect())) {
- int x1 = qRound(linef.x1() + aliasedCoordinateDelta);
- int y1 = qRound(linef.y1() + aliasedCoordinateDelta);
- int x2 = qRound(linef.x2() + aliasedCoordinateDelta);
- int y2 = qRound(linef.y2() + aliasedCoordinateDelta);
-
+ int x1 = qFloor(linef.x1() + aliasedCoordinateDelta);
+ int y1 = qFloor(linef.y1() + aliasedCoordinateDelta);
+ int x2 = qFloor(linef.x2() + aliasedCoordinateDelta);
+ int y2 = qFloor(linef.y2() + aliasedCoordinateDelta);
XDrawLine(d->dpy, d->hd, d->gc, x1, y1, x2, y2);
}
}
@@ -1690,8 +1688,8 @@ void QX11PaintEnginePrivate::strokePolygon_dev(const QPointF *polygonPoints, int
if (clippedCount > 0) {
QVarLengthArray<XPoint> xpoints(clippedCount);
for (int i = 0; i < clippedCount; ++i) {
- xpoints[i].x = qRound(clippedPoints[i].x + aliasedCoordinateDelta);
- xpoints[i].y = qRound(clippedPoints[i].y + aliasedCoordinateDelta);
+ xpoints[i].x = qFloor(clippedPoints[i].x + aliasedCoordinateDelta);
+ xpoints[i].y = qFloor(clippedPoints[i].y + aliasedCoordinateDelta);
}
uint numberPoints = qMin(clippedCount, xlibMaxLinePoints);
XPoint *pts = xpoints.data();
diff --git a/src/gui/s60framework/qs60maindocument.cpp b/src/gui/s60framework/qs60maindocument.cpp
index ed33a41..26e2d00 100644
--- a/src/gui/s60framework/qs60maindocument.cpp
+++ b/src/gui/s60framework/qs60maindocument.cpp
@@ -105,11 +105,17 @@ CEikAppUi *QS60MainDocument::CreateAppUiL()
return (static_cast <CEikAppUi*>(new(ELeave)QS60MainAppUi));
}
+/*!
+ \internal
+ */
CFileStore *QS60MainDocument::OpenFileL(TBool aDoOpen, const TDesC &aFilename, RFs &aFs)
{
return QS60MainDocumentBase::OpenFileL(aDoOpen, aFilename, aFs);
}
+/*!
+ \internal
+ */
void QS60MainDocument::OpenFileL(CFileStore *&aFileStore, RFile &aFile)
{
QS60MainDocumentBase::OpenFileL(aFileStore, aFile);
diff --git a/src/gui/s60framework/qs60maindocument.h b/src/gui/s60framework/qs60maindocument.h
index 2f0564f..fc32d8b 100644
--- a/src/gui/s60framework/qs60maindocument.h
+++ b/src/gui/s60framework/qs60maindocument.h
@@ -47,7 +47,7 @@
#ifdef Q_OS_SYMBIAN
#ifdef Q_WS_S60
-#include <akndoc.h>
+#include <AknDoc.h>
typedef CAknDocument QS60MainDocumentBase;
#else
#include <eikdoc.h>
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 2527662..f44b85e 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -58,12 +58,12 @@
#include <AknsSkinInstance.h>
#include <AknsBasicBackgroundControlContext.h>
#include <avkon.mbg>
-#include <aknfontaccess.h>
-#include <aknlayoutfont.h>
+#include <AknFontAccess.h>
+#include <AknLayoutFont.h>
#include <AknUtils.h>
#include <aknnavi.h>
#include <gulicon.h>
-#include <aknbitmapanimation.h>
+#include <AknBitmapAnimation.h>
#if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN)
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index deaad57..91b6082 100644
--- a/src/gui/text/qfontengine_mac.mm
+++ b/src/gui/text/qfontengine_mac.mm
@@ -349,11 +349,32 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay
int *nglyphs, QTextEngine::ShaperFlags flags) const
{
*nglyphs = len;
+ QCFType<CFStringRef> cfstring;
+
QVarLengthArray<CGGlyph> cgGlyphs(len);
CTFontGetGlyphsForCharacters(ctfont, (const UniChar*)str, cgGlyphs.data(), len);
- for (int i = 0; i < len; ++i)
- glyphs->glyphs[i] = cgGlyphs[i];
+ for (int i = 0; i < len; ++i) {
+ if (cgGlyphs[i]) {
+ glyphs->glyphs[i] = cgGlyphs[i];
+ } else {
+ if (!cfstring)
+ cfstring = CFStringCreateWithCharactersNoCopy(0, reinterpret_cast<const UniChar *>(str), len, kCFAllocatorNull);
+ QCFType<CTFontRef> substituteFont = CTFontCreateForString(ctfont, cfstring, CFRangeMake(i, 1));
+ CGGlyph substituteGlyph = 0;
+ CTFontGetGlyphsForCharacters(substituteFont, (const UniChar*)str + i, &substituteGlyph, 1);
+ if (substituteGlyph) {
+ const uint fontIndex = (fontIndexForFont(substituteFont) << 24);
+ glyphs->glyphs[i] = substituteGlyph | fontIndex;
+ if (!(flags & QTextEngine::GlyphIndicesOnly)) {
+ CGSize advance;
+ CTFontGetAdvancesForGlyphs(substituteFont, kCTFontHorizontalOrientation, &substituteGlyph, &advance, 1);
+ glyphs->advances_x[i] = QFixed::fromReal(advance.width);
+ glyphs->advances_y[i] = QFixed::fromReal(advance.height);
+ }
+ }
+ }
+ }
if (flags & QTextEngine::GlyphIndicesOnly)
return true;
@@ -362,9 +383,14 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay
CTFontGetAdvancesForGlyphs(ctfont, kCTFontHorizontalOrientation, cgGlyphs.data(), advances.data(), len);
for (int i = 0; i < len; ++i) {
+ if (glyphs->glyphs[i] & 0xff000000)
+ continue;
glyphs->advances_x[i] = QFixed::fromReal(advances[i].width);
glyphs->advances_y[i] = QFixed::fromReal(advances[i].height);
- if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
+ }
+
+ if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
+ for (int i = 0; i < len; ++i) {
glyphs->advances_x[i] = glyphs->advances_x[i].round();
glyphs->advances_y[i] = glyphs->advances_y[i].round();
}
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index f6daed8..7396bcd 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -472,7 +472,12 @@ namespace {
memcpy(charsDestination, ti.chars, sizeof(QChar) * currentItem.numChars);
m_items.append(currentItem);
- }
+ }
+
+ virtual void drawPolygon(const QPointF *, int , PolygonDrawMode )
+ {
+ /* intentionally empty */
+ }
virtual bool begin(QPaintDevice *) { return true; }
virtual bool end() { return true; }
diff --git a/src/gui/util/qdesktopservices_x11.cpp b/src/gui/util/qdesktopservices_x11.cpp
index fe7f9a6..75e7209 100644
--- a/src/gui/util/qdesktopservices_x11.cpp
+++ b/src/gui/util/qdesktopservices_x11.cpp
@@ -71,10 +71,12 @@ static bool openDocument(const QUrl &url)
if (launch(url, QLatin1String("xdg-open")))
return true;
- if (X11->desktopEnvironment == DE_GNOME && launch(url, QLatin1String("gnome-open"))) {
+ // Use the X11->desktopEnvironment value if X11 is non-NULL,
+ // otherwise just attempt to launch command regardless of the desktop environment
+ if ((!X11 || (X11 && X11->desktopEnvironment == DE_GNOME)) && launch(url, QLatin1String("gnome-open"))) {
return true;
} else {
- if (X11->desktopEnvironment == DE_KDE && launch(url, QLatin1String("kfmclient exec")))
+ if ((!X11 || (X11 && X11->desktopEnvironment == DE_KDE)) && launch(url, QLatin1String("kfmclient exec")))
return true;
}
@@ -104,10 +106,12 @@ static bool launchWebBrowser(const QUrl &url)
if (launch(url, QString::fromLocal8Bit(getenv("BROWSER"))))
return true;
- if (X11->desktopEnvironment == DE_GNOME && launch(url, QLatin1String("gnome-open"))) {
+ // Use the X11->desktopEnvironment value if X11 is non-NULL,
+ // otherwise just attempt to launch command regardless of the desktop environment
+ if ((!X11 || (X11 && X11->desktopEnvironment == DE_GNOME)) && launch(url, QLatin1String("gnome-open"))) {
return true;
} else {
- if (X11->desktopEnvironment == DE_KDE && launch(url, QLatin1String("kfmclient openURL")))
+ if ((!X11 || (X11 && X11->desktopEnvironment == DE_KDE)) && launch(url, QLatin1String("kfmclient openURL")))
return true;
}
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index 5d4274f..c4f7c00 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -150,25 +150,29 @@ QNetworkConfiguration QNetworkConfigurationManagerPrivate::defaultConfiguration(
end = engine->accessPointConfigurations.end(); it != end; ++it) {
QNetworkConfigurationPrivatePointer ptr = it.value();
- const QString bearerName = ptr->bearerName();
QMutexLocker configLocker(&ptr->mutex);
+ QNetworkConfiguration::BearerType bearerType = ptr->bearerType;
if ((ptr->state & QNetworkConfiguration::Discovered) ==
QNetworkConfiguration::Discovered) {
if (!defaultConfiguration) {
defaultConfiguration = ptr;
} else {
+ QMutexLocker defaultConfigLocker(&defaultConfiguration->mutex);
+
if (defaultConfiguration->state == ptr->state) {
- if (defaultConfiguration->bearerName() == QLatin1String("Ethernet")) {
+ switch (defaultConfiguration->bearerType) {
+ case QNetworkConfiguration::BearerEthernet:
// do nothing
- } else if (defaultConfiguration->bearerName() == QLatin1String("WLAN")) {
- // ethernet beats wlan
- if (bearerName == QLatin1String("Ethernet"))
- defaultConfiguration = ptr;
- } else {
- // ethernet and wlan beats other
- if (bearerName == QLatin1String("Ethernet") ||
- bearerName == QLatin1String("WLAN")) {
+ break;
+ case QNetworkConfiguration::BearerWLAN:
+ // Ethernet beats WLAN
+ defaultConfiguration = ptr;
+ break;
+ default:
+ // Ethernet and WLAN beats other
+ if (bearerType == QNetworkConfiguration::BearerEthernet ||
+ bearerType == QNetworkConfiguration::BearerWLAN) {
defaultConfiguration = ptr;
}
}
diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp
index d7fceba..3190a30 100644
--- a/src/network/bearer/qnetworkconfiguration.cpp
+++ b/src/network/bearer/qnetworkconfiguration.cpp
@@ -183,6 +183,23 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \enum QNetworkConfiguration::BearerType
+
+ Specifies the type of bearer used by a configuration.
+
+ \value BearerUnknown The type of bearer is unknown or unspecified. The bearerTypeName()
+ function may return additional information.
+ \value BearerEthernet The configuration is for an Ethernet interfaces.
+ \value BearerWLAN The configuration is for a Wireless LAN interface.
+ \value Bearer2G The configuration is for a CSD, GPRS, HSCSD, EDGE or cdmaOne interface.
+ \value BearerCDMA2000 The configuration is for CDMA interface.
+ \value BearerWCDMA The configuration is for W-CDMA/UMTS interface.
+ \value BearerHSPA The configuration is for High Speed Packet Access (HSPA) interface.
+ \value BearerBluetooth The configuration is for a Bluetooth interface.
+ \value BearerWiMAX The configuration is for a WiMAX interface.
+*/
+
+/*!
Constructs an invalid configuration object.
\sa isValid()
@@ -383,53 +400,113 @@ QList<QNetworkConfiguration> QNetworkConfiguration::children() const
}
/*!
- Returns the type of bearer. The string is not translated and
- therefore can not be shown to the user. The subsequent table presents the currently known
- bearer types:
+ \fn QString QNetworkConfiguration::bearerName() const
+ \deprecated
+
+ This function is deprecated. It is equivalent to calling bearerTypeName(), however
+ bearerType() should be used in preference.
+*/
+
+/*!
+ Returns the type of bearer used by this network configuration.
+
+ If the bearer type is \l {QNetworkConfiguration::BearerUnknown}{unknown} the bearerTypeName()
+ function can be used to retrieve a textural type name for the bearer.
+
+ An invalid network configuration always returns the BearerUnknown value.
+*/
+QNetworkConfiguration::BearerType QNetworkConfiguration::bearerType() const
+{
+ if (!isValid())
+ return BearerUnknown;
+
+ QMutexLocker locker(&d->mutex);
+
+ return d->bearerType;
+}
+
+/*!
+ Returns the type of bearer used by this network configuration as a string.
+
+ The string is not translated and therefore can not be shown to the user. The subsequent table
+ shows the fixed mappings between BearerType and the bearer type name for known types. If the
+ BearerType is unknown this function may return additional information if it is available;
+ otherwise an empty string will be returned.
\table
- \header
+ \header
+ \o BearerType
\o Value
- \o Description
\row
- \o Unknown
- \o The session is based on an unknown or unspecified bearer type.
+ \o BearerUnknown
+ \o
+ \o The session is based on an unknown or unspecified bearer type. The value of the
+ string returned describes the bearer type.
\row
+ \o BearerEthernet
\o Ethernet
- \o The session is based on Ethernet.
\row
+ \o BearerWLAN
\o WLAN
- \o The session is based on Wireless LAN.
\row
+ \o Bearer2G
\o 2G
- \o The session uses CSD, GPRS, HSCSD, EDGE or cdmaOne.
- \row
+ \row
+ \o BearerCDMA2000
\o CDMA2000
- \o The session uses CDMA.
\row
+ \o BearerWCDMA
\o WCDMA
- \o The session uses W-CDMA/UMTS.
\row
+ \o BearerHSPA
\o HSPA
- \o The session uses High Speed Packet Access.
\row
+ \o BearerBluetooth
\o Bluetooth
- \o The session uses Bluetooth.
\row
+ \o BearerWiMAX
\o WiMAX
- \o The session uses WiMAX.
\endtable
- This function returns an empty string if this is an invalid configuration,
- a network configuration of type \l QNetworkConfiguration::ServiceNetwork or
+ This function returns an empty string if this is an invalid configuration, a network
+ configuration of type \l QNetworkConfiguration::ServiceNetwork or
\l QNetworkConfiguration::UserChoice.
+
+ \sa bearerType()
*/
-QString QNetworkConfiguration::bearerName() const
+QString QNetworkConfiguration::bearerTypeName() const
{
if (!isValid())
return QString();
- return d->bearerName();
+ QMutexLocker locker(&d->mutex);
+
+ if (d->type == QNetworkConfiguration::ServiceNetwork ||
+ d->type == QNetworkConfiguration::UserChoice)
+ return QString();
+
+ switch (d->bearerType) {
+ case BearerUnknown:
+ return d->bearerTypeName();
+ case BearerEthernet:
+ return QLatin1String("Ethernet");
+ case BearerWLAN:
+ return QLatin1String("WLAN");
+ case Bearer2G:
+ return QLatin1String("2G");
+ case BearerCDMA2000:
+ return QLatin1String("CDMA2000");
+ case BearerWCDMA:
+ return QLatin1String("WCDMA");
+ case BearerHSPA:
+ return QLatin1String("HSPA");
+ case BearerBluetooth:
+ return QLatin1String("Bluetooth");
+ case BearerWiMAX:
+ return QLatin1String("WiMAX");
+ }
+
+ return QLatin1String("Unknown");
}
QT_END_NAMESPACE
diff --git a/src/network/bearer/qnetworkconfiguration.h b/src/network/bearer/qnetworkconfiguration.h
index dce39eb..d9d36fd 100644
--- a/src/network/bearer/qnetworkconfiguration.h
+++ b/src/network/bearer/qnetworkconfiguration.h
@@ -103,10 +103,27 @@ public:
Q_DECLARE_FLAGS(StateFlags, StateFlag)
+ enum BearerType {
+ BearerUnknown,
+ BearerEthernet,
+ BearerWLAN,
+ Bearer2G,
+ BearerCDMA2000,
+ BearerWCDMA,
+ BearerHSPA,
+ BearerBluetooth,
+ BearerWiMAX
+ };
+
StateFlags state() const;
Type type() const;
Purpose purpose() const;
- QString bearerName() const;
+
+ // Required to maintain source compatibility with Qt Mobility.
+ QT_DEPRECATED inline QString bearerName() const { return bearerTypeName(); }
+ BearerType bearerType() const;
+ QString bearerTypeName() const;
+
QString identifier() const;
bool isRoamingAvailable() const;
QList<QNetworkConfiguration> children() const;
diff --git a/src/network/bearer/qnetworkconfiguration_p.h b/src/network/bearer/qnetworkconfiguration_p.h
index 966dfb2..2b0bbf6 100644
--- a/src/network/bearer/qnetworkconfiguration_p.h
+++ b/src/network/bearer/qnetworkconfiguration_p.h
@@ -68,6 +68,7 @@ public:
QNetworkConfigurationPrivate ()
: mutex(QMutex::Recursive), type(QNetworkConfiguration::Invalid),
purpose(QNetworkConfiguration::UnknownPurpose),
+ bearerType(QNetworkConfiguration::BearerUnknown),
isValid(false), roamingSupported(false)
{
}
@@ -78,24 +79,22 @@ public:
serviceNetworkMembers.clear();
}
- virtual QString bearerName() const
+ virtual QString bearerTypeName() const
{
- QMutexLocker locker(&mutex);
-
- return bearer;
+ return QLatin1String("Unknown");
}
QMap<unsigned int, QNetworkConfigurationPrivatePointer> serviceNetworkMembers;
mutable QMutex mutex;
- QString bearer;
QString name;
QString id;
QNetworkConfiguration::StateFlags state;
QNetworkConfiguration::Type type;
QNetworkConfiguration::Purpose purpose;
+ QNetworkConfiguration::BearerType bearerType;
bool isValid;
bool roamingSupported;
diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp
index 5ed3958..ed5c3c6 100644
--- a/src/plugins/bearer/connman/qconnmanengine.cpp
+++ b/src/plugins/bearer/connman/qconnmanengine.cpp
@@ -125,7 +125,7 @@ QList<QNetworkConfigurationPrivate *> QConnmanEngine::getConfigurations()
config->type = cpPriv->type;
config->roamingSupported = cpPriv->roamingSupported;
config->purpose = cpPriv->purpose;
- config->bearer = cpPriv->bearer;
+ config->bearerType = cpPriv->bearerType;
fetchedConfigurations.append(config);
}
@@ -169,30 +169,6 @@ bool QConnmanEngine::hasIdentifier(const QString &id)
return accessPointConfigurations.contains(id);
}
-QString QConnmanEngine::bearerName(const QString &id)
-{
- QMutexLocker locker(&mutex);
- QConnmanServiceInterface serv(serviceFromId(id));
- QString connectionType = serv.getType();
-
- if (connectionType == "ethernet")
- return QLatin1String("Ethernet");
- else if (connectionType == "wifi")
- return QLatin1String("WLAN");
- else if (connectionType == "cellular") {
- QString mode = serv.getMode();
- if(mode == "gprs" || mode == "edge") {
- return QLatin1String("2G");
- } else if(mode == "umts") {
- return QLatin1String("WCDMA");
- }
- }
- else if (connectionType == "wimax")
- return QLatin1String("WIMAX");
-
- return QString();
-}
-
void QConnmanEngine::connectToId(const QString &id)
{
QMutexLocker locker(&mutex);
@@ -538,25 +514,25 @@ QNetworkConfiguration::StateFlags QConnmanEngine::getStateForService(const QStri
return flag;
}
-QString QConnmanEngine::typeToBearer(const QString &type)
+QNetworkConfiguration::BearerType QConnmanEngine::typeToBearer(const QString &type)
{
- QMutexLocker locker(&mutex);
- if(type == "wifi")
- return "WLAN";
- if(type == "ethernet")
- return "Ethernet";
- if(type == "bluetooth")
- return "Bluetooth";
- if(type == "cellular") {
- return "2G";
- // not handled: CDMA2000 HSPA WCDMA
+ if (type == "wifi")
+ return QNetworkConfiguration::BearerWLAN;
+ if (type == "ethernet")
+ return QNetworkConfiguration::BearerEthernet;
+ if (type == "bluetooth")
+ return QNetworkConfiguration::BearerBluetooth;
+ if (type == "cellular") {
+ return QNetworkConfiguration::BearerUnknown;
+ // not handled: CDMA2000 HSPA
}
- if(type == "wimax")
- return "WiMax";
+ if (type == "wimax")
+ return QNetworkConfiguration::BearerWiMAX;
+
// if(type == "gps")
// if(type == "vpn")
- return "Unknown";
+ return QNetworkConfiguration::BearerUnknown;
}
void QConnmanEngine::removeConfiguration(const QString &id)
@@ -623,7 +599,24 @@ void QConnmanEngine::addServiceConfiguration(const QString &servicePath)
cpPriv->isValid = true;
cpPriv->id = id;
cpPriv->type = QNetworkConfiguration::InternetAccessPoint;
- cpPriv->bearer = bearerName(id);
+
+
+ const QString connectionType = serv->getType();
+ if (connectionType == "ethernet") {
+ cpPriv->bearerType = QNetworkConfiguration::BearerEthernet;
+ } else if (connectionType == "wifi") {
+ cpPriv->bearerType = QNetworkConfiguration::BearerWLAN;
+ } else if (connectionType == "cellular") {
+ const QString mode = serv->getMode();
+ if (mode == "gprs" || mode == "edge")
+ cpPriv->bearerType = QNetworkConfiguration::Bearer2G;
+ else if (mode == "umts")
+ cpPriv->bearerType = QNetworkConfiguration::BearerWCDMA;
+ } else if (connectionType == "wimax") {
+ cpPriv->bearerType = QNetworkConfiguration::BearerWiMAX;
+ } else {
+ cpPriv->bearerType = QNetworkConfiguration::BearerUnknown;
+ }
if(serv->getSecurity() == "none") {
cpPriv->purpose = QNetworkConfiguration::PublicPurpose;
@@ -686,22 +679,23 @@ void QConnmanEngine::addNetworkConfiguration(const QString &networkPath)
if(networkName.isEmpty())
networkName = "Hidden Network";
- QString bearerName;
+
+ QNetworkConfiguration::BearerType bearerType;
if(servicePath.isEmpty()) {
QString devicePath = networkPath.section("/",0,5);
QConnmanDeviceInterface device(devicePath,this);
- bearerName = typeToBearer(device.getType());
+ bearerType = typeToBearer(device.getType());
} else {
- bearerName = typeToBearer(serv->getType());
+ bearerType = typeToBearer(serv->getType());
}
- if(bearerName == "2G") {
+ if (bearerType == QNetworkConfiguration::BearerUnknown) {
QString mode = serv->getMode();
- if(mode == "gprs" || mode == "edge") {
- bearerName = "2G";
- } else if(mode == "umts") {
- bearerName = "WCDMA";
+ if (mode == "gprs" || mode == "edge") {
+ bearerType = QNetworkConfiguration::Bearer2G;
+ } else if (mode == "umts") {
+ bearerType = QNetworkConfiguration::BearerWCDMA;
}
networkName = serv->getAPN();
if(networkName.isEmpty()) {
@@ -713,7 +707,7 @@ void QConnmanEngine::addNetworkConfiguration(const QString &networkPath)
cpPriv->isValid = true;
cpPriv->id = id;
cpPriv->type = QNetworkConfiguration::InternetAccessPoint;
- cpPriv->bearer = bearerName;
+ cpPriv->bearerType = bearerType;
if(network->getWifiSecurity() == "none") {
cpPriv->purpose = QNetworkConfiguration::PublicPurpose;
diff --git a/src/plugins/bearer/connman/qconnmanengine.h b/src/plugins/bearer/connman/qconnmanengine.h
index 0f6dc1c..2ee6da5 100644
--- a/src/plugins/bearer/connman/qconnmanengine.h
+++ b/src/plugins/bearer/connman/qconnmanengine.h
@@ -80,8 +80,6 @@ public:
virtual QString getInterfaceFromId(const QString &id);
bool hasIdentifier(const QString &id);
- virtual QString bearerName(const QString &id);
-
virtual void connectToId(const QString &id);
virtual void disconnectFromId(const QString &id);
@@ -125,7 +123,7 @@ private:
QString networkFromId(const QString &id);
QNetworkConfiguration::StateFlags getStateForService(const QString &service);
- QString typeToBearer(const QString &type);
+ QNetworkConfiguration::BearerType typeToBearer(const QString &type);
void removeConfiguration(const QString &servicePath);
void addServiceConfiguration(const QString &servicePath);
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.h b/src/plugins/bearer/corewlan/qcorewlanengine.h
index 4d90648..56da66a 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.h
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.h
@@ -68,8 +68,6 @@ public:
QString getInterfaceFromId(const QString &id);
bool hasIdentifier(const QString &id);
- QString bearerName(const QString &id);
-
void connectToId(const QString &id);
void disconnectFromId(const QString &id);
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
index 6ba9504..131f36d 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
@@ -264,7 +264,7 @@ QStringList QScanThread::foundNetwork(const QString &id, const QString &name, co
ptr->id = id;
ptr->state = state;
ptr->type = QNetworkConfiguration::InternetAccessPoint;
- ptr->bearer = QLatin1String("WLAN");
+ ptr->bearerType = QNetworkConfiguration::BearerWLAN;
ptr->purpose = purpose;
fetchedConfigurations.append( ptr);
@@ -789,8 +789,8 @@ void QCoreWlanEngine::networksChanged()
changed = true;
}
- if (ptr->bearer != cpPriv->bearer) {
- ptr->bearer = cpPriv->bearer;
+ if (ptr->bearerType != cpPriv->bearerType) {
+ ptr->bearerType = cpPriv->bearerType;
changed = true;
}
diff --git a/src/plugins/bearer/generic/qgenericengine.cpp b/src/plugins/bearer/generic/qgenericengine.cpp
index 652fe4a..fad3ae8 100644
--- a/src/plugins/bearer/generic/qgenericengine.cpp
+++ b/src/plugins/bearer/generic/qgenericengine.cpp
@@ -69,7 +69,7 @@
QT_BEGIN_NAMESPACE
#ifndef QT_NO_NETWORKINTERFACE
-static QString qGetInterfaceType(const QString &interface)
+static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interface)
{
#ifdef Q_OS_WIN32
unsigned long oid;
@@ -78,10 +78,10 @@ static QString qGetInterfaceType(const QString &interface)
NDIS_MEDIUM medium;
NDIS_PHYSICAL_MEDIUM physicalMedium;
- HANDLE handle = CreateFile((TCHAR *)QString("\\\\.\\%1").arg(interface).utf16(), 0,
+ HANDLE handle = CreateFile((TCHAR *)QString::fromLatin1("\\\\.\\%1").arg(interface).utf16(), 0,
FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
if (handle == INVALID_HANDLE_VALUE)
- return QLatin1String("Unknown");
+ return QNetworkConfiguration::BearerUnknown;
oid = OID_GEN_MEDIA_SUPPORTED;
bytesWritten = 0;
@@ -89,7 +89,7 @@ static QString qGetInterfaceType(const QString &interface)
&medium, sizeof(medium), &bytesWritten, 0);
if (!result) {
CloseHandle(handle);
- return QLatin1String("Unknown");
+ return QNetworkConfiguration::BearerUnknown;
}
oid = OID_GEN_PHYSICAL_MEDIUM;
@@ -100,9 +100,9 @@ static QString qGetInterfaceType(const QString &interface)
CloseHandle(handle);
if (medium == NdisMedium802_3)
- return QLatin1String("Ethernet");
+ return QNetworkConfiguration::BearerEthernet;
else
- return QLatin1String("Unknown");
+ return QNetworkConfiguration::BearerUnknown;
}
CloseHandle(handle);
@@ -110,16 +110,16 @@ static QString qGetInterfaceType(const QString &interface)
if (medium == NdisMedium802_3) {
switch (physicalMedium) {
case NdisPhysicalMediumWirelessLan:
- return QLatin1String("WLAN");
+ return QNetworkConfiguration::BearerWLAN;
case NdisPhysicalMediumBluetooth:
- return QLatin1String("Bluetooth");
+ return QNetworkConfiguration::BearerBluetooth;
case NdisPhysicalMediumWiMax:
- return QLatin1String("WiMAX");
+ return QNetworkConfiguration::BearerWiMAX;
default:
#ifdef BEARER_MANAGEMENT_DEBUG
qDebug() << "Physical Medium" << physicalMedium;
#endif
- return QLatin1String("Ethernet");
+ return QNetworkConfiguration::BearerEthernet;
}
}
@@ -135,12 +135,12 @@ static QString qGetInterfaceType(const QString &interface)
close(sock);
if (result >= 0 && request.ifr_hwaddr.sa_family == ARPHRD_ETHER)
- return QLatin1String("Ethernet");
+ return QNetworkConfiguration::BearerEthernet;
#else
Q_UNUSED(interface);
#endif
- return QLatin1String("Unknown");
+ return QNetworkConfiguration::BearerUnknown;
}
#endif
@@ -214,7 +214,7 @@ void QGenericEngine::doRequestUpdate()
continue;
// ignore WLAN interface handled in separate engine
- if (qGetInterfaceType(interface.name()) == QLatin1String("WLAN"))
+ if (qGetInterfaceType(interface.name()) == QNetworkConfiguration::BearerWLAN)
continue;
uint identifier;
@@ -277,7 +277,7 @@ void QGenericEngine::doRequestUpdate()
ptr->id = id;
ptr->state = state;
ptr->type = QNetworkConfiguration::InternetAccessPoint;
- ptr->bearer = qGetInterfaceType(interface.name());
+ ptr->bearerType = qGetInterfaceType(interface.name());
accessPointConfigurations.insert(id, ptr);
configurationInterface.insert(id, interface.name());
diff --git a/src/plugins/bearer/generic/qgenericengine.h b/src/plugins/bearer/generic/qgenericengine.h
index cdbbc9d..021b35b 100644
--- a/src/plugins/bearer/generic/qgenericengine.h
+++ b/src/plugins/bearer/generic/qgenericengine.h
@@ -65,8 +65,6 @@ public:
QString getInterfaceFromId(const QString &id);
bool hasIdentifier(const QString &id);
- QString bearerName(const QString &id);
-
void connectToId(const QString &id);
void disconnectFromId(const QString &id);
diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp
index 0083380..6060a09 100644
--- a/src/plugins/bearer/icd/qicdengine.cpp
+++ b/src/plugins/bearer/icd/qicdengine.cpp
@@ -60,16 +60,11 @@ IcdNetworkConfigurationPrivate::~IcdNetworkConfigurationPrivate()
{
}
-QString IcdNetworkConfigurationPrivate::bearerName() const
+QString IcdNetworkConfigurationPrivate::bearerTypeName() const
{
- if (iap_type == QLatin1String("WLAN_INFRA") ||
- iap_type == QLatin1String("WLAN_ADHOC")) {
- return QLatin1String("WLAN");
- } else if (iap_type == QLatin1String("GPRS")) {
- return QLatin1String("HSPA");
- } else {
- return iap_type;
- }
+ QMutexLocker locker(&mutex);
+
+ return iap_type;
}
/* The IapAddTimer is a helper class that makes sure we update
@@ -400,6 +395,7 @@ void QIcdEngine::addConfiguration(QString& iap_id)
ptr->mutex.lock();
ptr->id = iap_id;
toIcdConfig(ptr)->iap_type = iap_type;
+ ptr->bearerType = bearerTypeFromIapType(iap_type);
toIcdConfig(ptr)->network_attrs = getNetworkAttrs(true, iap_id, iap_type, QString());
toIcdConfig(ptr)->network_id = ssid;
toIcdConfig(ptr)->service_id = saved_iap.value("service_id").toString();
@@ -424,6 +420,7 @@ void QIcdEngine::addConfiguration(QString& iap_id)
cpPriv->isValid = true;
cpPriv->id = iap_id;
cpPriv->iap_type = iap_type;
+ cpPriv->bearerType = bearerTypeFromIapType(iap_type);
cpPriv->network_attrs = getNetworkAttrs(true, iap_id, iap_type, QString());
cpPriv->service_id = saved_iap.value("service_id").toString();
cpPriv->service_type = saved_iap.value("service_type").toString();
@@ -480,6 +477,7 @@ void QIcdEngine::addConfiguration(QString& iap_id)
ptr->isValid = true;
if (toIcdConfig(ptr)->iap_type != iap_type) {
toIcdConfig(ptr)->iap_type = iap_type;
+ ptr->bearerType = bearerTypeFromIapType(iap_type);
update_needed = true;
}
if (iap_type.startsWith(QLatin1String("WLAN"))) {
@@ -580,6 +578,7 @@ void QIcdEngine::doRequestUpdate(QList<Maemo::IcdScanResult> scanned)
cpPriv->network_id = ssid;
cpPriv->network_attrs = getNetworkAttrs(true, iap_id, iap_type, QString());
cpPriv->iap_type = iap_type;
+ cpPriv->bearerType = bearerTypeFromIapType(iap_type);
cpPriv->service_id = saved_ap.value("service_id").toString();
cpPriv->service_type = saved_ap.value("service_type").toString();
cpPriv->type = QNetworkConfiguration::InternetAccessPoint;
@@ -688,6 +687,7 @@ rescan_list:
cpPriv->id = scanned_ssid.data(); // Note: id is now ssid, it should be set to IAP id if the IAP is saved
cpPriv->network_id = scanned_ssid;
cpPriv->iap_type = ap.scan.network_type;
+ cpPriv->bearerType = bearerTypeFromIapType(cpPriv->iap_type);
cpPriv->network_attrs = ap.scan.network_attrs;
cpPriv->service_id = ap.scan.service_id;
cpPriv->service_type = ap.scan.service_type;
diff --git a/src/plugins/bearer/icd/qicdengine.h b/src/plugins/bearer/icd/qicdengine.h
index 1b291eb..16dc979 100644
--- a/src/plugins/bearer/icd/qicdengine.h
+++ b/src/plugins/bearer/icd/qicdengine.h
@@ -54,13 +54,25 @@ class QNetworkConfigurationPrivate;
class IapMonitor;
class QDBusInterface;
+inline QNetworkConfiguration::BearerType bearerTypeFromIapType(const QString &iapType)
+{
+ if (iapType == QLatin1String("WLAN_INFRA") ||
+ iapType == QLatin1String("WLAN_ADHOC")) {
+ return QNetworkConfiguration::BearerWLAN;
+ } else if (iapType == QLatin1String("GPRS")) {
+ return QNetworkConfiguration::BearerHSPA;
+ } else {
+ return QNetworkConfiguration::BearerUnknown;
+ }
+}
+
class IcdNetworkConfigurationPrivate : public QNetworkConfigurationPrivate
{
public:
IcdNetworkConfigurationPrivate();
~IcdNetworkConfigurationPrivate();
- QString bearerName() const;
+ virtual QString bearerTypeName() const;
// In Maemo the id field (defined in QNetworkConfigurationPrivate)
// is the IAP id (which typically is UUID)
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp
index e8e5183..2583b28 100644
--- a/src/plugins/bearer/icd/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp
@@ -318,6 +318,7 @@ QNetworkConfiguration& QNetworkSessionPrivateImpl::copyConfig(QNetworkConfigurat
cpPriv->purpose = fromPriv->purpose;
cpPriv->network_id = fromPriv->network_id;
cpPriv->iap_type = fromPriv->iap_type;
+ cpPriv->bearerType = fromPriv->bearerType;
cpPriv->network_attrs = fromPriv->network_attrs;
cpPriv->service_type = fromPriv->service_type;
cpPriv->service_id = fromPriv->service_id;
@@ -443,6 +444,7 @@ void QNetworkSessionPrivateImpl::syncStateWithInterface()
ptr->id = toIcdConfig(ptr)->network_id;
toIcdConfig(ptr)->network_attrs = state_results.first().params.network_attrs;
toIcdConfig(ptr)->iap_type = state_results.first().params.network_type;
+ ptr->bearerType = bearerTypeFromIapType(toIcdConfig(ptr)->iap_type);
toIcdConfig(ptr)->service_type = state_results.first().params.service_type;
toIcdConfig(ptr)->service_id = state_results.first().params.service_id;
toIcdConfig(ptr)->service_attrs = state_results.first().params.service_attrs;
@@ -819,6 +821,7 @@ void QNetworkSessionPrivateImpl::stateChange(const QDBusMessage& rep)
icdConfig->name = name;
icdConfig->iap_type = rep.arguments().at(3).toString(); // connect_result.connect.network_type;
+ icdConfig->bearerType = bearerTypeFromIapType(icdConfig->iap_type);
icdConfig->isValid = true;
icdConfig->state = QNetworkConfiguration::Active;
icdConfig->type = QNetworkConfiguration::InternetAccessPoint;
diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
index 1a55402..ba8297e 100644
--- a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
+++ b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
@@ -206,7 +206,7 @@ void QNativeWifiEngine::scanComplete()
ptr->id = id;
ptr->state = state;
ptr->type = QNetworkConfiguration::InternetAccessPoint;
- ptr->bearer = QLatin1String("WLAN");
+ ptr->bearerType = QNetworkConfiguration::BearerWLAN;
accessPointConfigurations.insert(id, ptr);
@@ -350,11 +350,6 @@ bool QNativeWifiEngine::hasIdentifier(const QString &id)
return false;
}
-/*QString QNativeWifiEngine::bearerName(const QString &)
-{
- return QLatin1String("WLAN");
-}*/
-
void QNativeWifiEngine::connectToId(const QString &id)
{
QMutexLocker locker(&mutex);
diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.h b/src/plugins/bearer/nativewifi/qnativewifiengine.h
index 0e9576b..dccf2e2 100644
--- a/src/plugins/bearer/nativewifi/qnativewifiengine.h
+++ b/src/plugins/bearer/nativewifi/qnativewifiengine.h
@@ -75,8 +75,6 @@ public:
QString getInterfaceFromId(const QString &id);
bool hasIdentifier(const QString &id);
- //QString bearerName(const QString &id);
-
void connectToId(const QString &id);
void disconnectFromId(const QString &id);
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
index 3ebc356..f3f693b 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
@@ -181,30 +181,6 @@ bool QNetworkManagerEngine::hasIdentifier(const QString &id)
return false;
}
-QString QNetworkManagerEngine::bearerName(const QString &id)
-{
- QMutexLocker locker(&mutex);
-
- QNetworkManagerSettingsConnection *connection = connectionFromId(id);
-
- if (!connection)
- return QString();
-
- QNmSettingsMap map = connection->getSettings();
- const QString connectionType = map.value("connection").value("type").toString();
-
- if (connectionType == "802-3-ethernet")
- return QLatin1String("Ethernet");
- else if (connectionType == "802-11-wireless")
- return QLatin1String("WLAN");
- else if (connectionType == "gsm")
- return QLatin1String("2G");
- else if (connectionType == "cdma")
- return QLatin1String("CDMA2000");
- else
- return QString();
-}
-
void QNetworkManagerEngine::connectToId(const QString &id)
{
QMutexLocker locker(&mutex);
@@ -611,7 +587,7 @@ void QNetworkManagerEngine::newAccessPoint(const QString &path, const QDBusObjec
ptr->purpose = QNetworkConfiguration::PublicPurpose;
}
ptr->state = QNetworkConfiguration::Undefined;
- ptr->bearer = QLatin1String("WLAN");
+ ptr->bearerType = QNetworkConfiguration::BearerWLAN;
accessPointConfigurations.insert(ptr->id, ptr);
@@ -724,7 +700,7 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri
const QString connectionType = map.value("connection").value("type").toString();
if (connectionType == QLatin1String("802-3-ethernet")) {
- cpPriv->bearer = QLatin1String("Ethernet");
+ cpPriv->bearerType = QNetworkConfiguration::BearerEthernet;
cpPriv->purpose = QNetworkConfiguration::PublicPurpose;
foreach (const QDBusObjectPath &devicePath, interface->getDevices()) {
@@ -739,7 +715,7 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri
}
}
} else if (connectionType == QLatin1String("802-11-wireless")) {
- cpPriv->bearer = QLatin1String("WLAN");
+ cpPriv->bearerType = QNetworkConfiguration::BearerWLAN;
const QString connectionSsid = map.value("802-11-wireless").value("ssid").toString();
const QString connectionSecurity = map.value("802-11-wireless").value("security").toString();
@@ -767,9 +743,9 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri
}
}
} else if (connectionType == "gsm") {
- cpPriv->bearer = QLatin1String("2G");
+ cpPriv->bearerType = QNetworkConfiguration::Bearer2G;
} else if (connectionType == "cdma") {
- cpPriv->bearer = QLatin1String("CDMA2000");
+ cpPriv->bearerType = QNetworkConfiguration::BearerCDMA2000;
}
return cpPriv;
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
index 8e95a2c..ffb8395 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
@@ -78,8 +78,6 @@ public:
QString getInterfaceFromId(const QString &id);
bool hasIdentifier(const QString &id);
- QString bearerName(const QString &id);
-
void connectToId(const QString &id);
void disconnectFromId(const QString &id);
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
index 31a9aa1..f47c97c 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
@@ -718,146 +718,80 @@ QNmSettingsMap QNetworkManagerSettingsConnection::getSettings()
NMDeviceType QNetworkManagerSettingsConnection::getType()
{
- QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("connection"));
- while (i != d->settingsMap.end() && i.key() == QLatin1String("connection")) {
- QMap<QString,QVariant> innerMap = i.value();
- QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("type"));
- while (ii != innerMap.end() && ii.key() == QLatin1String("type")) {
- QString devType = ii.value().toString();
- if (devType == QLatin1String("802-3-ethernet")) {
- return DEVICE_TYPE_802_3_ETHERNET;
- }
- if (devType == QLatin1String("802-11-wireless")) {
- return DEVICE_TYPE_802_11_WIRELESS;
- }
- ii++;
- }
- i++;
- }
- return DEVICE_TYPE_UNKNOWN;
+ const QString devType =
+ d->settingsMap.value(QLatin1String("connection")).value(QLatin1String("type")).toString();
+
+ if (devType == QLatin1String("802-3-ethernet"))
+ return DEVICE_TYPE_802_3_ETHERNET;
+ else if (devType == QLatin1String("802-11-wireless"))
+ return DEVICE_TYPE_802_11_WIRELESS;
+ else
+ return DEVICE_TYPE_UNKNOWN;
}
bool QNetworkManagerSettingsConnection::isAutoConnect()
{
- QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("connection"));
- while (i != d->settingsMap.end() && i.key() == QLatin1String("connection")) {
- QMap<QString,QVariant> innerMap = i.value();
- QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("autoconnect"));
- while (ii != innerMap.end() && ii.key() == QLatin1String("autoconnect")) {
- return ii.value().toBool();
- ii++;
- }
- i++;
- }
- return true; //default networkmanager is autoconnect
+ const QVariant autoConnect =
+ d->settingsMap.value(QLatin1String("connection")).value(QLatin1String("autoconnect"));
+
+ // NetworkManager default is to auto connect
+ if (!autoConnect.isValid())
+ return true;
+
+ return autoConnect.toBool();
}
quint64 QNetworkManagerSettingsConnection::getTimestamp()
{
- QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("connection"));
- while (i != d->settingsMap.end() && i.key() == QLatin1String("connection")) {
- QMap<QString,QVariant> innerMap = i.value();
- QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("timestamp"));
- while (ii != innerMap.end() && ii.key() == QLatin1String("timestamp")) {
- return ii.value().toUInt();
- ii++;
- }
- i++;
- }
- return 0;
+ qDebug() << d->settingsMap.value(QLatin1String("connection"));
+
+ return d->settingsMap.value(QLatin1String("connection"))
+ .value(QLatin1String("timestamp")).toUInt();
}
QString QNetworkManagerSettingsConnection::getId()
{
- QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("connection"));
- while (i != d->settingsMap.end() && i.key() == QLatin1String("connection")) {
- QMap<QString,QVariant> innerMap = i.value();
- QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("id"));
- while (ii != innerMap.end() && ii.key() == QLatin1String("id")) {
- return ii.value().toString();
- ii++;
- }
- i++;
- }
- return QString();
+ return d->settingsMap.value(QLatin1String("connection")).value(QLatin1String("id")).toString();
}
QString QNetworkManagerSettingsConnection::getUuid()
{
- QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("connection"));
- while (i != d->settingsMap.end() && i.key() == QLatin1String("connection")) {
- QMap<QString,QVariant> innerMap = i.value();
- QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("uuid"));
- while (ii != innerMap.end() && ii.key() == QLatin1String("uuid")) {
- return ii.value().toString();
- ii++;
- }
- i++;
- }
+ const QString id = d->settingsMap.value(QLatin1String("connection"))
+ .value(QLatin1String("uuid")).toString();
+
// is no uuid, return the connection path
- return d->connectionInterface->path();
+ return id.isEmpty() ? d->connectionInterface->path() : id;
}
QString QNetworkManagerSettingsConnection::getSsid()
{
- QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("802-11-wireless"));
- while (i != d->settingsMap.end() && i.key() == QLatin1String("802-11-wireless")) {
- QMap<QString,QVariant> innerMap = i.value();
- QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("ssid"));
- while (ii != innerMap.end() && ii.key() == QLatin1String("ssid")) {
- return ii.value().toString();
- ii++;
- }
- i++;
- }
- return QString();
+ return d->settingsMap.value(QLatin1String("802-11-wireless"))
+ .value(QLatin1String("ssid")).toString();
}
QString QNetworkManagerSettingsConnection::getMacAddress()
{
- if(getType() == DEVICE_TYPE_802_3_ETHERNET) {
- QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("802-3-ethernet"));
- while (i != d->settingsMap.end() && i.key() == QLatin1String("802-3-ethernet")) {
- QMap<QString,QVariant> innerMap = i.value();
- QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("mac-address"));
- while (ii != innerMap.end() && ii.key() == QLatin1String("mac-address")) {
- return ii.value().toString();
- ii++;
- }
- i++;
- }
- }
+ NMDeviceType type = getType();
- else if(getType() == DEVICE_TYPE_802_11_WIRELESS) {
- QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("802-11-wireless"));
- while (i != d->settingsMap.end() && i.key() == QLatin1String("802-11-wireless")) {
- QMap<QString,QVariant> innerMap = i.value();
- QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("mac-address"));
- while (ii != innerMap.end() && ii.key() == QLatin1String("mac-address")) {
- return ii.value().toString();
- ii++;
- }
- i++;
- }
+ if (type == DEVICE_TYPE_802_3_ETHERNET) {
+ return d->settingsMap.value(QLatin1String("802-3-ethernet"))
+ .value(QLatin1String("mac-address")).toString();
+ } else if (type == DEVICE_TYPE_802_11_WIRELESS) {
+ return d->settingsMap.value(QLatin1String("802-11-wireless"))
+ .value(QLatin1String("mac-address")).toString();
+ } else {
+ return QString();
}
- return QString();
-}
-
-QStringList QNetworkManagerSettingsConnection::getSeenBssids()
-{
- if(getType() == DEVICE_TYPE_802_11_WIRELESS) {
- QNmSettingsMap::const_iterator i = d->settingsMap.find(QLatin1String("802-11-wireless"));
- while (i != d->settingsMap.end() && i.key() == QLatin1String("802-11-wireless")) {
- QMap<QString,QVariant> innerMap = i.value();
- QMap<QString,QVariant>::const_iterator ii = innerMap.find(QLatin1String("seen-bssids"));
- while (ii != innerMap.end() && ii.key() == QLatin1String("seen-bssids")) {
- return ii.value().toStringList();
- ii++;
- }
- i++;
- }
+}
+
+QStringList QNetworkManagerSettingsConnection::getSeenBssids()
+{
+ if (getType() == DEVICE_TYPE_802_11_WIRELESS) {
+ return d->settingsMap.value(QLatin1String("802-11-wireless"))
+ .value(QLatin1String("seen-bssids")).toStringList();
+ } else {
+ return QStringList();
}
- return QStringList();
}
class QNetworkManagerConnectionActivePrivate
diff --git a/src/plugins/bearer/nla/qnlaengine.cpp b/src/plugins/bearer/nla/qnlaengine.cpp
index 9ab9924..fd50099 100644
--- a/src/plugins/bearer/nla/qnlaengine.cpp
+++ b/src/plugins/bearer/nla/qnlaengine.cpp
@@ -119,7 +119,7 @@ static void printBlob(NLA_BLOB *blob)
}
#endif
-static QString qGetInterfaceType(const QString &interface)
+static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interface)
{
#ifdef Q_OS_WINCE
Q_UNUSED(interface)
@@ -130,10 +130,10 @@ static QString qGetInterfaceType(const QString &interface)
NDIS_MEDIUM medium;
NDIS_PHYSICAL_MEDIUM physicalMedium;
- HANDLE handle = CreateFile((TCHAR *)QString(QLatin1String("\\\\.\\%1")).arg(interface).utf16(),
- 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
+ HANDLE handle = CreateFile((TCHAR *)QString::fromLatin1("\\\\.\\%1").arg(interface).utf16(), 0,
+ FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
if (handle == INVALID_HANDLE_VALUE)
- return QLatin1String("Unknown");
+ return QNetworkConfiguration::BearerUnknown;
oid = OID_GEN_MEDIA_SUPPORTED;
bytesWritten = 0;
@@ -141,7 +141,7 @@ static QString qGetInterfaceType(const QString &interface)
&medium, sizeof(medium), &bytesWritten, 0);
if (!result) {
CloseHandle(handle);
- return QLatin1String("Unknown");
+ return QNetworkConfiguration::BearerUnknown;
}
oid = OID_GEN_PHYSICAL_MEDIUM;
@@ -152,9 +152,9 @@ static QString qGetInterfaceType(const QString &interface)
CloseHandle(handle);
if (medium == NdisMedium802_3)
- return QLatin1String("Ethernet");
+ return QNetworkConfiguration::BearerEthernet;
else
- return QLatin1String("Unknown");
+ return QNetworkConfiguration::BearerUnknown;
}
CloseHandle(handle);
@@ -162,16 +162,16 @@ static QString qGetInterfaceType(const QString &interface)
if (medium == NdisMedium802_3) {
switch (physicalMedium) {
case NdisPhysicalMediumWirelessLan:
- return QLatin1String("WLAN");
+ return QNetworkConfiguration::BearerWLAN;
case NdisPhysicalMediumBluetooth:
- return QLatin1String("Bluetooth");
+ return QNetworkConfiguration::BearerBluetooth;
case NdisPhysicalMediumWiMax:
- return QLatin1String("WiMAX");
+ return QNetworkConfiguration::BearerWiMAX;
default:
#ifdef BEARER_MANAGEMENT_DEBUG
qDebug() << "Physical Medium" << physicalMedium;
#endif
- return QLatin1String("Ethernet");
+ return QNetworkConfiguration::BearerEthernet;
}
}
@@ -181,7 +181,7 @@ static QString qGetInterfaceType(const QString &interface)
#endif
- return QLatin1String("Unknown");
+ return QNetworkConfiguration::BearerUnknown;
}
class QNlaThread : public QThread
@@ -374,10 +374,9 @@ DWORD QNlaThread::parseBlob(NLA_BLOB *blob, QNetworkConfigurationPrivate *cpPriv
#endif
break;
case NLA_CONNECTIVITY:
- if (blob->data.connectivity.internet == NLA_INTERNET_YES)
- cpPriv->internet = true;
- else
- cpPriv->internet = false;
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug("%s: unhandled header type NLA_CONNECTIVITY", __FUNCTION__);
+#endif
break;
case NLA_ICS:
#ifdef BEARER_MANAGEMENT_DEBUG
@@ -438,8 +437,10 @@ QNetworkConfigurationPrivate *QNlaThread::parseQuerySet(const WSAQUERYSET *query
} while (offset != 0 && offset < querySet->lpBlob->cbSize);
}
- if (QNlaEngine *engine = qobject_cast<QNlaEngine *>(parent()))
- cpPriv->bearer = engine->bearerName(cpPriv->id);
+ if (QNlaEngine *engine = qobject_cast<QNlaEngine *>(parent())) {
+ const QString interface = engine->getInterfaceFromId(cpPriv->id);
+ cpPriv->bearerType = qGetInterfaceType(interface);
+ }
return cpPriv;
}
@@ -586,16 +587,6 @@ bool QNlaEngine::hasIdentifier(const QString &id)
return configurationInterface.contains(id.toUInt());
}
-QString QNlaEngine::bearerName(const QString &id)
-{
- QString interface = getInterfaceFromId(id);
-
- if (interface.isEmpty())
- return QString();
-
- return qGetInterfaceType(interface);
-}
-
void QNlaEngine::connectToId(const QString &id)
{
emit connectionError(id, OperationNotSupported);
diff --git a/src/plugins/bearer/nla/qnlaengine.h b/src/plugins/bearer/nla/qnlaengine.h
index 1d49464..69f54c9 100644
--- a/src/plugins/bearer/nla/qnlaengine.h
+++ b/src/plugins/bearer/nla/qnlaengine.h
@@ -85,8 +85,6 @@ public:
QString getInterfaceFromId(const QString &id);
bool hasIdentifier(const QString &id);
- QString bearerName(const QString &id);
-
void connectToId(const QString &id);
void disconnectFromId(const QString &id);
diff --git a/src/plugins/bearer/symbian/3_1/3_1.pro b/src/plugins/bearer/symbian/3_1/3_1.pro
index 2d721a8..b7c6aef 100644
--- a/src/plugins/bearer/symbian/3_1/3_1.pro
+++ b/src/plugins/bearer/symbian/3_1/3_1.pro
@@ -1,5 +1,9 @@
include(../symbian.pri)
-LIBS += -lapengine
+is_using_gnupoc {
+ LIBS += -lapengine
+} else {
+ LIBS += -lAPEngine
+}
TARGET = $${TARGET}_3_1
TARGET.UID3 = 0x2002131C
diff --git a/src/plugins/bearer/symbian/symbian.pri b/src/plugins/bearer/symbian/symbian.pri
index afe84dc..9b3f50c 100644
--- a/src/plugins/bearer/symbian/symbian.pri
+++ b/src/plugins/bearer/symbian/symbian.pri
@@ -14,8 +14,6 @@ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
symbian-abld:INCLUDEPATH += $$QT_BUILD_TREE/include/QtNetwork/private
LIBS += -lcommdb \
- -lapsettingshandlerui \
- -lconnmon \
-lcentralrepository \
-lesock \
-linsock \
@@ -23,6 +21,14 @@ LIBS += -lcommdb \
-lefsrv \
-lnetmeta
+is_using_gnupoc {
+ LIBS += -lconnmon \
+ -lapsettingshandlerui
+} else {
+ LIBS += -lConnMon \
+ -lApSettingsHandlerUI
+}
+
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/bearer
target.path += $$[QT_INSTALL_PLUGINS]/bearer
INSTALLS += target
diff --git a/src/plugins/bearer/symbian/symbian_3/symbian_3.pro b/src/plugins/bearer/symbian/symbian_3/symbian_3.pro
index ff0f11c..fd66198 100644
--- a/src/plugins/bearer/symbian/symbian_3/symbian_3.pro
+++ b/src/plugins/bearer/symbian/symbian_3/symbian_3.pro
@@ -12,7 +12,11 @@ symbian {
}
} else {
# Fall back to 3_1 implementation on platforms that do not have cmmanager
- LIBS += -lapengine
+ is_using_gnupoc {
+ LIBS += -lapengine
+ } else {
+ LIBS += -lAPEngine
+ }
}
}
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index 4bd6d2f..9593461 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -63,9 +63,9 @@
#include <cmpluginpacketdatadef.h>
#include <cmplugindialcommondefs.h>
#else
- #include <apaccesspointitem.h>
- #include <apdatahandler.h>
- #include <aputils.h>
+ #include <ApAccessPointItem.h>
+ #include <ApDataHandler.h>
+ #include <ApUtils.h>
#endif
#ifndef QT_NO_BEARERMANAGEMENT
@@ -75,7 +75,7 @@ QT_BEGIN_NAMESPACE
static const int KUserChoiceIAPId = 0;
SymbianNetworkConfigurationPrivate::SymbianNetworkConfigurationPrivate()
-: bearer(BearerUnknown), numericId(0), connectionId(0)
+: numericId(0), connectionId(0)
{
}
@@ -83,32 +83,6 @@ SymbianNetworkConfigurationPrivate::~SymbianNetworkConfigurationPrivate()
{
}
-QString SymbianNetworkConfigurationPrivate::bearerName() const
-{
- QMutexLocker locker(&mutex);
-
- switch (bearer) {
- case BearerEthernet:
- return QLatin1String("Ethernet");
- case BearerWLAN:
- return QLatin1String("WLAN");
- case Bearer2G:
- return QLatin1String("2G");
- case BearerCDMA2000:
- return QLatin1String("CDMA2000");
- case BearerWCDMA:
- return QLatin1String("WCDMA");
- case BearerHSPA:
- return QLatin1String("HSPA");
- case BearerBluetooth:
- return QLatin1String("Bluetooth");
- case BearerWiMAX:
- return QLatin1String("WiMAX");
- default:
- return QString();
- }
-}
-
SymbianEngine::SymbianEngine(QObject *parent)
: QBearerEngine(parent), CActive(CActive::EPriorityHigh), iFirstUpdate(true), iInitOk(true),
iUpdatePending(false)
@@ -146,7 +120,7 @@ void SymbianEngine::initialize()
SymbianNetworkConfigurationPrivate *cpPriv = new SymbianNetworkConfigurationPrivate;
cpPriv->name = "UserChoice";
- cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown;
+ cpPriv->bearerType = QNetworkConfiguration::BearerUnknown;
cpPriv->state = QNetworkConfiguration::Discovered;
cpPriv->isValid = true;
cpPriv->id = QString::number(qHash(KUserChoiceIAPId));
@@ -517,25 +491,25 @@ SymbianNetworkConfigurationPrivate *SymbianEngine::configFromConnectionMethodL(
TUint32 bearerId = connectionMethod.GetIntAttributeL(CMManager::ECmCommsDBBearerType);
switch (bearerId) {
case KCommDbBearerCSD:
- cpPriv->bearer = SymbianNetworkConfigurationPrivate::Bearer2G;
+ cpPriv->bearerType = QNetworkConfiguration::Bearer2G;
break;
case KCommDbBearerWcdma:
- cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerWCDMA;
+ cpPriv->bearerType = QNetworkConfiguration::BearerWCDMA;
break;
case KCommDbBearerLAN:
- cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerEthernet;
+ cpPriv->bearerType = QNetworkConfiguration::BearerEthernet;
break;
case KCommDbBearerVirtual:
- cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown;
+ cpPriv->bearerType = QNetworkConfiguration::BearerUnknown;
break;
case KCommDbBearerPAN:
- cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown;
+ cpPriv->bearerType = QNetworkConfiguration::BearerUnknown;
break;
case KCommDbBearerWLAN:
- cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerWLAN;
+ cpPriv->bearerType = QNetworkConfiguration::BearerWLAN;
break;
default:
- cpPriv->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown;
+ cpPriv->bearerType = QNetworkConfiguration::BearerUnknown;
break;
}
@@ -619,28 +593,28 @@ void SymbianEngine::readNetworkConfigurationValuesFromCommsDbL(
apNetworkConfiguration->roamingSupported = false;
switch (pAPItem->BearerTypeL()) {
case EApBearerTypeCSD:
- apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::Bearer2G;
+ apNetworkConfiguration->bearerType = QNetworkConfiguration::Bearer2G;
break;
case EApBearerTypeGPRS:
- apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::Bearer2G;
+ apNetworkConfiguration->bearerType = QNetworkConfiguration::Bearer2G;
break;
case EApBearerTypeHSCSD:
- apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA;
+ apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerHSPA;
break;
case EApBearerTypeCDMA:
- apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerCDMA2000;
+ apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerCDMA2000;
break;
case EApBearerTypeWLAN:
- apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerWLAN;
+ apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerWLAN;
break;
case EApBearerTypeLAN:
- apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerEthernet;
+ apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerEthernet;
break;
case EApBearerTypeLANModem:
- apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerEthernet;
+ apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerEthernet;
break;
default:
- apNetworkConfiguration->bearer = SymbianNetworkConfigurationPrivate::BearerUnknown;
+ apNetworkConfiguration->bearerType = QNetworkConfiguration::BearerUnknown;
break;
}
@@ -870,38 +844,38 @@ void SymbianEngine::updateMobileBearerToConfigs(TConnMonBearerInfo bearerInfo)
SymbianNetworkConfigurationPrivate *p = toSymbianConfig(ptr);
- if (p->bearer >= SymbianNetworkConfigurationPrivate::Bearer2G &&
- p->bearer <= SymbianNetworkConfigurationPrivate::BearerHSPA) {
+ if (p->bearerType >= QNetworkConfiguration::Bearer2G &&
+ p->bearerType <= QNetworkConfiguration::BearerHSPA) {
switch (bearerInfo) {
case EBearerInfoCSD:
- p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G;
+ p->bearerType = QNetworkConfiguration::Bearer2G;
break;
case EBearerInfoWCDMA:
- p->bearer = SymbianNetworkConfigurationPrivate::BearerWCDMA;
+ p->bearerType = QNetworkConfiguration::BearerWCDMA;
break;
case EBearerInfoCDMA2000:
- p->bearer = SymbianNetworkConfigurationPrivate::BearerCDMA2000;
+ p->bearerType = QNetworkConfiguration::BearerCDMA2000;
break;
case EBearerInfoGPRS:
- p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G;
+ p->bearerType = QNetworkConfiguration::Bearer2G;
break;
case EBearerInfoHSCSD:
- p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G;
+ p->bearerType = QNetworkConfiguration::Bearer2G;
break;
case EBearerInfoEdgeGPRS:
- p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G;
+ p->bearerType = QNetworkConfiguration::Bearer2G;
break;
case EBearerInfoWcdmaCSD:
- p->bearer = SymbianNetworkConfigurationPrivate::BearerWCDMA;
+ p->bearerType = QNetworkConfiguration::BearerWCDMA;
break;
case EBearerInfoHSDPA:
- p->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA;
+ p->bearerType = QNetworkConfiguration::BearerHSPA;
break;
case EBearerInfoHSUPA:
- p->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA;
+ p->bearerType = QNetworkConfiguration::BearerHSPA;
break;
case EBearerInfoHSxPA:
- p->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA;
+ p->bearerType = QNetworkConfiguration::BearerHSPA;
break;
}
}
diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h
index ecd858d..1fe6395 100644
--- a/src/plugins/bearer/symbian/symbianengine.h
+++ b/src/plugins/bearer/symbian/symbianengine.h
@@ -73,23 +73,9 @@ class AccessPointsAvailabilityScanner;
class SymbianNetworkConfigurationPrivate : public QNetworkConfigurationPrivate
{
public:
- enum Bearer {
- BearerEthernet,
- BearerWLAN,
- Bearer2G,
- BearerCDMA2000,
- BearerWCDMA,
- BearerHSPA,
- BearerBluetooth,
- BearerWiMAX,
- BearerUnknown = -1
- };
-
SymbianNetworkConfigurationPrivate();
~SymbianNetworkConfigurationPrivate();
- QString bearerName() const;
-
inline TUint32 numericIdentifier() const
{
QMutexLocker locker(&mutex);
@@ -110,8 +96,6 @@ public:
QString mappingName;
- Bearer bearer;
-
// So called IAP id from the platform. Remains constant as long as the
// platform is aware of the configuration ie. it is stored in the databases
// --> does not depend on whether connections are currently open or not.
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 53ec18c..7844688 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -12883,4 +12883,7 @@ EXPORTS
?focusScopeItemChange@QGraphicsItemPrivate@@UAEX_N@Z @ 12882 NONAME ; void QGraphicsItemPrivate::focusScopeItemChange(bool)
?setTimeout@QTapAndHoldGesture@@SAXH@Z @ 12883 NONAME ; void QTapAndHoldGesture::setTimeout(int)
?childrenBoundingRectHelper@QGraphicsItemPrivate@@QAEXPAVQTransform@@PAVQRectF@@_N@Z @ 12884 NONAME ; void QGraphicsItemPrivate::childrenBoundingRectHelper(class QTransform *, class QRectF *, bool)
+ ?zScaleChanged@QGraphicsScale@@IAEXXZ @ 12885 NONAME ; void QGraphicsScale::zScaleChanged(void)
+ ?xScaleChanged@QGraphicsScale@@IAEXXZ @ 12886 NONAME ; void QGraphicsScale::xScaleChanged(void)
+ ?yScaleChanged@QGraphicsScale@@IAEXXZ @ 12887 NONAME ; void QGraphicsScale::yScaleChanged(void)
diff --git a/src/s60installs/bwins/QtNetworku.def b/src/s60installs/bwins/QtNetworku.def
index 48af60c..2cf62a8 100644
--- a/src/s60installs/bwins/QtNetworku.def
+++ b/src/s60installs/bwins/QtNetworku.def
@@ -1143,4 +1143,6 @@ EXPORTS
?setNetworkAccessible@QNetworkAccessManager@@QAEXW4NetworkAccessibility@1@@Z @ 1142 NONAME ; void QNetworkAccessManager::setNetworkAccessible(enum QNetworkAccessManager::NetworkAccessibility)
??_EQBearerEngineFactoryInterface@@UAE@I@Z @ 1143 NONAME ; QBearerEngineFactoryInterface::~QBearerEngineFactoryInterface(unsigned int)
?enablePolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1144 NONAME ; void QNetworkConfigurationManagerPrivate::enablePolling(void)
+ ?bearerTypeName@QNetworkConfiguration@@QBE?AVQString@@XZ @ 1145 NONAME ; class QString QNetworkConfiguration::bearerTypeName(void) const
+ ?bearerType@QNetworkConfiguration@@QBE?AW4BearerType@1@XZ @ 1146 NONAME ; enum QNetworkConfiguration::BearerType QNetworkConfiguration::bearerType(void) const
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index 559c896..a22b4d9 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12088,4 +12088,7 @@ EXPORTS
_ZN18QTapAndHoldGesture7timeoutEv @ 12087 NONAME
_ZN20QGraphicsItemPrivate20focusScopeItemChangeEb @ 12088 NONAME
_ZN20QGraphicsItemPrivate26childrenBoundingRectHelperEP10QTransformP6QRectFb @ 12089 NONAME
+ _ZN14QGraphicsScale13xScaleChangedEv @ 12090 NONAME
+ _ZN14QGraphicsScale13yScaleChangedEv @ 12091 NONAME
+ _ZN14QGraphicsScale13zScaleChangedEv @ 12092 NONAME
diff --git a/src/s60installs/eabi/QtNetworku.def b/src/s60installs/eabi/QtNetworku.def
index eb30832..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
@@ -1167,4 +1167,6 @@ EXPORTS
_ZN14QAuthenticator9setOptionERK7QStringRK8QVariant @ 1166 NONAME
_ZNK14QAuthenticator6optionERK7QString @ 1167 NONAME
_ZNK14QAuthenticator7optionsEv @ 1168 NONAME
+ _ZNK21QNetworkConfiguration10bearerTypeEv @ 1169 NONAME
+ _ZNK21QNetworkConfiguration14bearerTypeNameEv @ 1170 NONAME
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index 4addb84..8a8167b 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -57,8 +57,8 @@ symbian: {
bearerPluginLocation = $${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)
bearerStubZ = $${EPOCROOT}$${HW_ZDIR}$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin
BLD_INF_RULES.prj_exports += \
- "qsymbianbearer.qtplugin $$bearerStubZ" \
- "qsymbianbearer.qtplugin $${EPOCROOT}epoc32/winscw/c$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin"
+ "qsymbianbearer.qtplugin /$${HW_ZDIR}$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin" \
+ "qsymbianbearer.qtplugin /epoc32/winscw/c$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin"
} else {
pluginLocations = $$QT_BUILD_TREE/plugins/s60
bearerPluginLocation = $$QT_BUILD_TREE/plugins/bearer
diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp
index 3f08e74..1a11100 100644
--- a/src/script/api/qscriptcontext.cpp
+++ b/src/script/api/qscriptcontext.cpp
@@ -323,6 +323,9 @@ QScriptValue QScriptContext::argumentsObject() const
When a function is called as constructor, the thisObject()
contains the newly constructed object to be initialized.
+
+ \note This function is only guarenteed to work for a context
+ corresponding to native functions.
*/
bool QScriptContext::isCalledAsConstructor() const
{
@@ -413,6 +416,9 @@ void QScriptContext::setReturnValue(const QScriptValue &result)
object provides access to the local variables associated with this
context.
+ \note The activation object might not be available if there is no
+ active QScriptEngineAgent, as it might be optimized.
+
\sa argument(), argumentsObject()
*/
@@ -472,6 +478,10 @@ QScriptValue QScriptContext::activationObject() const
activation.
If \a activation is not an object, this function does nothing.
+
+ \note For a context corresponding to a JavaScript function, this is only
+ guarenteed to work if there was an QScriptEngineAgent active on the
+ engine while the function was evaluated.
*/
void QScriptContext::setActivationObject(const QScriptValue &activation)
{
diff --git a/src/script/api/qscriptcontextinfo.cpp b/src/script/api/qscriptcontextinfo.cpp
index ebb1770..a90e014 100644
--- a/src/script/api/qscriptcontextinfo.cpp
+++ b/src/script/api/qscriptcontextinfo.cpp
@@ -53,8 +53,7 @@ QT_BEGIN_NAMESPACE
current statement.
If the called function is executing Qt Script code, you can obtain
- the script location with the functions fileName(), lineNumber() and
- columnNumber().
+ the script location with the functions fileName() and lineNumber().
You can obtain the starting line number and ending line number of a
Qt Script function definition with functionStartLineNumber() and
@@ -317,13 +316,7 @@ int QScriptContextInfo::lineNumber() const
}
/*!
- Returns the column number corresponding to the statement being
- executed, or -1 if the column number is not available.
-
- The column number is only available if Qt Script code is being
- executed.
-
- \sa lineNumber(), fileName()
+ \obsolete
*/
int QScriptContextInfo::columnNumber() const
{
diff --git a/src/script/api/qscriptcontextinfo.h b/src/script/api/qscriptcontextinfo.h
index d0b3f21..64a1e15 100644
--- a/src/script/api/qscriptcontextinfo.h
+++ b/src/script/api/qscriptcontextinfo.h
@@ -69,7 +69,9 @@ public:
qint64 scriptId() const;
QString fileName() const;
int lineNumber() const;
- int columnNumber() const;
+#ifdef QT_DEPRECATED
+ QT_DEPRECATED int columnNumber() const;
+#endif
QString functionName() const;
FunctionType functionType() const;
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 26673f4..8560214 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -44,7 +44,6 @@
#include "CodeBlock.h"
#include "Error.h"
-#include "JSLock.h"
#include "Interpreter.h"
#include "PrototypeFunction.h"
@@ -152,8 +151,7 @@ QT_BEGIN_NAMESPACE
evaluation caused an exception by calling hasUncaughtException(). In
that case, you can call toString() on the error object to obtain an
error message. The current uncaught exception is also available
- through uncaughtException(). You can obtain a human-readable
- backtrace of the exception with uncaughtExceptionBacktrace().
+ through uncaughtException().
Calling clearExceptions() will cause any uncaught exceptions to be
cleared.
@@ -1003,7 +1001,6 @@ QScriptEnginePrivate::~QScriptEnginePrivate()
detachAllRegisteredScriptStrings();
qDeleteAll(m_qobjectData);
qDeleteAll(m_typeInfos);
- JSC::JSLock lock(false);
globalData->heap.destroy();
globalData->deref();
while (freeScriptValues) {
@@ -1292,7 +1289,6 @@ bool QScriptEnginePrivate::isCollecting() const
void QScriptEnginePrivate::collectGarbage()
{
- JSC::JSLock lock(false);
QScript::APIShim shim(this);
globalData->heap.collectAllGarbage();
}
@@ -1322,7 +1318,6 @@ JSC::JSValue QScriptEnginePrivate::evaluateHelper(JSC::ExecState *exec, intptr_t
bool &compile)
{
Q_Q(QScriptEngine);
- JSC::JSLock lock(false); // ### hmmm
QBoolBlocker inEvalBlocker(inEval, true);
q->currentContext()->activationObject(); //force the creation of a context for native function;
@@ -2800,8 +2795,7 @@ void QScriptEnginePrivate::popContext()
The exception state is cleared when evaluate() is called.
- \sa uncaughtException(), uncaughtExceptionLineNumber(),
- uncaughtExceptionBacktrace()
+ \sa uncaughtException(), uncaughtExceptionLineNumber()
*/
bool QScriptEngine::hasUncaughtException() const
{
@@ -2819,7 +2813,6 @@ bool QScriptEngine::hasUncaughtException() const
message.
\sa hasUncaughtException(), uncaughtExceptionLineNumber(),
- uncaughtExceptionBacktrace()
*/
QScriptValue QScriptEngine::uncaughtException() const
{
@@ -2839,7 +2832,7 @@ QScriptValue QScriptEngine::uncaughtException() const
Line numbers are 1-based, unless a different base was specified as
the second argument to evaluate().
- \sa hasUncaughtException(), uncaughtExceptionBacktrace()
+ \sa hasUncaughtException()
*/
int QScriptEngine::uncaughtExceptionLineNumber() const
{
@@ -2851,7 +2844,7 @@ int QScriptEngine::uncaughtExceptionLineNumber() const
/*!
Returns a human-readable backtrace of the last uncaught exception.
- Each line is of the form \c{<function-name>(<arguments>)@<file-name>:<line-number>}.
+ It is in the form \c{<function-name>()@<file-name>:<line-number>}.
\sa uncaughtException()
*/
diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp
index c3d1566..b1f131e 100644
--- a/src/script/api/qscriptengineagent.cpp
+++ b/src/script/api/qscriptengineagent.cpp
@@ -372,9 +372,8 @@ void QScriptEngineAgent::functionExit(qint64 scriptId,
/*!
This function is called when the engine is about to execute a new
statement in the script identified by \a scriptId. The statement
- begins on the line and column specified by \a lineNumber and \a
- columnNumber. This event is not generated for native Qt Script
- functions.
+ begins on the line and column specified by \a lineNumber
+ This event is not generated for native Qt Script functions.
Reimplement this function to handle this event. For example, a
debugger implementation could reimplement this function to provide
@@ -383,6 +382,8 @@ void QScriptEngineAgent::functionExit(qint64 scriptId,
The default implementation does nothing.
+ \note \a columnNumber is undefined
+
\sa scriptLoad(), functionEntry()
*/
void QScriptEngineAgent::positionChange(qint64 scriptId,
diff --git a/src/src.pro b/src/src.pro
index 9704716..f856a0c 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -112,6 +112,7 @@ src_webkit_declarative.target = sub-webkitdeclarative
src_declarative.depends = src_gui src_script src_network
src_plugins.depends = src_gui src_sql src_svg src_multimedia
src_s60installs.depends = $$TOOLS_SUBDIRS $$SRC_SUBDIRS
+ src_s60installs.depends -= src_s60installs
src_imports.depends = src_gui src_declarative
contains(QT_CONFIG, webkit) {
src_webkit.depends = src_gui src_sql src_network