[med-svn] [SCM] aghermann branch, master, updated. c0bd21ca8eb529ade7e0c7aad22951a308a8dc8f

Andrei Zavada johnhommer at gmail.com
Wed May 1 00:09:44 UTC 2013


The following commit has been merged in the master branch:
commit d1e5e194cc8311eae9f02e9c051060c739c443fe
Author: Andrei Zavada <johnhommer at gmail.com>
Date:   Tue Apr 30 01:58:12 2013 +0300

    correctly report SChannel::name()

diff --git a/src/libsigfile/channel.hh b/src/libsigfile/channel.hh
index e34281e..d8f8482 100644
--- a/src/libsigfile/channel.hh
+++ b/src/libsigfile/channel.hh
@@ -145,14 +145,17 @@ struct SChannel {
 
 	const char* name() const
 		{
-			switch ( _type ) {
-			case TType::eeg: return channel_s<TType::eeg>( _idx);
-			case TType::eog: return channel_s<TType::eog>( _idx);
-			case TType::emg: return channel_s<TType::emg>( _idx);
-			case TType::ecg: return channel_s<TType::ecg>( _idx);
-			case TType::erg: return channel_s<TType::erg>( _idx);
-			default: return _custom_name.c_str();
-			}
+			if ( _custom_name.empty() )
+				switch ( _type ) {
+				case TType::eeg: return channel_s<TType::eeg>( _idx);
+				case TType::eog: return channel_s<TType::eog>( _idx);
+				case TType::emg: return channel_s<TType::emg>( _idx);
+				case TType::ecg: return channel_s<TType::ecg>( _idx);
+				case TType::erg: return channel_s<TType::erg>( _idx);
+				default: return "(unknown)";
+				}
+			else
+				return _custom_name.c_str();
 		}
 	const char* c_str() const
 		{ return name(); }

-- 
Sleep experiment manager



More information about the debian-med-commit mailing list