54 #include "private/qobject_p.h" 55 #include "private/qcoreapplication_p.h" 57 #include "private/qcore_symbian_p.h" 58 #include "private/qfilesystemwatcher_symbian_p.h" 68 class QSymbianSystemPluginWatcher :
public QSymbianFileSystemWatcherInterface
71 QSymbianSystemPluginWatcher();
72 ~QSymbianSystemPluginWatcher();
74 void watchForUpdates();
75 void handlePathChanged(QNotifyChangeEvent *e);
81 Q_GLOBAL_STATIC(QSymbianSystemPluginWatcher, qt_symbian_system_plugin_watcher)
99 void unloadPath(
const QString &path);
104 for (
int i = 0; i < libraryList.count(); ++i)
105 libraryList.at(i)->release();
122 qt_factory_loaders()->append(
this);
125 qt_symbian_system_plugin_watcher();
133 QString path = pluginDir +
d->suffix;
139 for (
int j = 0; j < plugins.
count(); ++j) {
143 qDebug() <<
"QFactoryLoader::QFactoryLoader() looking at" <<
fileName;
146 if (!library->
isPlugin(&settings)) {
149 qDebug() <<
" not a plugin";
168 qDebug() <<
" could not load";
180 if (instance && factory && instance->qt_metacast(
d->iid))
181 keys = factory->
keys();
199 for (
int k = 0; k < keys.
count(); ++k) {
210 d->keyList += keys.
at(k);
227 for (
int i = 0; i < paths.
count(); ++i) {
230 if (
d->loadedPaths.contains(pluginDir))
232 d->loadedPaths << pluginDir;
238 qDebug() <<
"QFactoryLoader::QFactoryLoader() ignoring" <<
d->iid
239 <<
"since plugins are disabled in static builds";
247 qt_factory_loaders()->removeAll(
this);
256 for (
int i = 0; i < instances.
count(); ++i)
258 if (instances.
at(i)->qt_metacast(
d->iid))
259 keys += factory->keys();
268 for (
int i = 0; i < instances.
count(); ++i)
271 return instances.
at(i);
277 if (obj && !obj->parent())
290 return d->keyMap.value(
d->cs ? key : key.
toLower());
305 QSymbianSystemPluginWatcher::QSymbianSystemPluginWatcher()
307 qt_s60GetRFs().DriveList(drives);
311 QSymbianSystemPluginWatcher::~QSymbianSystemPluginWatcher()
316 void QSymbianSystemPluginWatcher::watchForUpdates()
324 RFs& fs = qt_s60GetRFs();
325 for (
int i=0; i<KMaxDrives; i++) {
326 int attr = drives[i];
327 if ((attr & KDriveAttLocal) && !(attr & KDriveAttRom)) {
330 fs.DriveToChar(i, driveLetter);
331 installPathPlugins[0] = driveLetter;
332 TPtrC
ptr(qt_QString2TPtrC(installPathPlugins));
333 QNotifyChangeEvent *
event =
q_check_ptr(
new QNotifyChangeEvent(fs, ptr,
this,
true));
334 watchers.push_back(
event);
339 void QSymbianSystemPluginWatcher::handlePathChanged(QNotifyChangeEvent *e)
341 QCoreApplicationPrivate::rebuildInstallLibraryPaths();
348 (*it)->updateDir(dirName, settings);
356 #endif // QT_NO_LIBRARY The QDir class provides access to directory structures and their contents.
bool isPlugin(QSettings *settings=0)
void setValue(const QString &key, const QVariant &value)
Sets the value of setting key to value.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
Returns the value for setting key.
QFactoryLoader(const char *iid, const QString &suffix=QString(), Qt::CaseSensitivity=Qt::CaseSensitive)
#define QT_END_NAMESPACE
This macro expands to.
The QMutex class provides access serialization between threads.
const QChar at(int i) const
Returns the character at the given index position in the string.
#define it(className, varName)
The QSettings class provides persistent platform-independent application settings.
static QLibraryPrivate * findOrCreate(const QString &fileName, const QString &version=QString())
The QByteArray class provides an array of bytes.
QString & prepend(QChar c)
QtPluginInstanceFunction instance
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
The QString class provides a Unicode character string.
T * qobject_cast(QObject *object)
The QObject class is the base class of all Qt objects.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
static QObjectList staticInstances()
Returns a list of static plugin instances (root components) held by the plugin loader.
The QChar class provides a 16-bit Unicode character.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
QMap< QString, QLibraryPrivate * > keyMap
Q_CORE_EXPORT void qDebug(const char *,...)
QStringList toStringList() const
Returns the variant as a QStringList if the variant has type() StringList, String ...
#define QT_BEGIN_NAMESPACE
This macro expands to.
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
const T & at(int i) const
Returns the item at index position i in the list.
void updateDir(const QString &pluginDir, QSettings &settings)
The QStringList class provides a list of strings.
void removeFirst()
Removes the first item in the list.
void moveToThread(QThread *thread)
Changes the thread affinity for this object and its children.
const T * ptr(const T &t)
void clear()
Removes all items from the list.
static QString cleanPath(const QString &path)
Removes all multiple directory separators "/" and resolves any "."s or ".."s found in the path...
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
#define Q_DECLARE_PUBLIC(Class)
virtual QStringList keys() const =0
static QThread * mainThread()
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
static QStringList libraryPaths()
Returns a list of paths that the application will search when dynamically loading libraries...
QObject * instance(const QString &key) const
static QString location(LibraryLocation)
Returns the location specified by loc.
QString toLower() const Q_REQUIRED_RESULT
Returns a lowercase copy of the string.
The QFileInfo class provides system-independent file information.
QList< QLibraryPrivate * > libraryList
static QString toNativeSeparators(const QString &pathName)
Returns pathName with the '/' separators converted to separators that are appropriate for the underly...
QLibraryPrivate * library(const QString &key) const
static QString fileName(const QString &fileUrl)
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
QStringList entryList(Filters filters=NoFilter, SortFlags sort=NoSort) const
Returns a list of the names of all the files and directories in the directory, ordered according to t...
#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS)
Declares a global static variable with the specified type and name.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
bool qt_debug_component()
The QList class is a template class that provides lists.
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
#define QT_VERSION
This macro expands a numeric value of the form 0xMMNNPP (MM = major, NN = minor, PP = patch) that spe...