• 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
logger.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 /*
20  * Default implementation for notification dispatcher: use qDebug
21  */
22 
23 #include <QtDebug>
24 
25 #include "logger.h"
26 
27 
29 
30 Logger::~Logger()
31 {}
32 
33 void Logger::loadStart(const QString& filename)
34 {
35  _filename = filename;
36  _timer.setSingleShot(true);
37  _timer.start(1000);
38  qDebug() << "Loading" << filename;
39 }
40 
41 void Logger::loadProgress(int progress)
42 {
43  // print progress at most every second
44  if (_timer.isActive()) return;
45  _timer.start(1000);
46 
47  qDebug() << "Loading" << _filename << "(" << progress << "%)";
48 }
49 
50 void Logger::loadWarning(int line, const QString& msg)
51 {
52  qDebug() << "Warning in " << _filename << ", line" << line
53  << ":" << msg;
54 }
55 
56 void Logger::loadError(int line, const QString& msg)
57 {
58  qDebug() << "Error in " << _filename << ", line" << line
59  << ":" << msg;
60 }
61 
62 void Logger::loadFinished(const QString& msg)
63 {
64  _timer.stop();
65  if (msg.isEmpty())
66  qDebug() << "File" << _filename << "loaded.";
67  else
68  qDebug() << "Error loading file" << _filename << ":" << qPrintable(msg);
69 }
Logger::loadProgress
virtual void loadProgress(int progress)
Definition: logger.cpp:41
Logger::loadError
virtual void loadError(int line, const QString &msg)
Definition: logger.cpp:56
Logger::~Logger
virtual ~Logger()
Logger.
Definition: logger.cpp:30
Logger::loadStart
virtual void loadStart(const QString &filename)
Definition: logger.cpp:33
Logger::loadFinished
virtual void loadFinished(const QString &msg)
Definition: logger.cpp:62
Logger::loadWarning
virtual void loadWarning(int line, const QString &msg)
Definition: logger.cpp:50
QString::isEmpty
bool isEmpty() const
QString
Logger::_filename
QString _filename
Definition: logger.h:45
QTimer::stop
void stop()
logger.h
QTimer::start
void start(int msec)
QTimer::isActive
bool isActive() const
QTimer::setSingleShot
void setSingleShot(bool singleShot)
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