#include "backgroundlistmodel.h"
#include "backgrounddelegate.h"
-#if defined(HAVE_KWORKSPACE)
-# include "ksmserver_interface.h"
-#endif
-
K_EXPORT_PLASMA_WALLPAPER(virus, Virus)
Virus::Virus(QObject *parent, const QVariantList &args)
: Plasma::Wallpaper(parent, args),
m_configWidget(0),
m_model(0),
- m_dialog(0),
- m_startupResumed(false)
+ m_dialog(0)
{
connect(this, SIGNAL(renderCompleted(QImage)), this, SLOT(updateBackground(QImage)));
connect(&alife, SIGNAL(finished()), this, SLOT(virusUpdated()));
}
render(m_img, m_size, m_resizeMethod, m_color);
- suspendStartup(true); // during KDE startup, make ksmserver until the wallpaper is ready
}
QString Virus::cacheId() const
emit update(boundingRect());
}
-void Virus::suspendStartup(bool suspend)
-{
-#if defined(HAVE_KWORKSPACE)
- if (m_startupResumed) {
- return;
- }
-
- org::kde::KSMServerInterface ksmserver("org.kde.ksmserver", "/KSMServer", QDBusConnection::sessionBus());
- const QString startupID("desktop wallpaper");
- if (suspend) {
- ksmserver.suspendStartup(startupID);
- } else {
- m_startupResumed = true;
- ksmserver.resumeStartup(startupID);
- }
-#else
- Q_UNUSED(suspend);
-#endif // HAVE_KWORKSPACE
-}
-
void Virus::updateScreenshot(QPersistentModelIndex index)
{
m_uiVirus.m_view->update(index);
void fillMetaInfo(Plasma::Package *b);
bool setMetadata(QLabel *label, const QString &text);
void renderWallpaper(const QString& image = QString());
- void suspendStartup(bool suspend); // for ksmserver
void calculateGeometry();
void setSingleImage();
QString cacheId() const;
QSize m_size;
QString m_img;
QDateTime m_previousModified;
- bool m_startupResumed;
QTimer m_timer;