From 5750eb11d5c9469001464412a9a2d13e82728fee Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 14 Oct 2015 11:13:52 -0400 Subject: When dropping files into lumina-fm: Only treat it as a move when the initial/target directories are both within the user's home dir - otherwise treat it as a copy operation. --- lumina-fm/widgets/DDListWidgets.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lumina-fm/widgets/DDListWidgets.h b/lumina-fm/widgets/DDListWidgets.h index 67b54b4d..c2601335 100644 --- a/lumina-fm/widgets/DDListWidgets.h +++ b/lumina-fm/widgets/DDListWidgets.h @@ -22,6 +22,7 @@ #include #include #include +#include //============== // LIST WIDGET @@ -101,10 +102,11 @@ protected: } //Now turn the input urls into local file paths QStringList files; + QString home = QDir::homePath(); foreach(const QUrl &url, ev->mimeData()->urls()){ const QString filepath = url.toLocalFile(); //If the target file is modifiable, assume a move - otherwise copy - if(QFileInfo(filepath).isWritable()){ files << "cut::::"+filepath; } + if(QFileInfo(filepath).isWritable() && (filepath.startsWith(home) && dirpath.startsWith(home))){ files << "cut::::"+filepath; } else{ files << "copy::::"+filepath; } } //qDebug() << "Drop Event:" << dirpath; @@ -203,10 +205,11 @@ protected: //qDebug() << "Drop Event:" << dirpath; //Now turn the input urls into local file paths QStringList files; + QString home = QDir::homePath(); foreach(const QUrl &url, ev->mimeData()->urls()){ const QString filepath = url.toLocalFile(); //If the target file is modifiable, assume a move - otherwise copy - if(QFileInfo(filepath).isWritable()){ files << "cut::::"+filepath; } + if(QFileInfo(filepath).isWritable() && (filepath.startsWith(home) && dirpath.startsWith(home)) ){ files << "cut::::"+filepath; } else{ files << "copy::::"+filepath; } } //qDebug() << "Drop Event:" << dirpath; -- cgit