From 8acb29e00a2f1d6abc517cff4b76e85a6386fd04 Mon Sep 17 00:00:00 2001
From: "shirenzhi2015@gmail.com" <18354291536@163.com>
Date: Mon, 6 May 2019 02:10:53 +0800
Subject: [PATCH] change all Q_WS_XXX macro to Qt5 style

---
 src/commands/ExternalProcessingDialog.cpp |  74 ++--
 src/common/RingBuffer.cpp                 |  10 +-
 src/common/RingBufferNPT.h                |  50 +--
 src/core/DiskIO.cpp                       |  13 +-
 src/core/FileHelpers.cpp                  |   2 +-
 src/core/Peak.cpp                         | 396 +++++++++++-----------
 src/core/Project.cpp                      | 136 ++++----
 src/engine/AudioDeviceThread.cpp          |  23 +-
 src/plugins/LV2/LV2Plugin.cpp             |  83 +++--
 src/sheetcanvas/ViewItem.h                |   8 +-
 src/traverso/Main.cpp                     |  13 +-
 src/traverso/TMainWindow.cpp              |   6 +-
 src/traverso/dialogs/CDWritingDialog.cpp  | 185 +++++-----
 src/traverso/dialogs/settings/Pages.cpp   | 169 +++++----
 src/traverso/widgets/InfoWidgets.cpp      | 114 +++----
 src/traverso/widgets/ResourcesWidget.cpp  | 129 ++++---
 16 files changed, 701 insertions(+), 710 deletions(-)

diff --git a/src/commands/ExternalProcessingDialog.cpp b/src/commands/ExternalProcessingDialog.cpp
index 8fbd518e..f8833b11 100644
--- a/src/commands/ExternalProcessingDialog.cpp
+++ b/src/commands/ExternalProcessingDialog.cpp
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2007 Remon Sijrier 
+Copyright (C) 2007 Remon Sijrier
 
 This file is part of Traverso
 
@@ -49,14 +49,14 @@ ExternalProcessingDialog::ExternalProcessingDialog(QWidget * parent, AudioClipEx
 	setupUi(this);
 	m_acep = acep;
 	m_queryOptions = false;
-	
+
 	m_processor = new QProcess(this);
 	m_processor->setProcessChannelMode(QProcess::MergedChannels);
-	
+
 	m_completer = 0;
-	
+
 	command_lineedit_text_changed("sox");
-	
+
 	connect(m_processor, SIGNAL(readyReadStandardOutput()), this, SLOT(read_standard_output()));
 	connect(m_processor, SIGNAL(started()), this, SLOT(process_started()));
 	connect(m_processor, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(process_finished(int, QProcess::ExitStatus)));
@@ -76,46 +76,46 @@ ExternalProcessingDialog::~ ExternalProcessingDialog()
 void ExternalProcessingDialog::prepare_for_external_processing()
 {
 	m_commandargs = argumentsLineEdit->text();
-	
+
 	if (m_commandargs.isEmpty()) {
 		statusText->setText(tr("You have to supply an argument before starting the external process!"));
 		return;
 	}
-	
+
 	ReadSource* rs = resources_manager()->get_readsource(m_acep->m_clip->get_readsource_id());
-	
+
 	//This should NOT be possible, but just in case....
 	if (! rs) {
 		qDebug("ExternalProcessing:: resources manager did NOT return a resource for the to be processed audioclip (%lld) !!!!\n", m_acep->m_clip->get_id());
 		return;
 	}
-	
+
 	m_filename = rs->get_name();
 	m_newClipName= rs->get_short_name().remove(".wav") + "-" + m_commandargs.simplified();
-	
+
 	m_infilename = rs->get_filename();
-	// remove the extension and any dots that might confuse the external program, append the 
+	// remove the extension and any dots that might confuse the external program, append the
 	// new name and again the extension.
-	m_outfilename = pm().get_project()->get_audiosources_dir() + 
+	m_outfilename = pm().get_project()->get_audiosources_dir() +
 			m_filename.remove(".wav").remove(".").append("-").append(m_commandargs.simplified()).append(".wav");
-	
-	
+
+
 	start_external_processing();
 }
 
 void ExternalProcessingDialog::start_external_processing()
 {
 	m_arguments.clear();
-	
+
 	// On mac os x (and perhaps windows) the full path is given, so we check if the path contains sox!
 	if (m_program.contains("sox")) {
 		m_arguments.append("-S");
 	}
-	
+
 	m_arguments.append(m_infilename);
 	m_arguments.append(m_outfilename);
 	m_arguments += m_commandargs.split(QRegExp("\\s+"));
-	
+
 	m_processor->start(m_program, m_arguments);
 }
 
@@ -123,10 +123,10 @@ void ExternalProcessingDialog::read_standard_output()
 {
 	if (m_queryOptions) {
 		QString result = m_processor->readAllStandardOutput();
-		// This list is used to collect the availabe arguments for the 
+		// This list is used to collect the availabe arguments for the
 		// arugment lineedit completer.
 		QStringList completionlist;
-		
+
 		// On mac os x (and perhaps windows) the full path is given, so we check if the path contains sox!
 		if (m_program.contains("sox")) {
 			QStringList list = result.split("\n");
@@ -147,16 +147,16 @@ void ExternalProcessingDialog::read_standard_output()
 		if (m_completer) {
 			delete m_completer;
 		}
-			
+
 			// Set the completer for the arguments line edit.
 		m_completer = new QCompleter(completionlist, this);
 		argumentsLineEdit->setCompleter(m_completer);
-		
+
 		return;
 	}
-	
+
 	QString result = m_processor->readAllStandardOutput();
-	
+
 	if (result.contains("%")) {
 		QStringList tokens = result.split(QRegExp("\\s+"));
 		foreach(QString token, tokens) {
@@ -171,7 +171,7 @@ void ExternalProcessingDialog::read_standard_output()
 			}
 		}
 	}
-	
+
 	statusText->append(result);
 }
 
@@ -184,40 +184,40 @@ void ExternalProcessingDialog::process_finished(int exitcode, QProcess::ExitStat
 {
 	Q_UNUSED(exitcode);
 	Q_UNUSED(exitstatus);
-	
+
 	if (m_queryOptions) {
 		m_queryOptions = false;
 		return;
 	}
-	
+
 	if (exitstatus == QProcess::CrashExit) {
 		statusText->setHtml(tr("Program <b>%1</b> crashed!").arg(m_program));
 		return;
 	}
-	
+
 	QString dir = pm().get_project()->get_audiosources_dir();
-	
+
 	// In case we used the merger, remove the file...
 	QFile::remove(dir + "/merged.wav");
-	
-	
+
+
 	QString result = m_processor->readAllStandardOutput();
 	// print anything on command line we didn't catch
 	printf("output: \n %s", QS_C(result));
-		
+
 	ReadSource* source = resources_manager()->import_source(dir, m_filename);
 	if (!source) {
 		printf("ResourcesManager didn't return a ReadSource, most likely sox didn't understand your command\n");
 		return rejected();
 	}
-		
+
 	m_acep->m_resultingclip = resources_manager()->new_audio_clip(m_newClipName);
 	resources_manager()->set_source_for_clip(m_acep->m_resultingclip, source);
 	// Clips live at project level, we have to set its Sheet, Track and ReadSource explicitely!!
 	m_acep->m_resultingclip->set_sheet(m_acep->m_clip->get_sheet());
 	m_acep->m_resultingclip->set_track(m_acep->m_clip->get_track());
 	m_acep->m_resultingclip->set_track_start_location(m_acep->m_clip->get_track_start_location());
-	
+
 	close();
 }
 
@@ -230,14 +230,14 @@ void ExternalProcessingDialog::query_options()
 
 void ExternalProcessingDialog::arg_combo_index_changed(const QString & text)
 {
-	argumentsLineEdit->setText(text);	
+	argumentsLineEdit->setText(text);
 }
 
 void ExternalProcessingDialog::command_lineedit_text_changed(const QString & text)
 {
 	m_program = text.simplified();
 	if (m_program == "sox") {
-		#if defined (Q_WS_MAC)
+		#if defined (Q_OS_MAC)
 			m_program = qApp->applicationDirPath() + "/sox";
 		#endif
 
@@ -246,7 +246,7 @@ void ExternalProcessingDialog::command_lineedit_text_changed(const QString & tex
 		argsComboBox->setToolTip(tr("Available arguments for the sox program"));
 		return;
 	}
-	
+
 	argsComboBox->hide();
 }
 
@@ -256,5 +256,3 @@ void ExternalProcessingDialog::process_error(QProcess::ProcessError error)
 		statusText->setHtml(tr("Program <b>%1</b> not installed, or insufficient permissions to run!").arg(m_program));
 	}
 }
-
- 
diff --git a/src/common/RingBuffer.cpp b/src/common/RingBuffer.cpp
index 2c442573..30d430e2 100755
--- a/src/common/RingBuffer.cpp
+++ b/src/common/RingBuffer.cpp
@@ -18,7 +18,7 @@
   GNU Lesser General Public License for more details.
 
   You should have received a copy of the GNU Lesser General Public License
-  along with this program; if not, write to the Free Software 
+  along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 
   ISO/POSIX C version of Paul Davis's lock free ringbuffer C++ code.
@@ -30,7 +30,7 @@
 #include <string.h>
 #ifdef USE_MLOCK
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 #include <sys/types.h>
 #endif /* Q_WS_MAC */
 
@@ -60,7 +60,7 @@ RingBuffer::RingBuffer(size_t sz)
         write_ptr = 0;
         read_ptr = 0;
         buf = new char[size];
-         
+
         mlocked = 0;
         if (mlock_buffer() < 0) {
         	PERROR("Failed to memory lock buffer!");
@@ -278,7 +278,7 @@ void RingBuffer::write_advance (size_t cnt)
 }
 
 /* The non-copying data reader.  `vec' is an array of two places.  Set
-   the values at `vec' to hold the current readable data'.  If   the readable 
+   the values at `vec' to hold the current readable data'.  If   the readable
    data is in one segment the second segment has zero length.  */
 
 void RingBuffer::get_read_vector (ringbuffer_data_t * vec)
@@ -319,7 +319,7 @@ void RingBuffer::get_read_vector (ringbuffer_data_t * vec)
 }
 
 /* The non-copying data writer.  `vec' is an array of two places.  Set
-   the values at `vec' to hold the current writeable data.  If the writeable 
+   the values at `vec' to hold the current writeable data.  If the writeable
    data is in one segment the second segment has zero length.  */
 
 void RingBuffer::get_write_vector (ringbuffer_data_t * vec)
diff --git a/src/common/RingBufferNPT.h b/src/common/RingBufferNPT.h
index 2a1c5070..4d194fb7 100755
--- a/src/common/RingBufferNPT.h
+++ b/src/common/RingBufferNPT.h
@@ -23,7 +23,7 @@
 
 #include <stdio.h>
 
-#if ! defined (Q_WS_WIN)
+#if ! defined (Q_OS_WIN)
 #include <sys/mman.h>
 #endif
 
@@ -46,7 +46,7 @@ class RingBufferNPT
 		reset ();
 
 	};
-	
+
 	virtual ~RingBufferNPT() {
 #ifdef USE_MLOCK
 		munlock (buf, size);
@@ -65,7 +65,7 @@ class RingBufferNPT
 		t_atomic_int_set (&write_ptr, w);
 		t_atomic_int_set (&read_ptr, r);
 	}
-	
+
 	size_t  read  (T *dest, size_t cnt);
 	size_t  write (T *src, size_t cnt);
 
@@ -76,25 +76,25 @@ class RingBufferNPT
 
 	void get_read_vector (rw_vector *);
 	void get_write_vector (rw_vector *);
-	
+
 	void decrement_read_ptr (size_t cnt) {
 		t_atomic_int_set (&read_ptr, (t_atomic_int_get(&read_ptr) - cnt) % size);
-	}                
+	}
 
 	void increment_read_ptr (size_t cnt) {
 		t_atomic_int_set (&read_ptr, (t_atomic_int_get(&read_ptr) + cnt) % size);
-	}                
+	}
 
 	void increment_write_ptr (size_t cnt) {
 		t_atomic_int_set (&write_ptr,  (t_atomic_int_get(&write_ptr) + cnt) % size);
-	}                
+	}
 
 	size_t write_space () {
 		size_t w, r;
-		
+
 		w = t_atomic_int_get (&write_ptr);
 		r = t_atomic_int_get (&read_ptr);
-		
+
 		if (w > r) {
 			return ((r - w + size) % size) - 1;
 		} else if (w < r) {
@@ -103,13 +103,13 @@ class RingBufferNPT
 			return size - 1;
 		}
 	}
-	
+
 	size_t read_space () {
 		size_t w, r;
-		
+
 		w = t_atomic_int_get (&write_ptr);
 		r = t_atomic_int_get (&read_ptr);
-		
+
 		if (w > r) {
 			return w - r;
 		} else {
@@ -145,7 +145,7 @@ RingBufferNPT<T>::read (T *dest, size_t cnt)
         }
 
         to_read = cnt > free_cnt ? free_cnt : cnt;
-        
+
         cnt2 = priv_read_ptr + to_read;
 
         if (cnt2 > size) {
@@ -155,7 +155,7 @@ RingBufferNPT<T>::read (T *dest, size_t cnt)
                 n1 = to_read;
                 n2 = 0;
         }
-        
+
         memcpy (dest, &buf[priv_read_ptr], n1 * sizeof (T));
         priv_read_ptr = (priv_read_ptr + n1) % size;
 
@@ -184,7 +184,7 @@ RingBufferNPT<T>::write (T *src, size_t cnt)
         }
 
         to_write = cnt > free_cnt ? free_cnt : cnt;
-        
+
         cnt2 = priv_write_ptr + to_write;
 
         if (cnt2 > size) {
@@ -213,10 +213,10 @@ RingBufferNPT<T>::get_read_vector (RingBufferNPT<T>::rw_vector *vec)
 	size_t free_cnt;
 	size_t cnt2;
 	size_t w, r;
-	
+
 	w = t_atomic_int_get (&write_ptr);
 	r = t_atomic_int_get (&read_ptr);
-	
+
 	if (w > r) {
 		free_cnt = w - r;
 	} else {
@@ -227,7 +227,7 @@ RingBufferNPT<T>::get_read_vector (RingBufferNPT<T>::rw_vector *vec)
 
 	if (cnt2 > size) {
 		/* Two part vector: the rest of the buffer after the
-		   current write ptr, plus some from the start of 
+		   current write ptr, plus some from the start of
 		   the buffer.
 		*/
 
@@ -237,9 +237,9 @@ RingBufferNPT<T>::get_read_vector (RingBufferNPT<T>::rw_vector *vec)
 		vec->len[1] = cnt2 % size;
 
 	} else {
-		
+
 		/* Single part vector: just the rest of the buffer */
-		
+
 		vec->buf[0] = &buf[r];
 		vec->len[0] = free_cnt;
 		vec->len[1] = 0;
@@ -252,10 +252,10 @@ RingBufferNPT<T>::get_write_vector (RingBufferNPT<T>::rw_vector *vec)
 	size_t free_cnt;
 	size_t cnt2;
 	size_t w, r;
-	
+
 	w = t_atomic_int_get (&write_ptr);
 	r = t_atomic_int_get (&read_ptr);
-	
+
 	if (w > r) {
 		free_cnt = ((r - w + size) % size) - 1;
 	} else if (w < r) {
@@ -263,13 +263,13 @@ RingBufferNPT<T>::get_write_vector (RingBufferNPT<T>::rw_vector *vec)
 	} else {
 		free_cnt = size - 1;
 	}
-	
+
 	cnt2 = w + free_cnt;
 
 	if (cnt2 > size) {
-		
+
 		/* Two part vector: the rest of the buffer after the
-		   current write ptr, plus some from the start of 
+		   current write ptr, plus some from the start of
 		   the buffer.
 		*/
 
diff --git a/src/core/DiskIO.cpp b/src/core/DiskIO.cpp
index da261485..27208ead 100644
--- a/src/core/DiskIO.cpp
+++ b/src/core/DiskIO.cpp
@@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 #include "Sheet.h"
 #include <QThread>
 
-#if defined (Q_WS_X11)
+#if defined (Q_OS_UNIX)
 
 #include <unistd.h>
 #include <sys/syscall.h>
@@ -66,7 +66,7 @@ const char *to_prio[] = { "none", "realtime", "best-effort", "idle", };
 #define IOPRIO_CLASS_SHIFT	13
 #define IOPRIO_PRIO_MASK	0xff
 
-#endif // endif Q_WS_X11
+#endif // endif Q_OS_UNIX
 
 #include "AbstractAudioReader.h"
 #include "AudioSource.h"
@@ -106,7 +106,7 @@ protected:
 
 void DiskIOThread::run()
 {
-#if defined (Q_WS_X11)
+#if defined (Q_OS_UNIX)
     if (IOPRIO_SUPPORT) {
         // When using the cfq scheduler we are able to set the priority of the io for what it's worth though :-)
         int ioprio = 0, ioprio_class = IOPRIO_CLASS_RT;
@@ -134,7 +134,7 @@ void DiskIOThread::run()
 
 
 
-/** 	\class DiskIO 
+/** 	\class DiskIO
  *	\brief handles all the read's and write's of AudioSources in it's private thread.
  *
  *	Each Sheet class has it's own DiskIO instance.
@@ -179,8 +179,8 @@ DiskIO::~DiskIO()
 /**
 * 	Seek's all the ReadSources readbuffers to the new position.
 *	Call prepare_seek() first, to interupt do_work() if it was running.
-* 
-* @param position The position to seek too 
+*
+* @param position The position to seek too
 */
 void DiskIO::seek()
 {
@@ -528,4 +528,3 @@ void DiskIO::set_resample_quality(int quality)
 {
     m_resampleQuality = quality;
 }
-
diff --git a/src/core/FileHelpers.cpp b/src/core/FileHelpers.cpp
index 271aa88c..e364f45e 100644
--- a/src/core/FileHelpers.cpp
+++ b/src/core/FileHelpers.cpp
@@ -89,7 +89,7 @@ int FileHelper::remove_recursively(const QString& pName)
 
 int FileHelper::copy_recursively(const QString& pNameFrom, const QString& pNameTo)
 {
-#if defined (Q_WS_X11) || defined (Q_WS_MAC)
+#if defined (Q_OS_UNIX) || defined (Q_OS_MAC)
 	QString nameFrom = config().get_property("Project", "directory", "/directory/unknown").toString();
 	QString nameTo(nameFrom);
 
diff --git a/src/core/Peak.cpp b/src/core/Peak.cpp
index 7d18bcab..2edbce03 100644
--- a/src/core/Peak.cpp
+++ b/src/core/Peak.cpp
@@ -43,7 +43,7 @@ int Peak::zoomStep[] = {
 	// non-cached zoomlevels.
 	1, 2, 4, 8, 12, 16, 24, 32,
  	// Cached zoomlevels
- 	64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576 
+ 	64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576
 };
 
 QHash<int, int> Peak::chacheIndexLut;
@@ -51,9 +51,9 @@ QHash<int, int> Peak::chacheIndexLut;
 Peak::Peak(AudioSource* source)
 {
 	PENTERCONS;
-	
+
 	m_peaksAvailable = m_permanentFailure = m_interuptPeakBuild = false;
-	
+
 	QString sourcename = source->get_name();
 	QString path;
 	Project* project = pm().get_project();
@@ -63,20 +63,20 @@ Peak::Peak(AudioSource* source)
 		path = source->get_dir();
 		path = path.replace("audiosources", "peakfiles");
 	}
-	
+
 	for (uint chan = 0; chan < source->get_channel_count(); ++ chan) {
 		ChannelData* data = new Peak::ChannelData;
-		
+
 		data->fileName = sourcename + "-ch" + QByteArray::number(chan) + ".peak";
 		data->fileName.prepend(path);
 		data->pd = nullptr;
 		data->peakreader = nullptr;
-		
+
 		m_channelData.append(data);
 	}
-	
+
 	ReadSource* rs = qobject_cast<ReadSource*>(source);
-	
+
 	if (rs) {
 		// This Peak object was created by AudioClip, meant for reading peak data
 		m_source = resources_manager()->get_readsource(rs->get_id());
@@ -90,17 +90,17 @@ Peak::Peak(AudioSource* source)
 Peak::~Peak()
 {
 	PENTERDES;
-	
-	
+
+
 		delete m_source;
-	
-	
+
+
 	foreach(ChannelData* data, m_channelData) {
 		if (data->normFile.isOpen()) {
 			QFile::remove(data->normFileName);
 		}
 #if QT_VERSION < 0x040400
-#if defined Q_WS_X11 || defined Q_WS_MAC
+#if defined Q_OS_UNIX || defined Q_OS_MAC
 		if (data->memory) {
 			uchar *start = data->memory - data->maps[data->memory].first;
 			int len = data->maps[data->memory].second;
@@ -110,9 +110,9 @@ Peak::~Peak()
 		}
 #endif
 #endif
-		
+
 			delete data->peakreader;
-		
+
 		delete data;
 	}
 }
@@ -125,42 +125,42 @@ void Peak::close()
 int Peak::read_header()
 {
 	PENTER;
-	
+
 	Q_ASSERT(m_source);
-	
+
 	foreach(ChannelData* data, m_channelData) {
-		
+
 		data->file.setFileName(data->fileName);
-		
+
 		if (! data->file.open(QIODevice::ReadOnly)) {
 			if (QFile::exists(data->fileName)) {
 				m_permanentFailure = true;
 			}
-				
+
 			QString errorstring = FileHelper::fileerror_to_string(data->file.error());
 			qWarning("Couldn't open peak file for reading! (%s, Error: %s)", QS_C(data->fileName), QS_C(errorstring));
 			return -1;
 		}
-		
+
 		QFileInfo file(m_source->get_filename());
 		QFileInfo peakFile(data->fileName);
-		
+
 		QDateTime fileModTime = file.lastModified();
 		QDateTime peakModTime = peakFile.lastModified();
-		
+
 		if (fileModTime > peakModTime) {
 			PERROR("Source and Peak file modification time do not match");
 			printf("SourceFile modification time is %s\n", fileModTime.toString().toLatin1().data());
 			printf("PeakFile modification time is %s\n", peakModTime.toString().toLatin1().data());
 			return -1;
 		}
-		
-		
+
+
 		data->file.seek(0);
-	
+
 		data->file.read(data->headerdata.label, sizeof(data->headerdata.label));
         data->file.read(reinterpret_cast<char*>(data->headerdata.version), sizeof(data->headerdata.version));
-	
+
         if ((data->headerdata.label[0]!='T') ||
 			(data->headerdata.label[1]!='R') ||
 			(data->headerdata.label[2]!='A') ||
@@ -173,25 +173,25 @@ int Peak::read_header()
 				data->file.close();
 				return -1;
 		}
-		
+
 		data->file.read((char*)data->headerdata.peakDataOffsets, sizeof(data->headerdata.peakDataOffsets));
 		data->file.read((char*)data->headerdata.peakDataSizeForLevel, sizeof(data->headerdata.peakDataSizeForLevel));
 		data->file.read((char*)&data->headerdata.normValuesDataOffset, sizeof(data->headerdata.normValuesDataOffset));
 		data->file.read((char*)&data->headerdata.headerSize, sizeof(data->headerdata.headerSize));
-		
+
 		data->peakreader = new PeakDataReader(data);
 		data->peakdataDecodeBuffer = new DecodeBuffer;
 	}
-	
+
 	m_peaksAvailable = true;
-		
+
 	return 1;
 }
 
 int Peak::write_header(ChannelData* data)
 {
 	PENTER;
-	
+
 	data->file.seek(0);
 
 	data->headerdata.label[0] = 'T';
@@ -202,14 +202,14 @@ int Peak::write_header(ChannelData* data)
 	data->headerdata.label[5] = 'F';
 	data->headerdata.version[0] = PEAKFILE_MAJOR_VERSION;
 	data->headerdata.version[1] = PEAKFILE_MINOR_VERSION;
-	
+
 	data->file.write((char*)data->headerdata.label, sizeof(data->headerdata.label));
 	data->file.write((char*)data->headerdata.version, sizeof(data->headerdata.version));
 	data->file.write((char*)data->headerdata.peakDataOffsets, sizeof(data->headerdata.peakDataOffsets));
 	data->file.write((char*)data->headerdata.peakDataSizeForLevel, sizeof(data->headerdata.peakDataSizeForLevel));
 	data->file.write((char*) &data->headerdata.normValuesDataOffset, sizeof(data->headerdata.normValuesDataOffset));
 	data->file.write((char*) &data->headerdata.headerSize, sizeof(data->headerdata.headerSize));
-	
+
 	return 1;
 }
 
@@ -228,26 +228,26 @@ int Peak::calculate_peaks(
 	qreal framesPerPeak)
 {
 	PENTER3;
-	
+
 	if (m_permanentFailure) {
 		return PERMANENT_FAILURE;
 	}
-	
+
 	if(!m_peaksAvailable) {
 		if (read_header() < 0) {
 			return NO_PEAK_FILE;
 		}
 	}
-	
+
 	if (peakDataCount <= 0) {
 		return NO_PEAKDATA_FOUND;
 	}
-	
+
 	ChannelData* data = m_channelData.at(chan);
 	int produced = 0;
-	
+
 // 	PROFILE_START;
-	
+
 	// Macro view mode
 	if (framesPerPeak >= 64) {
 		int highbit;
@@ -255,15 +255,15 @@ int Peak::calculate_peaks(
 		if (nearestpow2 == 0) {
 			return NO_PEAKDATA_FOUND;
 		}
-		
-		
+
+
 		nframes_t startPos = startlocation.to_frame(44100);
-		
+
 		int index = cache_index_lut()->value(nearestpow2, -1);
 		if(index >= 0) {
 // 			printf("index %d\n", index);
 		}
-		
+
         int offset = qRound(float(startPos) / nearestpow2) * 2;
         int truncate = 0;
 
@@ -274,46 +274,46 @@ int Peak::calculate_peaks(
 //            qDebug("Peak::calculate_peaks truncate: %d", truncate);
 //            peakDataCount = data->headerdata.peakDataSizeForLevel[index] - offset;
 		}
-		
+
 		nframes_t readposition = data->headerdata.headerSize + (data->headerdata.peakDataOffsets[index] + offset) * sizeof(peak_data_t);
 		produced = data->peakreader->read_from(data->peakdataDecodeBuffer, readposition, peakDataCount);
-		
+
 		if (produced != peakDataCount) {
 //			PERROR("Could not read in all peak data, peakDataCount is %d, read count is %d", peakDataCount, produced);
 		}
-		
+
 // 		PROFILE_END("Peak calculate_peaks");
-		
+
 		if (produced == 0) {
 			return NO_PEAKDATA_FOUND;
 		}
-		
+
 // 		for (int i=(pixelcount-truncate); i<(pixelcount); ++i) {
 // 			data->peakdataDecodeBuffer->destination[0][i] = 0;
 // 		}
-// 		
+//
 		*buffer = data->peakdataDecodeBuffer->destination[0];
-		
+
 		return produced;
 
 	// Micro view mode
-	} 
+	}
 		// Calculate the amount of frames to be read
                 nframes_t toRead = qRound(peakDataCount * framesPerPeak * qreal(m_source->get_file_rate()) / qreal(44100));
-		
+
 		nframes_t readFrames = m_source->file_read(data->peakdataDecodeBuffer, startlocation, toRead);
 
 		if (readFrames == 0) {
 			return NO_PEAKDATA_FOUND;
 		}
-		
+
 		if ( readFrames != toRead) {
             PWARN(QString("Unable to read nframes %1 (only %2 available)").arg(toRead).arg(readFrames).toLatin1().data());
 		}
 
 		int count = 0;
 		audio_sample_t sample;
-		
+
 		// MicroView needs a buffer to store the calculated peakdata
 		// our decodebuffer's readbuffer is large enough for this purpose
 		// and it's no problem to use it at this point in the process chain.
@@ -321,50 +321,50 @@ int Peak::calculate_peaks(
 
 		ProcessData pd;
 		// the stepSize depends on the real file sample rate, Peak assumes 44100 Hz
-		// so if the file sample rate differs, the stepSize becomes the ratio of 
+		// so if the file sample rate differs, the stepSize becomes the ratio of
 		// the file sample rate and 44100
 		pd.stepSize = TimeRef(qreal(44100) / m_source->get_file_rate(), m_source->get_file_rate());
 		pd.processRange = TimeRef(framesPerPeak, m_source->get_file_rate());
 
 		for (uint i=0; i < readFrames; i++) {
-		
+
 			pd.processLocation += pd.stepSize;
-		
+
 			sample = data->peakdataDecodeBuffer->destination[chan][i];
-		
+
 			pd.normValue = f_max(pd.normValue, fabsf(sample));
-		
+
 			if (sample > pd.peakUpperValue) {
 				pd.peakUpperValue = sample;
 			}
-		
+
 			if (sample < pd.peakLowerValue) {
 				pd.peakLowerValue = sample;
 			}
-		
+
 			if (pd.processLocation >= pd.nextDataPointLocation) {
-		
+
 				if (pd.peakUpperValue > fabs(pd.peakLowerValue)) {
 					peakdata[count] = pd.peakUpperValue;
 				} else {
 					peakdata[count] = pd.peakLowerValue;
 				}
-				
+
 				pd.peakUpperValue = -10.0;
 				pd.peakLowerValue = 10.0;
-			
+
 				pd.nextDataPointLocation += pd.processRange;
 				count++;
 			}
 		}
-		
+
 // 		printf("framesPerPeak, peakDataCount, generated, readFrames %f, %d, %d, %d\n", framesPerPeak, peakDataCount, count, readFrames);
-		
-// 		PROFILE_END("Peak calculate_peaks");		
-		
+
+// 		PROFILE_END("Peak calculate_peaks");
+
 		// Assign the supplied buffer to the 'real' peakdata buffer.
 		*buffer = peakdata;
-		
+
 		return count;
 }
 
@@ -372,48 +372,48 @@ int Peak::calculate_peaks(
 int Peak::prepare_processing(uint rate)
 {
 	PENTER;
-	
+
 	foreach(ChannelData* data, m_channelData) {
-		
+
 		data->normFileName = data->fileName;
 		data->normFileName.append(".norm");
-		
+
 		// Create read/write enabled file
 		data->file.setFileName(data->fileName);
-		
+
 		if (! data->file.open(QIODevice::ReadWrite)) {
             PWARN(QString("Couldn't open peak file for writing! (%1)").arg(data->fileName).toLatin1().data());
 			m_permanentFailure  = true;
 			return -1;
 		}
-		
+
 		// Create the temporary normalization data file
 		data->normFile.setFileName(data->normFileName);
-		
+
 		if (! data->normFile.open(QIODevice::ReadWrite)) {
             PWARN(QString("Couldn't open normalization data file for writing! (%1)").arg(data->normFileName).toLatin1().data());
 			m_permanentFailure  = true;
 			return -1;
 		}
-		
+
 		// We need to know the headerSize.
-		data->headerdata.headerSize = 
-					sizeof(data->headerdata.label) + 
-					sizeof(data->headerdata.version) + 
-					sizeof(data->headerdata.peakDataOffsets) + 
+		data->headerdata.headerSize =
+					sizeof(data->headerdata.label) +
+					sizeof(data->headerdata.version) +
+					sizeof(data->headerdata.peakDataOffsets) +
 					sizeof(data->headerdata.peakDataSizeForLevel) +
-					sizeof(data->headerdata.normValuesDataOffset) + 
+					sizeof(data->headerdata.normValuesDataOffset) +
 					sizeof(data->headerdata.headerSize);
-					
+
 		// Now seek to the start position, so we can write the peakdata to it in the process function
 		data->file.seek(data->headerdata.headerSize);
-		
+
 		data->pd = new Peak::ProcessData;
 		data->pd->stepSize = TimeRef(nframes_t(1), rate);
 		data->pd->processRange = TimeRef(nframes_t(64), 44100);
 	}
-	
-	
+
+
 	return 1;
 }
 
@@ -421,9 +421,9 @@ int Peak::prepare_processing(uint rate)
 int Peak::finish_processing()
 {
 	PENTER;
-	
+
 	foreach(ChannelData* data, m_channelData) {
-		
+
 		if (data->pd->processLocation < data->pd->nextDataPointLocation) {
 			peak_data_t peakvalue = (peak_data_t)(data->pd->peakUpperValue * MAX_DB_VALUE);
 			data->file.write((char*)&peakvalue, sizeof(peak_data_t));
@@ -431,47 +431,47 @@ int Peak::finish_processing()
 			data->file.write((char*)&peakvalue, sizeof(peak_data_t));
 			data->pd->processBufferSize += 2;
 		}
-		
+
 		int totalBufferSize = 0;
-		
+
 		data->headerdata.peakDataSizeForLevel[0] = data->pd->processBufferSize;
 		totalBufferSize += data->pd->processBufferSize;
-		
+
 		for( int i = SAVING_ZOOM_FACTOR + 1; i < ZOOM_LEVELS+1; ++i) {
 			data->headerdata.peakDataSizeForLevel[i - SAVING_ZOOM_FACTOR] = data->headerdata.peakDataSizeForLevel[i - SAVING_ZOOM_FACTOR - 1] / 2;
 			totalBufferSize += data->headerdata.peakDataSizeForLevel[i - SAVING_ZOOM_FACTOR];
 		}
-		
-		
+
+
 		data->file.seek(data->headerdata.headerSize);
-		
+
 		// The routine below uses a different total buffer size calculation
 		// which might end up with a size >= totalbufferSize !!!
 		// Need to look into that, for now + 2 seems to work...
 		peak_data_t* saveBuffer = new peak_data_t[totalBufferSize + 1*sizeof(peak_data_t)];
-		
+
 		int read = data->file.read((char*)saveBuffer, sizeof(peak_data_t) * data->pd->processBufferSize) / sizeof(peak_data_t);
-		
+
 		if (read != data->pd->processBufferSize) {
 //			PERROR("couldn't read in all saved data?? (%d read)", read);
 		}
-		
-		
+
+
 		int prevLevelBufferPos = 0;
 		int nextLevelBufferPos;
 		data->headerdata.peakDataSizeForLevel[0] = data->pd->processBufferSize;
 		data->headerdata.peakDataOffsets[0] = 0;
-		
+
 		for (int i = SAVING_ZOOM_FACTOR+1; i < ZOOM_LEVELS+1; ++i) {
-		
+
 			int prevLevelSize = data->headerdata.peakDataSizeForLevel[i - SAVING_ZOOM_FACTOR - 1];
 			data->headerdata.peakDataOffsets[i - SAVING_ZOOM_FACTOR] = data->headerdata.peakDataOffsets[i - SAVING_ZOOM_FACTOR - 1] + prevLevelSize;
 			prevLevelBufferPos = data->headerdata.peakDataOffsets[i - SAVING_ZOOM_FACTOR - 1];
 			nextLevelBufferPos = data->headerdata.peakDataOffsets[i - SAVING_ZOOM_FACTOR];
-			
-			
+
+
 			int count = 0;
-			
+
 			do {
 				Q_ASSERT(nextLevelBufferPos <= totalBufferSize);
 				saveBuffer[nextLevelBufferPos] = (peak_data_t) f_max(saveBuffer[prevLevelBufferPos], saveBuffer[prevLevelBufferPos + 2]);
@@ -482,48 +482,48 @@ int Peak::finish_processing()
 			}
 			while (count < prevLevelSize);
 		}
-		
+
 		data->file.seek(data->headerdata.headerSize);
-		
+
 		int written = data->file.write((char*)saveBuffer, sizeof(peak_data_t) * totalBufferSize) / sizeof(peak_data_t);
-		
+
 		if (written != totalBufferSize) {
 //			PERROR("could not write complete buffer! (only %d)", written);
 	// 		return -1;
 		}
-		
+
 		data->normFile.seek(0);
-		
+
 		read = data->normFile.read((char*)saveBuffer, sizeof(audio_sample_t) * data->pd->normDataCount) / sizeof(audio_sample_t);
-		
+
 		if (read != data->pd->normDataCount) {
 //			PERROR("Could not read in all (%d) norm. data, only %d", data->pd->normDataCount, read);
 		}
-		
+
 		data->headerdata.normValuesDataOffset = data->headerdata.headerSize + totalBufferSize * sizeof(peak_data_t);
-		
+
 		data->normFile.close();
-		
+
 		if (!QFile::remove(data->normFileName)) {
 //			PERROR("Failed to remove temp. norm. data file! (%s)", data->normFileName.toLatin1().data());
 		}
-		
+
 		written = data->file.write((char*)saveBuffer, sizeof(audio_sample_t) * read) / sizeof(audio_sample_t);
-		
+
 		write_header(data);
-		
+
 		data->file.close();
-		
+
 		delete [] saveBuffer;
 		delete data->pd;
 		data->pd = nullptr;
-		
+
 	}
-	
+
 	emit finished();
-	
+
 	return 1;
-	
+
 }
 
 
@@ -533,53 +533,53 @@ void Peak::process(uint channel, const audio_sample_t* buffer, nframes_t nframes
 	ProcessData* pd = data->pd;
 
 	for (uint i=0; i < nframes; i++) {
-		
+
 		pd->processLocation += pd->stepSize;
-		
+
 		audio_sample_t sample = buffer[i];
-		
+
 		pd->normValue = f_max(pd->normValue, fabsf(sample));
-		
+
 		if (sample > pd->peakUpperValue) {
 			pd->peakUpperValue = sample;
 		}
-		
+
 		if (sample < pd->peakLowerValue) {
 			pd->peakLowerValue = sample;
 		}
-		
+
 		if (pd->processLocation >= pd->nextDataPointLocation) {
-		
+
 			peak_data_t peakbuffer[2];
 
 			peakbuffer[0] = (peak_data_t) (pd->peakUpperValue * MAX_DB_VALUE );
 			peakbuffer[1] = (peak_data_t) (-1 * (pd->peakLowerValue * MAX_DB_VALUE ));
-			
+
 			int written = data->file.write((char*)peakbuffer, sizeof(peak_data_t) * 2) / sizeof(peak_data_t);
-			
+
 			if (written != 2) {
                 PWARN(QString("couldnt write peak data, only (%1)").arg(written).toLatin1().data());
 			}
 
 			pd->peakUpperValue = -10.0;
 			pd->peakLowerValue = 10.0;
-			
+
 			pd->processBufferSize+=2;
 			pd->nextDataPointLocation += pd->processRange;
 		}
-		
+
 		if (pd->normProcessedFrames == NORMALIZE_CHUNK_SIZE) {
 			int written = data->normFile.write((char*)&pd->normValue, sizeof(audio_sample_t)) / sizeof(audio_sample_t);
-			
+
 			if (written != 1) {
                 PWARN(QString("couldnt write norm data, only (%1)").arg(written).toLatin1().data());
 			}
- 
+
 			pd->normValue = 0.0;
 			pd->normProcessedFrames = 0;
 			pd->normDataCount++;
 		}
-		
+
 		pd->normProcessedFrames++;
 	}
 }
@@ -588,15 +588,15 @@ void Peak::process(uint channel, const audio_sample_t* buffer, nframes_t nframes
 int Peak::create_from_scratch()
 {
 	PENTER;
-	
+
 // PROFILE_START;
-	
+
 	int ret = -1;
-	
+
 	if (prepare_processing(m_source->get_file_rate()) < 0) {
 		return ret;
 	}
-	
+
 	nframes_t readFrames = 0;
 	nframes_t totalReadFrames = 0;
 
@@ -618,29 +618,29 @@ int Peak::create_from_scratch()
 	}
 
 	DecodeBuffer decodebuffer;
-	
+
 	do {
 		if (m_interuptPeakBuild) {
 			ret = -1;
 			goto out;
 		}
-		
+
 		readFrames = m_source->file_read(&decodebuffer, totalReadFrames, bufferSize);
-		
+
 		if (readFrames <= 0) {
 			PERROR("readFrames < 0 during peak building");
 			break;
 		}
-		
+
 		for (uint chan = 0; chan < m_source->get_channel_count(); ++ chan) {
 			process(chan, decodebuffer.destination[chan], readFrames);
 		}
-		
+
 		totalReadFrames += readFrames;
 		progression = (int) ((float)totalReadFrames / ((float)m_source->get_nframes() / 100.0));
-		
+
 		ChannelData* data = m_channelData.at(0);
-		
+
 		if ( progression > data->pd->progress) {
 			emit progress(progression);
 			data->pd->progress = progression;
@@ -652,13 +652,13 @@ int Peak::create_from_scratch()
 		ret = -1;
 		goto out;
 	}
-	
+
 	ret = 1;
-	
+
 out:
-	 
+
 // 	PROFILE_END("Peak create from scratch");
-	
+
 	return ret;
 }
 
@@ -676,10 +676,10 @@ audio_sample_t Peak::get_max_amplitude(TimeRef startlocation, TimeRef endlocatio
 	nframes_t endframe = endlocation.to_frame(rate);
 	int startpos = startframe / NORMALIZE_CHUNK_SIZE;
 	uint count = (endframe / NORMALIZE_CHUNK_SIZE) - startpos;
-	
+
 	uint buffersize = count < NORMALIZE_CHUNK_SIZE*2 ? NORMALIZE_CHUNK_SIZE*2 : count;
 	audio_sample_t* readbuffer =  new audio_sample_t[buffersize];
-	
+
 	audio_sample_t maxamp = 0;
 	DecodeBuffer decodebuffer;
 	// Read in the part not fully occupied by a cached normalize value
@@ -687,46 +687,46 @@ audio_sample_t Peak::get_max_amplitude(TimeRef startlocation, TimeRef endlocatio
 	if (startframe != 0) {
 		startpos += 1;
 		int toRead = (int) ((startpos * NORMALIZE_CHUNK_SIZE) - startframe);
-		
+
 		int read = m_source->file_read(&decodebuffer, startframe, toRead);
-		
+
 		for (uint chan = 0; chan < m_source->get_channel_count(); ++ chan) {
 			maxamp = Mixer::compute_peak(decodebuffer.destination[chan], read, maxamp);
 		}
 	}
-	
-	
+
+
 	// Read in the part not fully occupied by a cached normalize value
 	// at the right hand part and run compute_peak on it.
 	float f = (float) endframe / NORMALIZE_CHUNK_SIZE;
 	int endpos = (int) f;
     int toRead = (int) ((f - (endframe / float(NORMALIZE_CHUNK_SIZE))) * NORMALIZE_CHUNK_SIZE);
 	int read = m_source->file_read(&decodebuffer, endframe - toRead, toRead);
-	
+
 	if (read > 0) {
 		for (uint chan = 0; chan < m_source->get_channel_count(); ++ chan) {
 			maxamp = Mixer::compute_peak(decodebuffer.destination[chan], read, maxamp);
 		}
 	}
-	
+
 	// Now that we have covered both boundary situations,
 	// read in the cached normvalues, and calculate the highest value!
 	count = endpos - startpos;
-	
+
 	foreach(ChannelData* data, m_channelData) {
 		data->file.seek(data->headerdata.normValuesDataOffset + (startpos * sizeof(audio_sample_t)));
-	
+
 		int read = data->file.read((char*)readbuffer, sizeof(audio_sample_t) * count) / sizeof(audio_sample_t);
-	
+
 		if (read != (int)count) {
                         printf("Peak::get_max_amplitude: could only read %d, %d requested\n", read, count);
 		}
-	
+
 		maxamp = Mixer::compute_peak(readbuffer, read, maxamp);
 	}
-	
+
 	delete [] readbuffer;
-	
+
 	return maxamp;
 }
 
@@ -750,9 +750,9 @@ PeakProcessor::PeakProcessor()
 	m_runningPeak = 0;
 
 	moveToThread(m_ppthread);
-	
+
 	m_ppthread->start();
-	
+
 	connect(this, SIGNAL(newTask()), this, SLOT(start_task()), Qt::QueuedConnection);
 }
 
@@ -760,11 +760,11 @@ PeakProcessor::PeakProcessor()
 PeakProcessor::~ PeakProcessor()
 {
 	m_ppthread->exit(0);
-	
+
 	if (!m_ppthread->wait(1000)) {
 		m_ppthread->terminate();
 	}
-	
+
 	delete m_ppthread;
 }
 
@@ -772,11 +772,11 @@ PeakProcessor::~ PeakProcessor()
 void PeakProcessor::start_task()
 {
 	m_runningPeak->create_from_scratch();
-	
+
 	QMutexLocker locker(&m_mutex);
-	
+
 	m_taskRunning = false;
-	
+
 	if (m_runningPeak->m_interuptPeakBuild) {
 		PMESG("PeakProcessor:: Deleting interrupted Peak!");
 		delete m_runningPeak;
@@ -784,25 +784,25 @@ void PeakProcessor::start_task()
 		m_wait.wakeAll();
 		return;
 	}
-	
+
 	foreach(Peak* peak, m_queue) {
 		if (m_runningPeak->m_source->get_filename() == peak->m_source->get_filename()) {
 			m_queue.removeAll(peak);
 			emit peak->finished();
 		}
 	}
-	
+
 	m_runningPeak = 0;
-	
+
 	dequeue_queue();
 }
 
 void PeakProcessor::queue_task(Peak * peak)
 {
 	QMutexLocker locker(&m_mutex);
-	
+
 	m_queue.enqueue(peak);
-	
+
 	if (!m_taskRunning) {
 		dequeue_queue();
 	}
@@ -820,26 +820,26 @@ void PeakProcessor::dequeue_queue()
 void PeakProcessor::free_peak(Peak * peak)
 {
 	m_mutex.lock();
-	
+
 	m_queue.removeAll(peak);
-	
+
 	if (peak == m_runningPeak) {
 		PMESG("PeakProcessor:: Interrupting running build process!");
 		peak->m_interuptPeakBuild =  true;
-		
+
 		PMESG("PeakProcessor:: Waiting GUI thread until interrupt finished");
 		m_wait.wait(&m_mutex);
 		PMESG("PeakProcessor:: Resuming GUI thread");
-		
+
 		dequeue_queue();
-		
+
 		m_mutex.unlock();
-		
+
 		return;
 	}
-	
+
 	m_mutex.unlock();
-	
+
 	delete peak;
 }
 
@@ -867,11 +867,11 @@ PeakDataReader::PeakDataReader(Peak::ChannelData* data)
 nframes_t PeakDataReader::read_from(DecodeBuffer* buffer, nframes_t start, nframes_t count)
 {
 // 	printf("read_from:: before_seek from %d, framepos is %d\n", start, m_readPos);
-	
+
 	if (!seek(start)) {
 		return 0;
 	}
-	
+
 	return read(buffer, count);
 }
 
@@ -880,20 +880,20 @@ bool PeakDataReader::seek(nframes_t start)
 {
 	if (m_readPos != start) {
 		Q_ASSERT(m_d->file.isOpen());
-	
-	
+
+
 		if (start >= m_nframes) {
 			return false;
 		}
-	
+
 		if (!m_d->file.seek(start)) {
 			qWarning("PeakDataReader: could not seek to data point %d within %s", start, QS_C(m_d->fileName));
 			return false;
 		}
-		
+
 		m_readPos = start;
 	}
-	
+
 	return true;
 }
 
@@ -903,15 +903,15 @@ nframes_t PeakDataReader::read(DecodeBuffer* buffer, nframes_t count)
 	if ( ! (count && (m_readPos < m_nframes)) ) {
 		return 0;
 	}
-		
+
 	// Make sure the read buffer is big enough for this read
 	buffer->check_buffers_capacity(count*3, 1);
-	
+
 	Q_ASSERT(m_d->file.isOpen());
-	
+
     qint64 framesRead = 0;
 	peak_data_t* readbuffer;
-	
+
     qint64 length = sizeof(peak_data_t) * count;
     framesRead = m_d->file.read(reinterpret_cast<char*>(buffer->readBuffer), length) / qint64(sizeof(peak_data_t));
     readbuffer = reinterpret_cast<peak_data_t*>(buffer->readBuffer);
@@ -919,9 +919,9 @@ nframes_t PeakDataReader::read(DecodeBuffer* buffer, nframes_t count)
 	for (int f = 0; f < framesRead; f++) {
 		buffer->destination[0][f] = float(readbuffer[f]);
 	}
-	
+
 	m_readPos += framesRead;
-	
+
     return nframes_t(framesRead);
 }
 
@@ -951,7 +951,7 @@ int Peak::max_zoom_value()
 
 Peak::ChannelData::~ ChannelData()
 {
-	
+
 		delete peakdataDecodeBuffer;
-	
+
 }
diff --git a/src/core/Project.cpp b/src/core/Project.cpp
index 7a3d4d89..52aaa925 100755
--- a/src/core/Project.cpp
+++ b/src/core/Project.cpp
@@ -59,12 +59,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 
 /**	\class Project
 	\brief Project restores and saves the state of a Traverso Project
-	
+
 	A Project can have as much Sheet's as one likes. A Project with one Sheet acts like a 'Session'
 	where the Sheet can be turned into a CD with various Tracks using Marker 's
 	When a Project has multiple Sheet's, each Sheet will be a CD Track, this can be usefull if each
 	Track on a CD is independend of the other CD Tracks.
- 
+
  */
 
 
@@ -146,19 +146,19 @@ int Project::create(int sheetcount, int numtracks)
 		info().critical(tr("Cannot create dir %1").arg(m_rootDir));
 		return -1;
 	}
-	
+
 	if (create_peakfiles_dir() < 0) {
 		return -1;
 	}
-	
+
 	if (create_audiosources_dir() < 0) {
 		return -1;
 	}
-	
+
 	if (pm().create_projectfilebackup_dir(m_rootDir) < 0) {
 		return -1;
 	}
-	
+
 	for (int i=0; i< sheetcount; i++) {
 		Sheet* sheet = new Sheet(this, numtracks);
         m_RtSheets.append(sheet);
@@ -168,7 +168,7 @@ int Project::create(int sheetcount, int numtracks)
 	if (m_sheets.size()) {
                 set_current_session(m_sheets.first()->get_id());
 	}
-	
+
 	m_id = create_id();
 	m_importDir = QDir::homePath();
 
@@ -191,7 +191,7 @@ int Project::create_audiosources_dir()
 		info().critical(tr("Cannot create dir %1").arg(m_sourcesDir));
 		return -1;
 	}
-	
+
 	return 1;
 
 }
@@ -205,7 +205,7 @@ int Project::create_peakfiles_dir()
 		info().critical(tr("Cannot create dir %1").arg(peaksDir));
 		return -1;
 	}
-	
+
 	return 1;
 }
 
@@ -214,10 +214,10 @@ int Project::load(const QString& projectfile)
 {
 	PENTER;
 	QDomDocument doc("Project");
-	
+
 	QFile file;
 	QString filename;
-	
+
 	if (projectfile.isEmpty()) {
 		filename = m_rootDir + "/project.tpf";
 		file.setFileName(filename);
@@ -231,7 +231,7 @@ int Project::load(const QString& projectfile)
 		info().critical(m_errorString);
 		return PROJECT_FILE_COULD_NOT_BE_OPENED;
 	}
-	
+
 	// Check if important directories still exist!
 	QDir dir;
 	if (!dir.exists(m_rootDir + "/peakfiles")) {
@@ -241,7 +241,7 @@ int Project::load(const QString& projectfile)
 		create_audiosources_dir();
 	}
 
-	
+
 	// Start setting and parsing the content of the xml file
 	QString errorMsg;
 	if (!doc.setContent(&file, &errorMsg)) {
@@ -249,13 +249,13 @@ int Project::load(const QString& projectfile)
 		info().critical(m_errorString);
 		return SETTING_XML_CONTENT_FAILED;
 	}
-	
+
         emit projectLoadStarted();
 
 	QDomElement docElem = doc.documentElement();
 	QDomNode propertiesNode = docElem.firstChildElement("Properties");
 	QDomElement e = propertiesNode.toElement();
-	
+
 	if (e.attribute("projectfileversion", "-1").toInt() != PROJECT_FILE_VERSION) {
 		m_errorString = tr("Project File Version does not match, unable to load Project!");
 		info().warning(m_errorString);
@@ -279,7 +279,7 @@ int Project::load(const QString& projectfile)
 	if (m_id == 0) {
 		m_id = create_id();
 	}
-	m_importDir = e.attribute("importdir", QDir::homePath()); 
+	m_importDir = e.attribute("importdir", QDir::homePath());
 
 
 
@@ -446,7 +446,7 @@ int Project::load(const QString& projectfile)
         }
 
         info().information( tr("Project %1 loaded").arg(m_name) );
-	
+
 	emit projectLoadFinished();
 
         return 1;
@@ -506,7 +506,7 @@ int Project::save(bool autosave)
 	PENTER;
 	QDomDocument doc("Project");
 	QString fileName = m_rootDir + "/project.tpf";
-	
+
 	QFile data( fileName );
 
 	if (!data.open( QIODevice::WriteOnly ) ) {
@@ -514,16 +514,16 @@ int Project::save(bool autosave)
 		info().critical( tr("Couldn't open Project properties file for writing! (File %1. Reason: %2)").arg(fileName).arg(errorstring) );
 		return -1;
 	}
-	
+
 	get_state(doc);
 	QTextStream stream(&data);
 	doc.save(stream, 4);
 	data.close();
-	
+
 	if (!autosave) {
 		info().information( tr("Project %1 saved ").arg(m_name) );
 	}
-	
+
         pm().start_incremental_backup(this);
 
 	return 1;
@@ -533,7 +533,7 @@ int Project::save(bool autosave)
 QDomNode Project::get_state(QDomDocument doc, bool istemplate)
 {
 	PENTER;
-	
+
 	QDomElement projectNode = doc.createElement("Project");
 	QDomElement properties = doc.createElement("Properties");
 
@@ -559,7 +559,7 @@ QDomNode Project::get_state(QDomDocument doc, bool istemplate)
 		properties.setAttribute("title", "Template Project File!!");
 	}
 	properties.setAttribute("importdir", m_importDir);
-		
+
 	projectNode.appendChild(properties);
 
 
@@ -647,7 +647,7 @@ QDomNode Project::get_state(QDomDocument doc, bool istemplate)
 
         projectNode.appendChild(workSheetsNode);
 
-	
+
 	return projectNode;
 }
 
@@ -666,7 +666,7 @@ void Project::prepare_audio_device(QDomDocument doc)
 //        ads.jackChannels.append(m_softwareAudioChannels.values());
 
         if (ads.driverType.isEmpty() || ads.driverType.isNull()) {
-#if defined (Q_WS_X11)
+#if defined (Q_OS_UNIX)
                 ads.driverType = config().get_property("Hardware", "drivertype", "ALSA").toString();
 #else
                 ads.driverType = config().get_property("Hardware", "drivertype", "PortAudio").toString();
@@ -700,11 +700,11 @@ void Project::prepare_audio_device(QDomDocument doc)
 #if defined (PORTAUDIO_SUPPORT)
         if (ads.driverType == "PortAudio") {
                 if (ads.cardDevice.isEmpty()) {
-#if defined (Q_WS_X11)
+#if defined (Q_OS_UNIX)
                         ads.cardDevice = config().get_property("Hardware", "pahostapi", "alsa").toString();
-#elif defined (Q_WS_MAC)
+#elif defined (Q_OS_MAC)
                         ads.cardDevice = config().get_property("Hardware", "pahostapi", "coreaudio").toString();
-#elif defined (Q_WS_WIN)
+#elif defined (Q_OS_WIN)
                         ads.cardDevice = config().get_property("Hardware", "pahostapi", "wmme").toString();
 #endif
                 }
@@ -726,7 +726,7 @@ int Project::disconnect_from_audio_device()
         int count = 0;
         while(m_audiodeviceClient->is_connected()) {
                 printf("Project: Waiting to be disconnected from Audio Device\n");
-#if defined (Q_WS_WIN)
+#if defined (Q_OS_WIN)
                 Sleep(20);
 #else
                 usleep(20 * 1000);
@@ -981,35 +981,35 @@ void Project::set_title(const QString& title)
 		// do nothing if the title is the same as the current one
 		return;
 	}
-	
+
 	if (pm().project_exists(title)) {
 		info().critical(tr("Project with title '%1' allready exists, not setting new title!").arg(title));
 		return;
 	}
-	
+
 	QString newrootdir = config().get_property("Project", "directory", "/directory/unknown/").toString() + "/" + title;
-	
+
 	QDir dir(m_rootDir);
-	
+
 	if ( ! dir.exists() ) {
-		info().critical(tr("Project directory %1 no longer exists, did you rename it? " 
+		info().critical(tr("Project directory %1 no longer exists, did you rename it? "
 				"Shame on you! Please undo that, and come back later to rename your Project...").arg(m_rootDir));
 		return;
 	}
-	
+
 	m_name = title;
-	
+
 	save();
-	
+
 	if (pm().rename_project_dir(m_rootDir, newrootdir) < 0 ) {
 		return;
 	}
-	
+
     QMessageBox::information( nullptr,
-			tr("Traverso - Information"), 
+			tr("Traverso - Information"),
 			tr("Project title changed, Project will to be reloaded to ensure proper operation"),
 			QMessageBox::Ok);
-	
+
 	pm().load_renamed_project(m_name);
 }
 
@@ -1072,13 +1072,13 @@ bool Project::has_changed()
 TCommand* Project::add_sheet(Sheet* sheet, bool historable)
 {
 	PENTER;
-	
+
 	AddRemove* cmd;
     cmd = new AddRemove(this, sheet, historable, nullptr,
                 "private_add_sheet(Sheet*)", "privateSheetAdded(Sheet*)",
                 "private_remove_sheet(Sheet*)", "privateSheetRemoved(Sheet*)",
                 tr("Sheet %1 added").arg(sheet->get_name()));
-	
+
 	return cmd;
 }
 
@@ -1175,16 +1175,16 @@ int Project::export_project(ExportSpecification* spec)
         info().warning(tr("Cannot disconnect from audiodevice. Export will not work"));
         return -1;
     }
-	
+
 	if (!m_exportThread) {
 		m_exportThread = new ExportThread(this);
 	}
-	
+
 	if (m_exportThread->isRunning()) {
 		info().warning(tr("Export already in progress, cannot start it twice!"));
 		return -1;
 	}
-	
+
 	QDir dir(spec->exportdir);
 	if (!spec->exportdir.isEmpty() && !dir.exists()) {
 		if (!dir.mkdir(spec->exportdir)) {
@@ -1192,7 +1192,7 @@ int Project::export_project(ExportSpecification* spec)
 			return -1;
 		}
 	}
-	
+
 	spec->progress = 0;
 	spec->running = true;
 	spec->stop = false;
@@ -1240,27 +1240,27 @@ int Project::start_export(ExportSpecification* spec)
 		spec->resumeTransport = false;
                 spec->resumeTransportLocation = sheet->get_transport_location();
 		sheet->readbuffer = readbuffer;
-		
+
 		if (spec->normalize) {
                         // start one render pass in mode "CALC_NORM_FACTOR"
 			spec->peakvalue = 0.0;
 			spec->renderpass = ExportSpecification::CALC_NORM_FACTOR;
-			
-			
+
+
 			if (sheet->prepare_export(spec) < 0) {
 				PERROR("Failed to prepare sheet for export");
 				continue;
 			}
-			
+
                         sheet->start_export(spec);
-			
+
             spec->normvalue = (1.0f - FLT_EPSILON) / spec->peakvalue;
-			
+
             if (spec->peakvalue > 1.0f) {
 				info().critical(tr("Detected clipping in exported audio! (%1)")
 						.arg(coefficient_to_dbstring(spec->peakvalue)));
 			}
-			
+
 			if (!spec->breakout) {
 				info().information(tr("calculated norm factor: %1").arg(coefficient_to_dbstring(spec->normvalue)));
 			}
@@ -1268,16 +1268,16 @@ int Project::start_export(ExportSpecification* spec)
 
                 // start the real render pass in mode "WRITE_TO_HARDDISK"
 		spec->renderpass = ExportSpecification::WRITE_TO_HARDDISK;
-		
+
                 // first call Sheet::prepare_export()...
 		if (sheet->prepare_export(spec) < 0) {
 			PERROR("Failed to prepare sheet for export");
 			break;
 		}
-		
+
                 // ... then start the render process and wait until it's finished
                 sheet->start_export(spec);
-		
+
 		if (!QMetaObject::invokeMethod(sheet, "set_transport_pos",  Qt::QueuedConnection, Q_ARG(TimeRef, spec->resumeTransportLocation))) {
 			printf("Invoking Sheet::set_transport_pos() failed\n");
 		}
@@ -1296,7 +1296,7 @@ int Project::start_export(ExportSpecification* spec)
 
 	spec->running = false;
 	overallExportProgress = 0;
-	
+
 	delete [] spec->dataF;
 	delete [] readbuffer;
     spec->dataF = nullptr;
@@ -1338,7 +1338,7 @@ int Project::create_cdrdao_toc(ExportSpecification* spec)
 {
 	QList<Sheet* > sheets;
 	QString filename = spec->exportdir;
-	
+
 	if (spec->allSheets) {
                 foreach(Sheet* sheet, m_sheets) {
                         sheets.append(sheet);
@@ -1356,7 +1356,7 @@ int Project::create_cdrdao_toc(ExportSpecification* spec)
                 // filename of the toc file is "sheet-name.toc"
                 filename += spec->basename + ".toc";
         }
-	
+
 	QString output;
 
 	output += "CD_DA\n\n";
@@ -1375,10 +1375,10 @@ int Project::create_cdrdao_toc(ExportSpecification* spec)
 	output += "    MESSAGE \"" + get_message() + "\"\n";
 	output += "    GENRE \"" + QString::number(get_genre()) + "\"\n  }\n}\n\n";
 
-	
+
 	bool pregap = true;
 	spec->renderpass = ExportSpecification::CREATE_CDRDAO_TOC;
-	
+
 	foreach(Sheet* sheet, sheets) {
 		if (sheet->prepare_export(spec) < 0) {
 			return -1;
@@ -1386,7 +1386,7 @@ int Project::create_cdrdao_toc(ExportSpecification* spec)
                 output += sheet->get_timeline()->get_cdrdao_tracklist(spec, pregap);
 		pregap = false; // only add the pregap at the first sheet
 	}
-	
+
 
 	if (spec->writeToc) {
 		spec->tocFileName = filename;
@@ -1400,9 +1400,9 @@ int Project::create_cdrdao_toc(ExportSpecification* spec)
 			file.close();
 		}
 	}
-	
+
 	spec->cdrdaoToc = output;
-	
+
 	return 1;
 }
 
@@ -1412,7 +1412,7 @@ uint Project::get_rate( ) const
 	if (m_useResampling) {
 		return audiodevice().get_sample_rate();
 	}
-	
+
 	return m_rate;
 }
 
@@ -1423,7 +1423,7 @@ uint Project::get_bitdepth( ) const
 
 void Project::set_sheet_export_progress(int progress)
 {
-	overallExportProgress = (progress / sheetsToRender.count()) + 
+	overallExportProgress = (progress / sheetsToRender.count()) +
 			(renderedSheets * (100 / sheetsToRender.count()) );
 
 	emit sheetExportProgressChanged(progress);
@@ -1449,7 +1449,7 @@ int Project::get_sheet_index(qint64 id)
 			return i + 1;
 		}
 	}
-	
+
 	return 0;
 }
 
@@ -1689,7 +1689,7 @@ bool Project::is_save_to_close() const
 {
 	if (is_recording()) {
         QMessageBox::information( nullptr,
-				tr("Traverso - Information"), 
+				tr("Traverso - Information"),
 				tr("You're still recording, please stop recording first to be able to exit the application!"),
 				QMessageBox::Ok);
 		return false;
diff --git a/src/engine/AudioDeviceThread.cpp b/src/engine/AudioDeviceThread.cpp
index 274ae9ca..f465a33a 100644
--- a/src/engine/AudioDeviceThread.cpp
+++ b/src/engine/AudioDeviceThread.cpp
@@ -25,7 +25,7 @@ $Id: AudioDeviceThread.cpp,v 1.21 2007/10/20 17:38:19 r_sijrier Exp $
 #include "AudioDevice.h"
 #include "TAudioDriver.h"
 
-#if defined (Q_WS_X11)
+#if defined (Q_OS_UNIX)
 #include <dlfcn.h>
 #include <sys/resource.h>
 #include <sched.h>
@@ -52,7 +52,7 @@ public:
 protected:
 	void run() override
 	{
-#if defined (Q_WS_X11) || defined (Q_WS_MAC)
+#if defined (Q_OS_UNIX) || defined (Q_OS_MAC)
 		struct sched_param param;
 		param.sched_priority = 90;
 		if (pthread_setschedparam (pthread_self(), SCHED_FIFO, &param) != 0) {}
@@ -66,7 +66,7 @@ protected:
 			if (guardedThread->watchdogCheck == 0) {
 				qCritical("WatchDog timed out!");
 //				guardedThread->terminate();
-#if defined (Q_WS_X11) || defined (Q_WS_MAC)
+#if defined (Q_OS_UNIX) || defined (Q_OS_MAC)
 				kill (-getpgrp(), SIGABRT);
 #endif
 			}
@@ -90,12 +90,12 @@ void AudioDeviceThread::run()
 {
 	run_on_cpu( 0 );
 
-	
+
 	WatchDogThread watchdog(this);
 	watchdog.start();
 
 	become_realtime(m_realTime);
-	
+
 	if (m_device->m_driver->start() < 0) {
 		watchdog.terminate();
 		watchdog.wait();
@@ -109,7 +109,7 @@ void AudioDeviceThread::run()
 		}
 		watchdogCheck = 1;
 	}
-	
+
 	watchdog.terminate();
 	watchdog.wait();
 }
@@ -118,7 +118,7 @@ void AudioDeviceThread::run()
 int AudioDeviceThread::become_realtime( bool realtime )
 {
 	m_realTime = realtime;
-#if defined (Q_WS_X11) || defined (Q_WS_MAC)
+#if defined (Q_OS_UNIX) || defined (Q_OS_MAC)
 
 	/* RTC stuff */
 	if (realtime) {
@@ -143,18 +143,18 @@ int AudioDeviceThread::become_realtime( bool realtime )
 }
 
 
-#if defined (Q_WS_X11)
+#if defined (Q_OS_UNIX)
 typedef int* (*setaffinity_func_type)(pid_t,unsigned int,cpu_set_t *);
 #endif
 
 void AudioDeviceThread::run_on_cpu( int cpu )
 {
-#if defined (Q_WS_X11)
+#if defined (Q_OS_UNIX)
 	void *setaffinity_handle = dlopen(NULL, RTLD_LAZY);// NULL might not be portable to platforms other than linux - tajmorton@gmail.com
-	
+
 	setaffinity_func_type setaffinity_func;
 	setaffinity_func = (setaffinity_func_type) dlsym(setaffinity_handle, "sched_setaffinity");
-	
+
 	if (setaffinity_func != NULL) {
 		cpu_set_t mask;
 		CPU_ZERO(&mask);
@@ -170,4 +170,3 @@ void AudioDeviceThread::run_on_cpu( int cpu )
 	}
 #endif
 }
-
diff --git a/src/plugins/LV2/LV2Plugin.cpp b/src/plugins/LV2/LV2Plugin.cpp
index b6eb4e3c..23307c13 100644
--- a/src/plugins/LV2/LV2Plugin.cpp
+++ b/src/plugins/LV2/LV2Plugin.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 #include <AudioDevice.h>
 #include <Utils.h>
 
-#if defined Q_WS_MAC
+#if defined Q_OS_MAC
 	#include <cmath>
 	extern "C" int isnan(double);
 #endif
@@ -79,10 +79,10 @@ LV2Plugin::~LV2Plugin()
 QDomNode LV2Plugin::get_state( QDomDocument doc )
 {
 	QDomElement node = Plugin::get_state(doc).toElement();
-	
+
 	node.setAttribute("type", "LV2Plugin");
 	node.setAttribute("uri", m_pluginUri);
-	
+
 	return node;
 }
 
@@ -90,66 +90,66 @@ QDomNode LV2Plugin::get_state( QDomDocument doc )
 int LV2Plugin::set_state(const QDomNode & node )
 {
 	Plugin::set_state(node);
-	
+
 	QDomElement e = node.toElement();
-	
+
 	m_pluginUri = e.attribute( "uri", "");
-	
+
 	if (create_instance() < 0) {
 		return -1;
 	}
-	
+
 	/* Create control ports */
 	QDomElement controlPortsNode = node.firstChildElement("ControlPorts");
 	if (!controlPortsNode.isNull()) {
 		QDomNode portNode = controlPortsNode.firstChild();
-		
+
 		while (!portNode.isNull()) {
-			
+
 			LV2ControlPort* port = new LV2ControlPort(this, portNode);
 			m_controlPorts.append(port);
-			
+
 			portNode = portNode.nextSibling();
 		}
 	}
-		
-	// Create audio input ports 	
+
+	// Create audio input ports
 	QDomElement audioInputPortsNode = node.firstChildElement("AudioInputPorts");
 	if (!audioInputPortsNode.isNull()) {
 		QDomNode portNode = audioInputPortsNode.firstChild();
-		
+
 		while (!portNode.isNull()) {
 			AudioInputPort* port = new AudioInputPort(this);
 			port->set_state(portNode);
 			m_audioInputPorts.append(port);
-			
+
 			portNode = portNode.nextSibling();
 		}
 	}
-	
+
 	// Create audio ouput ports
 	QDomElement audioOutputPortsNode = node.firstChildElement("AudioOutputPorts");
 	if (!audioOutputPortsNode.isNull()) {
 		QDomNode portNode = audioOutputPortsNode.firstChild();
-		
+
 		while (!portNode.isNull()) {
 			AudioOutputPort* port = new AudioOutputPort(this);
 			port->set_state(portNode);
 			m_audioOutputPorts.append(port);
-			
+
 			portNode = portNode.nextSibling();
 		}
 	}
-	
+
 	/* Activate the plugin instance */
 	lilv_instance_activate(m_instance);
-	
+
 	// The default is 2 channels in - out, if there is only 1 in - out, duplicate
 	// this plugin, and use it on the second channel
 	if (!m_isSlave && m_audioInputPorts.size() == 1 && m_audioOutputPorts.size() == 1) {
 		m_slave = create_copy();
 	}
-	
+
 	return 1;
 }
 
@@ -158,9 +158,9 @@ int LV2Plugin::init()
 {
 	m_num_ports = 0;
     m_ports = nullptr;
-	
+
 	LilvWorld* world = PluginManager::instance()->get_lilv_world();
-	
+
 	/* Set up the port classes this app supports */
 	m_input_class = lilv_new_uri(world, LILV_URI_INPUT_PORT);
 	m_output_class = lilv_new_uri(world, LILV_URI_OUTPUT_PORT);
@@ -190,12 +190,12 @@ int LV2Plugin::init()
 			// Not an audio port, or unrecognized port type
 		}
 	}
-	
+
 	free(default_values);
 
 	/* Activate the plugin instance */
 	lilv_instance_activate(m_instance);
-	
+
 	if (m_audioInputPorts.size() == 0) {
 //		PERROR("Plugin %s has no audio input ports set!!", QS_C(get_name()));
 		return -1;
@@ -205,13 +205,13 @@ int LV2Plugin::init()
 //		PERROR("Plugin %s has no audio output ports set!!", QS_C(get_name()));
 		return -1;
 	}
-	
+
 	// The default is 2 channels in - out, if there is only 1 in - out, duplicate
 	// this plugin, and use it on the second channel
 	if (!m_isSlave && m_audioInputPorts.size() == 1 && m_audioOutputPorts.size() == 1) {
 		m_slave = create_copy();
 	}
-	
+
 	return 1;
 }
 
@@ -224,12 +224,12 @@ int LV2Plugin::create_instance()
 	m_plugin = lilv_plugins_get_by_uri(PluginManager::instance()->get_lilv_plugins(), plugin_uri);
 	lilv_node_free(plugin_uri);
 
-	
+
 	if (! m_plugin) {
 		fprintf(stderr, "Failed to find plugin %s.\n", QS_C(m_pluginUri));
 		return -1;
 	}
-	
+
 	/* Instantiate the plugin */
     uint samplerate = audiodevice().get_sample_rate();
     m_instance = lilv_plugin_instantiate(m_plugin, samplerate, nullptr);
@@ -240,7 +240,7 @@ int LV2Plugin::create_instance()
 	} else {
 // 		printf("Succesfully instantiated plugin.\n\n");
 	}
-	
+
 	return 1;
 }
 
@@ -250,7 +250,7 @@ void LV2Plugin::process(AudioBus* bus, nframes_t nframes)
 	if ( is_bypassed() ) {
 		return;
 	}
-	
+
 	for (int i=0; i<m_audioInputPorts.size(); ++i) {
 		AudioInputPort* port = m_audioInputPorts.at(i);
 		int index = port->get_index();
@@ -258,7 +258,7 @@ void LV2Plugin::process(AudioBus* bus, nframes_t nframes)
 		if (m_isSlave) i = 1;
         lilv_instance_connect_port(m_instance, uint32_t(index), bus->get_buffer(i, nframes));
 	}
-	
+
 	for (int i=0; i<m_audioOutputPorts.size(); ++i) {
 		AudioOutputPort* port = m_audioOutputPorts.at(i);
 		int index = port->get_index();
@@ -266,15 +266,15 @@ void LV2Plugin::process(AudioBus* bus, nframes_t nframes)
 		if (m_isSlave) i = 1;
         lilv_instance_connect_port(m_instance, uint32_t(index), bus->get_buffer(i, nframes));
 	}
-	
+
 	/* Run plugin for this cycle */
 	lilv_instance_run(m_instance, nframes);
-	
+
 	// If we have a slave, and the bus has 2 channels, process the slave too!
 	if (m_slave && bus->get_channel_count() == 2) {
 		m_slave->process(bus, nframes);
-	}	
-	
+	}
+
 }
 
 
@@ -282,7 +282,7 @@ LV2ControlPort* LV2Plugin::create_port(uint32_t portIndex, float defaultValue)
 {
     LV2ControlPort* ctrlport = nullptr;
     const LilvPort* slv2_port = lilv_plugin_get_port_by_index(m_plugin, portIndex);
-	
+
 	PortDirection direction;
         PortType type = UNKNOWN;
 
@@ -470,23 +470,22 @@ PluginInfo LV2Plugin::get_plugin_info(const LilvPlugin* plugin)
 	PluginInfo info;
 	info.name = lilv_node_as_string(lilv_plugin_get_name(plugin));
 	info.uri = lilv_node_as_string(lilv_plugin_get_uri(plugin));
-	
-	
+
+
 	LilvWorld* world = PluginManager::instance()->get_lilv_world();
 	LilvNode* input = lilv_new_uri(world, LILV_URI_INPUT_PORT);
 	LilvNode* output = lilv_new_uri(world, LILV_URI_OUTPUT_PORT);
 	LilvNode* audio = lilv_new_uri(world, LILV_URI_AUDIO_PORT);
-	
+
     info.audioPortInCount = int(lilv_plugin_get_num_ports_of_class(plugin, input, audio, nullptr));
     info.audioPortOutCount = int(lilv_plugin_get_num_ports_of_class(plugin, output, audio, nullptr));
 	info.type = lilv_node_as_string(lilv_plugin_class_get_label(lilv_plugin_get_class(plugin)));
-	
+
 	lilv_node_free(input);
 	lilv_node_free(output);
 	lilv_node_free(audio);
-	
+
 	return info;
 }
 
 //eof
-
diff --git a/src/sheetcanvas/ViewItem.h b/src/sheetcanvas/ViewItem.h
index b0c77309..e1bce2ad 100755
--- a/src/sheetcanvas/ViewItem.h
+++ b/src/sheetcanvas/ViewItem.h
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2005-2006 Remon Sijrier 
+Copyright (C) 2005-2006 Remon Sijrier
 
 This file is part of Traverso
 
@@ -33,12 +33,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 class SheetView;
 
 // Canvas width should be 2^31, but it doesn't work ok
-// 2^30 works ok, so let's use that, still gives a lot 
+// 2^30 works ok, so let's use that, still gives a lot
 // of headroom for real large recordings
-#if ! defined (Q_WS_WIN)
+#if ! defined (Q_OS_WIN)
 #define MAX_CANVAS_WIDTH 1073741824
 #define MAX_CANVAS_HEIGHT 1073741824
-#else		
+#else
 #define MAX_CANVAS_WIDTH 107374182
 #define MAX_CANVAS_HEIGHT 107374182
 #endif
diff --git a/src/traverso/Main.cpp b/src/traverso/Main.cpp
index 820481af..04046114 100755
--- a/src/traverso/Main.cpp
+++ b/src/traverso/Main.cpp
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2005-2009 Remon Sijrier 
+Copyright (C) 2005-2009 Remon Sijrier
 
 This file is part of Traverso
 
@@ -49,7 +49,7 @@ Traverso* traverso;
 int signalcount = 0;
 
 
-#if defined (Q_WS_X11) || defined (Q_WS_MAC)
+#if defined (Q_OS_UNIX) || defined (Q_OS_MAC)
 void catch_signal(int sig_num)
 {
 	if (!signalcount) {
@@ -70,7 +70,7 @@ int main( int argc, char **argv )
 	TRACE_OFF();
 	MEM_ON();
 
-#if defined (Q_WS_X11) || defined (Q_WS_MAC)
+#if defined (Q_OS_UNIX) || defined (Q_OS_MAC)
 	signal(SIGINT, catch_signal);
 	signal(SIGSEGV, catch_signal);
 #endif
@@ -133,7 +133,7 @@ int main( int argc, char **argv )
 //	QApplication::setGraphicsSystem("raster");
 
 	traverso = new Traverso(argc, argv);
-	
+
 	QTranslator traversoTranslator;
 	QString systemLanguage = QLocale::system().name();
 	QString userLanguage = config().get_property("Interface", "LanguageFile", "").toString();
@@ -143,7 +143,7 @@ int main( int argc, char **argv )
 		traversoTranslator.load(userLanguage);
 	}
 	traverso->installTranslator(&traversoTranslator);
-	
+
         traverso->create_interface();
 
         if (argc > 1) {
@@ -164,7 +164,7 @@ int main( int argc, char **argv )
 
 
 	traverso->exec();
-	
+
 	delete traverso;
 
 	MEM_OFF();
@@ -172,4 +172,3 @@ int main( int argc, char **argv )
 	printf("Thank you for using Traverso !\n");
 	return 0;
 }
-
diff --git a/src/traverso/TMainWindow.cpp b/src/traverso/TMainWindow.cpp
index 186b18f6..28358dd4 100755
--- a/src/traverso/TMainWindow.cpp
+++ b/src/traverso/TMainWindow.cpp
@@ -234,7 +234,7 @@ TMainWindow::TMainWindow()
 //        m_mainMenuToolBar->setStyleSheet("margin-top: 0px; margin-bottom: 0px;");
 	m_mainMenuToolBar->setMovable(false);
 
-#if defined (Q_WS_MAC)
+#if defined (Q_OS_MAC)
 	// OS X is a lot pickier about menu bars. If we don't use
 	// QMainWindow::menuBar(), the menus won't be shown at all.
 	// If possible, I would recommend using the same solution
@@ -265,7 +265,7 @@ TMainWindow::TMainWindow()
 	m_transportConsole = new TransportConsoleWidget(this);
 	m_transportConsole->setObjectName("Transport Console");
 
-#if defined (Q_WS_MAC)
+#if defined (Q_OS_MAC)
 	// this is important only when setUnifiedTitleAndToolBarOnMac() is true,
 	// because in that case the toolbars in the TopToolBarArea can't be moved
 	// and buttons outside the window area are not accessible at all.
@@ -874,7 +874,7 @@ void TMainWindow::create_menus( )
 
 	// if unifiedTitleAndToolBarOnMac == true we don't want the main toolbars
 	// to be hidden. thus only add the menu entries on systems != OS X
-#if !defined (Q_WS_MAC)
+#if !defined (Q_OS_MAC)
 	menu->addAction(m_projectToolBar->toggleViewAction());
 	m_projectToolBar->toggleViewAction()->setText(tr("Project"));
 
diff --git a/src/traverso/dialogs/CDWritingDialog.cpp b/src/traverso/dialogs/CDWritingDialog.cpp
index e0bd4a8d..c20fcaa1 100644
--- a/src/traverso/dialogs/CDWritingDialog.cpp
+++ b/src/traverso/dialogs/CDWritingDialog.cpp
@@ -1,18 +1,18 @@
 /*
-    Copyright (C) 2007 Remon Sijrier 
- 
+    Copyright (C) 2007 Remon Sijrier
+
     This file is part of Traverso
- 
+
     Traverso is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
- 
+
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
- 
+
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
@@ -32,7 +32,7 @@
 #include "Utils.h"
 
 
-#if defined (Q_WS_WIN)
+#if defined (Q_OS_WIN)
 #define CDRDAO_BIN	"cdrdao.exe"
 #else
 #define CDRDAO_BIN	"cdrdao"
@@ -51,7 +51,7 @@ CDWritingDialog::CDWritingDialog( QWidget * parent )
 
 	stopButton->hide();
 	set_project(pm().get_project());
-	
+
 	connect(closeButton, SIGNAL(clicked()), this, SLOT(hide()));
 	connect(&pm(), SIGNAL(projectLoaded(Project*)), this, SLOT(set_project(Project*)));
 
@@ -62,11 +62,11 @@ CDWritingDialog::CDWritingDialog( QWidget * parent )
 	m_burnprocess->setEnvironment(env);
 	m_writingState = NO_STATE;
 	m_lastSheetExported = -1;
-	
+
 	refreshButton->setIcon(QIcon(find_pixmap(":/refresh-16")));
 	refreshButton->setMaximumHeight(26);
 	refreshButton->setMaximumWidth(30);
-	
+
 	connect(m_burnprocess, SIGNAL(readyReadStandardOutput()), this, SLOT(read_standard_output()));
 	connect(m_burnprocess, SIGNAL(started()), this, SLOT(cdrdao_process_started()));
 	connect(m_burnprocess, SIGNAL(finished(int, QProcess::ExitStatus)),
@@ -77,14 +77,14 @@ CDWritingDialog::CDWritingDialog( QWidget * parent )
 	connect(cdDiskExportOnlyCheckBox, SIGNAL(stateChanged(int)), this, SLOT(export_only_changed(int)));
         connect(m_project, SIGNAL(exportMessage(QString)), this, SLOT(set_export_message(QString)));
 
-	
+
 	m_wodimAvailable = false;
-	
+
 	// A bit lame way to 'detect' if wodim is installed
 	if (QProcess::execute("wodim") != QProcess::FailedToStart) {
 		m_wodimAvailable = true;
 	}
-	
+
 	query_devices();
 }
 
@@ -99,7 +99,7 @@ bool CDWritingDialog::is_safe_to_export()
 		info().warning(tr("CD Writing during recording is not supported!"));
 		return false;
 	}
-	
+
 	return true;
 }
 
@@ -119,7 +119,7 @@ void CDWritingDialog::set_export_message(QString message)
 void CDWritingDialog::set_project(Project * project)
 {
 	m_project = project;
-	
+
 	if (! m_project) {
 		info().information(tr("No project loaded, to write a project to CD, load it first!"));
 		setEnabled(false);
@@ -152,13 +152,13 @@ void CDWritingDialog::query_devices()
 		printf("query_devices: burnprocess still running!\n");
 		return;
 	}
-	
+
 	m_writingState = QUERY_DEVICE;
 	cdDeviceComboBox->clear();
 
-#if defined (Q_WS_WIN)
+#if defined (Q_OS_WIN)
 	m_burnprocess->start(CDRDAO_BIN, QStringList() << "scanbus");
-#elif defined (Q_WS_MAC)
+#elif defined (Q_OS_MAC)
 	cdDeviceComboBox->clear();
 	cdDeviceComboBox->addItem("IODVDServices");
 	cdDeviceComboBox->addItem("IODVDServices/2");
@@ -180,18 +180,18 @@ void CDWritingDialog::unlock_device()
 	if ( ! (m_burnprocess->state() == QProcess::NotRunning) ) {
 		return;
 	}
-	
+
 	m_writingState = UNLOCK_DEVICE;
 	int index = cdDeviceComboBox->currentIndex();
 	if (index == -1) {
 		return;
 	}
-		
+
 	QString device = get_device(index);
 
 	QStringList args;
 	args  << "unlock" << "--device" << device;
-#if defined (Q_WS_MAC)
+#if defined (Q_OS_MAC)
 	m_burnprocess->start(qApp->applicationDirPath() + "/cdrdao", args);
 #else
 	m_burnprocess->start(CDRDAO_BIN, args);
@@ -202,7 +202,7 @@ void CDWritingDialog::unlock_device()
 void CDWritingDialog::stop_burn_process()
 {
 	PENTER;
-	
+
 	if (m_writingState == RENDER) {
 		update_cdburn_status(tr("Aborting Render process ..."), NORMAL_MESSAGE);
 		m_exportSpec->stop = true;
@@ -214,7 +214,7 @@ void CDWritingDialog::stop_burn_process()
 		m_burnprocess->terminate();
 		m_writingState = ABORT_BURN;
 	}
-	
+
 	stopButton->setEnabled(false);
 }
 
@@ -222,14 +222,14 @@ void CDWritingDialog::stop_burn_process()
 void CDWritingDialog::start_burn_process()
 {
 	PENTER;
-	
+
 	if(!is_safe_to_export()) {
 		return;
 	}
-	
+
 	m_copyNumber = 0;
 	cd_render();
-	
+
 	int index = cdDeviceComboBox->currentIndex();
 	if (index != -1 && cdDeviceComboBox->itemData(index) != QVariant::Invalid) {
 		config().set_property("Cdrdao", "drive", cdDeviceComboBox->itemData(index));
@@ -240,7 +240,7 @@ void CDWritingDialog::start_burn_process()
 void CDWritingDialog::cdrdao_process_started()
 {
 	PENTER;
-	
+
 	if (m_writingState == BURNING) {
 		update_cdburn_status(tr("Waiting for CD-Writer..."), NORMAL_MESSAGE);
 		progressBar->setMaximum(0);
@@ -251,25 +251,25 @@ void CDWritingDialog::cdrdao_process_started()
 void CDWritingDialog::cdrdao_process_finished(int exitcode, QProcess::ExitStatus exitstatus)
 {
 	PENTER;
-	
+
 	Q_UNUSED(exitcode);
-	
+
 	if (exitstatus == QProcess::CrashExit) {
 		update_cdburn_status(tr("CD Burn process failed!"), ERROR_MESSAGE);
 	}
-	
+
 	if (m_writingState == ABORT_BURN) {
 		update_cdburn_status(tr("CD Burn process stopped on user request."), NORMAL_MESSAGE);
 	}
-	
+
 	if (m_writingState == BURNING) {
 		update_cdburn_status(tr("CD Writing process finished!"), NORMAL_MESSAGE);
 	}
-	
+
 	if (exitstatus == QProcess::CrashExit || m_writingState == ABORT_BURN) {
 		unlock_device();
 	}
-	
+
 	progressBar->setMaximum(100);
 	progressBar->setValue(0);
 
@@ -281,35 +281,35 @@ void CDWritingDialog::cdrdao_process_finished(int exitcode, QProcess::ExitStatus
 				writeAnotherCd = true;
 			}
 		}
-	
+
 		if (writeAnotherCd) {
 			write_to_cd();
 			return;
 		}
 	}
-	
+
 	enable_ui_interaction();
 }
 
 void CDWritingDialog::cd_render()
 {
 	PENTER;
-	
+
 	if ( ! (m_burnprocess->state() == QProcess::NotRunning) ) {
 		info().critical(tr("Burn process is still running, cannot start it twice!!"));
 		return;
 	}
-	
+
 	// FIXME: We should instead check export wav file timestamps/revision numbers as a dirty test
 	if (! cdAllSheetsButton->isChecked() && m_lastSheetExported != m_project->get_current_sheet_id()) {
 		m_exportSpec->renderfinished = false;
 	}
-	
+
 	if (m_wasClosed && m_exportSpec->renderfinished && (m_exportSpec->allSheets == cdAllSheetsButton->isChecked()) ) {
-		
-		if (QMessageBox::question(this, tr("Rerender CD content"), 
-		    		tr("There is already a CD render available.\nShould I re-render the CD content?"), 
-				QMessageBox::Yes | QMessageBox::No, 
+
+		if (QMessageBox::question(this, tr("Rerender CD content"),
+		    		tr("There is already a CD render available.\nShould I re-render the CD content?"),
+				QMessageBox::Yes | QMessageBox::No,
 				QMessageBox::No) == QMessageBox::Yes)
 		{
 			m_exportSpec->renderfinished = false;
@@ -317,11 +317,11 @@ void CDWritingDialog::cd_render()
 	}
 
 	m_wasClosed = false;
-	
-	if ( !	(m_exportSpec->renderfinished && 
+
+	if ( !	(m_exportSpec->renderfinished &&
 		(m_exportSpec->allSheets == cdAllSheetsButton->isChecked()) &&
 		(m_exportSpec->normalize == cdNormalizeCheckBox->isChecked())) ) {
-		
+
 		m_exportSpec->data_width = 16;
 		m_exportSpec->writerType = "sndfile";
 		m_exportSpec->extraFormat["filetype"] = "wav";
@@ -340,19 +340,19 @@ void CDWritingDialog::cd_render()
 		m_exportSpec->stop = false;
 		m_exportSpec->breakout = false;
 		m_exportSpec->isCdExport = true;
-		
+
 		if (m_project->create_cdrdao_toc(m_exportSpec) < 0) {
 			info().warning(tr("Creating CDROM table of contents failed, unable to write CD"));
 			return;
 		}
-	
+
 		m_writingState = RENDER;
 
 		connect(m_project, SIGNAL(overallExportProgressChanged(int)), this, SLOT(cd_export_progress(int)));
 		connect(m_project, SIGNAL(exportFinished()), this, SLOT(cd_export_finished()));
-	
+
 		update_cdburn_status(tr("Rendering Sheet(s)"), NORMAL_MESSAGE);
-		
+
 		disable_ui_interaction();
 		m_project->export_project(m_exportSpec);
 		m_lastSheetExported = m_project->get_current_sheet_id();
@@ -375,28 +375,28 @@ void CDWritingDialog::write_to_cd()
 		info().critical(tr("Burn process is still running, cannot start it twice!!"));
 		return;
 	}
-	
+
 	m_writingState = BURNING;
 	progressBar->setValue(0);
-	
+
 	int index = cdDeviceComboBox->currentIndex();
 	if (index == -1) {
-		QMessageBox::information( 0, tr("No Burn Device"), 
+		QMessageBox::information( 0, tr("No Burn Device"),
 					  tr("No burn Device selected or available!"),
 					     QMessageBox::Ok);
 		enable_ui_interaction();
 		return;
 	}
-		
+
 	QString device = get_device(index);
 	QStringList arguments;
 	QString burnprogram;
-	
-	
-	// wodim vs cdrecord vs cdrdao?? a lot of fuzz about these, 
+
+
+	// wodim vs cdrecord vs cdrdao?? a lot of fuzz about these,
 	// but so far cdrdao works for me just fine, so let's continue
 	// using it for the actual burning for now.
-	
+
 /*	if (m_wodimAvailable) {
 		burnprogram = "wodim";
 		arguments << "-vv";
@@ -420,12 +420,12 @@ void CDWritingDialog::write_to_cd()
 			arguments << "--simulate";
 		}
 // 	}
-	
+
 	arguments << m_exportSpec->tocFileName;
-	
+
 	printf("%s arguments: %s\n", QS_C(burnprogram), QS_C(arguments.join(" ")));
 
-#if defined (Q_WS_MAC)
+#if defined (Q_OS_MAC)
 	m_burnprocess->start(qApp->applicationDirPath() + "/cdrdao", arguments);
 #else
 	m_burnprocess->start(burnprogram, arguments);
@@ -437,20 +437,20 @@ void CDWritingDialog::cd_export_finished()
 	PENTER;
 	disconnect(m_project, SIGNAL(overallExportProgressChanged(int)), this, SLOT(cd_export_progress(int)));
 	disconnect(m_project, SIGNAL(exportFinished()), this, SLOT(cd_export_finished()));
-	
+
 	if (m_exportSpec->breakout) {
 		m_exportSpec->renderfinished = false;
 		update_cdburn_status(tr("Render process stopped on user request."), NORMAL_MESSAGE);
 		enable_ui_interaction();
 		return;
 	}
-	
+
 	if (cdDiskExportOnlyCheckBox->isChecked()) {
 		update_cdburn_status(tr("Export to disk finished!"), NORMAL_MESSAGE);
 		enable_ui_interaction();
 		return;
 	}
-	
+
 	m_exportSpec->renderfinished = true;
 	write_to_cd();
 }
@@ -468,7 +468,7 @@ void CDWritingDialog::update_cdburn_status(const QString& message, int type)
 		cdExportInformationLabel->setPalette(palette);
 		cdExportInformationLabel->setText(message);
 	}
-	
+
 	if (type == ERROR_MESSAGE) {
 		QPalette palette;
 		palette.setColor(QPalette::WindowText, QColor(Qt::red));
@@ -480,32 +480,32 @@ void CDWritingDialog::update_cdburn_status(const QString& message, int type)
 void CDWritingDialog::read_standard_output()
 {
 	PENTER;
-	
+
 	Q_ASSERT(m_burnprocess);
-	
+
 	if (m_writingState == QUERY_DEVICE) {
-		
+
 		QByteArray output = m_burnprocess->readAllStandardOutput();
 		QList<QByteArray> lines = output.split('\n');
-		
+
 		foreach(QByteArray data, lines) {
-			
+
 			if (data.isEmpty()) {
 				continue;
 			}
-			
+
 			printf("%s\n", data.data());
-			
+
 			if (data.contains("trying to open")) {
 				update_cdburn_status(tr("Trying to access CD Writer ..."), NORMAL_MESSAGE);
 				return;
 			}
-			
+
 			if (data.contains("Cannot open") || data.contains("Cannot setup")) {
 				update_cdburn_status(tr("Cannot access CD Writer, is it in use ?"), ERROR_MESSAGE);
 				return;
 			}
-#if defined (Q_WS_WIN)
+#if defined (Q_OS_WIN)
 			if (QString(data).contains(QRegExp("[0-9],[0-9],[0-9]"))) {
 #else
 			if (data.contains("/dev/") || data.contains("dev=")) {
@@ -513,7 +513,7 @@ void CDWritingDialog::read_standard_output()
 				QStringList strlist = QString(data).split(QRegExp("\\s+"));
 				QString deviceName = "No Device Available";
 				QString device = "/no/device/detected";
-				
+
 				if (m_wodimAvailable) {
 					if (strlist.size() > 5) {
 						deviceName = strlist.at(5) + " ";
@@ -544,62 +544,62 @@ void CDWritingDialog::read_standard_output()
 				cdDeviceComboBox->addItem(deviceName, device);
 			}
 		}
-		
+
 		QString cdrdaoDrive = config().get_property("Cdrdao", "drive", "").toString();
 		int index = cdDeviceComboBox->findData(cdrdaoDrive);
 		if (index >= 0) {
 			cdDeviceComboBox->setCurrentIndex(index);
 		}
-		
+
 		update_cdburn_status(tr("Information"), NORMAL_MESSAGE);
-		
+
 		return;
 	}
-	
-	
+
+
 	QString sout = m_burnprocess->readAllStandardOutput();
-	
+
 	if (sout.simplified().isEmpty()) {
 		return;
 	}
-	
+
 	if (sout.contains("Disk seems to be written")) {
 		int index = cdDeviceComboBox->currentIndex();
 		if (index != -1) {
-#if defined (Q_WS_WIN)
+#if defined (Q_OS_WIN)
 			// No idea if this works.....
 			QProcess::execute("rsm.exe", QStringList() << "eject" << "/n0");
 #else
 			QProcess::execute("eject", QStringList() << cdDeviceComboBox->itemData(index).toString());
 #endif
 		}
-		QMessageBox::information( 0, tr("Disc not empty"), 
+		QMessageBox::information( 0, tr("Disc not empty"),
 					  tr("Please, insert an empty disc and hit enter"),
 					     QMessageBox::Ok);
 		m_burnprocess->write("enter");
 		return;
 	}
-	
+
 	if (sout.contains("Inserted disk is not empty and not appendable.")) {
 		QMessageBox::information( 0, tr("Disc not empty"),
 					  tr("Inserted disk is not empty, and cannot append data to it!"),
 					     QMessageBox::Ok);
 		return;
 	}
-		
-	
+
+
 	if (sout.contains("Unit not ready")) {
 		update_cdburn_status(tr("Waiting for CD Writer... (no disk inserted?)"), NORMAL_MESSAGE);
 		progressBar->setMaximum(0);
 		return;
 	}
-		
-		
+
+
 	if (sout.contains("Turning BURN-Proof on")) {
 		update_cdburn_status(tr("Turning BURN-Proof on"), NORMAL_MESSAGE);
 		return;
 	}
-	
+
 	if (sout.contains("Writing track")) {
 		QStringList strlist = sout.split(QRegExp("\\s+"));
 		if (strlist.size() > 3) {
@@ -607,8 +607,8 @@ void CDWritingDialog::read_standard_output()
 			update_cdburn_status(text, NORMAL_MESSAGE);
 		}
 		return;
-	}	
-	
+	}
+
 	if (sout.contains("%") && sout.contains("(") && sout.contains(")")) {
 		QStringList strlist = sout.split(QRegExp("\\s+"));
 		if (strlist.size() > 7) {
@@ -626,7 +626,7 @@ void CDWritingDialog::read_standard_output()
 		}
 		return;
 	}
-	
+
 	// Write out only the unhandled cdrdao lines
 	printf("CD Writing: %s\n", QS_C(sout.trimmed()));
 }
@@ -682,7 +682,7 @@ void CDWritingDialog::set_was_closed()
 
 QString CDWritingDialog::get_device(int index)
 {
-#if defined (Q_WS_MAC)
+#if defined (Q_OS_MAC)
 	return cdDeviceComboBox->currentText();
 #else
 	return cdDeviceComboBox->itemData(index).toString();
@@ -698,4 +698,3 @@ QString CDWritingDialog::get_device(int index)
 //        t = m_project->get_cd_totaltime(m_exportSpec);
 //        cdTotalTimeLabel->setText(timeref_to_cd(t));
 //}
-
diff --git a/src/traverso/dialogs/settings/Pages.cpp b/src/traverso/dialogs/settings/Pages.cpp
index 5656fd50..23ba34ce 100644
--- a/src/traverso/dialogs/settings/Pages.cpp
+++ b/src/traverso/dialogs/settings/Pages.cpp
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2007-2009 Remon Sijrier 
+Copyright (C) 2007-2009 Remon Sijrier
 
 This file is part of Traverso
 
@@ -59,14 +59,14 @@ AudioDriverConfigPage::AudioDriverConfigPage(QWidget *parent)
         driverInformationTextEdit->hide();
 
 	periodBufferSizesList << 16 << 32 << 64 << 128 << 256 << 512 << 1024 << 2048 << 4096;
-	
+
 	m_mainLayout = qobject_cast<QVBoxLayout*>(layout());
-	
+
 	QStringList drivers = audiodevice().get_available_drivers();
 	foreach(const QString &name, drivers) {
 		driverCombo->addItem(name);
 	}
-	
+
 
 	m_portaudiodrivers = new PaDriverPage(this);
 	m_mainLayout->addWidget(m_portaudiodrivers);
@@ -74,7 +74,7 @@ AudioDriverConfigPage::AudioDriverConfigPage(QWidget *parent)
 	m_alsadevices = new AlsaDevicesPage(this);
 	m_alsadevices->layout()->setMargin(0);
 	m_mainLayout->addWidget(m_alsadevices);
-	
+
         connect(driverCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(driver_combobox_index_changed(QString)));
 	connect(restartDriverButton, SIGNAL(clicked()), this, SLOT(restart_driver_button_clicked()));
         connect(rateComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(rate_combobox_index_changed(QString)));
@@ -95,37 +95,37 @@ void AudioDriverConfigPage::save_config()
 		buffersize = periodBufferSizesList.at(bufferindex);
 	}
 	config().set_property("Hardware", "buffersize", buffersize);
-	
+
 	config().set_property("Hardware", "drivertype", driverCombo->currentText());
-	
+
 	int playback=1, capture=1;
 	if(duplexComboBox->currentIndex() == 1) {
 		capture = 0;
 	}
-	
+
 	if(duplexComboBox->currentIndex() == 2) {
 		playback = 0;
 	}
-	
+
 	config().set_property("Hardware", "capture", capture);
 	config().set_property("Hardware", "playback", playback);
 
-	
+
 #if defined (ALSA_SUPPORT)
 	int periods = m_alsadevices->periodsCombo->currentText().toInt();
 	config().set_property("Hardware", "numberofperiods", periods);
 	int index = m_alsadevices->devicesCombo->currentIndex();
 	config().set_property("Hardware", "carddevice", m_alsadevices->devicesCombo->itemData(index));
 	config().set_property("Hardware", "DitherShape", m_alsadevices->ditherShapeComboBox->currentText());
-	
+
 #endif
 
-	
+
 #if defined (PORTAUDIO_SUPPORT)
 	int paindex = m_portaudiodrivers->driverCombo->currentIndex();
 	config().set_property("Hardware", "pahostapi", m_portaudiodrivers->driverCombo->itemData(paindex));
 #endif
-	
+
 	config().set_property("Hardware", "jackslave", jackTransportCheckBox->isChecked());
 }
 
@@ -144,22 +144,22 @@ void AudioDriverConfigPage::reset_default_config()
 #else
 	config().set_property("Hardware", "drivertype", "Null Driver");
 #endif
-	
+
 #if defined (PORTAUDIO_SUPPORT)
-#if defined (Q_WS_X11)
+#if defined (Q_OS_UNIX)
 	config().set_property("Hardware", "pahostapi", "alsa");
 #endif
-#if defined (Q_WS_MAC)
+#if defined (Q_OS_MAC)
 	config().set_property("Hardware", "pahostapi", "coreaudio");
 #endif
-#if defined (Q_WS_WIN)
+#if defined (Q_OS_WIN)
 	config().set_property("Hardware", "pahostapi", "wmme");
 #endif
 #endif //end PORTAUDIO_SUPPORT
-	
+
 	config().set_property("Hardware", "capture", 1);
 	config().set_property("Hardware", "playback", 1);
-	
+
 	config().set_property("Hardware", "jackslave", false);
 
 	load_config();
@@ -169,11 +169,11 @@ void AudioDriverConfigPage::load_config( )
 {
 	int samplerate = config().get_property("Hardware", "samplerate", 44100).toInt();
     int buffersize = config().get_property("Hardware", "buffersize", 512).toInt();
-#if defined (Q_WS_X11)
+#if defined (Q_OS_UNIX)
 	QString driverType = config().get_property("Hardware", "drivertype", "ALSA").toString();
 #else
 	QString driverType = config().get_property("Hardware", "drivertype", "PortAudio").toString();
-#endif	
+#endif
 	bool capture = config().get_property("Hardware", "capture", 1).toInt();
 	bool playback = config().get_property("Hardware", "playback", 1).toInt();
 
@@ -182,16 +182,16 @@ void AudioDriverConfigPage::load_config( )
 	if (driverTypeIndex >= 0) {
 		driverCombo->setCurrentIndex(driverTypeIndex);
 	}
-	
+
 	driver_combobox_index_changed(driverType);
-	
+
 	int buffersizeIndex = periodBufferSizesList.indexOf(buffersize);
 	int samplerateIndex = rateComboBox->findText(QString::number(samplerate));
-	
+
 	rateComboBox->setCurrentIndex(samplerateIndex);
 	latencyComboBox->setCurrentIndex(buffersizeIndex);
-	
-	
+
+
 	if (capture && playback) {
 		duplexComboBox->setCurrentIndex(0);
 	} else if (playback) {
@@ -199,23 +199,23 @@ void AudioDriverConfigPage::load_config( )
 	} else {
 		duplexComboBox->setCurrentIndex(2);
 	}
-	
+
 	int index;
-	
+
 #if defined (ALSA_SUPPORT)
 	m_alsadevices->devicesCombo->clear();
 	int periodsIndex = config().get_property("Hardware", "numberofperiods", 3).toInt();
 	QString ditherShape = config().get_property("Hardware", "DitherShape", "None").toString();
 	m_alsadevices->periodsCombo->setCurrentIndex(periodsIndex - 2);
-	
+
 	int shapeIndex = m_alsadevices->ditherShapeComboBox->findText(ditherShape);
 	if (shapeIndex >=0) {
 		m_alsadevices->ditherShapeComboBox->setCurrentIndex(shapeIndex);
 	}
-	
+
 	// Always add the 'default' device
 	m_alsadevices->devicesCombo->addItem(tr("System default"), "default");
-	
+
 	// Iterate over the maximum number of devices that can be in a system
 	// according to alsa, and add them to the devices list.
     QString name, longName;
@@ -226,32 +226,32 @@ void AudioDriverConfigPage::load_config( )
                 m_alsadevices->devicesCombo->addItem(longName, name);
 		}
 	}
-	
+
         QString defaultdevice =  config().get_property("Hardware", "carddevice", "default").toString();
 	index = m_alsadevices->devicesCombo->findData(defaultdevice);
 	if (index >= 0) {
 		m_alsadevices->devicesCombo->setCurrentIndex(index);
 	}
 #endif
-	
+
 #if defined (PORTAUDIO_SUPPORT)
 	m_portaudiodrivers->driverCombo->clear();
 	QString defaulthostapi = "";
 
-#if defined (Q_WS_X11)
+#if defined (Q_OS_UNIX)
 	m_portaudiodrivers->driverCombo->addItem("ALSA", "alsa");
 	m_portaudiodrivers->driverCombo->addItem("Jack", "jack");
 	m_portaudiodrivers->driverCombo->addItem("OSS", "oss");
 	defaulthostapi = "jack";
 #endif
 
-#if defined (Q_WS_MAC)
+#if defined (Q_OS_MAC)
 	m_portaudiodrivers->driverCombo->addItem("Core Audio", "coreaudio");
 	m_portaudiodrivers->driverCombo->addItem("Jack", "jack");
 	defaulthostapi = "coreaudio";
 #endif
 
-#if defined (Q_WS_WIN)
+#if defined (Q_OS_WIN)
 	m_portaudiodrivers->driverCombo->addItem("MME", "wmme");
 	m_portaudiodrivers->driverCombo->addItem("Direct Sound", "directsound");
         m_portaudiodrivers->driverCombo->addItem("WASAPI", "wasapi");
@@ -259,13 +259,13 @@ void AudioDriverConfigPage::load_config( )
         m_portaudiodrivers->driverCombo->addItem("ASIO", "asio");
         defaulthostapi = "wmme";
 #endif
-	
+
 	QString hostapi = config().get_property("Hardware", "pahostapi", defaulthostapi).toString();
 	index = m_portaudiodrivers->driverCombo->findData(hostapi);
 	if (index >= 0) {
 		m_portaudiodrivers->driverCombo->setCurrentIndex(index);
 	}
-	
+
 	update_latency_combobox();
 
 #endif //end PORTAUDIO_SUPPORT
@@ -284,17 +284,17 @@ void AudioDriverConfigPage::restart_driver_button_clicked()
 	QString driver = driverCombo->currentText();
         ads.rate = rateComboBox->currentText().toInt();
         ads.bufferSize =  periodBufferSizesList.at(latencyComboBox->currentIndex());
-	
+
         ads.playback = true;
         ads.capture = true;
 	if(duplexComboBox->currentIndex() == 1) {
                 ads.capture = false;
 	}
-	
+
 	if(duplexComboBox->currentIndex() == 2) {
                 ads.playback = false;
 	}
-	
+
 
         ads.cardDevice = "";
         ads.ditherShape = "None";
@@ -308,13 +308,13 @@ void AudioDriverConfigPage::restart_driver_button_clicked()
 	// setting it now, and restoring it afterwards...
 	int currentperiods = config().get_property("Hardware", "numberofperiods", 3).toInt();
     config().set_property("Hardware", "numberofperiods", periods);
-	
+
 	if (driver == "ALSA") {
 		int index = m_alsadevices->devicesCombo->currentIndex();
                 ads.cardDevice = m_alsadevices->devicesCombo->itemData(index).toString();
 	}
 #endif
-	
+
 #if defined (PORTAUDIO_SUPPORT)
 	if (driver == "PortAudio") {
 		int index = m_portaudiodrivers->driverCombo->currentIndex();
@@ -323,14 +323,14 @@ void AudioDriverConfigPage::restart_driver_button_clicked()
                 ads.cardDevice += "::" + m_portaudiodrivers->outputDevicesCombo->currentText();
         }
 #endif
-			
+
         ads.driverType = driver;
         audiodevice().set_parameters(ads);
-	
+
 #if defined (ALSA_SUPPORT)
 	config().set_property("Hardware", "numberofperiods", currentperiods);
 #endif
-	
+
 	config().set_property("Hardware", "jackslave", jackTransportCheckBox->isChecked());
 }
 
@@ -357,7 +357,7 @@ void AudioDriverConfigPage::driver_combobox_index_changed(QString driver)
 		m_portaudiodrivers->hide();
 		m_mainLayout->removeWidget(m_portaudiodrivers);
 	}
-	
+
 	if (driver == "Jack") {
 		jackGroupBox->show();
         m_mainLayout->insertWidget(m_mainLayout->indexOf(driverConfigGroupBox), jackGroupBox);
@@ -402,12 +402,12 @@ void AudioDriverConfigPage::update_latency_combobox( )
 	latencyComboBox->clear();
 	int rate = rateComboBox->currentText().toInt();
 	int buffersize = audiodevice().get_buffer_size();
-	
+
 	for (int i=0; i<periodBufferSizesList.size(); ++i) {
 		QString latency = QString::number( ((float)(periodBufferSizesList.at(i)) / rate) * 1000 * 2, 'f', 2);
 		latencyComboBox->addItem(latency);
 	}
-	
+
 	int index = periodBufferSizesList.indexOf(buffersize);
 	latencyComboBox->setCurrentIndex(index);
 }
@@ -485,17 +485,17 @@ void AppearenceConfigPage::load_config()
 	pathSelectButton->setIcon(icon);
 	QString themepath = config().get_property("Themer", "themepath",
 				   QString(QDir::homePath()).append(".traverso/themes")).toString();
-	
-	
+
+
 	QStringList keys = QStyleFactory::keys();
 	keys.sort();
 	foreach(const QString &key, keys) {
 		styleCombo->addItem(key);
 	}
-	
+
 	update_theme_combobox(themepath);
-	
-	
+
+
 	// Hmm, there seems no way to get the name of the current
 	// used style, using the classname minus Q and Style seems to do the trick.
 	QString systemstyle = QString(QApplication::style()->metaObject()->className()).remove("Q").remove("Style");
@@ -509,9 +509,9 @@ void AppearenceConfigPage::load_config()
 	bool dbGrid = config().get_property("Themer", "drawdbgrid", false).toBool();
         Qt::Orientation orientation = (Qt::Orientation)config().get_property("Themer", "VUOrientation", Qt::Vertical).toInt();
 
-	
+
 	QString interfaceLanguage = config().get_property("Interface", "LanguageFile", "").toString();
-	
+
 	int index = styleCombo->findText(style);
 	styleCombo->setCurrentIndex(index);
 	index = themeSelecterCombo->findText(theme);
@@ -537,7 +537,7 @@ void AppearenceConfigPage::load_config()
 	QString iconsize = config().get_property("Themer", "iconsize", "22").toString();
 	supportedIconSizes = config().get_property("Themer", "supportediconsizes", "16;22;32;48").toString();
 
-	// if the list is empty, we should offer some default values. (The list can only be 
+	// if the list is empty, we should offer some default values. (The list can only be
 	// empty if someone deleted the values, but not the whole entry, in the config file.)
 	if (supportedIconSizes.isEmpty()) {
 		supportedIconSizes = "16;22;32;48";
@@ -569,8 +569,8 @@ void AppearenceConfigPage::load_config()
 	transportConsoleCombo->addItems(iconSizesList);
 	int trspsizeindex = iconSizeCombo->findText(trspsize);
 	transportConsoleCombo->setCurrentIndex(trspsizeindex);
-	
-	
+
+
 	int langIndex = languageComboBox->findData(interfaceLanguage);
 	if (langIndex >= 0) {
 		languageComboBox->setCurrentIndex(langIndex);
@@ -580,7 +580,7 @@ void AppearenceConfigPage::load_config()
 void AppearenceConfigPage::reset_default_config()
 {
 	styleCombo->clear();
-	
+
 	config().set_property("Themer", "themepath", QString(QDir::homePath()).append("/.traverso/themes"));
         config().set_property("Themer", "currenttheme", "Traverso Light");
 	config().set_property("Themer", "coloradjust", 100);
@@ -605,15 +605,15 @@ AppearenceConfigPage::AppearenceConfigPage(QWidget * parent)
 	: ConfigPage(parent)
 {
 	setupUi(this);
-	
+
 	themeSelecterCombo->setInsertPolicy(QComboBox::InsertAlphabetically);
         m_colorModifierDialog = 0;
-	
+
 	languageComboBox->addItem(tr("Default Language"), "");
 	foreach(const QString &lang, find_qm_files()) {
 		languageComboBox->addItem(language_name_from_qm_file(lang), lang);
 	}
-	
+
 	load_config();
         create_connections();
 }
@@ -646,7 +646,7 @@ void AppearenceConfigPage::theme_index_changed(const QString & theme)
 	int index = themeSelecterCombo->findText(theme);
 	QString data = themeSelecterCombo->itemData(index).toString();
 	QString path = config().get_property("Themer", "themepath", "").toString();
-	
+
 	if (data == "builtintheme") {
 		themer()->use_builtin_theme(theme);
 	} else {
@@ -690,7 +690,7 @@ void AppearenceConfigPage::update_theme_combobox(const QString& path)
         foreach(QString theme, themer()->get_builtin_themes()) {
                 themeSelecterCombo->addItem(theme, "builtintheme");
 	}
-	
+
 	QDir themedir(path);
         foreach (QString themeName, themedir.entryList(QDir::Files)) {
                 themeName = themeName.remove(".xml");
@@ -699,7 +699,7 @@ void AppearenceConfigPage::update_theme_combobox(const QString& path)
                         themeSelecterCombo->addItem(themeName);
 		}
 	}
-	
+
 }
 
 void AppearenceConfigPage::theme_option_changed()
@@ -730,9 +730,9 @@ BehaviorConfigPage::BehaviorConfigPage(QWidget * parent)
 	: ConfigPage(parent)
 {
 	setupUi(this);
-	
+
 	connect(&config(), SIGNAL(configChanged()), this, SLOT(update_follow()));
-	
+
 	load_config();
 }
 
@@ -764,13 +764,13 @@ void BehaviorConfigPage::load_config()
 	bool resyncAudio = config().get_property("AudioClip", "SyncDuringDrag", false).toBool();
 	bool lockClips = config().get_property("AudioClip", "LockByDefault", false).toBool();
     bool showShortcutHelpMessages = config().get_property("ShortCuts", "ShowCursorHelp", true).toBool();
-	
+
 	numberOfTrackSpinBox->setValue(defaultNumTracks);
 	scrollModeComboBox->setCurrentIndex(scrollMode);
 	resyncAudioCheckBox->setChecked(resyncAudio);
 	lockClipsCheckBox->setChecked(lockClips);
     showShortcutUsageMessagesCheckBox->setChecked(showShortcutHelpMessages);
-	
+
 	if (oncloseaction == "save") {
 		saveRadioButton->setChecked(true);
 	} else if (oncloseaction == "ask") {
@@ -778,7 +778,7 @@ void BehaviorConfigPage::load_config()
 	} else {
 		neverRadioButton->setChecked(true);
 	}
-	
+
 	update_follow();
 
 }
@@ -825,7 +825,7 @@ void KeyboardConfigPage::load_config()
 	int jogByPassDistance = config().get_property("InputEventDispatcher", "jobbypassdistance", 70).toInt();
 	int mouseClickTakesOverKeyboardNavigation = config().get_property("InputEventDispatcher", "mouseclicktakesoverkeyboardnavigation", false).toBool();
 	bool enterFinishesHold = config().get_property("InputEventDispatcher", "EnterFinishesHold", false).toBool();
-	
+
         mouseTreshHoldSpinBox->setValue(jogByPassDistance);
 
         if (mouseClickTakesOverKeyboardNavigation) {
@@ -862,7 +862,7 @@ void KeyboardConfigPage::reset_default_config()
 void KeyboardConfigPage::on_exportButton_clicked()
 {
 	tShortCutManager().export_keymap();
-	QMessageBox::information( TMainWindow::instance(), tr("KeyMap Export"), 
+	QMessageBox::information( TMainWindow::instance(), tr("KeyMap Export"),
 		     tr("The exported keymap can be found here:\n\n %1").arg(QDir::homePath() + "/traversokeymap.html"),
 		     QMessageBox::Ok);
 }
@@ -873,7 +873,7 @@ PerformanceConfigPage::PerformanceConfigPage(QWidget* parent)
 {
 	delete layout();
 	setupUi(this);
-	
+
 	load_config();
 
     QIcon icon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation);
@@ -908,18 +908,18 @@ RecordingConfigPage::RecordingConfigPage(QWidget * parent)
 	: ConfigPage(parent)
 {
 	setupUi(this);
-	
+
 	encodingComboBox->addItem("WAV", "wav");
 	encodingComboBox->addItem("WavPack", "wavpack");
 	encodingComboBox->addItem("WAV64", "w64");
 	wavpackCompressionComboBox->addItem("Very high", "very_high");
 	wavpackCompressionComboBox->addItem("High", "high");
 	wavpackCompressionComboBox->addItem("Fast", "fast");
-	
+
         connect(encodingComboBox, SIGNAL(activated(int)), this, SLOT(encoding_index_changed(int)));
-	connect(useResamplingCheckBox, SIGNAL(stateChanged(int)), 
+	connect(useResamplingCheckBox, SIGNAL(stateChanged(int)),
 		this, SLOT(use_onthefly_resampling_checkbox_changed(int)));
-	
+
 	load_config();
 }
 
@@ -931,7 +931,7 @@ void RecordingConfigPage::load_config()
 	} else {
 		use_onthefly_resampling_checkbox_changed(Qt::Unchecked);
 	}
-	
+
 	QString recordFormat = config().get_property("Recording", "FileFormat", "wav").toString();
 	if (recordFormat == "wavpack") {
 		encoding_index_changed(1);
@@ -940,7 +940,7 @@ void RecordingConfigPage::load_config()
 	} else {
 		encoding_index_changed(0);
 	}
-	
+
 	QString wavpackcompression = config().get_property("Recording", "WavpackCompressionType", "fast").toString();
 	if (wavpackcompression == "very_high") {
 		wavpackCompressionComboBox->setCurrentIndex(0);
@@ -948,11 +948,11 @@ void RecordingConfigPage::load_config()
 		wavpackCompressionComboBox->setCurrentIndex(1);
 	} else {
 		wavpackCompressionComboBox->setCurrentIndex(2);
-	}		
-	
+	}
+
 	int index = config().get_property("Conversion", "RTResamplingConverterType", DEFAULT_RESAMPLE_QUALITY).toInt();
 	ontheflyResampleComboBox->setCurrentIndex(index);
-	
+
 	index = config().get_property("Conversion", "ExportResamplingConverterType", 1).toInt();
 	exportDefaultResampleQualityComboBox->setCurrentIndex(index);
 }
@@ -976,7 +976,7 @@ void RecordingConfigPage::reset_default_config()
 	config().set_property("Recording", "FileFormat", "wav");
 	config().set_property("Recording", "WavpackCompressionType", "fast");
 	config().set_property("Recording", "WavpackSkipWVX", "false");
-	
+
 	load_config();
 }
 
@@ -1001,4 +1001,3 @@ void RecordingConfigPage::use_onthefly_resampling_checkbox_changed(int state)
 		ontheflyResampleComboBox->setEnabled(false);
 	}
 }
-
diff --git a/src/traverso/widgets/InfoWidgets.cpp b/src/traverso/widgets/InfoWidgets.cpp
index ec1df1fc..4f6a1f6e 100644
--- a/src/traverso/widgets/InfoWidgets.cpp
+++ b/src/traverso/widgets/InfoWidgets.cpp
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2005-2008 Remon Sijrier 
+Copyright (C) 2005-2008 Remon Sijrier
 
 This file is part of Traverso
 
@@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 #include "DiskIO.h"
 #include "TMainWindow.h"
 #include "TInputEventDispatcher.h"
-#include "MessageWidget.h" 
+#include "MessageWidget.h"
 #include "Project.h"
 #include "ProjectManager.h"
 #include "Sheet.h"
@@ -45,9 +45,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 #include <QAction>
 
 
-#if defined (Q_WS_WIN)
+#if defined (Q_OS_WIN)
 #include <windows.h>
-#elif defined (Q_WS_MAC)
+#elif defined (Q_OS_MAC)
 #include <sys/param.h>
 #include <sys/mount.h>
 #else
@@ -61,7 +61,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 // in case we run with memory leak detection enabled!
 #include "Debugger.h"
 
-#if defined (Q_WS_MAC)
+#if defined (Q_OS_MAC)
 static const int SONG_TOOLBAR_HEIGHT = 27;
 #else
 static const int SONG_TOOLBAR_HEIGHT = 24;
@@ -71,7 +71,7 @@ static const int SONG_TOOLBAR_HEIGHT = 24;
 SystemResources::SystemResources(QWidget * parent)
 	: InfoWidget(parent)
 {
-	
+
 	m_writeBufferStatus = new SystemValueBar(this);
 	m_readBufferStatus = new SystemValueBar(this);
 	m_readBufferStatus->setToolTip(tr("Read Buffer Status"));
@@ -86,30 +86,30 @@ SystemResources::SystemResources(QWidget * parent)
         m_collectedNumber = new QLabel(this);
         m_collectedNumber->setFocusPolicy(Qt::NoFocus);
         collected_number_changed();
-	
+
 	m_writeBufferStatus->set_range(0, 100);
 	m_writeBufferStatus->add_range_color(0, 40, QColor(255, 0, 0));
 	m_writeBufferStatus->add_range_color(40, 60, QColor(255, 255, 0));
 	m_writeBufferStatus->add_range_color(60, 100, QColor(227, 254, 227));
 	m_writeBufferStatus->setMinimumWidth(60);
-	
+
 	m_readBufferStatus->set_range(0, 100);
 	m_readBufferStatus->add_range_color(0, 40, QColor(255, 0, 0));
 	m_readBufferStatus->add_range_color(40, 60, QColor(255, 255, 0));
 	m_readBufferStatus->add_range_color(60, 100, QColor(227, 254, 227));
 	m_readBufferStatus->setMinimumWidth(60);
-	
+
 	m_cpuUsage->set_range(0, 100);
 	m_cpuUsage->set_int_rounding(false);
 	m_cpuUsage->setMinimumWidth(90);
 	m_cpuUsage->add_range_color(0, 60, QColor(227, 254, 227));
 	m_cpuUsage->add_range_color(60, 75, QColor(255, 255, 0));
 	m_cpuUsage->add_range_color(75, 100, QColor(255, 0, 0));
-	
+
         m_readBufferStatus->set_text("R");
 	m_writeBufferStatus->set_text("W");
         m_cpuUsage->set_text("DSP");
-	
+
         QHBoxLayout* lay = new QHBoxLayout(this);
 	lay->addSpacing(6);
 	lay->addWidget(m_readBufferStatus);
@@ -122,11 +122,11 @@ SystemResources::SystemResources(QWidget * parent)
 	lay->addSpacing(6);
 	setLayout(lay);
 	setFrameStyle(QFrame::NoFrame);
-	
+
 	connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(update_status()));
-	
+
 	update_status();
-	
+
         m_updateTimer.start(700);
 
         connect(&ied(), SIGNAL(collectedNumberChanged()), this, SLOT(collected_number_changed()));
@@ -137,7 +137,7 @@ void SystemResources::update_status( )
 	float time = audiodevice().get_cpu_time();
 	int bufReadStatus = 100;
 	int bufWriteStatus = 100;
-	
+
 	if (m_project) {
 		foreach(Sheet* sheet, m_project->get_sheets() ) {
 			bufReadStatus = std::min(sheet->get_diskio()->get_read_buffers_fill_status(), bufReadStatus);
@@ -145,7 +145,7 @@ void SystemResources::update_status( )
 		}
 	}
 
-	
+
 	m_readBufferStatus->set_value(bufReadStatus);
 	m_writeBufferStatus->set_value(bufWriteStatus);
 	m_cpuUsage->set_value(time);
@@ -175,18 +175,18 @@ DriverInfo::DriverInfo( QWidget * parent )
     m_driver->setToolTip(tr("Change Audio Device settings"));
 //	m_driver->setFlat(true);
 	m_driver->setFocusPolicy(Qt::NoFocus);
-	
+
     QHBoxLayout* lay = new QHBoxLayout(this);
     lay->addWidget(m_driver);
 	lay->setMargin(0);
 	setLayout(lay);
-	
+
 	setFrameStyle(QFrame::NoFrame);
-	
+
 	connect(&audiodevice(), SIGNAL(driverParamsChanged()), this, SLOT(update_driver_info()));
 	connect(&audiodevice(), SIGNAL(bufferUnderRun()), this, SLOT(update_xrun_info()));
     connect(m_driver, SIGNAL(clicked( bool )), TMainWindow::instance(), SLOT(show_settings_dialog_sound_system_page()));
-	
+
 	update_driver_info();
 }
 
@@ -245,16 +245,16 @@ HDDSpaceInfo::HDDSpaceInfo(QWidget* parent )
 	m_button->setFlat(true);
 	m_button->setFocusPolicy(Qt::NoFocus);
 	m_button->setEnabled(false);
-	
+
         QHBoxLayout* lay = new QHBoxLayout;
 	lay->setMargin(0);
 	lay->addWidget(m_button);
 	setLayout(lay);
-	
+
 	setFrameStyle(QFrame::NoFrame);
-	
+
 	connect(&updateTimer, SIGNAL(timeout()), this, SLOT(update_status()));
-	
+
 	update_status();
 	updateTimer.start(20000);
 }
@@ -263,14 +263,14 @@ HDDSpaceInfo::HDDSpaceInfo(QWidget* parent )
 void HDDSpaceInfo::set_session(TSession* session)
 {
         m_session = session;
-	
+
         if (! m_session) {
 		updateTimer.start(20000);
 		return;
 	}
-	
+
 	update_status();
-	
+
         connect(m_session, SIGNAL(transportStopped()), this, SLOT(sheet_stopped()));
         connect(m_session, SIGNAL(transportStarted()), this, SLOT(sheet_started()));
 }
@@ -297,21 +297,21 @@ void HDDSpaceInfo::update_status( )
 		m_button->setText("No Info");
 		return;
 	}
-	
+
 	double space = 0.0;
-	
-#if defined (Q_WS_WIN)
-	__int64 freebytestocaller, totalbytes, freebytes; 
+
+#if defined (Q_OS_WIN)
+	__int64 freebytestocaller, totalbytes, freebytes;
 	if (! GetDiskFreeSpaceEx ((const CHAR*)(QS_C(m_project->get_root_dir())),
 					(PULARGE_INTEGER)&freebytestocaller,
 					(PULARGE_INTEGER)&totalbytes,
-					(PULARGE_INTEGER)&freebytes)) 
+					(PULARGE_INTEGER)&freebytes))
 	{
 // 		info().warning("HHDSpaceInfo: " + QString().sprintf("error: %lu", GetLastError()));
 		m_button->setText("No Info");
 		return;
 	}
-	
+
 	space =  double(freebytestocaller / (1 << 20));
 #else
 
@@ -319,7 +319,7 @@ void HDDSpaceInfo::update_status( )
 	m_button->setText("No Info");
 	return;
 #else
-	
+
 	struct statfs fs;
 	statfs(QS_C(m_project->get_root_dir()), &fs);
 	space = floor (fs.f_bavail * (fs.f_bsize / 1048576.0));
@@ -332,9 +332,9 @@ void HDDSpaceInfo::update_status( )
 			recordingSheets.append(sheet);
 		}
 	}
-	
+
 	QString text;
-	
+
 	if (recordingSheets.size()) {
 		int recChannelCount = 0;
 		foreach(Sheet* sheet, recordingSheets) {
@@ -347,11 +347,11 @@ void HDDSpaceInfo::update_status( )
 				}
 			}
 		}
-		
+
 		uint rate = audiodevice().get_sample_rate();
 		double availabletime = (double(UNIVERSAL_SAMPLE_RATE) / rate) * space * 1048576.0;
 		availabletime /= double(sizeof(float) * recChannelCount);
- 		
+
 		QString recordFormat = config().get_property("Recording", "FileFormat", "wav").toString();
 		// I think a compression ratio of 40 % with wavpack is a safe estimation
 		// and 50% with skipwvx...
@@ -363,7 +363,7 @@ void HDDSpaceInfo::update_status( )
 				availabletime = qint64(availabletime / 0.6);
 			}
 		}
-		
+
 		TimeRef time(availabletime);
 		text = timeref_to_hms(time);
 		if (text < "00:30:00") {
@@ -380,7 +380,7 @@ void HDDSpaceInfo::update_status( )
 			text.append(" MB");
 		}
 	}
-	
+
 	m_button->setText(text);
 }
 
@@ -401,7 +401,7 @@ InfoWidget::InfoWidget(QWidget* parent)
 {
 	setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
 	connect(&pm(), SIGNAL(projectLoaded(Project*)), this, SLOT(set_project(Project*)));
-	
+
 	setFocusPolicy(Qt::NoFocus);
 }
 
@@ -430,11 +430,11 @@ SysInfoToolBar::SysInfoToolBar(QWidget * parent)
 	resourcesInfo = new SystemResources(this);
 	hddInfo = new HDDSpaceInfo(this);
 	driverInfo = new DriverInfo(this);
-	
+
         setMovable(false);
-	
+
 	QAction* action;
-	
+
 	action = addWidget(driverInfo);
 	action->setVisible(true);
 	addSeparator();
@@ -461,17 +461,17 @@ void SystemValueBar::set_value(float value)
     if (qFuzzyCompare(m_current, value)) {
 		return;
 	}
-	
+
 	m_current = value;
-	
+
         if (m_current > m_max) {
                 m_current  = m_max;
         }
-	
+
         if (m_current < m_min) {
                 m_current = m_min;
         }
-	
+
 	update();
 }
 
@@ -491,9 +491,9 @@ void SystemValueBar::paintEvent(QPaintEvent* )
 {
 	QPainter painter(this);
 	painter.setRenderHints(QPainter::Antialiasing);
-	
+
 	QColor color = QColor(227, 254, 227);
-	
+
 	for (int i=0; i<m_rangecolors.size(); ++i) {
 		RangeColor range = m_rangecolors.at(i);
 		if (m_current <= range.x1 && m_current >= range.x0) {
@@ -501,24 +501,24 @@ void SystemValueBar::paintEvent(QPaintEvent* )
 			break;
 		}
 	}
-	
+
 	QRect rect = QRect(0, (height() - 15) / 2, width(), 15);
 	painter.drawRect(rect);
-	
+
 	painter.setBrush(color);
 	painter.setPen(Qt::NoPen);
 	float scalefactor = width() / m_max;
 	rect = QRect(1, (height() - 15) / 2 + 1, width() - 2 - (int)(scalefactor* (m_max - m_current)), 13);
 	painter.drawRect(rect);
-	
+
 	painter.setPen(Qt::black);
 	painter.setFont(themer()->get_font("InfoWidget:fontscale:values"));
-	
+
 	if (m_introunding) {
-		painter.drawText(0, 0, width(), height(), Qt::AlignCenter, 
+		painter.drawText(0, 0, width(), height(), Qt::AlignCenter,
 				m_text + " " + QString::number((int)m_current).append("%"));
 	} else {
-		painter.drawText(0, 0, width(), height(), Qt::AlignCenter, 
+		painter.drawText(0, 0, width(), height(), Qt::AlignCenter,
                  m_text + " " + QString::number(double(m_current), 'f', 1).append("%"));
 	}
 }
@@ -552,7 +552,7 @@ ProgressToolBar::ProgressToolBar(QWidget* parent)
 	filecount = 1;
 	filenum = 1;
 
-	QString style = "QProgressBar {border: 2px solid grey;border-radius: 5px; height: 10px; width 300px; text-align: center;}" 
+	QString style = "QProgressBar {border: 2px solid grey;border-radius: 5px; height: 10px; width 300px; text-align: center;}"
 "QProgressBar::chunk {background-color: qlineargradient(x1: 0, y1: 0, x2: 1.0, y2: 1.0,stop: 0 white, stop: 1 navy);}";
 
         m_progressBar->setStyleSheet(style);
diff --git a/src/traverso/widgets/ResourcesWidget.cpp b/src/traverso/widgets/ResourcesWidget.cpp
index 24cd6499..84dd6d8c 100644
--- a/src/traverso/widgets/ResourcesWidget.cpp
+++ b/src/traverso/widgets/ResourcesWidget.cpp
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2007 Remon Sijrier 
+Copyright (C) 2007 Remon Sijrier
 
 This file is part of Traverso
 
@@ -44,14 +44,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 
 void FileWidget::showEvent( QShowEvent * event ) {
 	Q_UNUSED(event);
-		
+
 	if (m_dirModel) {
 		return;
 	}
-		
+
 	QPalette palette;
 	palette.setColor(QPalette::AlternateBase, themer()->get_color("ResourcesBin:alternaterowcolor"));
-		
+
 	m_dirModel = new QDirModel;
 	m_dirModel->setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot);
 	m_dirView = new QListView;
@@ -62,10 +62,10 @@ void FileWidget::showEvent( QShowEvent * event ) {
 	m_dirView->setAlternatingRowColors(true);
 	m_dirView->setPalette(palette);
 	m_dirModel->setSorting(QDir::DirsFirst | QDir::Name | QDir::IgnoreCase);
-		
+
 	m_box = new QComboBox(this);
 	m_box->addItem("", "");
-#if defined (Q_WS_WIN)
+#if defined (Q_OS_WIN)
 	m_box->addItem(tr("My Computer"), "");
 	m_box->addItem(tr("My Documents"), QDir::homePath() + "\\" + tr("My Documents"));
 #else
@@ -78,33 +78,33 @@ void FileWidget::showEvent( QShowEvent * event ) {
 	upButton->setIcon(upIcon);
 	upButton->setMaximumHeight(25);
 	upButton->setMaximumWidth(30);
-		
+
 	QPushButton* refreshButton = new QPushButton(this);
 	QIcon refreshIcon = QIcon(find_pixmap(":/refresh-16"));
 	refreshButton->setToolTip(tr("Refresh File View"));
 	refreshButton->setIcon(refreshIcon);
 	refreshButton->setMaximumHeight(25);
 	refreshButton->setMaximumWidth(30);
-		
+
 	QHBoxLayout* hlay = new QHBoxLayout;
 	hlay->addWidget(upButton);
 	hlay->addWidget(refreshButton);
 	hlay->addWidget(m_box, 10);
-		
+
 	QVBoxLayout* lay = new QVBoxLayout(this);
 	lay->setMargin(0);
 	lay->setSpacing(6);
 	lay->addLayout(hlay);
 	lay->addWidget(m_dirView);
-		
+
 	setLayout(lay);
-		
+
 	connect(m_dirView, SIGNAL(clicked(const QModelIndex& )), this, SLOT(dirview_item_clicked(const QModelIndex&)));
 	connect(upButton, SIGNAL(clicked()), this, SLOT(dir_up_button_clicked()));
 	connect(refreshButton, SIGNAL(clicked()), this, SLOT(refresh_button_clicked()));
 	connect(m_box, SIGNAL(activated(int)), this, SLOT(box_actived(int)));
 }
-		
+
 void FileWidget::dirview_item_clicked(const QModelIndex & index)
 {
 	if (m_dirModel->isDir(index)) {
@@ -119,24 +119,24 @@ void FileWidget::dirview_item_clicked(const QModelIndex & index)
 void FileWidget::dir_up_button_clicked()
 {
 	QDir dir(m_dirModel->filePath(m_dirView->rootIndex()));
-	
-#if defined (Q_WS_WIN)
+
+#if defined (Q_OS_WIN)
 	if (m_dirModel->filePath(m_dirView->rootIndex()) == "") {
 		return;
 	}
 	QString oldDir = dir.canonicalPath();
 #endif
-	
+
 	dir.cdUp();
 	QString text = dir.canonicalPath();
-	
-#if defined (Q_WS_WIN)
+
+#if defined (Q_OS_WIN)
 	if (oldDir == dir.canonicalPath()) {
 		dir.setPath("");
 		text = tr("My Computer");
 	}
 #endif
-	
+
 	m_dirView->setRootIndex(m_dirModel->index(dir.canonicalPath()));
 	m_box->setItemText(0, text);
 	m_box->setItemData(0, dir.canonicalPath());
@@ -171,16 +171,16 @@ ResourcesWidget::~ ResourcesWidget()
 {
 }
 
-void ResourcesWidget::showEvent( QShowEvent * event ) 
+void ResourcesWidget::showEvent( QShowEvent * event )
 {
 	Q_UNUSED(event);
-	
+
 	if (sourcesTreeWidget) {
 		return;
 	}
-	
+
 	setupUi(this);
-	
+
 	QPalette palette;
 	palette.setColor(QPalette::AlternateBase, themer()->get_color("ResourcesBin:alternaterowcolor"));
 	sourcesTreeWidget->setPalette(palette);
@@ -198,23 +198,23 @@ void ResourcesWidget::showEvent( QShowEvent * event )
 	sourcesTreeWidget->header()->resizeSection(3, LENGTH_SECTION_WIDTH);
 	sourcesTreeWidget->header()->setStretchLastSection(false);
 	sourcesTreeWidget->setUniformRowHeights(true);
-	
-	
+
+
 	m_filewidget = new FileWidget(this);
 	layout()->addWidget(m_filewidget);
 	m_filewidget->hide();
-	
+
 	m_currentSheet = 0;
 	m_project = 0;
-	
-	
+
+
 	connect(viewComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(view_combo_box_index_changed(int)));
 	connect(sheetComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(sheet_combo_box_index_changed(int)));
 	connect(sheetComboBox, SIGNAL(activated(int)), this, SLOT(sheet_combo_box_index_changed(int)));
 	connect(&pm(), SIGNAL(projectLoaded(Project*)), this, SLOT(set_project(Project*)));
-	
+
 	set_project(pm().get_project());
-	
+
 	// Fade a project load finished since we were not able to catch that signal!
 	project_load_finished();
 }
@@ -227,15 +227,15 @@ void ResourcesWidget::set_project(Project * project)
 	m_sourceindices.clear();
 	m_clipindices.clear();
 	sheetComboBox->clear();
-	
+
 	if (!m_project) {
 		sheetComboBox->setEnabled(false);
 		m_currentSheet = 0;
 		return;
 	}
-	
+
 	sheetComboBox->setEnabled(true);
-	
+
 	connect(m_project, SIGNAL(projectLoadFinished()), this, SLOT(project_load_finished()));
 }
 
@@ -244,30 +244,30 @@ void ResourcesWidget::project_load_finished()
 	if (!m_project) {
 		return;
 	}
-	
+
 	ResourcesManager* rsmanager = m_project->get_audiosource_manager();
-	
+
 	connect(m_project, SIGNAL(sheetAdded(Sheet*)), this, SLOT(sheet_added(Sheet*)));
 	connect(m_project, SIGNAL(sheetRemoved(Sheet*)), this, SLOT(sheet_removed(Sheet*)));
         connect(m_project, SIGNAL(currentSessionChanged(TSession*)), this, SLOT(set_current_session(TSession*)));
-	
+
 	connect(rsmanager, SIGNAL(clipAdded(AudioClip*)), this, SLOT(add_clip(AudioClip*)));
 	connect(rsmanager, SIGNAL(clipRemoved(AudioClip*)), this, SLOT(remove_clip(AudioClip*)));
 	connect(rsmanager, SIGNAL(sourceAdded(ReadSource*)), this, SLOT(add_source(ReadSource*)));
 	connect(rsmanager, SIGNAL(sourceRemoved(ReadSource*)), this, SLOT(remove_source(ReadSource*)));
-	
+
 	foreach(ReadSource* rs, resources_manager()->get_all_audio_sources()) {
 		add_source(rs);
 	}
-	
+
 	foreach(AudioClip* clip, resources_manager()->get_all_clips()) {
 		add_clip(clip);
 	}
-	
+
 	foreach(Sheet* sheet, m_project->get_sheets()) {
 		sheet_added(sheet);
 	}
-	
+
         set_current_sheet(qobject_cast<Sheet*>(m_project->get_current_session()));
 
 	sourcesTreeWidget->sortItems(0, Qt::AscendingOrder);
@@ -317,16 +317,16 @@ void ResourcesWidget::set_current_sheet(Sheet * sheet)
 	if (m_currentSheet == sheet) {
 		return;
 	}
-	
+
 	if (sheet) {
 		int index = sheetComboBox->findData(sheet->get_id());
 		if (index != -1) {
 			sheetComboBox->setCurrentIndex(index);
 		}
 	}
-	
+
 	m_currentSheet = sheet;
-	
+
 	filter_on_current_sheet();
 }
 
@@ -336,12 +336,12 @@ void ResourcesWidget::filter_on_current_sheet()
 	if (!m_currentSheet) {
 		return;
 	}
-	
+
 	foreach(ClipTreeItem* item, m_clipindices.values()) {
 		item->apply_filter(m_currentSheet);
 	}
 
-	
+
 	foreach(SourceTreeItem* item, m_sourceindices.values()) {
 		item->apply_filter(m_currentSheet);
 	}
@@ -351,40 +351,40 @@ void ResourcesWidget::filter_on_current_sheet()
 void ResourcesWidget::add_clip(AudioClip * clip)
 {
 	ClipTreeItem* item = m_clipindices.value(clip->get_id());
-	
+
 	if (!item) {
 		SourceTreeItem* sourceitem = m_sourceindices.value(clip->get_readsource_id());
-	
+
 		if (! sourceitem ) return;
-	
+
 		ClipTreeItem* clipitem = new ClipTreeItem(sourceitem, clip);
 		m_clipindices.insert(clip->get_id(), clipitem);
-		
+
 		clipitem->setTextAlignment(1, Qt::AlignHCenter);
 		clipitem->setTextAlignment(2, Qt::AlignHCenter);
 		clipitem->setTextAlignment(3, Qt::AlignLeft);
-		
+
 		connect(clip, SIGNAL(positionChanged()), clipitem, SLOT(clip_state_changed()));
 	}
-	
+
 	update_clip_state(clip);
 }
 
 void ResourcesWidget::remove_clip(AudioClip * clip)
 {
 	ClipTreeItem* item = m_clipindices.value(clip->get_id());
-	
+
 	if (!item) {
 		 return;
 	}
-	
+
 	update_clip_state(clip);
 }
 
 void ResourcesWidget::add_source(ReadSource * source)
 {
 	SourceTreeItem* item = m_sourceindices.value(source->get_id());
-	
+
 	if (! item) {
 		item = new SourceTreeItem(sourcesTreeWidget, source);
 		m_sourceindices.insert(source->get_id(), item);
@@ -392,7 +392,7 @@ void ResourcesWidget::add_source(ReadSource * source)
 		item->setTextAlignment(2, Qt::AlignHCenter);
 		item->setTextAlignment(3, Qt::AlignLeft);
 	}
-	
+
 	item->source_state_changed();
 }
 
@@ -413,9 +413,9 @@ void ResourcesWidget::update_clip_state(AudioClip* clip)
 {
 	ClipTreeItem* item = m_clipindices.value(clip->get_id());
 	Q_ASSERT(item);
-	
+
 	item->clip_state_changed();
-	
+
 	update_source_state(clip->get_readsource_id());
 }
 
@@ -446,10 +446,10 @@ void ClipTreeItem::clip_state_changed()
 			setForeground(i, QColor(Qt::lightGray));
 		}
 	}
-	
+
 	QString start = timeref_to_ms(m_clip->get_source_start_location());
 	QString end = timeref_to_ms(m_clip->get_source_end_location());
-		
+
 	setText(0, m_clip->get_name());
 	setText(1, timeref_to_ms(m_clip->get_length()));
 	setText(2, start);
@@ -467,7 +467,7 @@ void ClipTreeItem::apply_filter(Sheet * sheet)
 		if (!isHidden()) {
 			setHidden(true);
 		}
-	} 
+	}
 }
 
 
@@ -485,16 +485,16 @@ void SourceTreeItem::apply_filter(Sheet * sheet)
 		setHidden(false);
 		return;
 	}
-	
+
 	bool show = false;
-		
+
 	for (int i=0; i < childCount(); ++i) {
 		if (!child(i)->isHidden()) {
 			show = true;
 			break;
 		}
 	}
-		
+
 	if (show) {
 		setHidden(false);
 	} else {
@@ -513,7 +513,7 @@ void SourceTreeItem::source_state_changed()
 			setForeground(i, QColor(Qt::lightGray));
 		}
 	}
-	
+
 	int rate = m_source->get_rate();
 	if (rate == 0) rate = pm().get_project()->get_rate();
 	QString duration = timeref_to_ms(m_source->get_length());
@@ -534,8 +534,7 @@ void ResourcesWidget::resizeEvent(QResizeEvent * e)
 		if (nameSectionWidth < 130) {
 			nameSectionWidth = 130;
 		}
-		
+
 		sourcesTreeWidget->header()->resizeSection(0, nameSectionWidth);
 	}
 }
-
-- 
2.21.0.windows.1

