Replace typedef with using

Signed-off-by: LocalSpook <56512186+LocalSpook@users.noreply.github.com>
This commit is contained in:
LocalSpook 2023-10-22 21:34:11 -07:00
parent b376888f43
commit 5be80df1ee
37 changed files with 63 additions and 48 deletions

4
.clang-tidy Normal file
View File

@ -0,0 +1,4 @@
Checks:
- modernize-use-using
SystemHeaders: false

View File

@ -64,7 +64,7 @@ class LaunchTask;
class BaseInstance;
// pointer for lazy people
typedef std::shared_ptr<BaseInstance> InstancePtr;
using InstancePtr = std::shared_ptr<BaseInstance>;
/*!
* \brief Base class for instances.

View File

@ -51,7 +51,7 @@ class BaseVersionList : public QAbstractListModel {
ArchitectureRole,
SortRole
};
typedef QList<int> RoleList;
using RoleList = QList<int>;
explicit BaseVersionList(QObject* parent = 0);

View File

@ -123,26 +123,35 @@ namespace fs = ghc::filesystem;
#if defined(__MINGW32__)
typedef struct _DUPLICATE_EXTENTS_DATA {
struct _DUPLICATE_EXTENTS_DATA {
HANDLE FileHandle;
LARGE_INTEGER SourceFileOffset;
LARGE_INTEGER TargetFileOffset;
LARGE_INTEGER ByteCount;
} DUPLICATE_EXTENTS_DATA, *PDUPLICATE_EXTENTS_DATA;
};
typedef struct _FSCTL_GET_INTEGRITY_INFORMATION_BUFFER {
using DUPLICATE_EXTENTS_DATA = _DUPLICATE_EXTENTS_DATA;
using PDUPLICATE_EXTENTS_DATA = _DUPLICATE_EXTENTS_DATA*;
struct _FSCTL_GET_INTEGRITY_INFORMATION_BUFFER {
WORD ChecksumAlgorithm; // Checksum algorithm. e.g. CHECKSUM_TYPE_UNCHANGED, CHECKSUM_TYPE_NONE, CHECKSUM_TYPE_CRC32
WORD Reserved; // Must be 0
DWORD Flags; // FSCTL_INTEGRITY_FLAG_xxx
DWORD ChecksumChunkSizeInBytes;
DWORD ClusterSizeInBytes;
} FSCTL_GET_INTEGRITY_INFORMATION_BUFFER, *PFSCTL_GET_INTEGRITY_INFORMATION_BUFFER;
};
typedef struct _FSCTL_SET_INTEGRITY_INFORMATION_BUFFER {
using FSCTL_GET_INTEGRITY_INFORMATION_BUFFER = _FSCTL_GET_INTEGRITY_INFORMATION_BUFFER;
using PFSCTL_GET_INTEGRITY_INFORMATION_BUFFER = _FSCTL_GET_INTEGRITY_INFORMATION_BUFFER*;
struct _FSCTL_SET_INTEGRITY_INFORMATION_BUFFER {
WORD ChecksumAlgorithm; // Checksum algorithm. e.g. CHECKSUM_TYPE_UNCHANGED, CHECKSUM_TYPE_NONE, CHECKSUM_TYPE_CRC32
WORD Reserved; // Must be 0
DWORD Flags; // FSCTL_INTEGRITY_FLAG_xxx
} FSCTL_SET_INTEGRITY_INFORMATION_BUFFER, *PFSCTL_SET_INTEGRITY_INFORMATION_BUFFER;
};
using FSCTL_SET_INTEGRITY_INFORMATION_BUFFER = _FSCTL_SET_INTEGRITY_INFORMATION_BUFFER;
using PFSCTL_SET_INTEGRITY_INFORMATION_BUFFER = _FSCTL_SET_INTEGRITY_INFORMATION_BUFFER*;
#endif

View File

@ -172,7 +172,7 @@ class ExportToZipTask : public Task {
void setExcludeFiles(QStringList excludeFiles) { m_exclude_files = excludeFiles; }
void addExtraFile(QString fileName, QByteArray data) { m_extra_files.insert(fileName, data); }
typedef std::optional<QString> ZipResult;
using ZipResult = std::optional<QString>;
protected:
virtual void executeTask() override;

View File

@ -10,7 +10,7 @@ class VersionProxyModel : public QAbstractProxyModel {
Q_OBJECT
public:
enum Column { Name, ParentVersion, Branch, Type, Architecture, Path, Time };
typedef QHash<BaseVersionList::ModelRoles, std::shared_ptr<Filter>> FilterMap;
using FilterMap = QHash<BaseVersionList::ModelRoles, std::shared_ptr<Filter>>;
public:
VersionProxyModel(QObject* parent = 0);

View File

@ -22,8 +22,8 @@ struct JavaCheckResult {
enum class Validity { Errored, ReturnedInvalidData, Valid } validity = Validity::Errored;
};
typedef shared_qobject_ptr<QProcess> QProcessPtr;
typedef shared_qobject_ptr<JavaChecker> JavaCheckerPtr;
using QProcessPtr = shared_qobject_ptr<QProcess>;
using JavaCheckerPtr = shared_qobject_ptr<JavaChecker>;
class JavaChecker : public QObject {
Q_OBJECT
public:

View File

@ -20,7 +20,7 @@
#include "tasks/Task.h"
class JavaCheckerJob;
typedef shared_qobject_ptr<JavaCheckerJob> JavaCheckerJobPtr;
using JavaCheckerJobPtr = shared_qobject_ptr<JavaCheckerJob>;
// FIXME: this just seems horribly redundant
class JavaCheckerJob : public Task {

View File

@ -42,4 +42,4 @@ struct JavaInstall : public BaseVersion {
bool recommended = false;
};
typedef std::shared_ptr<JavaInstall> JavaInstallPtr;
using JavaInstallPtr = std::shared_ptr<JavaInstall>;

View File

@ -6,7 +6,7 @@
class Agent;
typedef std::shared_ptr<Agent> AgentPtr;
using AgentPtr = std::shared_ptr<Agent>;
class Agent {
public:

View File

@ -105,4 +105,4 @@ class Component : public QObject, public ProblemProvider {
bool m_loaded = false;
};
typedef shared_qobject_ptr<Component> ComponentPtr;
using ComponentPtr = shared_qobject_ptr<Component>;

View File

@ -52,7 +52,7 @@
class Library;
class MinecraftInstance;
typedef std::shared_ptr<Library> LibraryPtr;
using LibraryPtr = std::shared_ptr<Library>;
class Library {
friend class OneSixVersionFormat;

View File

@ -174,4 +174,4 @@ class MinecraftInstance : public BaseInstance {
mutable std::shared_ptr<GameOptions> m_game_options;
};
typedef std::shared_ptr<MinecraftInstance> MinecraftInstancePtr;
using MinecraftInstancePtr = std::shared_ptr<MinecraftInstance>;

View File

@ -5,7 +5,7 @@
struct MojangDownloadInfo {
// types
typedef std::shared_ptr<MojangDownloadInfo> Ptr;
using Ptr = std::shared_ptr<MojangDownloadInfo>;
// data
/// Local filesystem path. WARNING: not used, only here so we can pass through mojang files unmolested!
@ -23,7 +23,7 @@ struct MojangLibraryDownloadInfo {
MojangLibraryDownloadInfo() {}
// types
typedef std::shared_ptr<MojangLibraryDownloadInfo> Ptr;
using Ptr = std::shared_ptr<MojangLibraryDownloadInfo>;
// methods
MojangDownloadInfo* getDownloadInfo(QString classifier)
@ -42,7 +42,7 @@ struct MojangLibraryDownloadInfo {
struct MojangAssetIndexInfo : public MojangDownloadInfo {
// types
typedef std::shared_ptr<MojangAssetIndexInfo> Ptr;
using Ptr = std::shared_ptr<MojangAssetIndexInfo>;
// methods
MojangAssetIndexInfo() {}

View File

@ -38,7 +38,7 @@
#include "VersionFile.h"
namespace ProfileUtils {
typedef QStringList PatchOrder;
using PatchOrder = QStringList;
/// Read and parse a OneSix format order file
bool readOverrideOrders(QString path, PatchOrder& order);

View File

@ -43,4 +43,4 @@ struct AuthSession {
bool demo = false;
};
typedef std::shared_ptr<AuthSession> AuthSessionPtr;
using AuthSessionPtr = std::shared_ptr<AuthSession>;

View File

@ -54,7 +54,7 @@ class Task;
class AccountTask;
class MinecraftAccount;
typedef shared_qobject_ptr<MinecraftAccount> MinecraftAccountPtr;
using MinecraftAccountPtr = shared_qobject_ptr<MinecraftAccount>;
Q_DECLARE_METATYPE(MinecraftAccountPtr)
/**

View File

@ -26,4 +26,4 @@ struct MinecraftServerTarget {
static MinecraftServerTarget parse(const QString& fullAddress);
};
typedef std::shared_ptr<MinecraftServerTarget> MinecraftServerTargetPtr;
using MinecraftServerTargetPtr = std::shared_ptr<MinecraftServerTarget>;

View File

@ -4,7 +4,7 @@
#include <QtNetwork/QtNetwork>
#include "tasks/Task.h"
typedef shared_qobject_ptr<class SkinDelete> SkinDeletePtr;
using SkinDeletePtr = shared_qobject_ptr<class SkinDelete>;
class SkinDelete : public Task {
Q_OBJECT

View File

@ -5,7 +5,7 @@
#include <memory>
#include "tasks/Task.h"
typedef shared_qobject_ptr<class SkinUpload> SkinUploadPtr;
using SkinUploadPtr = shared_qobject_ptr<class SkinUpload>;
class SkinUpload : public Task {
Q_OBJECT

View File

@ -45,7 +45,7 @@ struct Modpack {
QIcon icon;
};
typedef QList<Modpack> ModpackList;
using ModpackList = QList<Modpack>;
Modpack parseDirectory(QString path);

View File

@ -31,7 +31,7 @@ struct Modpack {
QString packCode;
};
typedef QList<Modpack> ModpackList;
using ModpackList = QList<Modpack>;
} // namespace LegacyFTB

View File

@ -87,7 +87,7 @@ class NetRequest : public NetAction {
std::unique_ptr<Sink> m_sink;
Options m_options;
typedef const QLoggingCategory& (*logCatFunc)();
using logCatFunc = const QLoggingCategory& (*)();
logCatFunc logCat = taskUploadLogC;
std::chrono::steady_clock m_clock;

View File

@ -51,4 +51,4 @@ class NewsEntry : public QObject {
QString link;
};
typedef std::shared_ptr<NewsEntry> NewsEntryPtr;
using NewsEntryPtr = std::shared_ptr<NewsEntry>;

View File

@ -4,7 +4,7 @@
class IPathMatcher {
public:
typedef std::shared_ptr<IPathMatcher> Ptr;
using Ptr = std::shared_ptr<IPathMatcher>;
public:
virtual ~IPathMatcher() {}

View File

@ -26,8 +26,8 @@
class Setting;
class SettingsObject;
typedef std::shared_ptr<SettingsObject> SettingsObjectPtr;
typedef std::weak_ptr<SettingsObject> SettingsObjectWeakPtr;
using SettingsObjectPtr = std::shared_ptr<SettingsObject>;
using SettingsObjectWeakPtr = std::weak_ptr<SettingsObject>;
/*!
* \brief The SettingsObject handles communicating settings between the application and a

View File

@ -77,7 +77,7 @@ struct TaskStepProgress {
Q_DECLARE_METATYPE(TaskStepProgress)
typedef QList<std::shared_ptr<TaskStepProgress>> TaskStepProgressList;
using TaskStepProgressList = QList<std::shared_ptr<TaskStepProgress>>;
class Task : public QObject, public QRunnable {
Q_OBJECT

View File

@ -43,7 +43,7 @@
#include "FileIgnoreProxy.h"
class BaseInstance;
typedef std::shared_ptr<BaseInstance> InstancePtr;
using InstancePtr = std::shared_ptr<BaseInstance>;
namespace Ui {
class ExportInstanceDialog;

View File

@ -59,7 +59,7 @@ class AccessibleInstanceView : public QAccessibleTableInterface, public QAccessi
protected:
// maybe vector
typedef QHash<int, QAccessible::Id> ChildCache;
using ChildCache = QHash<int, QAccessible::Id>;
mutable ChildCache childToId;
virtual ~AccessibleInstanceView();

View File

@ -77,4 +77,4 @@ class BasePage {
bool isOpened = false;
};
typedef std::shared_ptr<BasePage> BasePagePtr;
using BasePagePtr = std::shared_ptr<BasePage>;

View File

@ -26,7 +26,7 @@ class BasePageProvider {
};
class GenericPageProvider : public BasePageProvider {
typedef std::function<BasePage*()> PageCreator;
using PageCreator = std::function<BasePage*()>;
public:
explicit GenericPageProvider(const QString& dialogTitle) : m_dialogTitle(dialogTitle) {}

View File

@ -68,8 +68,8 @@
#include <FileSystem.h>
#include "RWStorage.h"
typedef RWStorage<QString, QIcon> SharedIconCache;
typedef std::shared_ptr<SharedIconCache> SharedIconCachePtr;
using SharedIconCache = RWStorage<QString, QIcon>;
using SharedIconCachePtr = std::shared_ptr<SharedIconCache>;
class ThumbnailingResult : public QObject {
Q_OBJECT

View File

@ -24,8 +24,8 @@
namespace Atl {
typedef QMap<QString, QIcon> LogoMap;
typedef std::function<void(QString)> LogoCallback;
using LogoMap = QMap<QString, QIcon>;
using LogoCallback = std::function<void(QString)>;
class ListModel : public QAbstractListModel {
Q_OBJECT

View File

@ -19,8 +19,8 @@
namespace Flame {
typedef QMap<QString, QIcon> LogoMap;
typedef std::function<void(QString)> LogoCallback;
using LogoMap = QMap<QString, QIcon>;
using LogoCallback = std::function<void(QString)>;
class ListModel : public QAbstractListModel {
Q_OBJECT

View File

@ -13,8 +13,8 @@
namespace LegacyFTB {
typedef QMap<QString, QIcon> FTBLogoMap;
typedef std::function<void(QString)> LogoCallback;
using FTBLogoMap = QMap<QString, QIcon>;
using LogoCallback = std::function<void(QString)>;
class FilterModel : public QSortFilterProxyModel {
Q_OBJECT

View File

@ -42,7 +42,7 @@
namespace Technic {
typedef std::function<void(QString)> LogoCallback;
using LogoCallback = std::function<void(QString)>;
class ListModel : public QAbstractListModel {
Q_OBJECT

2
libraries/.clang-tidy Normal file
View File

@ -0,0 +1,2 @@
# We don't care about linting third-party code.
Checks: -*