diff --git a/CMakeLists.txt b/CMakeLists.txt index 2eca0dcad..373069257 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -291,7 +291,7 @@ target_link_libraries(plasma ${KDEPIMLIBS_GPGMEPP_LIBS} karchive) target_link_libraries(plasmaqgv plasma ${QT_QTUITOOLS_LIBRARY} ${QT_QTWEBKIT_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) target_link_libraries(plasma ${QCA2_LIBRARIES}) diff --git a/containment.cpp b/containment.cpp index bf7c34b7e..7641c8523 100644 --- a/containment.cpp +++ b/containment.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include @@ -1295,8 +1295,9 @@ void ContainmentPrivate::dropData(QPointF scenePos, QPoint screenPos, QGraphicsS } #ifndef PLASMA_NO_KIO else { - KMimeType::Ptr mime = KMimeType::findByUrl(url); - QString mimeName = mime->name(); + QMimeDatabase db; + QMimeType mime = db.mimeTypeForUrl(url); + QString mimeName = mime.name(); QRectF geom(pos, QSize()); QVariantList args; args << url.toString(); diff --git a/corona.cpp b/corona.cpp index a9a474650..dcf7a61e9 100644 --- a/corona.cpp +++ b/corona.cpp @@ -35,11 +35,7 @@ #include #include -#include #include -#include -#include -#include #include "coronabase.h" #include "abstractdialogmanager.h" diff --git a/coronabase.cpp b/coronabase.cpp index da6cc07d4..18032ea9d 100644 --- a/coronabase.cpp +++ b/coronabase.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include diff --git a/runnercontext.cpp b/runnercontext.cpp index b90b3b323..423277632 100644 --- a/runnercontext.cpp +++ b/runnercontext.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -233,9 +233,10 @@ class RunnerContextPrivate : public QSharedData mimeType = "inode/folder"; } else if (info.isFile()) { type = RunnerContext::File; - KMimeType::Ptr mimeTypePtr = KMimeType::findByPath(path); - if (mimeTypePtr) { - mimeType = mimeTypePtr->name(); + QMimeDatabase db; + QMimeType mime = db.mimeTypeForFile(path); + if (!mime.isDefault()) { + mimeType = mime.name(); } } } diff --git a/widgets/checkbox.cpp b/widgets/checkbox.cpp index 1cc014883..e26d5fb66 100644 --- a/widgets/checkbox.cpp +++ b/widgets/checkbox.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include "private/themedwidgetinterface_p.h" #include "svg.h" @@ -54,10 +54,11 @@ public: return; } - KMimeType::Ptr mime = KMimeType::findByPath(absImagePath); + QMimeDatabase db; + QMimeType mime = db.mimeTypeForFile(absImagePath); 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) { delete svg; svg = new Svg(); diff --git a/widgets/combobox.cpp b/widgets/combobox.cpp index 84e7592fa..be38c539a 100644 --- a/widgets/combobox.cpp +++ b/widgets/combobox.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include "applet.h" #include "framesvg.h" diff --git a/widgets/frame.cpp b/widgets/frame.cpp index 0cf51eba7..bd82ea192 100644 --- a/widgets/frame.cpp +++ b/widgets/frame.cpp @@ -26,7 +26,7 @@ #include //KDE -#include +#include //Plasma #include "framesvg.h" @@ -180,9 +180,10 @@ void Frame::setImage(const QString &path) 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); } else { d->image = new Plasma::Svg(this); diff --git a/widgets/groupbox.cpp b/widgets/groupbox.cpp index d86222383..e3d688651 100644 --- a/widgets/groupbox.cpp +++ b/widgets/groupbox.cpp @@ -23,8 +23,6 @@ #include #include -#include - #include "svg.h" #include "private/themedwidgetinterface_p.h" #include "theme.h" diff --git a/widgets/iconwidget.cpp b/widgets/iconwidget.cpp index 151cb7119..25175e4ed 100644 --- a/widgets/iconwidget.cpp +++ b/widgets/iconwidget.cpp @@ -40,8 +40,6 @@ #include #include #include -#include -#include #include #include "animator.h" diff --git a/widgets/label.cpp b/widgets/label.cpp index 800271e15..e62f9b1e0 100644 --- a/widgets/label.cpp +++ b/widgets/label.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include "private/themedwidgetinterface_p.h" #include "svg.h" @@ -62,10 +62,11 @@ public: return; } - KMimeType::Ptr mime = KMimeType::findByPath(absImagePath); + QMimeDatabase db; + QMimeType mime = db.mimeTypeForFile(absImagePath); 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) { delete svg; svg = new Svg(); diff --git a/widgets/lineedit.cpp b/widgets/lineedit.cpp index 9f8b9cbfb..acb7561d9 100644 --- a/widgets/lineedit.cpp +++ b/widgets/lineedit.cpp @@ -25,7 +25,6 @@ #include #include -#include #include "applet.h" #include "framesvg.h" diff --git a/widgets/pushbutton.cpp b/widgets/pushbutton.cpp index 379a040f6..29e6abdaf 100644 --- a/widgets/pushbutton.cpp +++ b/widgets/pushbutton.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include "animator.h" @@ -66,10 +66,11 @@ public: return; } - KMimeType::Ptr mime = KMimeType::findByPath(absImagePath); + QMimeDatabase db; + QMimeType mime = db.mimeTypeForFile(absImagePath); 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) { delete svg; svg = new Svg(); diff --git a/widgets/radiobutton.cpp b/widgets/radiobutton.cpp index 6f300c530..4e0d13105 100644 --- a/widgets/radiobutton.cpp +++ b/widgets/radiobutton.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include "private/themedwidgetinterface_p.h" #include "svg.h" @@ -52,10 +52,11 @@ public: return; } - KMimeType::Ptr mime = KMimeType::findByPath(absImagePath); + QMimeDatabase db; + QMimeType mime = db.mimeTypeForFile(absImagePath); QPixmap pm(q->size().toSize()); - if (mime->is("image/svg+xml")) { + if (mime.inherits("image/svg+xml")) { svg = new Svg(); QPainter p(&pm); svg->paint(&p, pm.rect()); diff --git a/widgets/scrollwidget.cpp b/widgets/scrollwidget.cpp index ccce9c65c..17ea77619 100644 --- a/widgets/scrollwidget.cpp +++ b/widgets/scrollwidget.cpp @@ -36,7 +36,6 @@ #include //KDE -#include #include #include #include diff --git a/widgets/slider.cpp b/widgets/slider.cpp index 865823f00..8bea7b037 100644 --- a/widgets/slider.cpp +++ b/widgets/slider.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include "theme.h" #include "framesvg.h" diff --git a/widgets/spinbox.cpp b/widgets/spinbox.cpp index 9815b37e1..dad00e093 100644 --- a/widgets/spinbox.cpp +++ b/widgets/spinbox.cpp @@ -24,7 +24,6 @@ #include #include -#include #include #include "applet.h" diff --git a/widgets/textbrowser.cpp b/widgets/textbrowser.cpp index 43bf3689d..a65702d9a 100644 --- a/widgets/textbrowser.cpp +++ b/widgets/textbrowser.cpp @@ -24,7 +24,6 @@ #include #include -#include #include #include "svg.h" diff --git a/widgets/textedit.cpp b/widgets/textedit.cpp index c98871d94..49a44f878 100644 --- a/widgets/textedit.cpp +++ b/widgets/textedit.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include "applet.h" diff --git a/widgets/toolbutton.cpp b/widgets/toolbutton.cpp index a004ffa1d..b4c315730 100644 --- a/widgets/toolbutton.cpp +++ b/widgets/toolbutton.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include "animator.h" #include "framesvg.h" @@ -63,10 +63,11 @@ public: return; } - KMimeType::Ptr mime = KMimeType::findByPath(absImagePath); + QMimeDatabase db; + QMimeType mime = db.mimeTypeForFile(absImagePath); 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) { delete svg; svg = new Svg();