• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • kio
kfilewriteplugin.cpp
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2
3 Copyright (c) 2007 Jos van den Oever <jos@vandenoever.info>
4
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.
9
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.
14
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.
19*/
20
21#include "kfilewriteplugin.h"
22#include "kfilewriteplugin_p.h"
23#include <kservicetypetrader.h>
24#include <QHash>
25#include <QDebug>
26
27KFileWritePlugin::KFileWritePlugin(QObject* parent, const QStringList&)
28 :QObject(parent), d(0)
29{
30}
31
32KFileWritePlugin::~KFileWritePlugin() {
33}
34
35K_GLOBAL_STATIC(KFileWriterProvider, staticKFileWriterProvider)
36
37KFileWriterProvider*
38KFileWriterProvider::self() {
39 return staticKFileWriterProvider;
40}
41
42KFileWriterProvider::~KFileWriterProvider() {
43 qDeleteAll(plugins);
44 plugins.clear();
45}
46
47KFileWritePlugin*
48KFileWriterProvider::loadPlugin(const QString& key) {
49 //kDebug() << "loading writer for key " << key;
50 const QString constraint = QString::fromLatin1("'%1' in MetaDataKeys")
51 .arg(key);
52 const KService::List offers = KServiceTypeTrader::self()->query(
53 "KFileWrite", constraint);
54 if (offers.isEmpty()) {
55 return 0;
56 }
57 return offers.first()->createInstance<KFileWritePlugin>();
58}
59
60#include "kfilewriteplugin.moc"
61
KFileWritePlugin
Definition: kfilewriteplugin.h:28
KFileWritePlugin::KFileWritePlugin
KFileWritePlugin(QObject *parent, const QStringList &args)
Constructor that initializes the object as a QObject.
Definition: kfilewriteplugin.cpp:27
KFileWritePlugin::~KFileWritePlugin
virtual ~KFileWritePlugin()
Destructor.
Definition: kfilewriteplugin.cpp:32
KFileWriterProvider
Definition: kfilewriteplugin_p.h:29
KFileWriterProvider::plugins
QHash< QString, KFileWritePlugin * > plugins
Definition: kfilewriteplugin_p.h:34
KFileWriterProvider::self
static KFileWriterProvider * self()
Definition: kfilewriteplugin.cpp:38
KFileWriterProvider::~KFileWriterProvider
~KFileWriterProvider()
Definition: kfilewriteplugin.cpp:42
KFileWriterProvider::loadPlugin
KFileWritePlugin * loadPlugin(const QString &key)
Definition: kfilewriteplugin.cpp:48
KServiceTypeTrader::self
static KServiceTypeTrader * self()
KServiceTypeTrader::query
KService::List query(const QString &servicetype, const QString &constraint=QString()) const
QList< Ptr >
QObject
K_GLOBAL_STATIC
#define K_GLOBAL_STATIC(TYPE, NAME)
kfilewriteplugin.h
kfilewriteplugin_p.h
kservicetypetrader.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal