~ubuntu-branches/ubuntu/quantal/kdepimlibs/quantal-proposed

« back to all changes in this revision

Viewing changes to kabc/errorhandler.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2006-09-06 22:45:39 UTC
  • Revision ID: james.westby@ubuntu.com-20060906224539-fiq8t03qdbqu7z3i
Tags: upstream-3.80.1
ImportĀ upstreamĀ versionĀ 3.80.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    This file is part of libkabc.
 
3
 
 
4
    Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
 
5
    Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
 
6
 
 
7
    This library is free software; you can redistribute it and/or
 
8
    modify it under the terms of the GNU Library General Public
 
9
    License as published by the Free Software Foundation; either
 
10
    version 2 of the License, or (at your option) any later version.
 
11
 
 
12
    This library is distributed in the hope that it will be useful,
 
13
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
    Library General Public License for more details.
 
16
 
 
17
    You should have received a copy of the GNU Library General Public License
 
18
    along with this library; see the file COPYING.LIB.  If not, write to
 
19
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
20
    Boston, MA 02110-1301, USA.
 
21
*/
 
22
 
 
23
#include <QApplication>
 
24
 
 
25
#include <kdebug.h>
 
26
#include <klocale.h>
 
27
#include <kmessagebox.h>
 
28
 
 
29
#include "errorhandler.h"
 
30
 
 
31
using namespace KABC;
 
32
 
 
33
void ConsoleErrorHandler::error( const QString &msg )
 
34
{
 
35
  // no debug area is ok here
 
36
  kError() << msg << endl;
 
37
}
 
38
 
 
39
 
 
40
GuiErrorHandler::GuiErrorHandler( QWidget *parent )
 
41
  : mParent( parent )
 
42
{
 
43
}
 
44
 
 
45
void GuiErrorHandler::error( const QString &msg )
 
46
{
 
47
  if (qApp)
 
48
    KMessageBox::error( mParent, msg );
 
49
}