[libcalamares] Remove Typedefs.h

- This small header file contained a few unrelated typedefs.
   Move those typedefs to the classes they relate to. This
   **does** mean that some consumers need to #include something
   else instead.
 - Use type names more consistently.

Editorial: why are **pages** responsible for creating the jobs?
This commit is contained in:
Adriaan de Groot 2019-05-07 09:51:23 -04:00
parent a99eccf19d
commit 9331a25905
18 changed files with 22 additions and 71 deletions

View File

@ -20,8 +20,6 @@
#ifndef CALAMARESAPPLICATION_H
#define CALAMARESAPPLICATION_H
#include "Typedefs.h"
#include <QApplication>
class CalamaresWindow;

View File

@ -24,7 +24,6 @@
#include <QVariant>
#include "DllMacro.h"
#include "Typedefs.h"
#include "Job.h"
namespace Calamares

View File

@ -20,9 +20,10 @@
#define CALAMARES_JOB_H
#include "DllMacro.h"
#include "Typedefs.h"
#include <QList>
#include <QObject>
#include <QSharedPointer>
namespace Calamares {
@ -97,6 +98,9 @@ private:
bool m_emergency = false;
};
using job_ptr = QSharedPointer< Job >;
using JobList = QList< job_ptr >;
} // namespace Calamares
#endif // CALAMARES_JOB_H

View File

@ -20,7 +20,7 @@
#define CALAMARES_JOBQUEUE_H
#include "DllMacro.h"
#include "Typedefs.h"
#include "Job.h"
#include <QObject>

View File

@ -1,37 +0,0 @@
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calamares is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TYPEDEFS_H
#define TYPEDEFS_H
#include <QList>
#include <QSharedPointer>
namespace Calamares
{
class Job;
typedef QSharedPointer< Job > job_ptr;
using JobList = QList< job_ptr >;
class ViewStep;
typedef QList< ViewStep* > ViewStepList;
} //ns
#endif // TYPEDEFS_H

View File

@ -22,7 +22,6 @@
#define BRANDING_H
#include "UiDllMacro.h"
#include "Typedefs.h"
#include "utils/NamedSuffix.h"

View File

@ -21,19 +21,14 @@
#define VIEWMANAGER_H
#include "UiDllMacro.h"
#include "Typedefs.h"
#include "viewpages/ViewStep.h"
#include <QList>
#include <QPushButton>
#include <QStackedWidget>
namespace Calamares
{
class ViewStep;
class ExecutionViewStep;
/**
* @brief The ViewManager class handles progression through view pages.
* @note Singleton object, only use through ViewManager::instance().

View File

@ -20,11 +20,10 @@
#ifndef CALAMARES_MODULE_H
#define CALAMARES_MODULE_H
#include "Job.h"
#include "Requirement.h"
#include "UiDllMacro.h"
#include <Typedefs.h>
#include <QStringList>
#include <QVariant>

View File

@ -21,7 +21,6 @@
#define MODULELOADER_H
#include "Requirement.h"
#include "Typedefs.h"
#include <QObject>
#include <QStringList>

View File

@ -20,10 +20,11 @@
#ifndef VIEWSTEP_H
#define VIEWSTEP_H
#include <QList>
#include <QObject>
#include <QSize>
#include "Typedefs.h"
#include "Job.h"
#include "UiDllMacro.h"
#include "modulesystem/Requirement.h"
@ -159,6 +160,7 @@ protected:
QString m_instanceKey;
};
using ViewStepList = QList< ViewStep* >;
}
#endif // VIEWSTEP_H

View File

@ -24,13 +24,11 @@
#ifndef KEYBOARDPAGE_H
#define KEYBOARDPAGE_H
#include "keyboardwidget/keyboardglobal.h"
#include "Typedefs.h"
#include "Job.h"
#include <QListWidgetItem>
#include <QWidget>
#include <QTimer>
#include <QWidget>
namespace Ui
{
@ -50,7 +48,7 @@ public:
QString prettyStatus() const;
QList< Calamares::job_ptr > createJobs( const QString& xOrgConfFileName,
Calamares::JobList createJobs( const QString& xOrgConfFileName,
const QString& convertedKeymapPath,
bool writeEtcDefaultKeyboard );

View File

@ -20,9 +20,8 @@
#ifndef LOCALEPAGE_H
#define LOCALEPAGE_H
#include "Typedefs.h"
#include "LocaleConfiguration.h"
#include "Job.h"
#include <QWidget>
@ -44,7 +43,7 @@ public:
QString prettyStatus() const;
QList< Calamares::job_ptr > createJobs();
Calamares::JobList createJobs();
QMap< QString, QString > localesMap();

View File

@ -23,7 +23,6 @@
#include "PackageModel.h"
#include "PackageTreeItem.h"
#include "Typedefs.h"
#include <QAbstractButton>
#include <QNetworkAccessManager>

View File

@ -50,7 +50,6 @@
#ifdef DEBUG_PARTITION_LAME
#include "JobExample.h"
#endif
#include "Typedefs.h"
#include "utils/Logger.h"
// KPMcore

View File

@ -24,7 +24,8 @@
#include "core/KPMHelpers.h"
#include "core/PartitionLayout.h"
#include "core/PartitionModel.h"
#include "Typedefs.h"
#include "Job.h"
// KPMcore
#include <kpmcore/core/lvmdevice.h>
@ -172,7 +173,7 @@ public:
* requested by the user.
* @return a list of jobs.
*/
QList< Calamares::job_ptr > jobs() const;
Calamares::JobList jobs() const;
bool hasRootMountPoint() const;

View File

@ -22,8 +22,6 @@
#include "core/PartUtils.h"
#include "Typedefs.h"
// KPMcore
#include <kpmcore/core/partitiontable.h>
#include <kpmcore/fs/filesystem.h>

View File

@ -19,7 +19,7 @@
#ifndef SUMMARYPAGE_H
#define SUMMARYPAGE_H
#include "Typedefs.h"
#include "viewpages/ViewStep.h"
#include <QWidget>

View File

@ -24,9 +24,8 @@
#ifndef USERSPAGE_H
#define USERSPAGE_H
#include "Typedefs.h"
#include "CheckPWQuality.h"
#include "Job.h"
#include <QWidget>
@ -44,7 +43,7 @@ public:
bool isReady();
QList< Calamares::job_ptr > createJobs( const QStringList& defaultGroupsList );
Calamares::JobList createJobs( const QStringList& defaultGroupsList );
void onActivate();