~ximilian/igotu2gpx/bugfixing

« back to all changes in this revision

Viewing changes to src/lib/igotu/pluginloader.cpp

  • Committer: Michael Hofmann
  • Date: 2011-05-28 20:26:13 UTC
  • Revision ID: mh21@piware.de-20110528202613-1jyl7s707nwv97ja
Cleanups.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
#include "paths.h"
20
20
#include "pluginloader.h"
21
 
#include "threadutils.h"
22
21
 
23
22
#include <QDir>
24
23
#include <QMap>
25
24
#include <QMutex>
26
25
#include <QPluginLoader>
 
26
#include <QThread>
27
27
 
28
28
namespace igotu
29
29
{
39
39
    QString pluginPath(const QObject *object);
40
40
    QMap<QString, QString> pluginsWithErrors();
41
41
 
42
 
    void reloadPlugins();
 
42
    void loadRemainingPlugins();
 
43
    void reloadAllPlugins();
43
44
 
44
45
Q_SIGNALS:
45
46
    void pluginsLoaded();
79
80
    PluginLoaderPrivate();
80
81
    ~PluginLoaderPrivate();
81
82
 
82
 
    EventThread thread;
 
83
    QThread thread;
83
84
    PluginLoaderWorker worker;
84
85
};
85
86
 
132
133
    return errors;
133
134
}
134
135
 
135
 
void PluginLoaderWorker::reloadPlugins()
 
136
void PluginLoaderWorker::reloadAllPlugins()
136
137
{
137
138
    QMutexLocker locker(&lock);
138
139
 
139
140
    initializeLoading();
140
 
    emit dispatchBackgroundInitialization();
 
141
    Q_EMIT dispatchBackgroundInitialization();
 
142
}
 
143
 
 
144
void PluginLoaderWorker::loadRemainingPlugins()
 
145
{
 
146
    Q_EMIT dispatchBackgroundInitialization();
141
147
}
142
148
 
143
149
void PluginLoaderWorker::backgroundInitialization()
187
193
    while (fileNames.isEmpty()) {
188
194
        if (pluginDirectories.isEmpty()) {
189
195
            allPluginsLoaded = true;
190
 
            emit pluginsLoaded();
 
196
            Q_EMIT pluginsLoaded();
191
197
            return false;
192
198
        }
193
199
        dir = QDir(pluginDirectories.takeFirst());
254
260
    return pluginLoaderPrivate()->worker.pluginsWithErrors();
255
261
}
256
262
 
257
 
void PluginLoader::reloadPlugins()
258
 
{
259
 
    return pluginLoaderPrivate()->worker.reloadPlugins();
 
263
void PluginLoader::reloadAllPlugins()
 
264
{
 
265
    return pluginLoaderPrivate()->worker.reloadAllPlugins();
 
266
}
 
267
 
 
268
void PluginLoader::loadRemainingPlugins()
 
269
{
 
270
    return pluginLoaderPrivate()->worker.loadRemainingPlugins();
260
271
}
261
272
 
262
273
} // namespace igotu