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

kcachegrind

  • sources
  • kde-4.12
  • kdesdk
  • kcachegrind
  • kcachegrind
kcachegrind/main.cpp
Go to the documentation of this file.
1 /* This file is part of KCachegrind.
2  Copyright (C) 2003 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 /*
20  * KCachegrind startup
21  */
22 
23 // for KCACHEGRIND_VERSION
24 #include "../version.h"
25 
26 
27 #include <kapplication.h>
28 #include <kcmdlineargs.h>
29 #include <kaboutdata.h>
30 #include <klocale.h>
31 
32 #include "kdeconfig.h"
33 #include "toplevel.h"
34 #include "tracedata.h"
35 #include "loader.h"
36 
37 int main( int argc, char ** argv )
38 {
39  KAboutData aboutData("kcachegrind", 0,
40  ki18n("KCachegrind"),
41  KCACHEGRIND_VERSION,
42  ki18n("KDE Frontend for Callgrind/Cachegrind"),
43  KAboutData::License_GPL,
44  ki18n("(C) 2002 - 2011"), KLocalizedString(),
45  "http://kcachegrind.sf.net");
46  aboutData.addAuthor(ki18n("Josef Weidendorfer"),
47  ki18n("Author/Maintainer"),
48  "Josef.Weidendorfer@gmx.de");
49 
50  KCmdLineArgs::init(argc, argv, &aboutData);
51 
52  KCmdLineOptions options;
53  //options.add("r <exec>", ki18n("Run <exec> under cachegrind"));
54  options.add("+[trace]", ki18n("Show information of this trace"));
55  KCmdLineArgs::addCmdLineOptions( options );
56 
57  KApplication a;
58  KGlobal::locale()->insertCatalog("kcachegrind_qt");
59  TopLevel* t;
60  Loader::initLoaders();
61 
62  KConfig* kc = KGlobal::config().data();
63  ConfigStorage::setStorage(new KDEConfigStorage(kc));
64 
65  if (a.isSessionRestored()){
66  int n = 1;
67  while (KMainWindow::canBeRestored(n)){
68  (new TopLevel())->restore(n);
69  n++;
70  }
71  }
72  else {
73  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
74  int nbArgs = args->count();
75  if (nbArgs>0) {
76  t = new TopLevel();
77  t->show();
78  for(int i = 0; i < nbArgs; i++) {
79  t->loadDelayed(args->arg(i));
80  }
81  }
82  else {
83  // load trace in current dir
84  t = new TopLevel();
85  t->show();
86  t->loadDelayed(".");
87  }
88  }
89 
90  a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
91  int res = a.exec();
92 
93  // to make leak checking in valgrind happy...
94  Loader::deleteLoaders();
95  ProfileContext::cleanup();
96  ConfigStorage::cleanup();
97 
98  return res;
99 }
ConfigStorage::setStorage
static void setStorage(ConfigStorage *)
Definition: config.cpp:88
Loader::initLoaders
static void initLoaders()
Definition: loader.cpp:73
main
int main(int argc, char **argv)
Definition: kcachegrind/main.cpp:37
TopLevel
Definition: toplevel.h:58
tracedata.h
loader.h
KDEConfigStorage
Definition: kdeconfig.h:51
toplevel.h
ProfileContext::cleanup
static void cleanup()
Definition: context.cpp:46
kdeconfig.h
Loader::deleteLoaders
static void deleteLoaders()
Definition: loader.cpp:79
TopLevel::loadDelayed
void loadDelayed(QString)
Definition: toplevel.cpp:1019
ConfigStorage::cleanup
static void cleanup()
Definition: config.cpp:93
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:03:27 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
  • okteta
  • 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