Changeset View
Changeset View
Standalone View
Standalone View
src/engine/fsutils.h
Show All 19 Lines | |||||
20 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 20 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
21 | * | 21 | * | ||
22 | */ | 22 | */ | ||
23 | 23 | | |||
24 | #ifndef BALOO_ENGINE_FSUTILS_H | 24 | #ifndef BALOO_ENGINE_FSUTILS_H | ||
25 | #define BALOO_ENGINE_FSUTILS_H | 25 | #define BALOO_ENGINE_FSUTILS_H | ||
26 | 26 | | |||
27 | #include <QString> | 27 | #include <QString> | ||
28 | #include <QStringList> | ||||
28 | 29 | | |||
29 | namespace Baloo { | 30 | namespace Baloo { | ||
30 | namespace FSUtils { | 31 | namespace FSUtils { | ||
31 | 32 | | |||
32 | /** | 33 | /** | ||
33 | * Returns name of filesystem that @p directory is stored on. This | 34 | * Returns name of filesystem that @p directory is stored on. This | ||
34 | * only works on Linux and returns empty string on other platforms or when it's | 35 | * only works on Linux and returns empty string on other platforms or when it's | ||
35 | * unable to detect the filesystem. | 36 | * unable to detect the filesystem. | ||
36 | */ | 37 | */ | ||
37 | QString getDirectoryFileSystem(const QString &directory); | 38 | QString getDirectoryFileSystem(const QString &directory); | ||
38 | 39 | | |||
39 | /** | 40 | /** | ||
40 | * Disables filesystem copy-on-write feature on given file or directory. | 41 | * Disables filesystem copy-on-write feature on given file or directory. | ||
41 | * Only works on Linux and does nothing on other platforms. | 42 | * Only works on Linux and does nothing on other platforms. | ||
42 | * | 43 | * | ||
43 | * It was tested only with Btrfs but in theory can be called on any FS that | 44 | * It was tested only with Btrfs but in theory can be called on any FS that | ||
44 | * supports NOCOW. | 45 | * supports NOCOW. | ||
45 | */ | 46 | */ | ||
46 | void disableCoW(const QString &path); | 47 | void disableCoW(const QString &path); | ||
47 | 48 | | |||
49 | struct DeviceInfo { | ||||
50 | quint64 id = 0; | ||||
51 | QString filesystem; | ||||
bruns: No need for explicitly calling the default constructor, this is only needed for POD types (e.g. | |||||
52 | QString name; | ||||
53 | QString mountpoint; | ||||
54 | QStringList options; | ||||
55 | }; | ||||
56 | | ||||
57 | const QVector<DeviceInfo> attachedDevices(); | ||||
58 | | ||||
48 | } | 59 | } | ||
49 | 60 | | |||
50 | } | 61 | } | ||
51 | #endif | 62 | #endif |
No need for explicitly calling the default constructor, this is only needed for POD types (e.g. quint64).