~ubuntu-filemanager-dev/ubuntu-filemanager-app/trunk

« back to all changes in this revision

Viewing changes to src/plugin/folderlistmodel/trash/trashlocation.h

  • Committer: Bileto Bot
  • Date: 2017-04-04 17:06:41 UTC
  • mfrom: (588.1.19 fix-desktop-file)
  • Revision ID: ci-train-bot@canonical.com-20170404170641-1p15lmx8wodlx2ut
* Rename binary file to ubuntu-filemanager-app
* Join plugin packages into the main package 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**************************************************************************
2
 
 *
3
 
 * Copyright 2014 Canonical Ltd.
4
 
 * Copyright 2014 Carlos J Mazieri <carlos.mazieri@gmail.com>
5
 
 *
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.
9
 
 *
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.
14
 
 *
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/>.
17
 
 *
18
 
 * File: trashlocation.h
19
 
 * Date: 08/03/2014
20
 
 */
21
 
 
22
 
#ifndef TRASHLOCATION_H
23
 
#define TRASHLOCATION_H
24
 
 
25
 
#include "disk/disklocation.h"
26
 
#include "trash/qtrashdir.h"
27
 
 
28
 
class TrashListWorker;
29
 
 
30
 
class TrashLocation : public DiskLocation, public QTrashDir
31
 
{
32
 
    Q_OBJECT
33
 
public:
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) ;
42
 
 
43
 
    virtual void        startWorking();
44
 
    virtual void        startExternalFsWatcher();
45
 
 
46
 
    virtual DirItemInfo *validateUrlPath(const QString& urlPath);
47
 
 
48
 
    virtual DirItemInfo * newItemInfo(const QString& urlPath);
49
 
    virtual DirListWorker * newListWorker(const QString &urlPath,
50
 
                                          QDir::Filters filter,
51
 
                                          const bool isRecursive);
52
 
    virtual QString     urlBelongsToLocation(const QString& urlPath, int indexOfColonAndSlashe);
53
 
 
54
 
    /*!
55
 
     * \brief getMovePairPaths() Get: original path and destination trash path
56
 
     *
57
 
     *
58
 
     * \param item desired item to be moved into Trash
59
 
     *
60
 
     * \return an \ref ActionPaths that contains the source orginal file and
61
 
     *                 the suitable Trash path where the source will moved into
62
 
     */
63
 
    ActionPaths         getMovePairPaths(const DirItemInfo& item) const;
64
 
 
65
 
    /*!
66
 
     * \brief getRestorePairPaths() Get: Trash path as source and item original path as destination
67
 
     *
68
 
     * \param item desired to be restored from Trash
69
 
     *
70
 
     * \return n \ref ActionPaths that contains the thash item and
71
 
     *                 the original source path as destionation
72
 
     */
73
 
    ActionPaths         getRestorePairPaths(const DirItemInfo& item) const;
74
 
 
75
 
private:
76
 
    void               addTrashFetchRequest(TrashListWorker *workerObject);
77
 
 
78
 
private:
79
 
    ActionPathList     m_actionPathList;
80
 
    QStringList        m_currentPaths;  //!< also used in the startExternalFsWatcher(), it can br activated any time
81
 
};
82
 
 
83
 
#endif // TRASHLOCATION_H