diff options
author | Ken Moore <moorekou@gmail.com> | 2015-10-14 11:13:52 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-10-14 11:13:52 -0400 |
commit | 5750eb11d5c9469001464412a9a2d13e82728fee (patch) | |
tree | 99c6545b6732b1d87a176cc6444effb128a66394 /lumina-fm/widgets | |
parent | Ensure that the item widgets in the start menu plugin use all the text possib... (diff) | |
download | lumina-5750eb11d5c9469001464412a9a2d13e82728fee.tar.gz lumina-5750eb11d5c9469001464412a9a2d13e82728fee.tar.bz2 lumina-5750eb11d5c9469001464412a9a2d13e82728fee.zip |
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.
Diffstat (limited to 'lumina-fm/widgets')
-rw-r--r-- | lumina-fm/widgets/DDListWidgets.h | 7 |
1 files 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 <QDebug> #include <QMouseEvent> #include <QUrl> +#include <QDir> //============== // 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; |