[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/security/pwmanager/pwmanager/libpwmanager
From:       Michael Buesch <mbuesch () freenet ! de>
Date:       2006-06-06 18:21:00
Message-ID: 1149618060.980288.13387.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 548879 by mbuesch:

beautify filenames in debug messages (remove paths).


 M  +15 -5     exceptions.cpp  


--- trunk/extragear/security/pwmanager/pwmanager/libpwmanager/exceptions.cpp #548878:548879
@@ -34,11 +34,21 @@
 static sig_atomic_t exceptionInProgress;
 
 
+static QString beautifyFile(const char *file)
+{
+	QString str(file);
+	int pos = str.findRev('/');
+	if (pos != -1)
+		pos++;
+	str = str.right(str.length() - pos);
+	return str;
+}
+
 #ifdef PWM_DEBUG
 kdbgstream _debugMsg(const char *file, int line, const char *func)
 {
 	kdbgstream stream(debugStream());
-	stream << file << ":" << line << " [" << func << "()]   ";
+	stream << beautifyFile(file) << ":" << line << " [" << func << "()]   ";
 	return stream;
 }
 #endif
@@ -46,28 +56,28 @@
 kdbgstream _infoMsg(const char *file, int line)
 {
 	kdbgstream stream(infoStream());
-	stream << "INFO: " << file << ":" << line << "   ";
+	stream << "INFO: " << beautifyFile(file) << ":" << line << "   ";
 	return stream;
 }
 
 kdbgstream _warnMsg(const char *file, int line)
 {
 	kdbgstream stream(warnStream());
-	stream << file << ":" << line << "   ";
+	stream << beautifyFile(file) << ":" << line << "   ";
 	return stream;
 }
 
 kdbgstream _errorMsg(const char *file, int line)
 {
 	kdbgstream stream(errorStream());
-	stream << file << ":" << line << "   ";
+	stream << beautifyFile(file) << ":" << line << "   ";
 	return stream;
 }
 
 kdbgstream _fatalMsg(const char *file, int line)
 {
 	kdbgstream stream(fatalStream());
-	stream << file << ":" << line << "   ";
+	stream << beautifyFile(file) << ":" << line << "   ";
 	return stream;
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic