aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/LDesktopPluginSpace.h
diff options
context:
space:
mode:
Diffstat (limited to 'lumina-desktop/LDesktopPluginSpace.h')
-rw-r--r--lumina-desktop/LDesktopPluginSpace.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/lumina-desktop/LDesktopPluginSpace.h b/lumina-desktop/LDesktopPluginSpace.h
index 353543d9..bf623b68 100644
--- a/lumina-desktop/LDesktopPluginSpace.h
+++ b/lumina-desktop/LDesktopPluginSpace.h
@@ -14,6 +14,8 @@
#include <QMimeData>
#include <QSettings>
#include <QDebug>
+#include <QFile>
+#include <QDir>
#include "desktop-plugins/LDPlugin.h"
@@ -217,7 +219,15 @@ protected:
qDebug() << "Desktop Drop Event:" << urls;
for(int i=0; i<urls.length(); i++){
//If this file is not in the desktop folder, move/copy it here
- // -- TO-DO
+ if(urls[i].isLocalFile()){
+ QFileInfo info(urls[i].toLocalFile());
+ if(info.exists() && !QFile::exists(QDir::homePath()+"/Desktop/"+info.fileName())){
+ //Make a link to the file here
+ QFile::link(info.absoluteFilePath(), QDir::homePath()+"/Desktop/"+info.fileName());
+ }else{
+ qWarning() << "Invalid desktop file drop (ignored):" << urls[i].toString();
+ }
+ }
}
}else{
bgstack15