digiKam
dfileoperations.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2008-12-10
7  * Description : misc file operation methods
8  *
9  * Copyright (C) 2014-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_DFILE_OPERATIONS_H
25 #define DIGIKAM_DFILE_OPERATIONS_H
26 
27 // Qt includes
28 
29 #include <QUrl>
30 #include <QString>
31 #include <QDateTime>
32 #include <QStringList>
33 
34 // Local includes
35 
36 #include "digikam_export.h"
37 
38 namespace Digikam
39 {
40 
41 class DIGIKAM_EXPORT DFileOperations
42 {
43 public:
44 
50  static bool localFileRename(const QString& source,
51  const QString& orgPath,
52  const QString& destPath,
53  bool ignoreSettings = false);
54 
59  static void openFilesWithDefaultApplication(const QList<QUrl>& urls);
60 
65  static QUrl getUniqueFileUrl(const QUrl& orgUrl, bool* const newurl = nullptr);
66 
71  static QUrl getUniqueFolderUrl(const QUrl& orgUrl);
72 
76  static void openInFileManager(const QList<QUrl>& urls);
77 
81  static bool copyFolderRecursively(const QString& srcPath,
82  const QString& dstPath,
83  const QString& itemId = QString(),
84  bool* const cancel = nullptr,
85  bool countTotal = true);
86 
90  static bool copyFiles(const QStringList& srcPaths,
91  const QString& dstPath);
92 
96  static bool renameFile(const QString& srcFile,
97  const QString& dstFile);
98 
102  static bool copyFile(const QString& srcFile,
103  const QString& dstFile);
104 
108  static bool copyModificationTime(const QString& srcFile,
109  const QString& dstFile);
114  static bool setModificationTime(const QString& srcFile,
115  const QDateTime& dateTime);
116 };
117 
118 } // namespace Digikam
119 
120 #endif // DIGIKAM_DFILE_OPERATIONS_H
Definition: dfileoperations.h:42
Definition: datefolderview.cpp:43