# HG changeset patch # User Dan Stowell # Date 1287151944 -3600 # Node ID 62e9f62752e125e43a2e154751727989a8c14087 # Parent 11f804c7582ad328de4e6518c0e18b88afc298c6 only do genre stuff etc if itunes returns a file diff -r 11f804c7582a -r 62e9f62752e1 main/MainWindow.cpp --- a/main/MainWindow.cpp Fri Oct 15 13:30:41 2010 +0100 +++ b/main/MainWindow.cpp Fri Oct 15 15:12:24 2010 +0100 @@ -2218,16 +2218,16 @@ { QStringList nowPlaying = iTunesNowPlaying(); QString path = nowPlaying.at(0); - QString genre = (nowPlaying.size() > 1) ? nowPlaying.at(1) : ""; - std::cerr << "MainWindow::importITunesAudio(): genre is " << genre.toStdString() << std::endl; - QString tplName = templateNameFromGenre(genre); if (path != "") { - if (openAudio(path, ReplaceMainModel, tplName) == FileOpenFailed) { - emit hideSplash(); - QMessageBox::critical(this, tr("Failed to open file"), - tr("File open failed

Audio file \"%1\" could not be opened").arg(path)); - } + QString genre = (nowPlaying.size() > 1) ? nowPlaying.at(1) : ""; + std::cerr << "MainWindow::importITunesAudio(): genre is " << genre.toStdString() << std::endl; + QString tplName = templateNameFromGenre(genre); + if (openAudio(path, ReplaceMainModel, tplName) == FileOpenFailed) { + emit hideSplash(); + QMessageBox::critical(this, tr("Failed to open file"), + tr("File open failed

Audio file \"%1\" could not be opened").arg(path)); + } } } #endif