[ekiga/ds-gtk-application] EkigaApp: Moved debug output handling to Ekiga GtkApplication.



commit 99fc49dadb39d58b2a10493159335589b36bfedf
Author: Damien Sandras <dsandras beip be>
Date:   Sun Feb 9 13:45:33 2014 +0100

    EkigaApp: Moved debug output handling to Ekiga GtkApplication.

 lib/engine/gui/gtk-frontend/ekiga-app.cpp |   23 +++++++++++++++++++++++
 src/main.cpp                              |   24 ------------------------
 2 files changed, 23 insertions(+), 24 deletions(-)
---
diff --git a/lib/engine/gui/gtk-frontend/ekiga-app.cpp b/lib/engine/gui/gtk-frontend/ekiga-app.cpp
index 6fc62d3..f328ee2 100644
--- a/lib/engine/gui/gtk-frontend/ekiga-app.cpp
+++ b/lib/engine/gui/gtk-frontend/ekiga-app.cpp
@@ -450,6 +450,29 @@ gm_application_command_line (GApplication *app,
     g_print (g_option_context_get_help (context, TRUE, NULL));
     g_application_quit (app);
   }
+  else if (debug_level > 0) {
+#ifndef WIN32
+    char* text_label =  g_strdup_printf ("%d", debug_level);
+    setenv ("PTLIB_TRACE_CODECS", text_label, TRUE);
+    g_free (text_label);
+#else
+    char* text_label =  g_strdup_printf ("PTLIB_TRACE_CODECS=%d", debug_level);
+    _putenv (text_label);
+    g_free (text_label);
+    if (debug_level != 0) {
+      std::string desk_path = g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP);
+      if (!desk_path.empty ())
+        std::freopen((desk_path + "\\ekiga-stderr.txt").c_str (), "w", stderr);
+    }
+#endif
+
+#if PTRACING
+    if (debug_level != 0)
+      PTrace::Initialise (PMAX (PMIN (8, debug_level), 0), NULL,
+                          PTrace::Timestamp | PTrace::Thread
+                          | PTrace::Blocks | PTrace::DateAndTime);
+#endif
+  }
 
   g_strfreev (arguments);
   g_option_context_free (context);
diff --git a/src/main.cpp b/src/main.cpp
index e40e98d..fd7e672 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -109,30 +109,6 @@ main (int argc,
   setenv ("PA_PROP_MEDIA_ROLE", "phone", true);
 #endif
 
-
-#ifndef WIN32
-  char* text_label =  g_strdup_printf ("%d", debug_level);
-  setenv ("PTLIB_TRACE_CODECS", text_label, TRUE);
-  g_free (text_label);
-#else
-  char* text_label =  g_strdup_printf ("PTLIB_TRACE_CODECS=%d", debug_level);
-  _putenv (text_label);
-  g_free (text_label);
-  if (debug_level != 0) {
-    std::string desk_path = g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP);
-    if (!desk_path.empty ())
-      std::freopen((desk_path + "\\ekiga-stderr.txt").c_str (), "w", stderr);
-  }
-#endif
-
-#if PTRACING
-  if (debug_level != 0)
-    PTrace::Initialise (PMAX (PMIN (8, debug_level), 0), NULL,
-                       PTrace::Timestamp | PTrace::Thread
-                       | PTrace::Blocks | PTrace::DateAndTime);
-#endif
-
-
   PTRACE (1, "Ekiga version "
           << MAJOR_VERSION << "." << MINOR_VERSION << "." << BUILD_NUMBER);
 #ifdef EKIGA_REVISION


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]