digiKam
Loading...
Searching...
No Matches
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 * SPDX-FileCopyrightText: 2014-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17// Qt includes
18
19#include <QUrl>
20#include <QString>
21#include <QDateTime>
22#include <QStringList>
23
24// Local includes
25
26#include "digikam_export.h"
27
28namespace Digikam
29{
30
31class DIGIKAM_EXPORT DFileOperations
32{
33
34public:
35
37 {
38 Rename = 0,
39 Copy
40 };
41
42public:
43
49 static bool localFileRename(const QString& source,
50 const QString& orgPath,
51 const QString& destPath,
52 bool ignoreSettings = false);
53
58 static void openFilesWithDefaultApplication(const QList<QUrl>& urls);
59
64 static QUrl getUniqueFileUrl(const QUrl& orgUrl, bool* const newurl = nullptr);
65
70 static QUrl getUniqueFolderUrl(const QUrl& orgUrl);
71
75 static void openInFileManager(const QList<QUrl>& urls);
76
80 static bool copyFolderRecursively(const QString& srcPath,
81 const QString& dstPath,
82 const QString& itemId = QString(),
83 bool* const cancel = nullptr,
84 bool useDstPath = false);
85
89 static bool copyFiles(const QStringList& srcPaths,
90 const QString& dstPath);
91
95 static bool renameFile(const QString& srcFile,
96 const QString& dstFile);
97
101 static bool copyFile(const QString& srcFile,
102 const QString& dstFile,
103 const bool* const cancel = nullptr);
104
110 static bool removeAndCopyFile(const QString& srcFile,
111 const QString& dstFile);
112
116 static bool copyModificationTime(const QString& srcFile,
117 const QString& dstFile);
122 static bool setModificationTime(const QString& srcFile,
123 const QDateTime& dateTime);
130 static QString findExecutable(const QString& name,
131 const QStringList& hints = QStringList());
132
137 static bool sidecarFiles(const QString& srcFile,
138 const QString& dstFile,
139 SidecarAction action);
140};
141
142} // namespace Digikam
Definition dfileoperations.h:32
SidecarAction
Definition dfileoperations.h:37
Definition datefolderview.cpp:34