[kad-general] [PATCH] little-typo-fix

[ Thread Index | Date Index | More lists.tuxfamily.org/kad-general Archives ]


From 68b88a85fb3f0be77b824c10373051966a270526 Mon Sep 17 00:00:00 2001
From: Riccardo Gori <goric@xxxxxxxxxxx>
Date: Tue, 1 Apr 2008 23:16:04 +0200
Subject: [PATCH] little typo fix

---
 qcadlib/src/debug/rs_debug.cpp |   45 ++++++++++++++-------------------------
 1 files changed, 16 insertions(+), 29 deletions(-)

diff --git a/qcadlib/src/debug/rs_debug.cpp b/qcadlib/src/debug/rs_debug.cpp
index 0fff86f..28311ab 100644
--- a/qcadlib/src/debug/rs_debug.cpp
+++ b/qcadlib/src/debug/rs_debug.cpp
@@ -30,10 +30,6 @@
 #include <stdio.h>
 #include <stdarg.h>
 
-#include "rs_datetime.h"
-#include "rs_string.h"
-#include "rs_system.h"
-
 RS_Debug* RS_Debug::uniqueInstance = NULL;
 
 
@@ -46,21 +42,15 @@ RS_Debug* RS_Debug::uniqueInstance = NULL;
  */
 RS_Debug* RS_Debug::instance() {
     if(uniqueInstance==NULL) {
-        RS_DateTime now = RS_DateTime::currentDateTime();
+        QDateTime now = QDateTime::currentDateTime();
         QString nowStr;
-#if QT_VERSION>=0x030000
-		nowStr = now.toString("yyyyMMdd_hhmmss");
-#else
-		nowStr = now.toString();
-#endif
-		//QString fName = QString("%1/debug_%2.log")
-		//	.arg(RS_SYSTEM->getHomeDir())
-		//	.arg(nowStr);
-		QString fName = QString("debug_%1.log")
-			.arg(nowStr);
+
+	nowStr = now.toString("yyyyMMdd_hhmmss");
+
+	QString fName = QString("debug_%1.log").arg(nowStr);
 
         uniqueInstance = new RS_Debug;
-        //uniqueInstance->stream = fopen(fName.toLatin1(), "wt");
+
         uniqueInstance->stream = stderr;
     }
     return uniqueInstance;
@@ -80,10 +70,10 @@ RS_Debug::deleteInstance() {
 
 
 /**
- * Constructor for a point with default coordinates.
+ * Constructor.
  */
 RS_Debug::RS_Debug() {
-    debugLevel = D_DEBUGGING;
+    debugLevel = D_WARNING;
 }
 
 /**
@@ -91,11 +81,11 @@ RS_Debug::RS_Debug() {
  */
 void RS_Debug::setLevel(RS_DebugLevel level) {
     debugLevel = level;
-    print("RS_DEBUG: Warnings", D_WARNING);
-    print("RS_DEBUG: Errors", D_ERROR);
-    print("RS_DEBUG: Notice", D_NOTICE);
-    print("RS_DEBUG: Informational", D_INFORMATIONAL);
-    print("RS_DEBUG: Debugging", D_DEBUGGING);
+    print(D_WARNING, "RS_DEBUG: Warnings");
+    print(D_ERROR, "RS_DEBUG: Errors");
+    print(D_NOTICE, "RS_DEBUG: Notice");
+    print(D_INFORMATIONAL, "RS_DEBUG: Informational");
+    print(D_DEBUGGING, "RS_DEBUG: Debugging");
 }
 
 
@@ -146,14 +136,11 @@ void RS_Debug::print(RS_DebugLevel level, const char* format ...) {
  * Prints a time stamp in the format yyyyMMdd_hhmmss.
  */
 void RS_Debug::timestamp() {
-    RS_DateTime now = RS_DateTime::currentDateTime();
+    QDateTime now = QDateTime::currentDateTime();
     QString nowStr;
 
-#if QT_VERSION>=0x030000
-		nowStr = now.toString("yyyyMMdd_hh:mm:ss:zzz ");
-#else
-		nowStr = now.toString();
-#endif
+    nowStr = now.toString("yyyyMMdd_hh:mm:ss:zzz ");
+
     fprintf(stream, nowStr.toLatin1());
     fprintf(stream, "\n");
     fflush(stream);
-- 
1.5.3.7



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/