Merge remote-tracking branch 'origin/KDE/4.7' into frameworks
Conflicts: plasma/runnermanager.cpp
This commit is contained in:
commit
3c55a5489a
@ -988,7 +988,9 @@ void ContainmentPrivate::setScreen(int newScreen, int newDesktop, bool preventIn
|
||||
//kDebug() << activity() << "setting screen to " << newScreen << newDesktop << "and type is" << type;
|
||||
|
||||
Containment *swapScreensWith(0);
|
||||
if (type == Containment::DesktopContainment || type >= Containment::CustomContainment) {
|
||||
const bool isDesktopContainment = type == Containment::DesktopContainment ||
|
||||
type == Containment::CustomContainment;
|
||||
if (isDesktopContainment) {
|
||||
// we want to listen to changes in work area if our screen changes
|
||||
if (toolBox) {
|
||||
if (screen < 0 && newScreen > -1) {
|
||||
@ -1014,8 +1016,7 @@ void ContainmentPrivate::setScreen(int newScreen, int newDesktop, bool preventIn
|
||||
}
|
||||
}
|
||||
|
||||
if (newScreen < numScreens && newScreen > -1 &&
|
||||
(type == Containment::DesktopContainment || type >= Containment::CustomContainment)) {
|
||||
if (newScreen < numScreens && newScreen > -1 && isDesktopContainment) {
|
||||
q->resize(corona->screenGeometry(newScreen).size());
|
||||
}
|
||||
|
||||
|
@ -65,10 +65,14 @@ public:
|
||||
|
||||
~ContainmentPrivate()
|
||||
{
|
||||
qDeleteAll(applets);
|
||||
// qDeleteAll is broken with Qt4.8, delete it by hand
|
||||
while (!applets.isEmpty()) {
|
||||
delete applets.first();
|
||||
}
|
||||
applets.clear();
|
||||
|
||||
qDeleteAll(dropMenus);
|
||||
dropMenus.clear();
|
||||
}
|
||||
|
||||
void createToolBox();
|
||||
|
@ -170,10 +170,11 @@ Plasma::AbstractRunner* FindMatchesJob::runner() const
|
||||
return m_runner;
|
||||
}
|
||||
|
||||
DelayedJobCleaner::DelayedJobCleaner(QSet<FindMatchesJob*> jobs, ThreadWeaver::WeaverInterface *weaver)
|
||||
: QObject(weaver),
|
||||
m_weaver(weaver),
|
||||
m_jobs(jobs)
|
||||
DelayedJobCleaner::DelayedJobCleaner(const QSet<FindMatchesJob *> &jobs, const QSet<AbstractRunner *> &runners)
|
||||
: QObject(Weaver::instance()),
|
||||
m_weaver(Weaver::instance()),
|
||||
m_jobs(jobs),
|
||||
m_runners(runners)
|
||||
{
|
||||
connect(m_weaver, SIGNAL(finished()), this, SLOT(checkIfFinished()));
|
||||
|
||||
@ -182,6 +183,11 @@ DelayedJobCleaner::DelayedJobCleaner(QSet<FindMatchesJob*> jobs, ThreadWeaver::W
|
||||
}
|
||||
}
|
||||
|
||||
DelayedJobCleaner::~DelayedJobCleaner()
|
||||
{
|
||||
qDeleteAll(m_runners);
|
||||
}
|
||||
|
||||
void DelayedJobCleaner::jobDone(ThreadWeaver::Job *job)
|
||||
{
|
||||
FindMatchesJob *runJob = dynamic_cast<FindMatchesJob *>(job);
|
||||
|
@ -126,16 +126,17 @@ private:
|
||||
class DelayedJobCleaner : public QObject
|
||||
{
|
||||
public:
|
||||
DelayedJobCleaner(QSet<FindMatchesJob*> jobs, ThreadWeaver::WeaverInterface *weaver);
|
||||
DelayedJobCleaner(const QSet<FindMatchesJob*> &jobs, const QSet<AbstractRunner *> &runners = QSet<AbstractRunner *>());
|
||||
~DelayedJobCleaner();
|
||||
|
||||
private Q_SLOTS:
|
||||
void jobDone(ThreadWeaver::Job*);
|
||||
void checkIfFinished();
|
||||
//connect(ThreadWeaver::instance(), SIGNAL(finished()), this, SLOT(checkIfFinished()));
|
||||
|
||||
private:
|
||||
ThreadWeaver::WeaverInterface *m_weaver;
|
||||
QSet<FindMatchesJob*> m_jobs;
|
||||
QSet<AbstractRunner *> m_runners;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ public:
|
||||
KPluginInfo::List offers = RunnerManager::listRunnerInfo();
|
||||
|
||||
const bool loadAll = config.readEntry("loadAll", false);
|
||||
QStringList whiteList = config.readEntry("pluginWhiteList", QStringList());
|
||||
const QStringList whiteList = config.readEntry("pluginWhiteList", QStringList());
|
||||
const bool noWhiteList = whiteList.isEmpty();
|
||||
KConfigGroup pluginConf;
|
||||
if (conf.isValid()) {
|
||||
@ -188,6 +188,7 @@ public:
|
||||
|
||||
advertiseSingleRunnerIds.clear();
|
||||
|
||||
QSet<AbstractRunner *> deadRunners;
|
||||
QMutableListIterator<KPluginInfo> it(offers);
|
||||
while (it.hasNext()) {
|
||||
KPluginInfo &description = it.next();
|
||||
@ -203,8 +204,7 @@ public:
|
||||
description.load(pluginConf);
|
||||
|
||||
const bool loaded = runners.contains(runnerName);
|
||||
const bool selected = loadAll ||
|
||||
(description.isPluginEnabled() && (noWhiteList || whiteList.contains(runnerName)));
|
||||
const bool selected = loadAll || (description.isPluginEnabled() && (noWhiteList || whiteList.contains(runnerName)));
|
||||
|
||||
const bool singleQueryModeEnabled = description.property("X-Plasma-AdvertiseSingleRunnerQueryMode").toBool();
|
||||
|
||||
@ -223,11 +223,35 @@ public:
|
||||
}
|
||||
} else if (loaded) {
|
||||
//Remove runner
|
||||
AbstractRunner *runner = runners.take(runnerName);
|
||||
deadRunners.insert(runners.take(runnerName));
|
||||
#ifndef NDEBUG
|
||||
kDebug() << "Removing runner: " << runnerName;
|
||||
#endif
|
||||
delete runner;
|
||||
}
|
||||
}
|
||||
|
||||
if (!deadRunners.isEmpty()) {
|
||||
QSet<FindMatchesJob *> deadJobs;
|
||||
foreach (FindMatchesJob *job, searchJobs) {
|
||||
if (deadRunners.contains(job->runner())) {
|
||||
QObject::disconnect(job, SIGNAL(done(ThreadWeaver::Job*)), q, SLOT(jobDone(ThreadWeaver::Job*)));
|
||||
searchJobs.remove(job);
|
||||
deadJobs.insert(job);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (FindMatchesJob *job, oldSearchJobs) {
|
||||
if (deadRunners.contains(job->runner())) {
|
||||
oldSearchJobs.remove(job);
|
||||
deadJobs.insert(job);
|
||||
}
|
||||
}
|
||||
|
||||
if (deadJobs.isEmpty()) {
|
||||
qDeleteAll(deadRunners);
|
||||
} else {
|
||||
new DelayedJobCleaner(deadJobs, deadRunners);
|
||||
>>>>>>> origin/KDE/4.7
|
||||
}
|
||||
}
|
||||
|
||||
@ -437,7 +461,7 @@ RunnerManager::RunnerManager(KConfigGroup &c, QObject *parent)
|
||||
RunnerManager::~RunnerManager()
|
||||
{
|
||||
if (!qApp->closingDown() && (!d->searchJobs.isEmpty() || !d->oldSearchJobs.isEmpty())) {
|
||||
new DelayedJobCleaner(d->searchJobs + d->oldSearchJobs, Weaver::instance());
|
||||
new DelayedJobCleaner(d->searchJobs + d->oldSearchJobs);
|
||||
}
|
||||
|
||||
delete d;
|
||||
@ -451,11 +475,13 @@ void RunnerManager::reloadConfiguration()
|
||||
|
||||
void RunnerManager::setAllowedRunners(const QStringList &runners)
|
||||
{
|
||||
qDeleteAll(d->runners);
|
||||
d->runners.clear();
|
||||
|
||||
KConfigGroup config = d->configGroup();
|
||||
config.writeEntry("pluginWhiteList", runners);
|
||||
|
||||
if (!d->runners.isEmpty()) {
|
||||
// this has been called with runners already created. so let's do an instant reload
|
||||
d->loadRunners();
|
||||
}
|
||||
}
|
||||
|
||||
QStringList RunnerManager::allowedRunners() const
|
||||
|
Loading…
Reference in New Issue
Block a user