Index: io/kdebug.cpp
===================================================================
--- io/kdebug.cpp	(revision 711197)
+++ io/kdebug.cpp	(working copy)
@@ -202,7 +202,7 @@
     typedef QHash<unsigned int, Area> Cache;
 
     KDebugPrivate()
-        : config(0), kDebugDBusIface(0)
+        : config(0), kDebugDBusIface(0), defaultArea(0)
     {
         Q_ASSERT(int(QtDebugMsg) == 0);
         Q_ASSERT(int(QtFatalMsg) == 3);
@@ -359,6 +359,9 @@
             loadAreaNames();
         }
 
+        if (defaultArea != 0 && num == 0)
+            num = defaultArea; 
+            
         if (!cache.contains(num))
             // unknown area
             return cache.find(0);
@@ -558,6 +561,7 @@
     KFileDebugStream filewriter;
     KMessageBoxDebugStream messageboxwriter;
     KLineEndStrippingDebugStream lineendstrippingwriter;
+    int defaultArea;
 };
 
 K_GLOBAL_STATIC(KDebugPrivate, kDebug_data)
@@ -592,6 +596,20 @@
     return QDebug(&kDebug_data->devnull);
 }
 
+void kDebugSetDefaultArea(int area)
+{
+    if (!kDebug_data) 
+        return;
+    kDebug_data->defaultArea = area;
+}
+
+int kDebugDefaultArea()
+{
+    if (!kDebug_data) 
+        return 0;
+    return kDebug_data->defaultArea;
+}
+
 QDebug kDebugStream(QtMsgType level, int area, const char *file, int line, const char *funcinfo)
 {
     if (kDebug_data.isDestroyed()) {
Index: io/kdebug.h
===================================================================
--- io/kdebug.h	(revision 711197)
+++ io/kdebug.h	(working copy)
@@ -103,6 +103,19 @@
  */
 KDECORE_EXPORT void kClearDebugConfig();
 
+/**
+ * \relates KGlobal
+ * set the default debug area to a different value
+ * @param area an id to identify the default area for output
+ */
+KDECORE_EXPORT void kDebugSetDefaultArea(int area);
+
+/**
+ * \relates KGlobal
+ * return the currently set default debug area 
+ */
+KDECORE_EXPORT int kDebugDefaultArea();
+
 #if !defined(KDE_NO_DEBUG_OUTPUT)
 /**
  * \relates KGlobal
