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

kcachegrind

  • sources
  • kde-4.14
  • kdesdk
  • kcachegrind
  • libcore
config.cpp
Go to the documentation of this file.
1 /* This file is part of KCachegrind.
2  Copyright (C) 2008 Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
3 
4  KCachegrind is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public
6  License as published by the Free Software Foundation, version 2.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; see the file COPYING. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #include "config.h"
20 
21 #include <QStringList>
22 #include <QList>
23 
24 // helper functions
25 
26 QList<int> toIntList(QStringList l)
27 {
28  QList<int> iList;
29 
30  foreach(const QString& s, l)
31  iList << s.toInt();
32 
33  return iList;
34 }
35 
36 QStringList toStringList(QList<int> l)
37 {
38  QStringList sList;
39 
40  foreach(int i, l)
41  sList << QString::number(i);
42 
43  return sList;
44 }
45 
46 
47 //
48 // ConfigGroup
49 //
50 
51 ConfigGroup::ConfigGroup()
52 {}
53 
54 ConfigGroup::~ConfigGroup()
55 {}
56 
57 void ConfigGroup::setValue(const QString&, const QVariant&, const QVariant&)
58 {}
59 
60 QVariant ConfigGroup::value(const QString&, const QVariant& def) const
61 {
62  return def;
63 }
64 
65 
66 //
67 // ConfigStorage
68 //
69 
70 ConfigStorage* ConfigStorage::_storage = 0;
71 
72 ConfigStorage::ConfigStorage()
73 {
74  _storage = 0;
75 }
76 
77 ConfigStorage::~ConfigStorage()
78 {}
79 
80 ConfigGroup* ConfigStorage::group(const QString& group,
81  const QString& optSuffix)
82 {
83  Q_ASSERT(_storage != 0);
84 
85  return _storage->getGroup(group, optSuffix);
86 }
87 
88 void ConfigStorage::setStorage(ConfigStorage* storage)
89 {
90  _storage = storage;
91 }
92 
93 void ConfigStorage::cleanup()
94 {
95  delete _storage;
96 }
97 
98 ConfigGroup* ConfigStorage::getGroup(const QString&, const QString&)
99 {
100  return new ConfigGroup();
101 }
ConfigStorage::~ConfigStorage
virtual ~ConfigStorage()
Definition: config.cpp:77
ConfigStorage::setStorage
static void setStorage(ConfigStorage *)
Definition: config.cpp:88
ConfigStorage::ConfigStorage
ConfigStorage()
Definition: config.cpp:72
ConfigStorage::_storage
static ConfigStorage * _storage
Definition: config.h:81
ConfigGroup::ConfigGroup
ConfigGroup()
Definition: config.cpp:51
ConfigGroup::setValue
virtual void setValue(const QString &key, const QVariant &value, const QVariant &defaultValue=QVariant())
Definition: config.cpp:57
config.h
ConfigStorage::group
static ConfigGroup * group(const QString &group, const QString &optSuffix=QString())
Definition: config.cpp:80
QString::number
QString number(int n, int base)
ConfigStorage::getGroup
virtual ConfigGroup * getGroup(const QString &group, const QString &optSuffix)
Definition: config.cpp:98
QString::toInt
int toInt(bool *ok, int base) const
ConfigGroup::~ConfigGroup
virtual ~ConfigGroup()
Definition: config.cpp:54
ConfigStorage
This is an adapter class for different configuration backends.
Definition: config.h:63
QString
QList
ConfigGroup
A group of configuration settings.
Definition: config.h:35
QStringList
toStringList
QStringList toStringList(QList< int > l)
Definition: config.cpp:36
ConfigGroup::value
virtual QVariant value(const QString &key, const QVariant &defaultValue) const
Definition: config.cpp:60
ConfigStorage::cleanup
static void cleanup()
Definition: config.cpp:93
toIntList
QList< int > toIntList(QStringList l)
Definition: config.cpp:26
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:39:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kcachegrind

Skip menu "kcachegrind"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • umbrello
  •   umbrello

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