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

Proposed by Carlos Jose Mazieri
Status: Merged
Approved by: Arto Jalkanen
Approved revision: 438
Merged at revision: 443
Proposed branch: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-07
Merge into: lp:ubuntu-filemanager-app
Prerequisite: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-06
Diff against target: 55 lines (+3/-36)
1 file modified
src/plugin/folderlistmodel/filesystemaction.cpp (+3/-36)
To merge this branch: bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-07
Reviewer Review Type Date Requested Status
Arto Jalkanen Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+265198@code.launchpad.net

Commit message

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

Description of the change

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

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Arto Jalkanen (ajalkane) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
933#endif933#endif
934 m_clipboardChanged = false;934 m_clipboardChanged = false;
935 if (items.count())935 if (items.count())
936 {936 {
937 DirItemInfo destination(m_path);937 createAndProcessAction(ActionCopy, items);
938 if (destination.isWritable())
939 {
940 createAndProcessAction(ActionCopy, items);
941 }
942 else
943 {
944 emit error(tr("Cannot copy items"),
945 tr("no write permission on folder ") + destination.absoluteFilePath() );
946
947 }
948 }938 }
949}939}
950940
@@ -957,30 +947,7 @@
957 m_clipboardChanged = false;947 m_clipboardChanged = false;
958 if (items.count())948 if (items.count())
959 {949 {
960 DirItemInfo destination(m_path);950 createAndProcessAction(ActionMove, items);
961 DirItemInfo origin(DirItemInfo(items.at(0)).absolutePath());
962 ActionType actionType = ActionMove;
963 static QString titleError = tr("Cannot move items");
964 static QString noWriteError = tr("no write permission on folder ");
965 //we allow Copy to backup items, but Cut must Fail
966 if (destination.absoluteFilePath() == origin.absoluteFilePath())
967 {
968 emit error(titleError,
969 tr("origin and destination folders are the same"));
970 return;
971 }
972 // cut needs write permission on origin
973 if (!origin.isWritable())
974 {
975 emit error(titleError, noWriteError + origin.absoluteFilePath());
976 return;
977 }
978 if (!destination.isWritable())
979 {
980 emit error(titleError, noWriteError + destination.absoluteFilePath());
981 return;
982 }
983 createAndProcessAction(actionType, items);
984 }951 }
985}952}
986953

Subscribers

People subscribed via source and target branches