Merge lp:~carlos-mazieri/ubuntu-filemanager-app/trash-operations-3 into lp:ubuntu-filemanager-app
- trash-operations-3
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Francis Ginther |
Approved revision: | 188 |
Merged at revision: | 206 |
Proposed branch: | lp:~carlos-mazieri/ubuntu-filemanager-app/trash-operations-3 |
Merge into: | lp:ubuntu-filemanager-app |
Prerequisite: | lp:~carlos-mazieri/ubuntu-filemanager-app/trash-operations-2 |
Diff against target: |
429 lines (+294/-8) 6 files modified
src/plugin/folderlistmodel/dirmodel.cpp (+110/-2) src/plugin/folderlistmodel/dirmodel.h (+21/-1) src/plugin/folderlistmodel/filesystemaction.cpp (+103/-3) src/plugin/folderlistmodel/filesystemaction.h (+10/-2) src/plugin/folderlistmodel/trash/trashlocation.cpp (+28/-0) src/plugin/folderlistmodel/trash/trashlocation.h (+22/-0) |
To merge this branch: | bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/trash-operations-3 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Arto Jalkanen | Approve | ||
Review via email: mp+219943@code.launchpad.net |
Commit message
Code to complete Trash opearations: move into / restore from / restore all / empty trash
Description of the change
Code to complete Trash opearations: move into / restore from / restore all / empty trash
Removing items from trash is driven to DirModel::rm() as normal remove, the operation differs from a normal remove only that for each top level item the ".trashinfo" file is also removed, but removing sub items from Trash is not allowed.
All Trash operations in Trash sub items (not in top level) are not allowed, that means, items in Trash sub folders are not allowed to be restored neither removed, these actions are supported on the top Trash root only.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
Arto Jalkanen (ajalkane) wrote : | # |
1)
#define IS_BROWSING_TRASH() (mCurLocation && mCurLocation-
Wouldn't this be clearer if it was IS_BROWSING_
2)
297 +void FileSystemActio
Typo: should be createTrashInfo
310 +void FileSystemActio
Typo: should be removeTrashInfo
3)
This is not anything that should be changed, just a note if there's a problem later when doing QML work:
Q_INVOKABLE void moveIndexesToTr
And functions like this, that take const reference to a list. I have an impression these were a problem in Qt 4.8 for QML, and if I remember correctly QML needed a QVariantList pointer. But lots have changed for Qt5 so perhaps this cleaner way works now. Let's only do some QML specific functions if there is a problem.
So in summary, only the cosmetic change of 2) is needed, and I'd think 1) would be a change that would make the macro's intent clearer.
Carlos Jose Mazieri (carlos-mazieri) wrote : | # |
Thanks,
All items have been addressed in revision 189.
I was not aware about item 3), Q_INVOKABLE was removed, it'd better to create a better QML interface for that.
The last MP has functions using selections like moveSelectionTo
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:188
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Arto Jalkanen (ajalkane) wrote : | # |
Thank you, looks good.
Arto Jalkanen (ajalkane) wrote : | # |
Ready to approve once Jenkins is not failing.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Carlos Jose Mazieri (carlos-mazieri) wrote : | # |
Can anyone help here?
I think that needs manual fixing in the build process,it has happened once more.
Francis Ginther (fginther) wrote : | # |
The trusty testing has been disabled for dependency reasons. Re-approving to try autolanding again.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) : | # |
Preview Diff
1 | === modified file 'src/plugin/folderlistmodel/dirmodel.cpp' | |||
2 | --- src/plugin/folderlistmodel/dirmodel.cpp 2014-05-17 12:57:46 +0000 | |||
3 | +++ src/plugin/folderlistmodel/dirmodel.cpp 2014-05-28 21:14:07 +0000 | |||
4 | @@ -38,6 +38,7 @@ | |||
5 | 38 | #include "location.h" | 38 | #include "location.h" |
6 | 39 | #include "locationurl.h" | 39 | #include "locationurl.h" |
7 | 40 | #include "disklocation.h" | 40 | #include "disklocation.h" |
8 | 41 | #include "trashlocation.h" | ||
9 | 41 | 42 | ||
10 | 42 | 43 | ||
11 | 43 | #ifndef DO_NOT_USE_TAG_LIB | 44 | #ifndef DO_NOT_USE_TAG_LIB |
12 | @@ -75,7 +76,7 @@ | |||
13 | 75 | 76 | ||
14 | 76 | #define IS_FILE_MANAGER_IDLE() (!mAwaitingResults) | 77 | #define IS_FILE_MANAGER_IDLE() (!mAwaitingResults) |
15 | 77 | 78 | ||
17 | 78 | 79 | #define IS_BROWSING_TRASH_ROOTDIR() (mCurLocation && mCurLocation->type() == LocationsFactory::TrashDisk && mCurLocation->isRoot()) | |
18 | 79 | 80 | ||
19 | 80 | namespace { | 81 | namespace { |
20 | 81 | QHash<QByteArray, int> roleMapping; | 82 | QHash<QByteArray, int> roleMapping; |
21 | @@ -482,7 +483,18 @@ | |||
22 | 482 | 483 | ||
23 | 483 | void DirModel::rm(const QStringList &paths) | 484 | void DirModel::rm(const QStringList &paths) |
24 | 484 | { | 485 | { |
26 | 485 | m_fsAction->remove(paths); | 486 | //if current location is Trash only in the root is allowed to remove Items |
27 | 487 | if (mCurLocation->type() == LocationsFactory::TrashDisk) | ||
28 | 488 | { | ||
29 | 489 | if (IS_BROWSING_TRASH_ROOTDIR()) | ||
30 | 490 | { | ||
31 | 491 | m_fsAction->removeFromTrash(paths); | ||
32 | 492 | } | ||
33 | 493 | } | ||
34 | 494 | else | ||
35 | 495 | { | ||
36 | 496 | m_fsAction->remove(paths); | ||
37 | 497 | } | ||
38 | 486 | } | 498 | } |
39 | 487 | 499 | ||
40 | 488 | 500 | ||
41 | @@ -1509,6 +1521,102 @@ | |||
42 | 1509 | } | 1521 | } |
43 | 1510 | 1522 | ||
44 | 1511 | 1523 | ||
45 | 1524 | void DirModel:: moveIndexesToTrash(const QList<int>& items) | ||
46 | 1525 | { | ||
47 | 1526 | if (mCurLocation->type() == LocationsFactory::LocalDisk) | ||
48 | 1527 | { | ||
49 | 1528 | const TrashLocation *trashLocation = static_cast<const TrashLocation*> | ||
50 | 1529 | (mLocationFactory->getLocation(LocationsFactory::TrashDisk)); | ||
51 | 1530 | ActionPathList itemsAndTrashPath; | ||
52 | 1531 | int index = 0; | ||
53 | 1532 | for (int counter=0; counter < items.count(); ++counter) | ||
54 | 1533 | { | ||
55 | 1534 | index = items.at(counter); | ||
56 | 1535 | if (IS_VALID_ROW(index)) | ||
57 | 1536 | { | ||
58 | 1537 | const DirItemInfo &it = mDirectoryContents.at(index); | ||
59 | 1538 | itemsAndTrashPath.append(trashLocation->getMovePairPaths(it)); | ||
60 | 1539 | } | ||
61 | 1540 | } | ||
62 | 1541 | if (itemsAndTrashPath.count() > 0) | ||
63 | 1542 | { | ||
64 | 1543 | m_fsAction->moveToTrash(itemsAndTrashPath); | ||
65 | 1544 | } | ||
66 | 1545 | } | ||
67 | 1546 | } | ||
68 | 1547 | |||
69 | 1548 | |||
70 | 1549 | void DirModel:: moveIndexToTrash(int index) | ||
71 | 1550 | { | ||
72 | 1551 | QList<int> list; | ||
73 | 1552 | list.append(index); | ||
74 | 1553 | return moveIndexesToTrash(list); | ||
75 | 1554 | } | ||
76 | 1555 | |||
77 | 1556 | |||
78 | 1557 | void DirModel::restoreTrash() | ||
79 | 1558 | { | ||
80 | 1559 | if ( IS_BROWSING_TRASH_ROOTDIR() ) | ||
81 | 1560 | { | ||
82 | 1561 | QList<int> allItems; | ||
83 | 1562 | for (int counter=0; counter < rowCount(); ++counter) | ||
84 | 1563 | { | ||
85 | 1564 | allItems.append(counter); | ||
86 | 1565 | } | ||
87 | 1566 | restoreIndexesFromTrash(allItems); | ||
88 | 1567 | } | ||
89 | 1568 | } | ||
90 | 1569 | |||
91 | 1570 | |||
92 | 1571 | void DirModel::emptyTrash() | ||
93 | 1572 | { | ||
94 | 1573 | if ( IS_BROWSING_TRASH_ROOTDIR() ) | ||
95 | 1574 | { | ||
96 | 1575 | QStringList allItems; | ||
97 | 1576 | for (int counter=0; counter < rowCount(); ++counter) | ||
98 | 1577 | { | ||
99 | 1578 | allItems.append(mDirectoryContents.at(counter).absoluteFilePath()); | ||
100 | 1579 | } | ||
101 | 1580 | if (allItems.count() > 0) | ||
102 | 1581 | { | ||
103 | 1582 | m_fsAction->removeFromTrash(allItems); | ||
104 | 1583 | } | ||
105 | 1584 | } | ||
106 | 1585 | } | ||
107 | 1586 | |||
108 | 1587 | |||
109 | 1588 | void DirModel::restoreIndexFromTrash(int index) | ||
110 | 1589 | { | ||
111 | 1590 | QList<int> item; | ||
112 | 1591 | item.append(index); | ||
113 | 1592 | restoreIndexesFromTrash(item); | ||
114 | 1593 | } | ||
115 | 1594 | |||
116 | 1595 | |||
117 | 1596 | void DirModel::restoreIndexesFromTrash(const QList<int> &items) | ||
118 | 1597 | { | ||
119 | 1598 | if ( IS_BROWSING_TRASH_ROOTDIR() ) | ||
120 | 1599 | { | ||
121 | 1600 | TrashLocation *trashLocation = static_cast<TrashLocation*> (mCurLocation); | ||
122 | 1601 | ActionPathList itemsAndOriginalPaths; | ||
123 | 1602 | int index = 0; | ||
124 | 1603 | for (int counter=0; counter < items.count(); ++counter) | ||
125 | 1604 | { | ||
126 | 1605 | index = items.at(counter); | ||
127 | 1606 | if (IS_VALID_ROW(index)) | ||
128 | 1607 | { | ||
129 | 1608 | const DirItemInfo &it = mDirectoryContents.at(index); | ||
130 | 1609 | itemsAndOriginalPaths.append(trashLocation->getRestorePairPaths(it)); | ||
131 | 1610 | } | ||
132 | 1611 | } | ||
133 | 1612 | if (itemsAndOriginalPaths.count() > 0) | ||
134 | 1613 | { | ||
135 | 1614 | m_fsAction->restoreFromTrash(itemsAndOriginalPaths); | ||
136 | 1615 | } | ||
137 | 1616 | } | ||
138 | 1617 | } | ||
139 | 1618 | |||
140 | 1619 | |||
141 | 1512 | #ifndef DO_NOT_USE_TAG_LIB | 1620 | #ifndef DO_NOT_USE_TAG_LIB |
142 | 1513 | QVariant DirModel::getAudioMetaData(const QFileInfo& fi, int role) const | 1621 | QVariant DirModel::getAudioMetaData(const QFileInfo& fi, int role) const |
143 | 1514 | { | 1622 | { |
144 | 1515 | 1623 | ||
145 | === modified file 'src/plugin/folderlistmodel/dirmodel.h' | |||
146 | --- src/plugin/folderlistmodel/dirmodel.h 2014-05-02 12:22:11 +0000 | |||
147 | +++ src/plugin/folderlistmodel/dirmodel.h 2014-05-28 21:14:07 +0000 | |||
148 | @@ -289,7 +289,27 @@ | |||
149 | 289 | Q_INVOKABLE bool existsFile(const QString& fileName) const; | 289 | Q_INVOKABLE bool existsFile(const QString& fileName) const; |
150 | 290 | Q_INVOKABLE bool canReadFile(const QString& fileName) const; | 290 | Q_INVOKABLE bool canReadFile(const QString& fileName) const; |
151 | 291 | 291 | ||
153 | 292 | public slots: | 292 | // Trash functions |
154 | 293 | Q_INVOKABLE void moveIndexToTrash(int index); | ||
155 | 294 | void moveIndexesToTrash(const QList<int>&); | ||
156 | 295 | Q_INVOKABLE void restoreIndexFromTrash(int index); | ||
157 | 296 | void restoreIndexesFromTrash(const QList<int>&); | ||
158 | 297 | |||
159 | 298 | public slots: | ||
160 | 299 | /*! | ||
161 | 300 | * \brief restoreTrash() restore all items being actually browsed in the Trash | ||
162 | 301 | * | ||
163 | 302 | */ | ||
164 | 303 | void restoreTrash(); | ||
165 | 304 | |||
166 | 305 | /*! | ||
167 | 306 | * \brief emptyTrash() remove definitely all items being actually browsed in the Trash | ||
168 | 307 | * | ||
169 | 308 | * \sa \ref removeSelection() and \ref rm() | ||
170 | 309 | * | ||
171 | 310 | */ | ||
172 | 311 | void emptyTrash(); | ||
173 | 312 | |||
174 | 293 | /*! | 313 | /*! |
175 | 294 | * \brief goHome() goes to user home dir | 314 | * \brief goHome() goes to user home dir |
176 | 295 | * Go to user home dir, we may have a tab for places or something like that | 315 | * Go to user home dir, we may have a tab for places or something like that |
177 | 296 | 316 | ||
178 | === modified file 'src/plugin/folderlistmodel/filesystemaction.cpp' | |||
179 | --- src/plugin/folderlistmodel/filesystemaction.cpp 2014-05-24 01:40:01 +0000 | |||
180 | +++ src/plugin/folderlistmodel/filesystemaction.cpp 2014-05-28 21:14:07 +0000 | |||
181 | @@ -36,6 +36,7 @@ | |||
182 | 36 | 36 | ||
183 | 37 | #include "filesystemaction.h" | 37 | #include "filesystemaction.h" |
184 | 38 | #include "clipboard.h" | 38 | #include "clipboard.h" |
185 | 39 | #include "qtrashutilinfo.h" | ||
186 | 39 | 40 | ||
187 | 40 | #if defined(Q_OS_UNIX) | 41 | #if defined(Q_OS_UNIX) |
188 | 41 | #include <sys/statvfs.h> | 42 | #include <sys/statvfs.h> |
189 | @@ -264,8 +265,17 @@ | |||
190 | 264 | ); | 265 | ); |
191 | 265 | return false; | 266 | return false; |
192 | 266 | } | 267 | } |
195 | 267 | //action->type is top level for all items, entry->type drives item behaviour | 268 | //action->type is top level for all items, entry->type drives item behaviour |
196 | 268 | entry->type = action->type; //normal behaviour | 269 | switch(action->type) |
197 | 270 | { | ||
198 | 271 | case ActionMoveToTrash: | ||
199 | 272 | case ActionRestoreFromTrash: entry->type = ActionMove; //needs create .trashinfo file | ||
200 | 273 | break; | ||
201 | 274 | case ActionRemoveFromTrash: entry->type = ActionRemove; //needs remove .trashinfo file | ||
202 | 275 | break; | ||
203 | 276 | default: entry->type = action->type; //normal behaviour | ||
204 | 277 | break; | ||
205 | 278 | } | ||
206 | 269 | //this is the item being handled | 279 | //this is the item being handled |
207 | 270 | entry->reversedOrder.append(info); | 280 | entry->reversedOrder.append(info); |
208 | 271 | // verify if the destination item already exists and it the destination path is in other file system | 281 | // verify if the destination item already exists and it the destination path is in other file system |
209 | @@ -447,9 +457,31 @@ | |||
210 | 447 | const DirItemInfo & mainItem = curEntry->reversedOrder.at(curEntry->currItem -1); | 457 | const DirItemInfo & mainItem = curEntry->reversedOrder.at(curEntry->currItem -1); |
211 | 448 | m_curAction->currEntryIndex++; | 458 | m_curAction->currEntryIndex++; |
212 | 449 | 459 | ||
213 | 460 | //check Trash operations | ||
214 | 461 | if ( (m_curAction->type == ActionMoveToTrash || m_curAction->type == ActionRestoreFromTrash) | ||
215 | 462 | && (curEntry->type == ActionMove || curEntry->type == ActionHardMoveRemove) | ||
216 | 463 | ) | ||
217 | 464 | { | ||
218 | 465 | if ( m_curAction->type == ActionMoveToTrash ) | ||
219 | 466 | { | ||
220 | 467 | createTrashInfoFileFromEntry(curEntry); | ||
221 | 468 | } | ||
222 | 469 | else | ||
223 | 470 | { | ||
224 | 471 | removeTrashInfoFileFromEntry(curEntry); | ||
225 | 472 | } | ||
226 | 473 | emit removed(mainItem); | ||
227 | 474 | } | ||
228 | 475 | else | ||
229 | 476 | { | ||
230 | 450 | switch(curEntry->type) | 477 | switch(curEntry->type) |
231 | 451 | { | 478 | { |
233 | 452 | case ActionRemove: | 479 | case ActionRemove: |
234 | 480 | if (m_curAction->type == ActionRemoveFromTrash) | ||
235 | 481 | { | ||
236 | 482 | //it is necessary to remove also (file).trashinfo file | ||
237 | 483 | removeTrashInfoFileFromEntry(curEntry); | ||
238 | 484 | } | ||
239 | 453 | emit removed(mainItem); | 485 | emit removed(mainItem); |
240 | 454 | break; | 486 | break; |
241 | 455 | case ActionHardMoveRemove: // nothing to do | 487 | case ActionHardMoveRemove: // nothing to do |
242 | @@ -478,6 +510,7 @@ | |||
243 | 478 | default: | 510 | default: |
244 | 479 | break; | 511 | break; |
245 | 480 | }//switch | 512 | }//switch |
246 | 513 | } | ||
247 | 481 | }//end if (curEntry->currItem == curEntry->reversedOrder.count()) | 514 | }//end if (curEntry->currItem == curEntry->reversedOrder.count()) |
248 | 482 | 515 | ||
249 | 483 | if (curEntry->currStep == STEP_FILES) | 516 | if (curEntry->currStep == STEP_FILES) |
250 | @@ -1403,3 +1436,70 @@ | |||
251 | 1403 | { | 1436 | { |
252 | 1404 | m_clipboardChanged = true; | 1437 | m_clipboardChanged = true; |
253 | 1405 | } | 1438 | } |
254 | 1439 | |||
255 | 1440 | |||
256 | 1441 | //================================================================== | ||
257 | 1442 | /*! | ||
258 | 1443 | * \brief FileSystemAction::moveToTrash() Move a set of files to Trash | ||
259 | 1444 | * \param items files/dirs that belong to the same parent directory | ||
260 | 1445 | */ | ||
261 | 1446 | void FileSystemAction::moveToTrash(const ActionPathList &pairPaths) | ||
262 | 1447 | { | ||
263 | 1448 | Action *moveAction = createAction(ActionMoveToTrash); | ||
264 | 1449 | for (int counter=0; counter < pairPaths.count(); ++counter) | ||
265 | 1450 | { | ||
266 | 1451 | addEntry(moveAction, pairPaths.at(counter)); | ||
267 | 1452 | } | ||
268 | 1453 | queueAction(moveAction); | ||
269 | 1454 | } | ||
270 | 1455 | |||
271 | 1456 | //================================================================== | ||
272 | 1457 | /*! | ||
273 | 1458 | * \brief FileSystemAction::restoreFromTrash() restore a set of Files to | ||
274 | 1459 | * their original path | ||
275 | 1460 | * \param pairPaths | ||
276 | 1461 | */ | ||
277 | 1462 | void FileSystemAction::restoreFromTrash(const ActionPathList &pairPaths) | ||
278 | 1463 | { | ||
279 | 1464 | Action *moveAction = createAction(ActionRestoreFromTrash); | ||
280 | 1465 | for (int counter=0; counter < pairPaths.count(); ++counter) | ||
281 | 1466 | { | ||
282 | 1467 | addEntry(moveAction, pairPaths.at(counter)); | ||
283 | 1468 | } | ||
284 | 1469 | queueAction(moveAction); | ||
285 | 1470 | } | ||
286 | 1471 | |||
287 | 1472 | /*! | ||
288 | 1473 | * \brief FileSystemAction::removeFromTrash | ||
289 | 1474 | * \param paths | ||
290 | 1475 | */ | ||
291 | 1476 | void FileSystemAction::removeFromTrash(const QStringList &paths) | ||
292 | 1477 | { | ||
293 | 1478 | createAndProcessAction(ActionRemoveFromTrash, paths); | ||
294 | 1479 | } | ||
295 | 1480 | |||
296 | 1481 | |||
297 | 1482 | void FileSystemAction::createTrashInfoFileFromEntry(ActionEntry *entry) | ||
298 | 1483 | { | ||
299 | 1484 | QTrashUtilInfo trashUtil; | ||
300 | 1485 | trashUtil.setInfoFromTrashItem(entry->itemPaths.target()); | ||
301 | 1486 | if (!trashUtil.createTrashInfoFile(entry->itemPaths.source())) | ||
302 | 1487 | { | ||
303 | 1488 | m_cancelCurrentAction = true; | ||
304 | 1489 | m_errorTitle = QObject::tr("Could not create trash info file"); | ||
305 | 1490 | m_errorMsg = trashUtil.absInfo; | ||
306 | 1491 | } | ||
307 | 1492 | } | ||
308 | 1493 | |||
309 | 1494 | |||
310 | 1495 | void FileSystemAction::removeTrashInfoFileFromEntry(ActionEntry *entry) | ||
311 | 1496 | { | ||
312 | 1497 | QTrashUtilInfo trashUtil; | ||
313 | 1498 | trashUtil.setInfoFromTrashItem(entry->itemPaths.source()); | ||
314 | 1499 | if (!trashUtil.removeTrashInfoFile()) | ||
315 | 1500 | { | ||
316 | 1501 | m_cancelCurrentAction = true; | ||
317 | 1502 | m_errorTitle = QObject::tr("Could not remove the trash info file"); | ||
318 | 1503 | m_errorMsg = trashUtil.absInfo; | ||
319 | 1504 | } | ||
320 | 1505 | } | ||
321 | 1406 | 1506 | ||
322 | === modified file 'src/plugin/folderlistmodel/filesystemaction.h' | |||
323 | --- src/plugin/folderlistmodel/filesystemaction.h 2014-05-24 01:40:01 +0000 | |||
324 | +++ src/plugin/folderlistmodel/filesystemaction.h 2014-05-28 21:14:07 +0000 | |||
325 | @@ -108,6 +108,9 @@ | |||
326 | 108 | void pathChanged(const QString& path); | 108 | void pathChanged(const QString& path); |
327 | 109 | void copyIntoCurrentPath(const QStringList& items); | 109 | void copyIntoCurrentPath(const QStringList& items); |
328 | 110 | void moveIntoCurrentPath(const QStringList& items); | 110 | void moveIntoCurrentPath(const QStringList& items); |
329 | 111 | void moveToTrash(const ActionPathList& pairPaths ); | ||
330 | 112 | void restoreFromTrash(const ActionPathList& pairPaths); | ||
331 | 113 | void removeFromTrash(const QStringList& paths); | ||
332 | 111 | void onClipboardChanged(); | 114 | void onClipboardChanged(); |
333 | 112 | 115 | ||
334 | 113 | 116 | ||
335 | @@ -134,7 +137,10 @@ | |||
336 | 134 | ActionCopy, | 137 | ActionCopy, |
337 | 135 | ActionMove, | 138 | ActionMove, |
338 | 136 | ActionHardMoveCopy, | 139 | ActionHardMoveCopy, |
340 | 137 | ActionHardMoveRemove | 140 | ActionHardMoveRemove, |
341 | 141 | ActionMoveToTrash, | ||
342 | 142 | ActionRestoreFromTrash, | ||
343 | 143 | ActionRemoveFromTrash | ||
344 | 138 | }; | 144 | }; |
345 | 139 | 145 | ||
346 | 140 | void createAndProcessAction(ActionType actionType, const QStringList& paths); | 146 | void createAndProcessAction(ActionType actionType, const QStringList& paths); |
347 | @@ -227,7 +233,9 @@ | |||
348 | 227 | bool makeBackupNameForCurrentItem(ActionEntry *entry); | 233 | bool makeBackupNameForCurrentItem(ActionEntry *entry); |
349 | 228 | bool endCopySingleFile(); | 234 | bool endCopySingleFile(); |
350 | 229 | bool isThereDiskSpace(const ActionEntry *entry, qint64 requiredSize); | 235 | bool isThereDiskSpace(const ActionEntry *entry, qint64 requiredSize); |
352 | 230 | void queueAction(Action *myAction); | 236 | void queueAction(Action *myAction); |
353 | 237 | void createTrashInfoFileFromEntry(ActionEntry *entry); | ||
354 | 238 | void removeTrashInfoFileFromEntry(ActionEntry *entry); | ||
355 | 231 | 239 | ||
356 | 232 | #if defined(REGRESSION_TEST_FOLDERLISTMODEL) //used in Unit/Regression tests | 240 | #if defined(REGRESSION_TEST_FOLDERLISTMODEL) //used in Unit/Regression tests |
357 | 233 | bool m_forceUsingOtherFS; | 241 | bool m_forceUsingOtherFS; |
358 | 234 | 242 | ||
359 | === modified file 'src/plugin/folderlistmodel/trash/trashlocation.cpp' | |||
360 | --- src/plugin/folderlistmodel/trash/trashlocation.cpp 2014-05-17 11:47:11 +0000 | |||
361 | +++ src/plugin/folderlistmodel/trash/trashlocation.cpp 2014-05-28 21:14:07 +0000 | |||
362 | @@ -258,3 +258,31 @@ | |||
363 | 258 | { | 258 | { |
364 | 259 | // do nothing, the startExternalFsWatcher() is called in fetchItems() | 259 | // do nothing, the startExternalFsWatcher() is called in fetchItems() |
365 | 260 | } | 260 | } |
366 | 261 | |||
367 | 262 | |||
368 | 263 | ActionPaths | ||
369 | 264 | TrashLocation::getRestorePairPaths(const DirItemInfo& item) const | ||
370 | 265 | { | ||
371 | 266 | const TrashItemInfo* ptrash = static_cast<const TrashItemInfo*> (&item); | ||
372 | 267 | QTrashUtilInfo trashInfo; | ||
373 | 268 | |||
374 | 269 | trashInfo.setInfo(ptrash->getRootTrashDir(), ptrash->absoluteFilePath()); | ||
375 | 270 | |||
376 | 271 | ActionPaths ret(ptrash->absoluteFilePath()); | ||
377 | 272 | ret.setTargetFullName(trashInfo.getOriginalPathName()); | ||
378 | 273 | |||
379 | 274 | return ret; | ||
380 | 275 | } | ||
381 | 276 | |||
382 | 277 | |||
383 | 278 | ActionPaths | ||
384 | 279 | TrashLocation::getMovePairPaths(const DirItemInfo &item) const | ||
385 | 280 | { | ||
386 | 281 | ActionPaths ret(item.absoluteFilePath()); | ||
387 | 282 | |||
388 | 283 | QTrashUtilInfo trashInfo; | ||
389 | 284 | trashInfo.setInfo(suitableTrash(item.absoluteFilePath()), item.absoluteFilePath()); | ||
390 | 285 | |||
391 | 286 | ret.setTargetFullName( trashInfo.absFile ); | ||
392 | 287 | return ret; | ||
393 | 288 | } | ||
394 | 261 | 289 | ||
395 | === modified file 'src/plugin/folderlistmodel/trash/trashlocation.h' | |||
396 | --- src/plugin/folderlistmodel/trash/trashlocation.h 2014-05-15 00:18:54 +0000 | |||
397 | +++ src/plugin/folderlistmodel/trash/trashlocation.h 2014-05-28 21:14:07 +0000 | |||
398 | @@ -45,10 +45,32 @@ | |||
399 | 45 | 45 | ||
400 | 46 | virtual DirItemInfo *validateUrlPath(const QString& urlPath); | 46 | virtual DirItemInfo *validateUrlPath(const QString& urlPath); |
401 | 47 | 47 | ||
402 | 48 | /*! | ||
403 | 49 | * \brief getMovePairPaths() Get: original path and destination trash path | ||
404 | 50 | * | ||
405 | 51 | * | ||
406 | 52 | * \param item desired item to be moved into Trash | ||
407 | 53 | * | ||
408 | 54 | * \return an \ref ActionPaths that contains the source orginal file and | ||
409 | 55 | * the suitable Trash path where the source will moved into | ||
410 | 56 | */ | ||
411 | 57 | ActionPaths getMovePairPaths(const DirItemInfo& item) const; | ||
412 | 58 | |||
413 | 59 | /*! | ||
414 | 60 | * \brief getRestorePairPaths() Get: Trash path as source and item original path as destination | ||
415 | 61 | * | ||
416 | 62 | * \param item desired to be restored from Trash | ||
417 | 63 | * | ||
418 | 64 | * \return n \ref ActionPaths that contains the thash item and | ||
419 | 65 | * the original source path as destionation | ||
420 | 66 | */ | ||
421 | 67 | ActionPaths getRestorePairPaths(const DirItemInfo& item) const; | ||
422 | 68 | |||
423 | 48 | private: | 69 | private: |
424 | 49 | void addTrashFetchRequest(TrashListWorker *workerObject); | 70 | void addTrashFetchRequest(TrashListWorker *workerObject); |
425 | 50 | 71 | ||
426 | 51 | private: | 72 | private: |
427 | 73 | ActionPathList m_actionPathList; | ||
428 | 52 | QStringList m_currentPaths; //!< also used in the startExternalFsWatcher(), it can br activated any time | 74 | QStringList m_currentPaths; //!< also used in the startExternalFsWatcher(), it can br activated any time |
429 | 53 | }; | 75 | }; |
430 | 54 | 76 |
FAILED: Continuous integration, rev:187 /code.launchpad .net/~carlos- mazieri/ ubuntu- filemanager- app/trash- operations- 3/+merge/ 219943/ +edit-commit- message
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http:// 91.189. 93.70:8080/ job/ubuntu- filemanager- app-ci/ 236/ 91.189. 93.70:8080/ job/generic- mediumtests- trusty/ 2681 91.189. 93.70:8080/ job/generic- mediumtests- trusty/ 2681/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 218 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 218/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/ubuntu- filemanager- app-trusty- amd64-ci/ 186 91.189. 93.70:8080/ job/ubuntu- filemanager- app-utopic- amd64-ci/ 34
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- filemanager- app-ci/ 236/rebuild
http://