summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/qfactoryloader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QPluginLoader: add 'staticPlugins' functionRichard Moe Gustavsen2013-09-041-8/+4
| | | | | | | | | | | | | | | | | | Currently there is no API to extract the meta data from static plugins. This is needed in e.g QtDeclarative for loading static module plugins. This patch moves the 'staticPlugins' function from QLibraryPrivate into QPluginLoader, and makes it public. As such, we now also export QStaticPlugin. Since an application developer cannot do much with raw metadata, we add a new function QStaticPlugin::metaData() that returns the QJsonObject for the plugin. The old metaData function is renamed 'rawMetaData'. Change-Id: Idb0bf9ad8ebb13340565512e1998b26e762a357e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix warning about using QString's const char* constructor on MacThiago Macieira2013-07-201-1/+2
| | | | | Change-Id: I20ca50fdcdcfb075ad317247f147e4eb007a0c44 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-06-201-10/+9
|\ | | | | | | Change-Id: I94bb158562ae6b80a87b40139d7302ea7b9b9aa8
| * QFactoryLoader: Release unused libraries.Friedemann Kleint2013-06-181-1/+6
| | | | | | | | | | | | | | Task-number: QTBUG-31476 Change-Id: Ib2eb076afaa21ab1fdc12944f80483e3de260d4b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Remove unused member QFactoryLoaderPrivate::keyList.Friedemann Kleint2013-06-181-9/+3
| | | | | | | | | | | | | | Task-number: QTBUG-31476 Change-Id: Ife9b25ede67837152d94cd500a1d7c6dc6cd8ab8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Print directories for QT_DEBUG_PLUGINSKai Koehne2013-06-051-0/+4
|/ | | | | | | | So far we stayed completely silent if the user forgot to deploy all plugins, or deployed them in the wrong way. Change-Id: Idd776c4b4a2ddffd5da08985e5925248c97e0270 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Improve Cocoa platform plugin loading.Morten Johan Sorvig2012-12-121-0/+21
| | | | | | | | | | | | | | | | | | | Loading both the debug and release version of the cocoa plugins causes the objective-c runtime to print "duplicate class definitions" warnings. Fix this by directing the plugin loader to only load one of the cocoa plugins if both are available. Implement this as a special case directly in QFactoryLoader. Define QT_NO_DEBUG_PLUGIN_CHECK to allow mixing debug and release builds. Task-number: QTBUG-28155 Change-Id: Ie1927b219cc501a821f91b7e4b56f0589e0acbf5 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Fix static plugin loading.Thiago Macieira2012-07-121-4/+11
| | | | | | | | | | | | The QFactoryLoader::indexOf and keyMap functions expect to receive the metadata that contains a "MetaData" entry, instead of the entry itself. Also, QFactoryLoader::metaData() skips static plugins with the wrong IID, so we need to skip it too in QFactoryLoader::instance(). Change-Id: I8a453087feb88d0e8d1021054353f3600d5100a5 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Remove support for Qt 4 style pluginsLars Knoll2012-06-061-120/+16
| | | | | | | | | | The new plugin format allows us to avoid loading the plugins in all cases. Remove the old format, as we could get bad behavior with the old format if Qt would try to dlopen a Qt 4.x plugin. Change-Id: I2193e6874d6cca3c0b12298c2b9beb4105a42fd5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Populate MetaData:Keys for compat pluginsKent Hansen2012-05-241-1/+5
| | | | | | | | | | QFactoryLoader::indexOf() expects the meta-data to contain a Keys entry, if there were any keys. For compat plugins, the result of the plugin's keys() function should be stored here. Change-Id: Ifd04f90cbfce2598d71548c469baa55ca6b0b338 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QFactoryLoader: Add API for supporting the metadata containing keys.Friedemann Kleint2012-05-071-0/+33
| | | | | | | | | | | - Add a method returning a QMultiMap<int index, QString key> to QFactoryLoader, determined from metadata(), correctly reflecting the data structure ('Keys' being a list) - Add convenience templates to create plugins via factory interfaces Change-Id: I247749aa3245f635e476605db1c4cd9c74b74dea Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Allow loading of static plugins by indexLars Knoll2012-05-011-10/+19
| | | | | | | | | | Static plugins could so far not get loaded by index. Implement the missing support for this. Task-number: QTBUG-25274 Change-Id: I901b08bfaf4f9fc3cb9fcea0b47f3ed89588a27b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix a crash in QFactoryLoaderJonas Rabbe2012-03-291-1/+2
| | | | | | | | | | | | | | The change in plugin loading has meant that different plugins in the same plugin folder will not be handled properly when loaded with different instances of QFactoryLoader. A solution is to only unload compatability plugins from QFactoryLoader::update() since they are the only plugins that are actually loaded in that method. This auto test shows the error on the current version of QFactoryLoader and passes with the fix described above. Change-Id: I12001525d51bb631d6742c5965357598322f247c Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Don't reject plugins that have empty meta-dataLincoln Ramsay2012-03-171-2/+1
| | | | | | | | | Having an empty Json object ({}) should be valid meta-data but this check means that there needs to be at least one key-value pair or the plugin will be rejected. Change-Id: I578ccc35016af16fd30b3807e796fa63c0282f30 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Support new-style plugins without a "Keys" json propertyAlex Wilson2012-03-061-1/+12
| | | | | | | | | As per discussion with Lars, intent here was to allow plugins without a "Keys" property to still function correctly, but this particular if statement was blocking any such plugins from being detected. Change-Id: Icb343ca8bd95a508d62565cd816fe2a57a4f82bd Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Plugin loader: Output offending plugin name in warning.Friedemann Kleint2012-02-171-1/+2
| | | | | Change-Id: I0aba0cf04f703b893459af55263685c5548a92f9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Static plugins don't break QFactoryLoader::keys()Lincoln Ramsay2012-02-171-1/+1
| | | | | | | | | | | The = means that a single, static, compat plugin replaces the list of keys (eg. from previously checked static plugins or from dynamic plugins). Using += prevents this undesirable behaviour. Change-Id: I3a40752c08dddbfe81444ca9c782b633e9742ab9 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Implement new plugin mechanismLars Knoll2012-02-151-30/+127
| | | | | | | | | | | | | | moc can now embed meta information about the plugin inside the plugin itself. This information can be queried by Qt without having to load the plugin. Source compatibility with the old plugin loading mechanism is still there, but will be removed before Qt 5.0. Change-Id: I03e4196ddfed07d0fe94acca40d5de8a6ce7f920 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* fix memory leak of QLibraryPrivatejian liang2012-02-071-5/+14
| | | | | | | | | | | | this commit is aimed to fix QTBUG-4341. now QFactoryLoaderPrivate's destructor will call unload() to QLibaryPrivate object which will destory the plugin's root instance if its refcount reach zero. Task-number: QTBUG-4341 Change-Id: I3cd3e071b34271bf5802ab09f6c125beda5e9844 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* corelib: Remove Q_WS-macros.Friedemann Kleint2011-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | Q_WS_QPA is the only active code path after merging refactor, other Q_WS-macros are no longer used. Enable compilation without -qpa. - Remove Q_OS_MSDOS, Q_OS_OS2 - Remove Q_WS_QWS - Remove/replace definitions/conditionals of Q_WS_XX - Remove qpa branches from profiles - Replace Q_WS_MAC by Q_OS_MAC - Replace Q_WS_MAC && !Q_WS_QPA by Q_OS_MAC && !QT_NO_CORESERVICES - Similarly in profiles: mac:contains(QT_CONFIG, coreservices) - Replace Q_FS_FAT by Q_OS_WIN Change-Id: Icce5a6c55b052c8f72b3b979ddf31a4f388ea9c9 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Don't use QSettings to "cache" plugin informationBradley T. Hughes2011-09-051-39/+18
| | | | | | | | | | | | | | | | | | | | The main rationale of the cache was to examine the plugin's build-key before loading it. Now that the build-key has been removed, the cache has lost its usefulness. This is part of a larger push to not use QSettings for Qt specific settings or caches. See also: http://lists.qt.nokia.com/pipermail/qt5-feedback/2011-August/000892.html http://lists.qt.nokia.com/pipermail/qt5-feedback/2011-August/000960.html http://lists.qt.nokia.com/pipermail/qt5-feedback/2011-August/000907.html http://lists.qt.nokia.com/pipermail/qt5-feedback/2011-August/000904.html Change-Id: I96e84aa25983c8e06e027ff70cef109444c362a2 Reviewed-on: http://codereview.qt.nokia.com/3978 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+269
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12