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

« back to all changes in this revision

Viewing changes to src/plugin/folderlistmodel/trash/qtrashutilinfo.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: qtrashutilinfo.h
19
 
 * Date: 16/03/2014
20
 
 */
21
 
 
22
 
#ifndef QTRASHUTILINFO_H
23
 
#define QTRASHUTILINFO_H
24
 
 
25
 
#include <QString>
26
 
 
27
 
 
28
 
/*!
29
 
 * \brief The QTrashUtilInfo struct just provides helper functions and information using a file structure like
30
 
 *
31
 
 *  Trash/
32
 
 *        files/           info/
33
 
 *              item           item.trashinfo
34
 
 */
35
 
struct QTrashUtilInfo
36
 
{
37
 
public:
38
 
    /*!
39
 
     * \brief setInfo()          build the whole Trash information
40
 
     * \param trashRootDir       the root Trash Dir usually a folder "Trash"
41
 
     * \param filename           the item, it can be either a relative file name or a full path name
42
 
     */
43
 
    void setInfo(const QString& trashRootDir, const QString& filename);
44
 
 
45
 
    /*!
46
 
     * \brief setInfoFromTrashItem() build the whole Trash information from the absolute path name from a trash item
47
 
     * \param absTrashItem       the full path, something like <TrashRoot>/files/item
48
 
     *
49
 
     *  The item pointed by \a absTrashItem does not need to exist
50
 
     */
51
 
    void setInfoFromTrashItem(const QString& absTrashItem);
52
 
    void clear();
53
 
    bool existsInfoFile();
54
 
    bool existsFile();
55
 
    bool isValid();
56
 
    QString getOriginalPathName();
57
 
    bool createTrashInfoFile(const QString& orignalPathname);
58
 
    bool removeTrashInfoFile();
59
 
 
60
 
    /*!
61
 
     * \brief filesTrashDir() gets the "files" directory under Trash Dir
62
 
     * \param trashDir
63
 
     * \return trashDir/files
64
 
     */
65
 
    static QString       filesTrashDir(const QString& trashDir);
66
 
 
67
 
    /*!
68
 
     * \brief infoTrashDir() gets gets the "info" directory under Trash Dir
69
 
     * \param trashDir
70
 
     * \return trashDir/info
71
 
     */
72
 
    static QString       infoTrashDir(const QString& trashDir);
73
 
 
74
 
    QString  trashRoot; // root
75
 
    QString  filesDir;  // root/files
76
 
    QString  absFile;   // root/files/item
77
 
    QString  infoDir;   // root/info
78
 
    QString  absInfo;   // root/info/item.trashinfo
79
 
    bool     valid;
80
 
};
81
 
 
82
 
#endif // QTRASHUTILINFO_H