diff options
| author | Tannin <devnull@localhost> | 2014-11-28 11:19:20 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2014-11-28 11:19:20 +0100 |
| commit | 99de80e7224f2491fb7518e32f195ad6a912b624 (patch) | |
| tree | ef8f1d3ba16b7681beaae5cf67d0f5671e486061 /src/installationmanager.cpp | |
| parent | 78f628e0af2f2df562c40ac1424b432b6a969055 (diff) | |
replaced all uses of NULL with nullptr
fixed a few placed where NULL was used as a number or boolean
Diffstat (limited to 'src/installationmanager.cpp')
| -rw-r--r-- | src/installationmanager.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp index 25fe06a4..6ab051b2 100644 --- a/src/installationmanager.cpp +++ b/src/installationmanager.cpp @@ -60,7 +60,7 @@ typedef Archive* (*CreateArchiveType)(); template <typename T> T resolveFunction(QLibrary &lib, const char *name)
{
T temp = reinterpret_cast<T>(lib.resolve(name));
- if (temp == NULL) {
+ if (temp == nullptr) {
throw std::runtime_error(QObject::tr("invalid 7-zip32.dll: %1").arg(lib.errorString()).toLatin1().constData());
}
return temp;
@@ -94,7 +94,7 @@ InstallationManager::~InstallationManager() void InstallationManager::setParentWidget(QWidget *widget)
{
- m_InstallationProgress.setParent(widget);
+ m_InstallationProgress.setParent(widget, Qt::Dialog);
for (IPluginInstaller *installer : m_Installers) {
installer->setParentWidget(widget);
}
@@ -103,7 +103,7 @@ void InstallationManager::setParentWidget(QWidget *widget) void InstallationManager::queryPassword(LPSTR password)
{
- QString result = QInputDialog::getText(NULL, tr("Password required"), tr("Password"), QLineEdit::Password);
+ QString result = QInputDialog::getText(nullptr, tr("Password required"), tr("Password"), QLineEdit::Password);
strncpy(password, result.toLocal8Bit().constData(), MAX_PASSWORD_LENGTH);
}
@@ -231,10 +231,10 @@ QStringList InstallationManager::extractFiles(const QStringList &filesOrig, bool const wchar_t *targetFile = data[i]->getFileName();
if (flatten) {
targetFile = wcsrchr(data[i]->getFileName(), '\\');
- if (targetFile == NULL) {
+ if (targetFile == nullptr) {
targetFile = wcsrchr(data[i]->getFileName(), '/');
}
- if (targetFile == NULL) {
+ if (targetFile == nullptr) {
qCritical("failed to find backslash in %ls", data[i]->getFileName());
continue;
} else {
@@ -383,7 +383,7 @@ DirectoryTree::Node *InstallationManager::getSimpleArchiveBase(DirectoryTree *da currentNode = *currentNode->nodesBegin();
} else {
qDebug("not a simple archive");
- return NULL;
+ return nullptr;
}
}
}
@@ -675,7 +675,7 @@ bool InstallationManager::install(const QString &fileName, GuessedValue<QString> }
ON_BLOCK_EXIT(std::bind(&InstallationManager::postInstallCleanup, this));
- QScopedPointer<DirectoryTree> filesTree(archiveOpen ? createFilesTree() : NULL);
+ QScopedPointer<DirectoryTree> filesTree(archiveOpen ? createFilesTree() : nullptr);
IPluginInstaller::EInstallResult installResult = IPluginInstaller::RESULT_NOTATTEMPTED;
std::sort(m_Installers.begin(), m_Installers.end(), [] (IPluginInstaller *LHS, IPluginInstaller *RHS) {
@@ -700,8 +700,8 @@ bool InstallationManager::install(const QString &fileName, GuessedValue<QString> try {
{ // simple case
IPluginInstallerSimple *installerSimple = dynamic_cast<IPluginInstallerSimple*>(installer);
- if ((installerSimple != NULL) &&
- (filesTree != NULL) && (installer->isArchiveSupported(*filesTree))) {
+ if ((installerSimple != nullptr) &&
+ (filesTree != nullptr) && (installer->isArchiveSupported(*filesTree))) {
installResult = installerSimple->install(modName, *filesTree, version, modID);
if (installResult == IPluginInstaller::RESULT_SUCCESS) {
mapToArchive(filesTree.data());
@@ -715,9 +715,9 @@ bool InstallationManager::install(const QString &fileName, GuessedValue<QString> { // custom case
IPluginInstallerCustom *installerCustom = dynamic_cast<IPluginInstallerCustom*>(installer);
- if ((installerCustom != NULL) &&
- (((filesTree != NULL) && installer->isArchiveSupported(*filesTree)) ||
- ((filesTree == NULL) && installerCustom->isArchiveSupported(fileName)))) {
+ if ((installerCustom != nullptr) &&
+ (((filesTree != nullptr) && installer->isArchiveSupported(*filesTree)) ||
+ ((filesTree == nullptr) && installerCustom->isArchiveSupported(fileName)))) {
std::set<QString> installerExtensions = installerCustom->supportedExtensions();
if (installerExtensions.find(fileInfo.suffix()) != installerExtensions.end()) {
installResult = installerCustom->install(modName, fileName, version, modID);
@@ -738,7 +738,7 @@ bool InstallationManager::install(const QString &fileName, GuessedValue<QString> } break;
case IPluginInstaller::RESULT_SUCCESS:
case IPluginInstaller::RESULT_SUCCESSCANCEL: {
- if (filesTree != NULL) {
+ if (filesTree != nullptr) {
DirectoryTree::node_iterator iniTweakNode = filesTree->nodeFind(DirectoryTreeInformation("INI Tweaks"));
hasIniTweaks = (iniTweakNode != filesTree->nodesEnd()) &&
((*iniTweakNode)->numLeafs() != 0);
@@ -796,7 +796,7 @@ void InstallationManager::registerInstaller(IPluginInstaller *installer) m_Installers.push_back(installer);
installer->setInstallationManager(this);
IPluginInstallerCustom *installerCustom = dynamic_cast<IPluginInstallerCustom*>(installer);
- if (installerCustom != NULL) {
+ if (installerCustom != nullptr) {
std::set<QString> extensions = installerCustom->supportedExtensions();
m_SupportedExtensions.insert(extensions.begin(), extensions.end());
}
|
