KCoreAddons

kdelibs4configmigrator.h
1 /*
2  This file is part of the KDE Frameworks
3 
4  SPDX-FileCopyrightText: 2014 Montel Laurent <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef KDELIBS4CONFIGMIGRATOR_H
10 #define KDELIBS4CONFIGMIGRATOR_H
11 
12 #include <QStringList>
13 #include <kcoreaddons_export.h>
14 #include <memory>
15 
16 /**
17  * @class Kdelibs4ConfigMigrator kdelibs4configmigrator.h Kdelibs4ConfigMigrator
18  *
19  * Kdelibs4ConfigMigrator migrates selected config files and ui files
20  * from the kdelibs 4.x location ($KDEHOME, as used by KStandardDirs)
21  * to the Qt 5.x location ($XDG_*_HOME, as used by QStandardPaths).
22  *
23  * @short Class for migration of config files and ui file from kdelibs4.
24  * @since 5.2
25  */
26 class KCOREADDONS_EXPORT Kdelibs4ConfigMigrator
27 {
28 public:
29  /**
30  * Constructs a Kdelibs4ConfigMigrator
31  *
32  * @param appName The application name, which is used for the directory
33  * containing the .ui files.
34  */
35  explicit Kdelibs4ConfigMigrator(const QString &appName);
36 
37  /**
38  * Destructor
39  */
41 
43  Kdelibs4ConfigMigrator &operator=(const Kdelibs4ConfigMigrator &) = delete;
44 
45  /**
46  * Migrate the files, if any.
47  *
48  * Returns true if the migration happened.
49  * It will return false if there was nothing to migrate (no KDEHOME).
50  * This return value is unrelated to error handling. It is just a way to skip anything else
51  * related to migration on a clean system, by writing
52  * @code
53  * if (migrate()) {
54  * look for old data to migrate as well
55  * }
56  * @endcode
57  */
58  bool migrate();
59 
60  /**
61  * Set the list of config files that need to be migrated.
62  * @param configFileNameList list of config files
63  */
64  void setConfigFiles(const QStringList &configFileNameList);
65 
66  /**
67  * Set the list of ui files to migrate.
68  * @param uiFileNameList list of ui files
69  */
70  void setUiFiles(const QStringList &uiFileNameList);
71 
72 private:
73  friend class Kdelibs4ConfigMigratorPrivate;
74  std::unique_ptr<class Kdelibs4ConfigMigratorPrivate> const d;
75 };
76 
77 #endif // KDELIBS4CONFIGMIGRATOR_H
QCA_EXPORT QString appName()
Kdelibs4ConfigMigrator migrates selected config files and ui files from the kdelibs 4...
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Apr 18 2021 23:02:02 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.