diff options
author | RJ Ryan <rryan@mixxx.org> | 2014-01-26 02:58:50 -0500 |
---|---|---|
committer | RJ Ryan <rryan@mixxx.org> | 2014-02-13 23:31:28 -0500 |
commit | d6f0e3277ffa9904bf4a0f1af0bbe704bed73015 (patch) | |
tree | 590ced89bfa002f6c3a9141213ab867ad54e6487 /src/library/traktor/traktorfeature.cpp | |
parent | 7104fee370155293583c146b3d0051bca7cd3b90 (diff) |
Support creating sandbox tokens on iTunes and Traktor library selection.
Diffstat (limited to 'src/library/traktor/traktorfeature.cpp')
-rw-r--r-- | src/library/traktor/traktorfeature.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/library/traktor/traktorfeature.cpp b/src/library/traktor/traktorfeature.cpp index e7f3eb86e5..1e062c96b8 100644 --- a/src/library/traktor/traktorfeature.cpp +++ b/src/library/traktor/traktorfeature.cpp @@ -15,6 +15,7 @@ #include "library/queryutil.h" #include "library/trackcollection.h" #include "library/treeitem.h" +#include "util/sandbox.h" TraktorTrackModel::TraktorTrackModel(QObject* parent, TrackCollection* pTrackCollection, @@ -556,7 +557,13 @@ QString TraktorFeature::getTraktorMusicDatabase() { //Let's try to detect the latest Traktor version and its collection.nml QString myDocuments = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation); QDir ni_directory(myDocuments +"/Native Instruments/"); - ni_directory.setFilter(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks) ; + ni_directory.setFilter(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks); + + // We may not have access to this directory since it is in the user's + // Documents folder. Ask for access if we don't have it. + if (ni_directory.exists()) { + Sandbox::instance()->askForAccess(ni_directory.canonicalPath()); + } //Iterate over the subfolders QFileInfoList list = ni_directory.entryInfoList(); @@ -595,7 +602,7 @@ void TraktorFeature::onTrackCollectionLoaded() { TreeItem* root = m_future.result(); if (root) { m_childModel.setRootItem(root); - // Tell the rhythmbox track source that it should re-build its index. + // Tell the traktor track source that it should re-build its index. m_trackSource->buildIndex(); //m_pTraktorTableModel->select(); |