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

KIO

  • sources
  • kde-4.14
  • kdelibs
  • 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 
27 KFileWritePlugin::KFileWritePlugin(QObject* parent, const QStringList&)
28  :QObject(parent), d(0)
29 {
30 }
31 
32 KFileWritePlugin::~KFileWritePlugin() {
33 }
34 
35 K_GLOBAL_STATIC(KFileWriterProvider, staticKFileWriterProvider)
36 
37 KFileWriterProvider*
38 KFileWriterProvider::self() {
39  return staticKFileWriterProvider;
40 }
41 
42 KFileWriterProvider::~KFileWriterProvider() {
43  qDeleteAll(plugins);
44  plugins.clear();
45 }
46 
47 KFileWritePlugin*
48 KFileWriterProvider::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 
KFileWriterProvider
Definition: kfilewriteplugin_p.h:29
KFileWritePlugin::KFileWritePlugin
KFileWritePlugin(QObject *parent, const QStringList &args)
Constructor that initializes the object as a QObject.
Definition: kfilewriteplugin.cpp:27
kfilewriteplugin_p.h
KServiceTypeTrader::self
static KServiceTypeTrader * self()
K_GLOBAL_STATIC
#define K_GLOBAL_STATIC(TYPE, NAME)
KFileWritePlugin::~KFileWritePlugin
virtual ~KFileWritePlugin()
Destructor.
Definition: kfilewriteplugin.cpp:32
KFileWriterProvider::loadPlugin
KFileWritePlugin * loadPlugin(const QString &key)
Definition: kfilewriteplugin.cpp:48
KFileWriterProvider::~KFileWriterProvider
~KFileWriterProvider()
Definition: kfilewriteplugin.cpp:42
kservicetypetrader.h
QObject
QList::isEmpty
bool isEmpty() const
QList::first
T & first()
QString
QList
QStringList
QHash::clear
void clear()
KServiceTypeTrader::query
KService::List query(const QString &servicetype, const QString &constraint=QString()) const
QString::fromLatin1
QString fromLatin1(const char *str, int size)
QString::arg
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
kfilewriteplugin.h
KFileWritePlugin
Definition: kfilewriteplugin.h:28
KFileWriterProvider::plugins
QHash< QString, KFileWritePlugin * > plugins
Definition: kfilewriteplugin_p.h:34
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:53 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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