Akonadi

dbconfigmysql.h
1 /*
2  Copyright (c) 2010 Tobias Koenig <[email protected]>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef DBCONFIGMYSQL_H
21 #define DBCONFIGMYSQL_H
22 
23 #include "dbconfig.h"
24 #include <QObject>
25 #include <QProcess>
26 
27 namespace Akonadi
28 {
29 namespace Server
30 {
31 
32 class DbConfigMysql : public QObject, public DbConfig
33 {
34  Q_OBJECT
35 
36 public:
37  DbConfigMysql();
38 
42  QString driverName() const override;
43 
47  QString databaseName() const override;
48 
56  bool init(QSettings &settings) override;
57 
62  void apply(QSqlDatabase &database) override;
63 
67  bool useInternalServer() const override;
68 
72  bool startInternalServer() override;
73 
77  void stopInternalServer() override;
78 
80  void initSession(const QSqlDatabase &database) override;
81 
82 private Q_SLOTS:
83  void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
84 
85 private:
86  int parseCommandLineToolsVersion() const;
87 
88  bool initializeMariaDBDatabase(const QString &confFile, const QString &dataDir) const;
89  bool initializeMySQL5_7_6Database(const QString &confFile, const QString &dataDir) const;
90  bool initializeMySQLDatabase(const QString &confFile, const QString &dataDir) const;
91 
92  QString mDatabaseName;
93  QString mHostName;
94  QString mUserName;
95  QString mPassword;
96  QString mConnectionOptions;
97  QString mMysqldPath;
98  QString mCleanServerShutdownCommand;
99  QString mMysqlInstallDbPath;
100  QString mMysqlCheckPath;
101  bool mInternalServer;
102  QProcess *mDatabaseProcess = nullptr;
103 };
104 
105 } // namespace Server
106 } // namespace Akonadi
107 
108 #endif
QUICKADDONS_EXPORT void init()
Q_OBJECTQ_OBJECT
Helper integration between Akonadi and Qt.
KGuiItem apply()
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon May 25 2020 22:46:08 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.