KDb

KDbDriverMetaData.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2003-2016 Jarosław Staniek <staniek@kde.org>
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this program; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#include "KDbDriverMetaData.h"
21
22#include <QStringList>
23
24static bool isTrue(KPluginMetaData *metaData, const char* fieldName)
25{
26 return 0 == metaData->value(QLatin1String(fieldName))
27 .compare(QLatin1String("true"), Qt::CaseInsensitive);
28}
29
30class Q_DECL_HIDDEN KDbDriverMetaData::Private
31{
32public:
33 explicit Private(KDbDriverMetaData *metaData)
34 : fileBased(isTrue(metaData, "X-KDb-FileBased"))
35 , importingEnabled(isTrue(metaData, "X-KDb-ImportingEnabled"))
36 {
37 }
38
39 QStringList mimeTypes;
40 bool fileBased;
41 bool importingEnabled;
42private:
43 Q_DISABLE_COPY(Private)
44};
45
46// ---
47
48KDbDriverMetaData::KDbDriverMetaData(const QPluginLoader &loader)
49 : KPluginMetaData(loader), d(new Private(this))
50{
51}
52
53KDbDriverMetaData::~KDbDriverMetaData()
54{
55 delete d;
56}
57
59{
60 return pluginId();
61}
62
64{
65 return d->fileBased;
66}
67
69{
70 return d->importingEnabled;
71}
Provides information about a single driver plugin.
bool isImportingEnabled() const
QString pluginId() const
bool value(const QString &key, bool defaultValue) const
CaseInsensitive
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 12 2024 12:05:27 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.