digiKam
iojobsthread.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 : 2015-06-15
7  * Description : IO Jobs thread for file system jobs
8  *
9  * Copyright (C) 2015 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
10  * Copyright (C) 2018 by Maik Qualmann <metzpinguin at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_IO_JOBS_THREAD_H
26 #define DIGIKAM_IO_JOBS_THREAD_H
27 
28 // Local includes
29 
30 #include "actionthreadbase.h"
31 #include "digikam_export.h"
32 #include "dtrashiteminfo.h"
33 
34 namespace Digikam
35 {
36 
37 class IOJob;
38 class IOJobData;
39 
40 class DIGIKAM_GUI_EXPORT IOJobsThread : public ActionThreadBase
41 {
42  Q_OBJECT
43 
44 public:
45 
46  explicit IOJobsThread(QObject* const parent);
47  ~IOJobsThread() override;
48 
53  void copyOrMove(IOJobData* const data);
54 
59  void deleteFiles(IOJobData* const data);
60 
65  void renameFile(IOJobData* const data);
66 
71  void listDTrashItems(const QString& collectionPath);
72 
77  void restoreDTrashItems(IOJobData* const data);
78 
83  void emptyDTrashItems(IOJobData* const data);
84 
89  bool isCanceled() const;
90 
95  bool hasErrors() const;
96 
101  QStringList& errorsList() const;
102 
107  IOJobData* jobData() const;
108 
109 public Q_SLOTS:
110 
114  void slotCancel();
115 
116 Q_SIGNALS:
117 
119 
120  void signalOneProccessed(const QUrl& url);
121  void signalRenameFailed(const QUrl& url);
122 
123  void collectionTrashItemInfo(const DTrashItemInfo& trashItemInfo);
124 
125 private:
126 
131  void connectOneJob(IOJob* const j);
132 
133 private Q_SLOTS:
134 
139  void slotOneJobFinished();
140 
145  void slotError(const QString& errString);
146 
147 private:
148 
149  class Private;
150  Private* const d;
151 };
152 
153 } // namespace Digikam
154 
155 #endif // DIGIKAM_IO_JOBS_THREAD_H
Definition: actionthreadbase.h:102
Definition: dtrashiteminfo.h:36
Definition: iojobdata.h:45
Definition: iojob.h:44
Definition: iojobsthread.h:41
void collectionTrashItemInfo(const DTrashItemInfo &trashItemInfo)
void signalRenameFailed(const QUrl &url)
void signalOneProccessed(const QUrl &url)
Definition: datefolderview.cpp:43