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
1=== modified file 'src/plugin/folderlistmodel/filesystemaction.cpp'
2--- src/plugin/folderlistmodel/filesystemaction.cpp 2015-07-18 21:52:38 +0000
3+++ src/plugin/folderlistmodel/filesystemaction.cpp 2015-07-18 21:52:39 +0000
4@@ -933,18 +933,8 @@
5 #endif
6 m_clipboardChanged = false;
7 if (items.count())
8- {
9- DirItemInfo destination(m_path);
10- if (destination.isWritable())
11- {
12- createAndProcessAction(ActionCopy, items);
13- }
14- else
15- {
16- emit error(tr("Cannot copy items"),
17- tr("no write permission on folder ") + destination.absoluteFilePath() );
18-
19- }
20+ {
21+ createAndProcessAction(ActionCopy, items);
22 }
23 }
24
25@@ -957,30 +947,7 @@
26 m_clipboardChanged = false;
27 if (items.count())
28 {
29- DirItemInfo destination(m_path);
30- DirItemInfo origin(DirItemInfo(items.at(0)).absolutePath());
31- ActionType actionType = ActionMove;
32- static QString titleError = tr("Cannot move items");
33- static QString noWriteError = tr("no write permission on folder ");
34- //we allow Copy to backup items, but Cut must Fail
35- if (destination.absoluteFilePath() == origin.absoluteFilePath())
36- {
37- emit error(titleError,
38- tr("origin and destination folders are the same"));
39- return;
40- }
41- // cut needs write permission on origin
42- if (!origin.isWritable())
43- {
44- emit error(titleError, noWriteError + origin.absoluteFilePath());
45- return;
46- }
47- if (!destination.isWritable())
48- {
49- emit error(titleError, noWriteError + destination.absoluteFilePath());
50- return;
51- }
52- createAndProcessAction(actionType, items);
53+ createAndProcessAction(ActionMove, items);
54 }
55 }
56

Subscribers

People subscribed via source and target branches