equal
deleted
inserted
replaced
37 ** |
37 ** |
38 ** $QT_END_LICENSE$ |
38 ** $QT_END_LICENSE$ |
39 ** |
39 ** |
40 ****************************************************************************/ |
40 ****************************************************************************/ |
41 |
41 |
42 #include <qmediapluginloader_p.h> |
42 #include "qmediapluginloader_p.h" |
43 #include <QtCore/qcoreapplication.h> |
43 #include <QtCore/qcoreapplication.h> |
44 #include <QtCore/qpluginloader.h> |
44 #include <QtCore/qpluginloader.h> |
45 #include <QtCore/qdir.h> |
45 #include <QtCore/qdir.h> |
46 #include <QtCore/qdebug.h> |
46 #include <QtCore/qdebug.h> |
47 |
47 |
48 #include <qmediaserviceproviderplugin.h> |
48 #include "qmediaserviceproviderplugin.h" |
49 |
49 |
50 QTM_BEGIN_NAMESPACE |
50 QTM_BEGIN_NAMESPACE |
51 |
51 |
52 |
52 |
53 typedef QMap<QString,QObjectList> ObjectListMap; |
53 typedef QMap<QString,QObjectList> ObjectListMap; |
85 { |
85 { |
86 if (!m_instances.isEmpty()) |
86 if (!m_instances.isEmpty()) |
87 return; |
87 return; |
88 |
88 |
89 if (staticMediaPlugins() && staticMediaPlugins()->contains(m_location)) { |
89 if (staticMediaPlugins() && staticMediaPlugins()->contains(m_location)) { |
90 qWarning() << "Load static plugins for" << m_location; |
|
91 foreach(QObject *o, staticMediaPlugins()->value(m_location)) { |
90 foreach(QObject *o, staticMediaPlugins()->value(m_location)) { |
92 if (o != 0 && o->qt_metacast(m_iid) != 0) { |
91 if (o != 0 && o->qt_metacast(m_iid) != 0) { |
93 QFactoryInterface* p = qobject_cast<QFactoryInterface*>(o); |
92 QFactoryInterface* p = qobject_cast<QFactoryInterface*>(o); |
94 if (p != 0) { |
93 if (p != 0) { |
95 foreach (QString const &key, p->keys()) |
94 foreach (QString const &key, p->keys()) |
97 } |
96 } |
98 } |
97 } |
99 } |
98 } |
100 } else { |
99 } else { |
101 QStringList paths = QCoreApplication::libraryPaths(); |
100 QStringList paths = QCoreApplication::libraryPaths(); |
|
101 |
|
102 #ifdef QTM_PLUGIN_PATH |
|
103 paths << QTM_PLUGIN_PATH; |
|
104 #endif |
102 |
105 |
103 foreach (QString const &path, paths) { |
106 foreach (QString const &path, paths) { |
104 QString pluginPathName(path + m_location); |
107 QString pluginPathName(path + m_location); |
105 QDir pluginDir(pluginPathName); |
108 QDir pluginDir(pluginPathName); |
106 |
109 |