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

kapptemplate

  • sources
  • kde-4.14
  • kdesdk
  • kapptemplate
prefs.cpp
Go to the documentation of this file.
1 // This file is generated by kconfig_compiler from kapptemplate.kcfg.
2 // All changes you do to this file will be lost.
3 
4 #include "prefs.h"
5 
6 #include <kglobal.h>
7 #include <QtCore/QFile>
8 
9 class PrefsHelper
10 {
11  public:
12  PrefsHelper() : q(0) {}
13  ~PrefsHelper() { delete q; }
14  Prefs *q;
15 };
16 K_GLOBAL_STATIC(PrefsHelper, s_globalPrefs)
17 Prefs *Prefs::self()
18 {
19  if (!s_globalPrefs->q) {
20  new Prefs;
21  s_globalPrefs->q->readConfig();
22  }
23 
24  return s_globalPrefs->q;
25 }
26 
27 Prefs::Prefs( )
28  : KConfigSkeleton( QLatin1String( "kapptemplaterc" ) )
29 {
30  Q_ASSERT(!s_globalPrefs->q);
31  s_globalPrefs->q = this;
32  setCurrentGroup( QLatin1String( "Project" ) );
33 
34  KConfigSkeleton::ItemString *itemAppName;
35  itemAppName = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "appName" ), mAppName, QLatin1String( "KApp4" ) );
36  addItem( itemAppName, QLatin1String( "appName" ) );
37  KConfigSkeleton::ItemString *itemAppVersion;
38  itemAppVersion = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "appVersion" ), mAppVersion, QLatin1String( "0.1" ) );
39  addItem( itemAppVersion, QLatin1String( "appVersion" ) );
40 QString defaultDir = KUser().homeDir()+"/src";
41 
42  KConfigSkeleton::ItemString *itemUrl;
43  itemUrl = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "url" ), mUrl, defaultDir );
44  addItem( itemUrl, QLatin1String( "url" ) );
45 
46  setCurrentGroup( QLatin1String( "User" ) );
47 
48 QString name;
49  {
50  KEMailSettings emailConfig;
51  emailConfig.setProfile( emailConfig.defaultProfileName() );
52  name = emailConfig.getSetting( KEMailSettings::RealName );
53  }
54 
55  KConfigSkeleton::ItemString *itemName;
56  itemName = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "name" ), mName, name );
57  addItem( itemName, QLatin1String( "name" ) );
58 QString address;
59  {
60  KEMailSettings emailConfig;
61  emailConfig.setProfile( emailConfig.defaultProfileName() );
62  address = emailConfig.getSetting( KEMailSettings::EmailAddress );
63  }
64 
65  KConfigSkeleton::ItemString *itemEmail;
66  itemEmail = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "email" ), mEmail, address );
67  addItem( itemEmail, QLatin1String( "email" ) );
68 }
69 
70 Prefs::~Prefs()
71 {
72  if (!s_globalPrefs.isDestroyed()) {
73  s_globalPrefs->q = 0;
74  }
75 }
76 
Prefs::mUrl
QString mUrl
Definition: prefs.h:121
Prefs
Definition: prefs.h:11
prefs.h
KConfigSkeleton
Prefs::name
static QString name()
Get Name of the user.
Definition: prefs.h:89
Prefs::mAppVersion
QString mAppVersion
Definition: prefs.h:120
Prefs::mAppName
QString mAppName
Definition: prefs.h:119
Prefs::mName
QString mName
Definition: prefs.h:124
QString
Prefs::Prefs
Prefs()
Definition: prefs.cpp:27
Prefs::mEmail
QString mEmail
Definition: prefs.h:125
QLatin1String
Prefs::~Prefs
~Prefs()
Definition: prefs.cpp:70
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:39:44 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kapptemplate

Skip menu "kapptemplate"
  • 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