[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/plasma
From: Aaron J. Seigo <aseigo () kde ! org>
Date: 2011-01-26 20:08:35
Message-ID: 20110126200835.65234AC8BA () svn ! kde ! org
[Download RAW message or body]
SVN commit 1217338 by aseigo:
see if a wallpaper plugin can handle (import, display, etc) a given mimetype; this \
may be different from the drop types supported!
M +6 -0 wallpaper.cpp
M +9 -0 wallpaper.h
--- trunk/KDE/kdelibs/plasma/wallpaper.cpp #1217337:1217338
@@ -176,6 +176,12 @@
return KPluginInfo::fromServices(offers);
}
+bool Wallpaper::supportsMimetype(const QString &mimetype) const
+{
+ return d->wallpaperDescription.isValid() &&
+ d->wallpaperDescription.service()->hasMimeType(mimetype);
+}
+
Wallpaper *Wallpaper::load(const QString &wallpaperName, const QVariantList &args)
{
if (wallpaperName.isEmpty()) {
--- trunk/KDE/kdelibs/plasma/wallpaper.h #1217337:1217338
@@ -21,6 +21,7 @@
#ifndef PLASMA_WALLPAPER_H
#define PLASMA_WALLPAPER_H
+#include <kmimetype.h>
#include <kplugininfo.h>
#include <plasma/plasma.h>
@@ -177,6 +178,14 @@
*/
KServiceAction renderingMode() const;
+ /**
+ * @return true if the mimetype is supported by this wallpaper and
+ * can be used in renderering. Uses the MimeType= entry from
+ * the .desktop file, and can include mimetypes that may not be
+ * suitable for drag-and-drop purposes.
+ * @since 4.7
+ */
+ bool supportsMimetype(const QString &mimetype) const;
/**
* Sets the rendering mode for this wallpaper.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic