1 /* This file is part of the KDE libraries
3 Copyright (c) 2007 Jos van den Oever <jos@vandenoever.info>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License (LGPL) as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
20 #include "kfilemetainfo_p.h"
22 #include "kservicetypetrader.h"
26 KFileWritePlugin::KFileWritePlugin(QObject
* parent
, const QStringList
&)
27 :QObject(parent
), d(0)
31 KFileWritePlugin::~KFileWritePlugin() {
34 K_GLOBAL_STATIC(KFileWriterProvider
, staticKFileWriterProvider
)
37 KFileWriterProvider::self() {
38 return staticKFileWriterProvider
;
41 KFileWriterProvider::~KFileWriterProvider() {
47 KFileWriterProvider::loadPlugin(const QString
& key
) {
48 //kDebug() << "loading writer for key " << key;
49 const QString constraint
= QString::fromLatin1("'%1' in MetaDataKeys")
51 KService::List offers
= KServiceTypeTrader::self()->query(
52 "KFileWrite", constraint
);
53 if (offers
.isEmpty()) {
56 return offers
.first()->createInstance
<KFileWritePlugin
>();
59 #include "kfilewriteplugin.moc"