Port the last uses of KMimeType. Only plasma/package.cpp is left...
This commit is contained in:
parent
8f02ed76a1
commit
a2b502dbf4
@ -291,7 +291,7 @@ target_link_libraries(plasma ${KDEPIMLIBS_GPGMEPP_LIBS} karchive)
|
|||||||
|
|
||||||
target_link_libraries(plasmaqgv plasma ${QT_QTUITOOLS_LIBRARY} ${QT_QTWEBKIT_LIBRARY}
|
target_link_libraries(plasmaqgv plasma ${QT_QTUITOOLS_LIBRARY} ${QT_QTWEBKIT_LIBRARY}
|
||||||
${QT_QTSCRIPT_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY}
|
${QT_QTSCRIPT_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY}
|
||||||
${KDE4_KDEUI_LIBS} kdeclarative ${PLASMA_EXTRA_LIBS} kcoreaddons)
|
${KDE4_KDEUI_LIBS} kdeclarative ${PLASMA_EXTRA_LIBS} kcoreaddons ${QtMimeTypes_LIBRARY})
|
||||||
|
|
||||||
if(QCA2_FOUND)
|
if(QCA2_FOUND)
|
||||||
target_link_libraries(plasma ${QCA2_LIBRARIES})
|
target_link_libraries(plasma ${QCA2_LIBRARIES})
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
#include <kcoreauthorized.h>
|
#include <kcoreauthorized.h>
|
||||||
#include <kmenu.h>
|
#include <kmenu.h>
|
||||||
#include <kmessagebox.h>
|
#include <kmessagebox.h>
|
||||||
#include <kmimetype.h>
|
#include <qmimedatabase.h>
|
||||||
#include <kservicetypetrader.h>
|
#include <kservicetypetrader.h>
|
||||||
|
|
||||||
#include <kurlmimedata.h>
|
#include <kurlmimedata.h>
|
||||||
@ -1295,8 +1295,9 @@ void ContainmentPrivate::dropData(QPointF scenePos, QPoint screenPos, QGraphicsS
|
|||||||
}
|
}
|
||||||
#ifndef PLASMA_NO_KIO
|
#ifndef PLASMA_NO_KIO
|
||||||
else {
|
else {
|
||||||
KMimeType::Ptr mime = KMimeType::findByUrl(url);
|
QMimeDatabase db;
|
||||||
QString mimeName = mime->name();
|
QMimeType mime = db.mimeTypeForUrl(url);
|
||||||
|
QString mimeName = mime.name();
|
||||||
QRectF geom(pos, QSize());
|
QRectF geom(pos, QSize());
|
||||||
QVariantList args;
|
QVariantList args;
|
||||||
args << url.toString();
|
args << url.toString();
|
||||||
|
@ -35,11 +35,7 @@
|
|||||||
|
|
||||||
#include <kaction.h>
|
#include <kaction.h>
|
||||||
#include <kdebug.h>
|
#include <kdebug.h>
|
||||||
#include <kglobal.h>
|
|
||||||
#include <klocalizedstring.h>
|
#include <klocalizedstring.h>
|
||||||
#include <kmimetype.h>
|
|
||||||
#include <kshortcutsdialog.h>
|
|
||||||
#include <kwindowsystem.h>
|
|
||||||
|
|
||||||
#include "coronabase.h"
|
#include "coronabase.h"
|
||||||
#include "abstractdialogmanager.h"
|
#include "abstractdialogmanager.h"
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
#include <kaction.h>
|
#include <kaction.h>
|
||||||
#include <kdebug.h>
|
#include <kdebug.h>
|
||||||
#include <klocalizedstring.h>
|
#include <klocalizedstring.h>
|
||||||
#include <kmimetype.h>
|
|
||||||
#include <kshortcutsdialog.h>
|
#include <kshortcutsdialog.h>
|
||||||
#include <kwindowsystem.h>
|
#include <kwindowsystem.h>
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include <kcompletion.h>
|
#include <kcompletion.h>
|
||||||
#include <kconfiggroup.h>
|
#include <kconfiggroup.h>
|
||||||
#include <kdebug.h>
|
#include <kdebug.h>
|
||||||
#include <kmimetype.h>
|
#include <qmimedatabase.h>
|
||||||
#include <kshell.h>
|
#include <kshell.h>
|
||||||
#include <qstandardpaths.h>
|
#include <qstandardpaths.h>
|
||||||
#include <qurl.h>
|
#include <qurl.h>
|
||||||
@ -233,9 +233,10 @@ class RunnerContextPrivate : public QSharedData
|
|||||||
mimeType = "inode/folder";
|
mimeType = "inode/folder";
|
||||||
} else if (info.isFile()) {
|
} else if (info.isFile()) {
|
||||||
type = RunnerContext::File;
|
type = RunnerContext::File;
|
||||||
KMimeType::Ptr mimeTypePtr = KMimeType::findByPath(path);
|
QMimeDatabase db;
|
||||||
if (mimeTypePtr) {
|
QMimeType mime = db.mimeTypeForFile(path);
|
||||||
mimeType = mimeTypePtr->name();
|
if (!mime.isDefault()) {
|
||||||
|
mimeType = mime.name();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
#include <kmimetype.h>
|
#include <qmimedatabase.h>
|
||||||
|
|
||||||
#include "private/themedwidgetinterface_p.h"
|
#include "private/themedwidgetinterface_p.h"
|
||||||
#include "svg.h"
|
#include "svg.h"
|
||||||
@ -54,10 +54,11 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
KMimeType::Ptr mime = KMimeType::findByPath(absImagePath);
|
QMimeDatabase db;
|
||||||
|
QMimeType mime = db.mimeTypeForFile(absImagePath);
|
||||||
QPixmap pm(q->size().toSize());
|
QPixmap pm(q->size().toSize());
|
||||||
|
|
||||||
if (mime->is("image/svg+xml") || mime->is("image/svg+xml-compressed")) {
|
if (mime.inherits("image/svg+xml") || mime.inherits("image/svg+xml-compressed")) {
|
||||||
if (!svg || svg->imagePath() != imagePath) {
|
if (!svg || svg->imagePath() != imagePath) {
|
||||||
delete svg;
|
delete svg;
|
||||||
svg = new Svg();
|
svg = new Svg();
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include <kcombobox.h>
|
#include <kcombobox.h>
|
||||||
#include <kiconeffect.h>
|
#include <kiconeffect.h>
|
||||||
#include <kiconloader.h>
|
#include <kiconloader.h>
|
||||||
#include <kmimetype.h>
|
|
||||||
|
|
||||||
#include "applet.h"
|
#include "applet.h"
|
||||||
#include "framesvg.h"
|
#include "framesvg.h"
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
//KDE
|
//KDE
|
||||||
#include <kmimetype.h>
|
#include <qmimedatabase.h>
|
||||||
|
|
||||||
//Plasma
|
//Plasma
|
||||||
#include "framesvg.h"
|
#include "framesvg.h"
|
||||||
@ -180,9 +180,10 @@ void Frame::setImage(const QString &path)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
KMimeType::Ptr mime = KMimeType::findByPath(d->absImagePath);
|
QMimeDatabase db;
|
||||||
|
QMimeType mime = db.mimeTypeForFile(d->absImagePath);
|
||||||
|
|
||||||
if (!mime->is("image/svg+xml") && !mime->is("application/x-gzip")) {
|
if (!mime.inherits("image/svg+xml") && !mime.inherits("application/x-gzip")) {
|
||||||
d->pixmap = new QPixmap(d->absImagePath);
|
d->pixmap = new QPixmap(d->absImagePath);
|
||||||
} else {
|
} else {
|
||||||
d->image = new Plasma::Svg(this);
|
d->image = new Plasma::Svg(this);
|
||||||
|
@ -23,8 +23,6 @@
|
|||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
#include <kmimetype.h>
|
|
||||||
|
|
||||||
#include "svg.h"
|
#include "svg.h"
|
||||||
#include "private/themedwidgetinterface_p.h"
|
#include "private/themedwidgetinterface_p.h"
|
||||||
#include "theme.h"
|
#include "theme.h"
|
||||||
|
@ -40,8 +40,6 @@
|
|||||||
#include <kglobalsettings.h>
|
#include <kglobalsettings.h>
|
||||||
#include <kiconeffect.h>
|
#include <kiconeffect.h>
|
||||||
#include <kiconloader.h>
|
#include <kiconloader.h>
|
||||||
#include <kmimetype.h>
|
|
||||||
#include <kurl.h>
|
|
||||||
#include <klocale.h>
|
#include <klocale.h>
|
||||||
|
|
||||||
#include "animator.h"
|
#include "animator.h"
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include <kcolorscheme.h>
|
#include <kcolorscheme.h>
|
||||||
#include <kglobalsettings.h>
|
#include <kglobalsettings.h>
|
||||||
#include <kmimetype.h>
|
#include <qmimedatabase.h>
|
||||||
|
|
||||||
#include "private/themedwidgetinterface_p.h"
|
#include "private/themedwidgetinterface_p.h"
|
||||||
#include "svg.h"
|
#include "svg.h"
|
||||||
@ -62,10 +62,11 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
KMimeType::Ptr mime = KMimeType::findByPath(absImagePath);
|
QMimeDatabase db;
|
||||||
|
QMimeType mime = db.mimeTypeForFile(absImagePath);
|
||||||
QPixmap pm(q->size().toSize());
|
QPixmap pm(q->size().toSize());
|
||||||
|
|
||||||
if (mime->is("image/svg+xml") || mime->is("image/svg+xml-compressed")) {
|
if (mime.inherits("image/svg+xml") || mime.inherits("image/svg+xml-compressed")) {
|
||||||
if (!svg || svg->imagePath() != absImagePath) {
|
if (!svg || svg->imagePath() != absImagePath) {
|
||||||
delete svg;
|
delete svg;
|
||||||
svg = new Svg();
|
svg = new Svg();
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
|
|
||||||
#include <klineedit.h>
|
#include <klineedit.h>
|
||||||
#include <kmimetype.h>
|
|
||||||
|
|
||||||
#include "applet.h"
|
#include "applet.h"
|
||||||
#include "framesvg.h"
|
#include "framesvg.h"
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include <kiconeffect.h>
|
#include <kiconeffect.h>
|
||||||
#include <kiconloader.h>
|
#include <kiconloader.h>
|
||||||
#include <kmimetype.h>
|
#include <qmimedatabase.h>
|
||||||
#include <kpushbutton.h>
|
#include <kpushbutton.h>
|
||||||
|
|
||||||
#include "animator.h"
|
#include "animator.h"
|
||||||
@ -66,10 +66,11 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
KMimeType::Ptr mime = KMimeType::findByPath(absImagePath);
|
QMimeDatabase db;
|
||||||
|
QMimeType mime = db.mimeTypeForFile(absImagePath);
|
||||||
QPixmap pm;
|
QPixmap pm;
|
||||||
|
|
||||||
if (mime->is("image/svg+xml") || mime->is("image/svg+xml-compressed")) {
|
if (mime.inherits("image/svg+xml") || mime.inherits("image/svg+xml-compressed")) {
|
||||||
if (!svg || svg->imagePath() != absImagePath) {
|
if (!svg || svg->imagePath() != absImagePath) {
|
||||||
delete svg;
|
delete svg;
|
||||||
svg = new Svg();
|
svg = new Svg();
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QRadioButton>
|
#include <QRadioButton>
|
||||||
|
|
||||||
#include <kmimetype.h>
|
#include <qmimedatabase.h>
|
||||||
|
|
||||||
#include "private/themedwidgetinterface_p.h"
|
#include "private/themedwidgetinterface_p.h"
|
||||||
#include "svg.h"
|
#include "svg.h"
|
||||||
@ -52,10 +52,11 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
KMimeType::Ptr mime = KMimeType::findByPath(absImagePath);
|
QMimeDatabase db;
|
||||||
|
QMimeType mime = db.mimeTypeForFile(absImagePath);
|
||||||
QPixmap pm(q->size().toSize());
|
QPixmap pm(q->size().toSize());
|
||||||
|
|
||||||
if (mime->is("image/svg+xml")) {
|
if (mime.inherits("image/svg+xml")) {
|
||||||
svg = new Svg();
|
svg = new Svg();
|
||||||
QPainter p(&pm);
|
QPainter p(&pm);
|
||||||
svg->paint(&p, pm.rect());
|
svg->paint(&p, pm.rect());
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|
||||||
//KDE
|
//KDE
|
||||||
#include <kmimetype.h>
|
|
||||||
#include <kdebug.h>
|
#include <kdebug.h>
|
||||||
#include <kglobalsettings.h>
|
#include <kglobalsettings.h>
|
||||||
#include <kiconloader.h>
|
#include <kiconloader.h>
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include <QSlider>
|
#include <QSlider>
|
||||||
#include <QStyleOptionSlider>
|
#include <QStyleOptionSlider>
|
||||||
#include <QGraphicsSceneWheelEvent>
|
#include <QGraphicsSceneWheelEvent>
|
||||||
#include <kmimetype.h>
|
|
||||||
|
|
||||||
#include "theme.h"
|
#include "theme.h"
|
||||||
#include "framesvg.h"
|
#include "framesvg.h"
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include <QStyleOptionSpinBox>
|
#include <QStyleOptionSpinBox>
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
|
|
||||||
#include <kmimetype.h>
|
|
||||||
#include <knuminput.h>
|
#include <knuminput.h>
|
||||||
|
|
||||||
#include "applet.h"
|
#include "applet.h"
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
|
|
||||||
#include <kmimetype.h>
|
|
||||||
#include <ktextbrowser.h>
|
#include <ktextbrowser.h>
|
||||||
|
|
||||||
#include "svg.h"
|
#include "svg.h"
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
|
|
||||||
#include <kmimetype.h>
|
|
||||||
#include <ktextedit.h>
|
#include <ktextedit.h>
|
||||||
|
|
||||||
#include "applet.h"
|
#include "applet.h"
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include <kcolorutils.h>
|
#include <kcolorutils.h>
|
||||||
#include <kiconeffect.h>
|
#include <kiconeffect.h>
|
||||||
#include <kmimetype.h>
|
#include <qmimedatabase.h>
|
||||||
|
|
||||||
#include "animator.h"
|
#include "animator.h"
|
||||||
#include "framesvg.h"
|
#include "framesvg.h"
|
||||||
@ -63,10 +63,11 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
KMimeType::Ptr mime = KMimeType::findByPath(absImagePath);
|
QMimeDatabase db;
|
||||||
|
QMimeType mime = db.mimeTypeForFile(absImagePath);
|
||||||
QPixmap pm;
|
QPixmap pm;
|
||||||
|
|
||||||
if (mime->is("image/svg+xml") || mime->is("image/svg+xml-compressed")) {
|
if (mime.inherits("image/svg+xml") || mime.inherits("image/svg+xml-compressed")) {
|
||||||
if (!svg || svg->imagePath() != absImagePath) {
|
if (!svg || svg->imagePath() != absImagePath) {
|
||||||
delete svg;
|
delete svg;
|
||||||
svg = new Svg();
|
svg = new Svg();
|
||||||
|
Loading…
Reference in New Issue
Block a user