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

kjots

  • sources
  • kde-4.14
  • kdepim
  • kjots
main.cpp
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 //
4 // kjots
5 //
6 // Copyright (C) 1997 Christoph Neerfeld <Christoph.Neerfeld@home.ivm.de>
7 // Copyright (C) 2002, 2003 Aaron J. Seigo <aseigo@kde.org>
8 // Copyright (C) 2003 Stanislav Kljuhhin <crz@hot.ee>
9 // Copyright (C) 2005-2006 Jaison Lee <lee.jaison@gmail.com>
10 //
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation; either version 2 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 
26 #include "KJotsMain.h"
27 #include "aboutdata.h"
28 
29 #include <kontactinterface/pimuniqueapplication.h>
30 
31 #include <kcmdlineargs.h>
32 #include <kconfig.h>
33 #include <kdebug.h>
34 #include <klocale.h>
35 #include <kglobal.h>
36 #include <kconfiggroup.h>
37 
38 int main( int argc, char **argv )
39 {
40  AboutData aboutData;
41  KCmdLineArgs::init(argc, argv, &aboutData);
42 
43  KontactInterface::PimUniqueApplication::addCmdLineOptions();
44  if (!KontactInterface::PimUniqueApplication::start()) {
45  kWarning() << "kjots is already running!";
46  exit(0);
47  }
48  KontactInterface::PimUniqueApplication a;
49 
50  // backwards compatibility code to convert "old" user font settings
51  // to the new config settings
52  KConfigGroup config(KGlobal::config(), "kjots");
53  if (config.hasKey("EFontFamily")) {
54  // read old font and create it
55  QFont font( config.readEntry("EFontFamily"),
56  config.readEntry("EFontSize", 12),
57  config.readEntry("EFontWeight", 0),
58  config.readEntry("EFontItalic", 0));
59  // delete old entries
60  config.deleteEntry("EFontFamily");
61  config.deleteEntry("EFontSize");
62  config.deleteEntry("EFontWeight");
63  config.deleteEntry("EFontItalic");
64  config.deleteEntry("EFontCharset");
65  // write new "converted" entry
66  config.writeEntry("Font", font);
67  }
68 
69  KJotsMain *jots = new KJotsMain;
70  if( a.isSessionRestored() ) {
71  if( KJotsMain::canBeRestored(1) ) {
72  jots->restore(1);
73  }
74  }
75 
76  jots->show();
77  jots->resize(jots->size());
78  return a.exec();
79 }
80 
81 /* ex: set tabstop=4 softtabstop=4 shiftwidth=4 expandtab: */
82 /* kate: tab-indents off; replace-tabs on; tab-width 4; remove-trailing-space on; encoding utf-8;*/
KJotsMain
Definition: KJotsMain.h:32
KJotsMain.h
QFont
main
int main(int argc, char **argv)
Definition: main.cpp:38
AboutData
Definition: aboutdata.h:29
aboutdata.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:12 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kjots

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

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

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