summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/qlibrary.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-08-27 00:00:10 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-08-27 00:00:10 (GMT)
commit5e28455598096b8c1e3b07498a40909a3aebf9fd (patch)
treee69791316d02fbac8bfbd0a98667122c2139502a /src/corelib/plugin/qlibrary.cpp
parenta5ac66200f77fd09d4c4ee5af3a9380efce871ad (diff)
parent3db2df0a33952223ef0e1a087329ada7f2b2d3ea (diff)
downloadQt-5e28455598096b8c1e3b07498a40909a3aebf9fd.zip
Qt-5e28455598096b8c1e3b07498a40909a3aebf9fd.tar.gz
Qt-5e28455598096b8c1e3b07498a40909a3aebf9fd.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (374 commits) Add a test for the QPen::brush() != Qt::NoBrush for a Qt::NoPen pen. Calling QPen::brush() on a Qt::NoPen pen, should return QBrush::NoBrush. use QFile:map instead of ::mmap Do not use global static const references to objects Revert "Refactor blend_transformed_bilinear to simplify the blend type checking" Don't rely on mapFromGlobal in QGraphicsScenePrivate::itemsAtPosition. Refactor blend_transformed_bilinear to simplify the blend type checking Note RTL behavior changes in docs and changelog Implement qt_memfill32 with Neon. Implement the composition mode Plus with Neon. Fix the broken unicode detection of ODBC driver. Doc: Fixed qdoc warnings. Doc: updating getting started docs - not finished Make it possible again to build Qt without webkit Doc: fixing creator bugs, removing menus and textbox in the header Fixing qdoc index file...Commit hack to work around the massive amounts of dependencies in the upstream branch. Doc: Fixing overlapping text in header list Use Ctrl rather than Alt for switching tabs in the demo browser Doc: add link to new gettings started to index.html Doc: Fixing bug involving header misplacement in Creator style ...
Diffstat (limited to 'src/corelib/plugin/qlibrary.cpp')
-rw-r--r--src/corelib/plugin/qlibrary.cpp48
1 files changed, 5 insertions, 43 deletions
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index a9ae2ab..1874a9e 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -295,14 +295,6 @@ static bool qt_parse_pattern(const char *s, uint *version, bool *debug, QByteArr
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN) && !defined(QT_NO_PLUGIN_CHECK)
-#if defined(Q_OS_FREEBSD) || defined(Q_OS_LINUX)
-# define USE_MMAP
-QT_BEGIN_INCLUDE_NAMESPACE
-# include <sys/types.h>
-# include <sys/mman.h>
-QT_END_INCLUDE_NAMESPACE
-#endif // Q_OS_FREEBSD || Q_OS_LINUX
-
static long qt_find_pattern(const char *s, ulong s_len,
const char *pattern, ulong p_len)
{
@@ -363,34 +355,15 @@ static bool qt_unix_query(const QString &library, uint *version, bool *debug, QB
}
QByteArray data;
- char *filedata = 0;
- ulong fdlen = 0;
-
-# ifdef USE_MMAP
- char *mapaddr = 0;
- size_t maplen = file.size();
- mapaddr = (char *) mmap(mapaddr, maplen, PROT_READ, MAP_PRIVATE, file.handle(), 0);
- if (mapaddr != MAP_FAILED) {
- // mmap succeeded
- filedata = mapaddr;
- fdlen = maplen;
- } else {
- // mmap failed
- if (qt_debug_component()) {
- qWarning("mmap: %s", qPrintable(qt_error_string(errno)));
- }
- if (lib)
- lib->errorString = QLibrary::tr("Could not mmap '%1': %2")
- .arg(library)
- .arg(qt_error_string());
-# endif // USE_MMAP
+ const char *filedata = 0;
+ ulong fdlen = file.size();
+ filedata = (char *) file.map(0, fdlen);
+ if (filedata == 0) {
// try reading the data into memory instead
data = file.readAll();
- filedata = data.data();
+ filedata = data.constData();
fdlen = data.size();
-# ifdef USE_MMAP
}
-# endif // USE_MMAP
// verify that the pattern is present in the plugin
const char pattern[] = "pattern=QT_PLUGIN_VERIFICATION_DATA";
@@ -403,17 +376,6 @@ static bool qt_unix_query(const QString &library, uint *version, bool *debug, QB
if (!ret && lib)
lib->errorString = QLibrary::tr("Plugin verification data mismatch in '%1'").arg(library);
-# ifdef USE_MMAP
- if (mapaddr != MAP_FAILED && munmap(mapaddr, maplen) != 0) {
- if (qt_debug_component())
- qWarning("munmap: %s", qPrintable(qt_error_string(errno)));
- if (lib)
- lib->errorString = QLibrary::tr("Could not unmap '%1': %2")
- .arg(library)
- .arg( qt_error_string() );
- }
-# endif // USE_MMAP
-
file.close();
return ret;
}