diff options
author | Lorn Potter <lorn.potter@nokia.com> | 2010-03-07 19:06:05 (GMT) |
---|---|---|
committer | Lorn Potter <lorn.potter@nokia.com> | 2010-03-07 19:06:05 (GMT) |
commit | 987ffcbad3337fd343febb305911298a37ed9b7e (patch) | |
tree | 3665886405a5bc5300ef8a1c0522780639f29843 /src/gui/kernel/qmime_win.cpp | |
parent | 4e605d83b5966b08a82eb54e733c2f37bca6b5d6 (diff) | |
parent | 987458462994497f764baf253baca0faabdb63cc (diff) | |
download | Qt-987ffcbad3337fd343febb305911298a37ed9b7e.zip Qt-987ffcbad3337fd343febb305911298a37ed9b7e.tar.gz Qt-987ffcbad3337fd343febb305911298a37ed9b7e.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'src/gui/kernel/qmime_win.cpp')
-rw-r--r-- | src/gui/kernel/qmime_win.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/kernel/qmime_win.cpp b/src/gui/kernel/qmime_win.cpp index e191d7b..39633bf 100644 --- a/src/gui/kernel/qmime_win.cpp +++ b/src/gui/kernel/qmime_win.cpp @@ -640,14 +640,18 @@ bool QWindowsMimeURI::convertFromMime(const FORMATETC &formatetc, const QMimeDat } else if (getCf(formatetc) == CF_INETURL_W) { QList<QUrl> urls = mimeData->urls(); QByteArray result; - QString url = urls.at(0).toString(); - result = QByteArray((const char *)url.utf16(), url.length() * sizeof(ushort)); + if (!urls.isEmpty()) { + QString url = urls.at(0).toString(); + result = QByteArray((const char *)url.utf16(), url.length() * sizeof(ushort)); + } result.append('\0'); result.append('\0'); return setData(result, pmedium); } else if (getCf(formatetc) == CF_INETURL) { QList<QUrl> urls = mimeData->urls(); - QByteArray result = urls.at(0).toString().toLocal8Bit(); + QByteArray result; + if (!urls.isEmpty()) + result = urls.at(0).toString().toLocal8Bit(); return setData(result, pmedium); } } |