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: qtrashutilinfo.h
22
#ifndef QTRASHUTILINFO_H
23
#define QTRASHUTILINFO_H
29
* \brief The QTrashUtilInfo struct just provides helper functions and information using a file structure like
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
43
void setInfo(const QString& trashRootDir, const QString& filename);
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
49
* The item pointed by \a absTrashItem does not need to exist
51
void setInfoFromTrashItem(const QString& absTrashItem);
53
bool existsInfoFile();
56
QString getOriginalPathName();
57
bool createTrashInfoFile(const QString& orignalPathname);
58
bool removeTrashInfoFile();
61
* \brief filesTrashDir() gets the "files" directory under Trash Dir
63
* \return trashDir/files
65
static QString filesTrashDir(const QString& trashDir);
68
* \brief infoTrashDir() gets gets the "info" directory under Trash Dir
70
* \return trashDir/info
72
static QString infoTrashDir(const QString& trashDir);
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
82
#endif // QTRASHUTILINFO_H