1
/**************************************************************************
3
* Copyright 2014 Canonical Ltd.
4
* Copyright 2014 Carlos J Mazieri <carlos.mazieri@gmail.com>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU Lesser General Public License as published by
8
* the Free Software Foundation; version 3.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
* File: trashlocation.h
22
#ifndef TRASHLOCATION_H
23
#define TRASHLOCATION_H
25
#include "disk/disklocation.h"
26
#include "trash/qtrashdir.h"
28
class TrashListWorker;
30
class TrashLocation : public DiskLocation, public QTrashDir
34
explicit TrashLocation(int type, QObject *parent=0);
35
virtual ~TrashLocation();
36
virtual bool becomeParent();
37
virtual void refreshInfo();
38
virtual void fetchItems(QDir::Filters dirFilter, bool recursive=0);
39
virtual void fetchExternalChanges(const QString& urlPath,
40
const DirItemInfoList& list,
41
QDir::Filters dirFilter) ;
43
virtual void startWorking();
44
virtual void startExternalFsWatcher();
46
virtual DirItemInfo *validateUrlPath(const QString& urlPath);
48
virtual DirItemInfo * newItemInfo(const QString& urlPath);
49
virtual DirListWorker * newListWorker(const QString &urlPath,
51
const bool isRecursive);
52
virtual QString urlBelongsToLocation(const QString& urlPath, int indexOfColonAndSlashe);
55
* \brief getMovePairPaths() Get: original path and destination trash path
58
* \param item desired item to be moved into Trash
60
* \return an \ref ActionPaths that contains the source orginal file and
61
* the suitable Trash path where the source will moved into
63
ActionPaths getMovePairPaths(const DirItemInfo& item) const;
66
* \brief getRestorePairPaths() Get: Trash path as source and item original path as destination
68
* \param item desired to be restored from Trash
70
* \return n \ref ActionPaths that contains the thash item and
71
* the original source path as destionation
73
ActionPaths getRestorePairPaths(const DirItemInfo& item) const;
76
void addTrashFetchRequest(TrashListWorker *workerObject);
79
ActionPathList m_actionPathList;
80
QStringList m_currentPaths; //!< also used in the startExternalFsWatcher(), it can br activated any time
83
#endif // TRASHLOCATION_H