digiKam
coredbcopymanager.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 : 2009-11-14
7  * Description : Core database copy manager for migration operations.
8  *
9  * Copyright (C) 2009-2010 by Holger Foerster <Hamsi2k at freenet dot de>
10  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles 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_CORE_DB_COPY_MANAGER_H
26 #define DIGIKAM_CORE_DB_COPY_MANAGER_H
27 
28 // Qt includes
29 
30 #include <QObject>
31 
32 // Local includes
33 
34 #include "digikam_export.h"
35 #include "coredbbackend.h"
36 
37 namespace Digikam
38 {
39 
40 class DIGIKAM_DATABASE_EXPORT CoreDbCopyManager : public QObject
41 {
42  Q_OBJECT
43 
44 public:
45 
47  {
50  canceled
51  };
52 
53 public:
54 
56  ~CoreDbCopyManager() override;
57 
58  void copyDatabases(const DbEngineParameters& fromDBParameters,
59  const DbEngineParameters& toDBParameters);
60 
61 Q_SIGNALS:
62 
63  void stepStarted(const QString& stepName);
64  void smallStepStarted(int currValue, int maxValue);
65  void finished(int finishState, const QString& errorMsg);
66 
67 public Q_SLOTS:
68 
69  void stopProcessing();
70 
71 private:
72 
73  // Disabled
74  explicit CoreDbCopyManager(QObject*) = delete;
75 
76  bool copyTable(CoreDbBackend& fromDBbackend,
77  const QString& fromActionName,
78  CoreDbBackend& toDBbackend,
79  const QString& toActionName);
80 
81  void handleClosing(bool isstopThread,
82  CoreDbBackend& fromDBbackend,
83  CoreDbBackend& toDBbackend);
84 
85 private:
86 
87  volatile bool m_isStopProcessing;
88 };
89 
90 } // namespace Digikam
91 
92 #endif // DIGIKAM_CORE_DB_COPY_MANAGER_H
Definition: coredbbackend.h:42
Definition: coredbcopymanager.h:41
void stepStarted(const QString &stepName)
void finished(int finishState, const QString &errorMsg)
FinishStates
Definition: coredbcopymanager.h:47
@ failed
Definition: coredbcopymanager.h:49
@ success
Definition: coredbcopymanager.h:48
void smallStepStarted(int currValue, int maxValue)
Definition: dbengineparameters.h:49
Definition: datefolderview.cpp:43