← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-07 into lp:ubuntu-filemanager-app

 

Carlos Jose Mazieri has proposed merging lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-07 into lp:ubuntu-filemanager-app with lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-06 as a prerequisite.

Commit message:
Removed unnecessary checks, it is already done in FileSystemAction::canMoveItems() and FileSystemAction::populateEntry()

Requested reviews:
  Ubuntu File Manager Developers (ubuntu-filemanager-dev)

For more details, see:
https://code.launchpad.net/~carlos-mazieri/ubuntu-filemanager-app/samba-actions-07/+merge/265198

Removed unnecessary checks, it is already done in FileSystemAction::canMoveItems() and FileSystemAction::populateEntry()
-- 
Your team Ubuntu File Manager Developers is requested to review the proposed merge of lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-07 into lp:ubuntu-filemanager-app.
=== modified file 'src/plugin/folderlistmodel/filesystemaction.cpp'
--- src/plugin/folderlistmodel/filesystemaction.cpp	2015-07-18 21:52:38 +0000
+++ src/plugin/folderlistmodel/filesystemaction.cpp	2015-07-18 21:52:39 +0000
@@ -933,18 +933,8 @@
 #endif
     m_clipboardChanged = false;
     if (items.count())
-    {
-        DirItemInfo destination(m_path);
-        if (destination.isWritable())
-        {
-            createAndProcessAction(ActionCopy, items);
-        }
-        else
-        {
-            emit error(tr("Cannot copy items"),
-                       tr("no write permission on folder ") + destination.absoluteFilePath() );
-
-        }
+    {       
+        createAndProcessAction(ActionCopy, items);
     }
 }
 
@@ -957,30 +947,7 @@
     m_clipboardChanged = false;
     if (items.count())
     {
-        DirItemInfo destination(m_path);
-        DirItemInfo origin(DirItemInfo(items.at(0)).absolutePath());
-        ActionType actionType  = ActionMove;
-        static QString titleError     = tr("Cannot move items");
-        static QString noWriteError   = tr("no write permission on folder ");
-        //we allow Copy to backup items, but Cut must Fail
-        if (destination.absoluteFilePath() == origin.absoluteFilePath())
-        {
-            emit error(titleError,
-                       tr("origin and destination folders are the same"));
-            return;
-        }
-        // cut needs write permission on origin
-        if (!origin.isWritable())
-        {
-            emit error(titleError, noWriteError + origin.absoluteFilePath());
-            return;
-        }        
-        if (!destination.isWritable())
-        {
-            emit error(titleError, noWriteError + destination.absoluteFilePath());
-            return;
-        }
-        createAndProcessAction(actionType, items);
+        createAndProcessAction(ActionMove, items);
     }
 }
 


Follow ups