=== modified file 'mixxx/src/library/libraryscanner.cpp'
--- mixxx/src/library/libraryscanner.cpp	2009-11-13 18:28:01 +0000
+++ mixxx/src/library/libraryscanner.cpp	2009-11-15 06:18:23 +0000
@@ -17,9 +17,14 @@
 
 #include <QtCore>
 #include <QtDebug>
+#include <QDomDocument>
+#include <QDomNodeList>
+#include <QDomNode>
 #include "defs_audiofiles.h"
 #include "libraryscanner.h"
 #include "libraryscannerdlg.h"
+#include "trackinfoobject.h" //needed for importing 1.7.x library
+#include "xmlparse.h" //needed for importing 1.7.x library
 
 LibraryScanner::LibraryScanner(TrackCollection* collection) :
     m_pCollection(collection),
@@ -141,6 +146,59 @@
 
 void LibraryScanner::scan(QString libraryPath)
 {
+  
+    QString trackXML = QDir::homePath().append("/").append(SETTINGS_PATH).append("mixxxtrack.xml");
+    
+    QFile file(trackXML);
+    if(file.exists()){
+        /**************************************************************************
+	 * 1.7.x library upgrade code
+	 * 
+	 * Description: 
+	 * 
+	 * Parse the mixxxtrack.xml file in order to create list of of songs to be
+	 * added to the sqlite database 1.8 now uses
+         *
+         * TODO:  m_trackDao.addTrack(&trackInfo) cause an error
+         * TODO:  once the upgrade is complete mode the file mixxxtrack.xml to 
+         *        mixxxtrack.backup
+	 * ***********************************************************************/
+        qDebug() << "STARTING 1.8.0 LIBRARY UPGRADE IN LIBRARYSCANNER::SCAN()";
+	QString trackXML = QDir::homePath().append("/").append(SETTINGS_PATH).append("mixxxtrack.xml");
+	
+	QDomDocument doc("TrackList");
+	QFile file(trackXML);
+	
+	if(!file.open(QIODevice::ReadOnly)){
+	    qDebug() << "could not open file: " << trackXML;
+	    
+	} else {
+      
+	  QString* errorMsg;
+	  int* errorLine; 
+	  int* errorColumn;
+	  
+	  if (doc.setContent(&file, false, errorMsg, errorLine, errorColumn)) {
+	    QDomNodeList trackList = doc.elementsByTagName("Track");
+	    QDomNode track;
+	    
+	    for(unsigned x=0;x<trackList.length();x++){
+	      track = trackList.at(x);
+	      TrackInfoObject trackInfo(track);
+	      m_trackDao.addTrack(&trackInfo);	    
+	    }
+
+	    //now change the file to mixxxtrack.bak so that its not readded next time program loads
+	    file.copy(QDir::homePath().append("/").append(SETTINGS_PATH).append("mixxxtrack.bak"));
+	    file.remove();
+	  } else {
+	    qDebug() << errorMsg << " line: " << errorLine << " column: " << errorColumn;
+	  }
+	}
+
+	file.close();
+    }
+
     m_qLibraryPath = libraryPath;
     m_pProgress = new LibraryScannerDlg();
 

