From c557663c22e7e74122b13cfc6de2c38df4dcb467 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Sun, 25 Nov 2012 22:32:26 -0500 Subject: [PATCH] Retry if the /Volumes entry is still not found after our wait --- src/libtomahawk/widgets/CheckDirTree.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/libtomahawk/widgets/CheckDirTree.cpp b/src/libtomahawk/widgets/CheckDirTree.cpp index 5949bf3a4..384cddca2 100644 --- a/src/libtomahawk/widgets/CheckDirTree.cpp +++ b/src/libtomahawk/widgets/CheckDirTree.cpp @@ -90,6 +90,23 @@ void CheckDirModel::volumeShowFinished() { reset(); + +#ifdef Q_OS_MAC + // Make sure /Volumes is there, if not wait and try again + const QModelIndex parent = index("/"); + const int count = rowCount(parent); + bool found = false; + for ( int i = 0; i < count; i++ ) + { + if ( data( index( i, 0, parent ) ).toString() == "Volumes" ) + { + found = true; + break; + } + } + if ( !found ) + QTimer::singleShot( 500, this, SLOT( volumeShowFinished() ) ); +#endif }