summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library/banshee/bansheefeature.cpp2
-rw-r--r--src/library/rhythmbox/rhythmboxfeature.cpp3
-rw-r--r--src/library/serato/seratofeature.cpp4
-rw-r--r--src/library/traktor/traktorfeature.cpp2
4 files changed, 6 insertions, 5 deletions
diff --git a/src/library/banshee/bansheefeature.cpp b/src/library/banshee/bansheefeature.cpp
index 182cee18f6..d7b565ec02 100644
--- a/src/library/banshee/bansheefeature.cpp
+++ b/src/library/banshee/bansheefeature.cpp
@@ -79,7 +79,7 @@ void BansheeFeature::activate() {
qDebug() << m_databaseFile << "does not exist";
}
- if (!m_connection.open(m_databaseFile)) {
+ if (!Sandbox::askForAccess(m_databaseFile) || !m_connection.open(m_databaseFile)) {
QMessageBox::warning(
nullptr,
tr("Error loading Banshee database"),
diff --git a/src/library/rhythmbox/rhythmboxfeature.cpp b/src/library/rhythmbox/rhythmboxfeature.cpp
index 89e2990e44..d0b54b57b5 100644
--- a/src/library/rhythmbox/rhythmboxfeature.cpp
+++ b/src/library/rhythmbox/rhythmboxfeature.cpp
@@ -150,7 +150,8 @@ TreeItem* RhythmboxFeature::importMusicCollection() {
}
}
- if (!db.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ if (!Sandbox::askForAccess(QFileInfo(db).absoluteFilePath()) ||
+ !db.open(QIODevice::ReadOnly | QIODevice::Text)) {
return nullptr;
}
diff --git a/src/library/serato/seratofeature.cpp b/src/library/serato/seratofeature.cpp
index be6c26d56d..9d38b551c0 100644
--- a/src/library/serato/seratofeature.cpp
+++ b/src/library/serato/seratofeature.cpp
@@ -353,7 +353,7 @@ QString parseCrate(
}
QFile crateFile(crateFilePath);
- if (!crateFile.open(QIODevice::ReadOnly)) {
+ if (!Sandbox::askForAccess(crateFilePath) || !crateFile.open(QIODevice::ReadOnly)) {
qWarning() << "Failed to open file "
<< crateFilePath
<< " for reading.";
@@ -534,7 +534,7 @@ QString parseDatabase(mixxx::DbConnectionPoolPtr dbConnectionPool, TreeItem* dat
")");
QFile databaseFile(databaseFilePath);
- if (!databaseFile.open(QIODevice::ReadOnly)) {
+ if (!Sandbox::askForAccess(databaseFilePath) || !databaseFile.open(QIODevice::ReadOnly)) {
qWarning() << "Failed to open file "
<< databaseFilePath
<< " for reading.";
diff --git a/src/library/traktor/traktorfeature.cpp b/src/library/traktor/traktorfeature.cpp
index 9ab5e2afe7..5dda60f5cb 100644
--- a/src/library/traktor/traktorfeature.cpp
+++ b/src/library/traktor/traktorfeature.cpp
@@ -216,7 +216,7 @@ TreeItem* TraktorFeature::importLibrary(const QString& file) {
//Parse Trakor XML file using SAX (for performance)
QFile traktor_file(file);
- if (!traktor_file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ if (!Sandbox::askForAccess(file) || !traktor_file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qDebug() << "Cannot open Traktor music collection";
return nullptr;
}