~ubuntu-branches/ubuntu/karmic/kst/karmic

« back to all changes in this revision

Viewing changes to kst/kst/ksdebug.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2006-06-30 19:11:30 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060630191130-acumuar75bz4puty
Tags: 1.2.1-1ubuntu1
Merge from debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#undef kstdBacktrace
26
26
#endif
27
27
 
28
 
#include "kdebugdcopiface.h"
29
 
 
30
28
#include <kapplication.h>
31
29
#include <kglobal.h>
32
30
#include <kinstance.h>
171
169
 
172
170
static kstDebugPrivate *kstDebug_data = 0;
173
171
static KStaticDeleter<kstDebugPrivate> pcd;
174
 
static KStaticDeleter<KDebugDCOPIface> dcopsd;
175
 
static KDebugDCOPIface* kstDebugDCOPIface = 0;
176
172
 
177
173
static void kstDebugBackend( unsigned short nLevel, unsigned int nArea, const char *data)
178
174
{
182
178
      pcd.setObject(kstDebug_data, new kstDebugPrivate());
183
179
      // Do not call this deleter from ~KApplication
184
180
      KGlobal::unregisterStaticDeleter(&pcd);
185
 
 
186
 
      // create the dcop interface if it has not been created yet
187
 
      if (!kstDebugDCOPIface)
188
 
      {
189
 
          kstDebugDCOPIface = dcopsd.setObject(kstDebugDCOPIface, new KDebugDCOPIface);
190
 
      }
191
181
  }
192
182
 
193
183
  if (!kstDebug_data->config && KGlobal::_instance )
563
553
    void* trace[256];
564
554
    int n = backtrace(trace, 256);
565
555
    if (!n)
566
 
        return s;
 
556
        return s;
567
557
    char** strings = backtrace_symbols (trace, n);
568
558
 
569
559
    if ( levels != -1 )
577
567
    s += "]\n";
578
568
    if (strings)
579
569
        free (strings);
 
570
#else
 
571
    Q_UNUSED(levels)
580
572
#endif
581
573
    return s;
582
574
}