From 9dacee18f9b7211699164bc70dd17f9934a15f50 Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Thu, 1 Nov 2018 10:38:13 +0200 Subject: Replace 0 with nullptr Prevents a lot of warnings seen in QtCreator Change-Id: I63bf95aca68a04fc9fd0eecbe29c63e9b9c47efd Reviewed-by: Iikka Eklund --- src/libs/installer/binaryformat.cpp | 2 +- src/libs/installer/binaryformatengine.cpp | 2 +- src/libs/installer/binaryformatenginehandler.cpp | 2 +- src/libs/installer/component_p.cpp | 12 ++--- src/libs/installer/componentmodel.cpp | 2 +- src/libs/installer/componentselectionpage_p.cpp | 2 +- src/libs/installer/copyfiletask.cpp | 2 +- .../installer/createlocalrepositoryoperation.cpp | 2 +- src/libs/installer/createshortcutoperation.cpp | 8 +-- src/libs/installer/downloadarchivesjob.cpp | 14 ++--- src/libs/installer/elevatedexecuteoperation.cpp | 4 +- .../installer/environmentvariablesoperation.cpp | 4 +- src/libs/installer/fileutils.cpp | 6 +-- src/libs/installer/globalsettingsoperation.cpp | 4 +- src/libs/installer/init.cpp | 2 +- src/libs/installer/keepaliveobject.cpp | 4 +- src/libs/installer/lib7z_facade.cpp | 16 +++--- src/libs/installer/link.cpp | 14 ++--- src/libs/installer/messageboxhandler.cpp | 12 ++--- src/libs/installer/metadatajob.cpp | 2 +- src/libs/installer/packagemanagercore.cpp | 10 ++-- src/libs/installer/packagemanagercore_p.cpp | 62 +++++++++++----------- src/libs/installer/packagemanagercoredata.cpp | 2 +- src/libs/installer/packagemanagergui.cpp | 44 +++++++-------- src/libs/installer/performinstallationform.cpp | 12 ++--- src/libs/installer/progresscoordinator.cpp | 4 +- src/libs/installer/qprocesswrapper.cpp | 2 +- src/libs/installer/registerfiletypeoperation.cpp | 4 +- src/libs/installer/remoteclient.cpp | 4 +- src/libs/installer/remoteobject.cpp | 6 +-- src/libs/installer/remoteserverconnection.cpp | 10 ++-- src/libs/installer/scriptengine.cpp | 2 +- src/libs/installer/settings.cpp | 2 +- src/libs/installer/sysinfo_win.cpp | 6 +-- src/libs/installer/unziptask.cpp | 6 +-- src/libs/installer/utils.cpp | 20 +++---- 36 files changed, 156 insertions(+), 156 deletions(-) (limited to 'src/libs') diff --git a/src/libs/installer/binaryformat.cpp b/src/libs/installer/binaryformat.cpp index 42c94ab1d..9a46095ce 100644 --- a/src/libs/installer/binaryformat.cpp +++ b/src/libs/installer/binaryformat.cpp @@ -293,7 +293,7 @@ void ResourceCollection::setName(const QByteArray &name) void ResourceCollection::appendResource(const QSharedPointer& resource) { Q_ASSERT(resource); - resource->setParent(0); + resource->setParent(nullptr); m_resources.append(resource); } diff --git a/src/libs/installer/binaryformatengine.cpp b/src/libs/installer/binaryformatengine.cpp index 1100bcf08..ec6926031 100644 --- a/src/libs/installer/binaryformatengine.cpp +++ b/src/libs/installer/binaryformatengine.cpp @@ -81,7 +81,7 @@ namespace QInstaller { */ BinaryFormatEngine::BinaryFormatEngine(const QHash &collections, const QString &fileName) - : m_resource(0) + : m_resource(nullptr) , m_collections(collections) { setFileName(fileName); diff --git a/src/libs/installer/binaryformatenginehandler.cpp b/src/libs/installer/binaryformatenginehandler.cpp index fffb248b9..885888912 100644 --- a/src/libs/installer/binaryformatenginehandler.cpp +++ b/src/libs/installer/binaryformatenginehandler.cpp @@ -48,7 +48,7 @@ namespace QInstaller { QAbstractFileEngine *BinaryFormatEngineHandler::create(const QString &fileName) const { return fileName.startsWith(QLatin1String("installer://"), Qt::CaseInsensitive ) - ? new BinaryFormatEngine(m_resources, fileName) : 0; + ? new BinaryFormatEngine(m_resources, fileName) : nullptr; } /*! diff --git a/src/libs/installer/component_p.cpp b/src/libs/installer/component_p.cpp index 5f44f83a4..5a5284a4b 100644 --- a/src/libs/installer/component_p.cpp +++ b/src/libs/installer/component_p.cpp @@ -41,9 +41,9 @@ namespace QInstaller { ComponentPrivate::ComponentPrivate(PackageManagerCore *core, Component *qq) : q(qq) , m_core(core) - , m_parentComponent(0) - , m_licenseOperation(0) - , m_minimumProgressOperation(0) + , m_parentComponent(nullptr) + , m_licenseOperation(nullptr) + , m_minimumProgressOperation(nullptr) , m_newlyInstalled (false) , m_operationsCreated(false) , m_autoCreateOperations(true) @@ -98,11 +98,11 @@ int ComponentModelHelper::childCount() const Component *ComponentModelHelper::childAt(int index) const { if (index < 0 && index >= childCount()) - return 0; + return nullptr; if (m_componentPrivate->m_core->virtualComponentsVisible()) - return m_componentPrivate->m_allChildComponents.value(index, 0); - return m_componentPrivate->m_childComponents.value(index, 0); + return m_componentPrivate->m_allChildComponents.value(index, nullptr); + return m_componentPrivate->m_childComponents.value(index, nullptr); } /*! diff --git a/src/libs/installer/componentmodel.cpp b/src/libs/installer/componentmodel.cpp index e729f3088..186b37e41 100644 --- a/src/libs/installer/componentmodel.cpp +++ b/src/libs/installer/componentmodel.cpp @@ -378,7 +378,7 @@ Component *ComponentModel::componentFromIndex(const QModelIndex &index) const { if (index.isValid()) return static_cast(index.internalPointer()); - return 0; + return nullptr; } diff --git a/src/libs/installer/componentselectionpage_p.cpp b/src/libs/installer/componentselectionpage_p.cpp index 22c478beb..9b8c86efb 100644 --- a/src/libs/installer/componentselectionpage_p.cpp +++ b/src/libs/installer/componentselectionpage_p.cpp @@ -380,7 +380,7 @@ void ComponentSelectionPagePrivate::customButtonClicked(int which) if (QWizard::WizardButton(which) == QWizard::CustomButton2) { QString defaultDownloadDirectory = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation); - QStringList fileNames = QFileDialog::getOpenFileNames(NULL, + QStringList fileNames = QFileDialog::getOpenFileNames(nullptr, ComponentSelectionPage::tr("Open File"),defaultDownloadDirectory, QLatin1String("QBSP or 7z Files (*.qbsp *.7z)")); diff --git a/src/libs/installer/copyfiletask.cpp b/src/libs/installer/copyfiletask.cpp index fdde9b15d..50626b682 100644 --- a/src/libs/installer/copyfiletask.cpp +++ b/src/libs/installer/copyfiletask.cpp @@ -104,7 +104,7 @@ void CopyFileTask::doTask(QFutureInterface &fi) } observer.addSample(read); - observer.timerEvent(NULL); + observer.timerEvent(nullptr); observer.addBytesTransfered(read); observer.addCheckSumData(buffer.data(), read); diff --git a/src/libs/installer/createlocalrepositoryoperation.cpp b/src/libs/installer/createlocalrepositoryoperation.cpp index 8f6ab2eaa..a2f7806a3 100644 --- a/src/libs/installer/createlocalrepositoryoperation.cpp +++ b/src/libs/installer/createlocalrepositoryoperation.cpp @@ -251,7 +251,7 @@ bool CreateLocalRepositoryOperation::performOperation() // start to read the binary layout ResourceCollectionManager manager; - BinaryContent::readBinaryContent(&file, 0, &manager, 0, BinaryContent::MagicCookie); + BinaryContent::readBinaryContent(&file, nullptr, &manager, 0, BinaryContent::MagicCookie); emit progressChanged(0.65); diff --git a/src/libs/installer/createshortcutoperation.cpp b/src/libs/installer/createshortcutoperation.cpp index 2c2e96eff..bbe3feba1 100644 --- a/src/libs/installer/createshortcutoperation.cpp +++ b/src/libs/installer/createshortcutoperation.cpp @@ -50,7 +50,7 @@ typedef ITEMIDLIST *PIDLIST_ABSOLUTE; struct DeCoInitializer { DeCoInitializer() - : neededCoInit(CoInitialize(NULL) == S_OK) + : neededCoInit(CoInitialize(nullptr) == S_OK) { } ~DeCoInitializer() @@ -100,12 +100,12 @@ static bool createLink(const QString &fileName, const QString &linkName, QString // CoInitialize cleanup object DeCoInitializer _; - IUnknown *iunkn = NULL; + IUnknown *iunkn = nullptr; if (fileName.toLower().startsWith(QLatin1String("http:")) || fileName.toLower().startsWith(QLatin1String("ftp:"))) { - IUniformResourceLocator *iurl = NULL; - if (FAILED(CoCreateInstance(CLSID_InternetShortcut, NULL, CLSCTX_INPROC_SERVER, + IUniformResourceLocator *iurl = nullptr; + if (FAILED(CoCreateInstance(CLSID_InternetShortcut, nullptr, CLSCTX_INPROC_SERVER, IID_IUniformResourceLocator, (LPVOID*)&iurl))) { return false; } diff --git a/src/libs/installer/downloadarchivesjob.cpp b/src/libs/installer/downloadarchivesjob.cpp index 80c094ae0..102783133 100644 --- a/src/libs/installer/downloadarchivesjob.cpp +++ b/src/libs/installer/downloadarchivesjob.cpp @@ -49,7 +49,7 @@ using namespace KDUpdater; DownloadArchivesJob::DownloadArchivesJob(PackageManagerCore *core) : Job(core) , m_core(core) - , m_downloader(0) + , m_downloader(nullptr) , m_archivesDownloaded(0) , m_archivesToDownloadCount(0) , m_canceled(false) @@ -93,7 +93,7 @@ void DownloadArchivesJob::doStart() void DownloadArchivesJob::doCancel() { m_canceled = true; - if (m_downloader != 0) + if (m_downloader != nullptr) m_downloader->cancelDownload(); } @@ -130,7 +130,7 @@ void DownloadArchivesJob::fetchNextArchiveHash() void DownloadArchivesJob::finishedHashDownload() { - Q_ASSERT(m_downloader != 0); + Q_ASSERT(m_downloader != nullptr); QFile sha1HashFile(m_downloader->downloadedFileName()); if (sha1HashFile.open(QFile::ReadOnly)) { @@ -156,7 +156,7 @@ void DownloadArchivesJob::fetchNextArchive() return; } - if (m_downloader != 0) + if (m_downloader != nullptr) m_downloader->deleteLater(); m_downloader = setupDownloader(QString(), m_core->value(scUrlQueryString)); @@ -202,7 +202,7 @@ void DownloadArchivesJob::timerEvent(QTimerEvent *event) */ void DownloadArchivesJob::registerFile() { - Q_ASSERT(m_downloader != 0); + Q_ASSERT(m_downloader != nullptr); if (m_canceled) return; @@ -259,7 +259,7 @@ void DownloadArchivesJob::finishWithError(const QString &error) { const FileDownloader *const dl = qobject_cast (sender()); const QString msg = tr("Cannot fetch archives: %1\nError while loading %2"); - if (dl != 0) + if (dl != nullptr) emitFinishedWithError(QInstaller::DownloadError, msg.arg(error, dl->url().toString())); else emitFinishedWithError(QInstaller::DownloadError, msg.arg(error, m_downloader->url().toString())); @@ -267,7 +267,7 @@ void DownloadArchivesJob::finishWithError(const QString &error) KDUpdater::FileDownloader *DownloadArchivesJob::setupDownloader(const QString &suffix, const QString &queryString) { - KDUpdater::FileDownloader *downloader = 0; + KDUpdater::FileDownloader *downloader = nullptr; const QFileInfo fi = QFileInfo(m_archivesToDownload.first().first); const Component *const component = m_core->componentByName(PackageManagerCore::checkableName(QFileInfo(fi.path()).fileName())); if (component) { diff --git a/src/libs/installer/elevatedexecuteoperation.cpp b/src/libs/installer/elevatedexecuteoperation.cpp index 2cc988a4d..aa88f0398 100644 --- a/src/libs/installer/elevatedexecuteoperation.cpp +++ b/src/libs/installer/elevatedexecuteoperation.cpp @@ -43,7 +43,7 @@ class ElevatedExecuteOperation::Private public: explicit Private(ElevatedExecuteOperation *qq) : q(qq) - , process(0) + , process(nullptr) , showStandardError(false) { } @@ -221,7 +221,7 @@ bool ElevatedExecuteOperation::Private::run(const QStringList &arguments) Q_ASSERT(process); Q_ASSERT(process->state() == QProcessWrapper::NotRunning); delete process; - process = 0; + process = nullptr; return returnValue; } diff --git a/src/libs/installer/environmentvariablesoperation.cpp b/src/libs/installer/environmentvariablesoperation.cpp index 7a8dbfb5a..006ea3762 100644 --- a/src/libs/installer/environmentvariablesoperation.cpp +++ b/src/libs/installer/environmentvariablesoperation.cpp @@ -83,8 +83,8 @@ bool handleRegExpandSz(const QString ®Path, const QString &name, if (res == ERROR_SUCCESS) { DWORD dataType; DWORD dataSize; - res = RegQueryValueEx(handle, reinterpret_cast(name.utf16()), 0, - &dataType, 0, &dataSize); + res = RegQueryValueEx(handle, reinterpret_cast(name.utf16()), nullptr, + &dataType, nullptr, &dataSize); setAsExpandSZ = (res == ERROR_SUCCESS) && (dataType == REG_EXPAND_SZ); if (setAsExpandSZ) { RegCloseKey(handle); diff --git a/src/libs/installer/fileutils.cpp b/src/libs/installer/fileutils.cpp index c142b55f1..590654ed7 100644 --- a/src/libs/installer/fileutils.cpp +++ b/src/libs/installer/fileutils.cpp @@ -239,7 +239,7 @@ void QInstaller::removeDirectory(const QString &path, bool ignoreErrors) class RemoveDirectoryThread : public QThread { public: - explicit RemoveDirectoryThread(const QString &path, bool ignoreErrors = false, QObject *parent = 0) + explicit RemoveDirectoryThread(const QString &path, bool ignoreErrors = false, QObject *parent = nullptr) : QThread(parent) , p(path) , ignore(ignoreErrors) @@ -411,7 +411,7 @@ QString QInstaller::getShortPathName(const QString &name) // Determine length, then convert. const LPCTSTR nameC = reinterpret_cast(name.utf16()); // MinGW - const DWORD length = GetShortPathName(nameC, NULL, 0); + const DWORD length = GetShortPathName(nameC, nullptr, 0); if (length == 0) return name; QScopedArrayPointer buffer(new TCHAR[length]); @@ -427,7 +427,7 @@ QString QInstaller::getLongPathName(const QString &name) // Determine length, then convert. const LPCTSTR nameC = reinterpret_cast(name.utf16()); // MinGW - const DWORD length = GetLongPathName(nameC, NULL, 0); + const DWORD length = GetLongPathName(nameC, nullptr, 0); if (length == 0) return name; QScopedArrayPointer buffer(new TCHAR[length]); diff --git a/src/libs/installer/globalsettingsoperation.cpp b/src/libs/installer/globalsettingsoperation.cpp index f8f7c112d..0840cecf2 100644 --- a/src/libs/installer/globalsettingsoperation.cpp +++ b/src/libs/installer/globalsettingsoperation.cpp @@ -96,7 +96,7 @@ bool GlobalSettingsOperation::testOperation() QSettingsWrapper *GlobalSettingsOperation::setup(QString *key, QString *value, const QStringList &arguments) { if (!checkArgumentCount(3, 5)) - return 0; + return nullptr; if (arguments.count() == 5) { QSettingsWrapper::Scope scope = QSettingsWrapper::UserScope; @@ -120,5 +120,5 @@ QSettingsWrapper *GlobalSettingsOperation::setup(QString *key, QString *value, c return new QSettingsWrapper(filename, QSettingsWrapper::NativeFormat); } - return 0; + return nullptr; } diff --git a/src/libs/installer/init.cpp b/src/libs/installer/init.cpp index 285c7ebc9..8a13119b0 100644 --- a/src/libs/installer/init.cpp +++ b/src/libs/installer/init.cpp @@ -130,7 +130,7 @@ void messageHandler(QtMsgType type, const QMessageLogContext &context, const QSt std::cout << qPrintable(ba) << std::endl; if (type == QtFatalMsg) { - QtMessageHandler oldMsgHandler = qInstallMessageHandler(0); + QtMessageHandler oldMsgHandler = qInstallMessageHandler(nullptr); qt_message_output(type, context, msg); qInstallMessageHandler(oldMsgHandler); } diff --git a/src/libs/installer/keepaliveobject.cpp b/src/libs/installer/keepaliveobject.cpp index 6f56d7823..f3b4e7779 100644 --- a/src/libs/installer/keepaliveobject.cpp +++ b/src/libs/installer/keepaliveobject.cpp @@ -35,8 +35,8 @@ namespace QInstaller { KeepAliveObject::KeepAliveObject() - : m_timer(0) - , m_socket(0) + : m_timer(nullptr) + , m_socket(nullptr) { } diff --git a/src/libs/installer/lib7z_facade.cpp b/src/libs/installer/lib7z_facade.cpp index f5561af2f..b3b3319e8 100644 --- a/src/libs/installer/lib7z_facade.cpp +++ b/src/libs/installer/lib7z_facade.cpp @@ -64,7 +64,7 @@ #include #ifdef Q_OS_WIN -HINSTANCE g_hInstance = 0; +HINSTANCE g_hInstance = nullptr; # define S_IFMT 00170000 # define S_IFLNK 0120000 @@ -353,16 +353,16 @@ static quint32 getUInt32Property(IInArchive *archive, int index, int propId, qui static QFile::Permissions getPermissions(IInArchive *archive, int index, bool *hasPermissions) { quint32 attributes = getUInt32Property(archive, index, kpidAttrib, 0); - QFile::Permissions permissions = 0; + QFile::Permissions permissions = nullptr; if (attributes & FILE_ATTRIBUTE_UNIX_EXTENSION) { - if (hasPermissions != 0) + if (hasPermissions != nullptr) *hasPermissions = true; // filter the Unix permissions attributes = (attributes >> 16) & 0777; permissions |= static_cast((attributes & 0700) << 2); // owner rights permissions |= static_cast((attributes & 0070) << 1); // group permissions |= static_cast((attributes & 0007) << 0); // and world rights - } else if (hasPermissions != 0) { + } else if (hasPermissions != nullptr) { *hasPermissions = false; } return permissions; @@ -536,7 +536,7 @@ QVector listArchive(QFileDevice *archive) f.archiveIndex.setY(item); f.path = UString2QString(s).replace(QLatin1Char('\\'), QLatin1Char('/')); Archive_IsItem_Folder(arch, item, f.isDirectory); - f.permissions = getPermissions(arch, item, 0); + f.permissions = getPermissions(arch, item, nullptr); getDateTimeProperty(arch, item, kpidMTime, &(f.utcTime)); f.uncompressedSize = getUInt64Property(arch, item, kpidSize, 0); f.compressedSize = getUInt64Property(arch, item, kpidPackSize, 0); @@ -579,7 +579,7 @@ STDMETHODIMP ExtractCallback::SetCompleted(const UInt64 *c) // CDecoder::CodeSpec extracted content to an output stream. STDMETHODIMP ExtractCallback::GetStream(UInt32 index, ISequentialOutStream **outStream, Int32 /*askExtractMode*/) { - *outStream = 0; + *outStream = nullptr; if (targetDir.isEmpty()) return E_FAIL; @@ -790,14 +790,14 @@ HRESULT UpdateCallback::OpenFileError(const wchar_t*, DWORD) HRESULT UpdateCallback::CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password) { - *password = 0; + *password = nullptr; *passwordIsDefined = false; return S_OK; } HRESULT UpdateCallback::CryptoGetTextPassword(BSTR *password) { - *password = 0; + *password = nullptr; return E_NOTIMPL; } diff --git a/src/libs/installer/link.cpp b/src/libs/installer/link.cpp index ef91828ce..62ba06cb2 100644 --- a/src/libs/installer/link.cpp +++ b/src/libs/installer/link.cpp @@ -84,8 +84,8 @@ public: : m_dirHandle(INVALID_HANDLE_VALUE) { QString normalizedPath = QString(path).replace(QLatin1Char('/'), QLatin1Char('\\')); - m_dirHandle = CreateFile((wchar_t*)normalizedPath.utf16(), GENERIC_READ | GENERIC_WRITE, 0, 0, - OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, 0); + m_dirHandle = CreateFile((wchar_t*)normalizedPath.utf16(), GENERIC_READ | GENERIC_WRITE, 0, nullptr, + OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, nullptr); if (m_dirHandle == INVALID_HANDLE_VALUE) { qWarning() << "Cannot open" << path << ":" << QInstaller::windowsErrorString(GetLastError()); @@ -112,7 +112,7 @@ QString readWindowsSymLink(const QString &path) if (dirHandle.handle() != INVALID_HANDLE_VALUE) { REPARSE_DATA_BUFFER* reparseStructData = (REPARSE_DATA_BUFFER*)calloc(1, MAXIMUM_REPARSE_DATA_BUFFER_SIZE); DWORD bytesReturned = 0; - if (::DeviceIoControl(dirHandle.handle(), FSCTL_GET_REPARSE_POINT, 0, 0, reparseStructData, + if (::DeviceIoControl(dirHandle.handle(), FSCTL_GET_REPARSE_POINT, nullptr, 0, reparseStructData, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &bytesReturned, 0)) { if (reparseStructData->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) { int length = reparseStructData->MountPointReparseBuffer.SubstituteNameLength / sizeof(wchar_t); @@ -170,8 +170,8 @@ Link createJunction(const QString &linkPath, const QString &targetPath) DWORD bytesReturned; if (!::DeviceIoControl(dirHandle.handle(), FSCTL_SET_REPARSE_POINT, reparseStructData, - reparseStructData->ReparseDataLength + REPARSE_DATA_BUFFER_HEADER_SIZE, 0, 0, - &bytesReturned, 0)) { + reparseStructData->ReparseDataLength + REPARSE_DATA_BUFFER_HEADER_SIZE, nullptr, 0, + &bytesReturned, nullptr)) { qWarning() << "Cannot set the reparse point for" << linkPath << "to" << targetPath << ":" << QInstaller::windowsErrorString(GetLastError()); } @@ -191,8 +191,8 @@ bool removeJunction(const QString &path) DWORD bytesReturned; if (!::DeviceIoControl(dirHandle.handle(), FSCTL_DELETE_REPARSE_POINT, reparseStructData, - REPARSE_GUID_DATA_BUFFER_HEADER_SIZE, 0, 0, - &bytesReturned, 0)) { + REPARSE_GUID_DATA_BUFFER_HEADER_SIZE, nullptr, 0, + &bytesReturned, nullptr)) { qWarning() << "Cannot remove the reparse point" << path << ":" << QInstaller::windowsErrorString(GetLastError()); return false; diff --git a/src/libs/installer/messageboxhandler.cpp b/src/libs/installer/messageboxhandler.cpp index fcdee4a5f..286009e21 100644 --- a/src/libs/installer/messageboxhandler.cpp +++ b/src/libs/installer/messageboxhandler.cpp @@ -107,7 +107,7 @@ using namespace QInstaller; Reports non-critical errors. */ -MessageBoxHandler *MessageBoxHandler::m_instance = 0; +MessageBoxHandler *MessageBoxHandler::m_instance = nullptr; MessageBoxHandler::MessageBoxHandler(QObject *parent) : QObject(parent) @@ -120,7 +120,7 @@ MessageBoxHandler::MessageBoxHandler(QObject *parent) */ MessageBoxHandler *MessageBoxHandler::instance() { - if (m_instance == 0) + if (m_instance == nullptr) m_instance = new MessageBoxHandler(qApp); return m_instance; } @@ -131,8 +131,8 @@ MessageBoxHandler *MessageBoxHandler::instance() */ QWidget *MessageBoxHandler::currentBestSuitParent() { - if (qobject_cast (qApp) == 0) - return 0; + if (qobject_cast (qApp) == nullptr) + return nullptr; if (qApp->activeModalWidget()) return qApp->activeModalWidget(); @@ -363,7 +363,7 @@ static QMessageBox::StandardButton showNewMessageBox(QWidget *parent, QMessageBo { QMessageBox msgBox(icon, title, text, QMessageBox::NoButton, parent); QDialogButtonBox *buttonBox = msgBox.findChild(); - Q_ASSERT(buttonBox != 0); + Q_ASSERT(buttonBox != nullptr); uint mask = QMessageBox::FirstButton; while (mask <= QMessageBox::LastButton) { @@ -404,7 +404,7 @@ QMessageBox::StandardButton MessageBoxHandler::showMessageBox(MessageType messag qDebug().nospace() << "Created " << messageTypeHash.value(messageType).toUtf8().constData() << " message box " << identifier << ": " << title << ", " << text; - if (qobject_cast (qApp) == 0) + if (qobject_cast (qApp) == nullptr) return defaultButton; if (m_automaticAnswers.contains(identifier)) diff --git a/src/libs/installer/metadatajob.cpp b/src/libs/installer/metadatajob.cpp index cb1579756..e210528e1 100644 --- a/src/libs/installer/metadatajob.cpp +++ b/src/libs/installer/metadatajob.cpp @@ -53,7 +53,7 @@ static QUrl resolveUrl(const FileTaskResult &result, const QString &url) MetadataJob::MetadataJob(QObject *parent) : Job(parent) - , m_core(0) + , m_core(nullptr) , m_addCompressedPackages(false) , m_downloadableChunkSize(1000) , m_taskNumber(0) diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp index 0c814288e..a80fc608e 100644 --- a/src/libs/installer/packagemanagercore.cpp +++ b/src/libs/installer/packagemanagercore.cpp @@ -392,7 +392,7 @@ using namespace QInstaller; Q_GLOBAL_STATIC(QMutex, globalModelMutex); -static QFont *sVirtualComponentsFont = 0; +static QFont *sVirtualComponentsFont = nullptr; Q_GLOBAL_STATIC(QMutex, globalVirtualComponentsFontMutex); static bool sNoForceInstallation = false; @@ -697,7 +697,7 @@ void PackageManagerCore::rollBackInstallation() // reregister all the undo operations with the new size to the ProgressCoordinator foreach (Operation *const operation, d->m_performedOperationsCurrentSession) { QObject *const operationObject = dynamic_cast (operation); - if (operationObject != 0) { + if (operationObject != nullptr) { const QMetaObject* const mo = operationObject->metaObject(); if (mo->indexOfSignal(QMetaObject::normalizedSignature("progressChanged(double)")) > -1) { ProgressCoordinator::instance()->registerPartProgress(operationObject, @@ -939,7 +939,7 @@ PackageManagerCore::~PackageManagerCore() QMutexLocker _(globalVirtualComponentsFontMutex()); delete sVirtualComponentsFont; - sVirtualComponentsFont = 0; + sVirtualComponentsFont = nullptr; } /* static */ @@ -1549,7 +1549,7 @@ Component *PackageManagerCore::componentByName(const QString &name) const Component *PackageManagerCore::componentByName(const QString &name, const QList &components) { if (name.isEmpty()) - return 0; + return nullptr; QString fixedVersion; QString fixedName; @@ -1561,7 +1561,7 @@ Component *PackageManagerCore::componentByName(const QString &name, const QList< return component; } - return 0; + return nullptr; } /*! diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp index ccb80306e..d28f11b43 100644 --- a/src/libs/installer/packagemanagercore_p.cpp +++ b/src/libs/installer/packagemanagercore_p.cpp @@ -81,7 +81,7 @@ namespace QInstaller { class OperationTracer { public: - OperationTracer(Operation *operation) : m_operation(0) + OperationTracer(Operation *operation) : m_operation(nullptr) { // don't create output for that hacky pseudo operation if (operation->name() != QLatin1String("MinimumProgress")) @@ -197,29 +197,29 @@ static void deferredRename(const QString &oldName, const QString &newName, bool // -- PackageManagerCorePrivate PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core) - : m_updateFinder(0) - , m_compressedFinder(0) + : m_updateFinder(nullptr) + , m_compressedFinder(nullptr) , m_localPackageHub(std::make_shared()) , m_core(core) , m_updates(false) , m_repoFetched(false) , m_updateSourcesAdded(false) , m_componentsToInstallCalculated(false) - , m_componentScriptEngine(0) - , m_controlScriptEngine(0) - , m_installerCalculator(0) - , m_uninstallerCalculator(0) - , m_proxyFactory(0) - , m_defaultModel(0) - , m_updaterModel(0) - , m_guiObject(0) + , m_componentScriptEngine(nullptr) + , m_controlScriptEngine(nullptr) + , m_installerCalculator(nullptr) + , m_uninstallerCalculator(nullptr) + , m_proxyFactory(nullptr) + , m_defaultModel(nullptr) + , m_updaterModel(nullptr) + , m_guiObject(nullptr) { } PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core, qint64 magicInstallerMaker, const QList &performedOperations) - : m_updateFinder(0) - , m_compressedFinder(0) + : m_updateFinder(nullptr) + , m_compressedFinder(nullptr) , m_localPackageHub(std::make_shared()) , m_status(PackageManagerCore::Unfinished) , m_needsHardRestart(false) @@ -234,14 +234,14 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core, q , m_updateSourcesAdded(false) , m_magicBinaryMarker(magicInstallerMaker) , m_componentsToInstallCalculated(false) - , m_componentScriptEngine(0) - , m_controlScriptEngine(0) - , m_installerCalculator(0) - , m_uninstallerCalculator(0) - , m_proxyFactory(0) - , m_defaultModel(0) - , m_updaterModel(0) - , m_guiObject(0) + , m_componentScriptEngine(nullptr) + , m_controlScriptEngine(nullptr) + , m_installerCalculator(nullptr) + , m_uninstallerCalculator(nullptr) + , m_proxyFactory(nullptr) + , m_defaultModel(nullptr) + , m_updaterModel(nullptr) + , m_guiObject(nullptr) { foreach (const OperationBlob &operation, performedOperations) { QScopedPointer op(KDUpdater::UpdateOperationFactory::instance() @@ -363,7 +363,7 @@ bool PackageManagerCorePrivate::buildComponentTree(QHash &c for (it = components.constBegin(); it != components.constEnd(); ++it) { QString id = it.key(); QInstaller::Component *component = it.value(); - while (!id.isEmpty() && component->parentComponent() == 0) { + while (!id.isEmpty() && component->parentComponent() == nullptr) { id = id.section(QLatin1Char('.'), 0, -2); if (components.contains(id)) components[id]->appendComponent(component); @@ -372,7 +372,7 @@ bool PackageManagerCorePrivate::buildComponentTree(QHash &c // append all components w/o parent to the direct list foreach (QInstaller::Component *component, components) { - if (component->parentComponent() == 0) + if (component->parentComponent() == nullptr) m_core->appendRootComponent(component); } @@ -443,7 +443,7 @@ void PackageManagerCorePrivate::cleanUpComponentEnvironment() // there could be still some references to already deleted components, // so we need to remove the current component script engine delete m_componentScriptEngine; - m_componentScriptEngine = 0; + m_componentScriptEngine = nullptr; } ScriptEngine *PackageManagerCorePrivate::componentScriptEngine() const @@ -517,7 +517,7 @@ QHash > &PackageManagerCorePrivate::compo void PackageManagerCorePrivate::clearInstallerCalculator() { delete m_installerCalculator; - m_installerCalculator = 0; + m_installerCalculator = nullptr; } InstallerCalculator *PackageManagerCorePrivate::installerCalculator() const @@ -533,7 +533,7 @@ InstallerCalculator *PackageManagerCorePrivate::installerCalculator() const void PackageManagerCorePrivate::clearUninstallerCalculator() { delete m_uninstallerCalculator; - m_uninstallerCalculator = 0; + m_uninstallerCalculator = nullptr; } UninstallerCalculator *PackageManagerCorePrivate::uninstallerCalculator() const @@ -685,7 +685,7 @@ Operation *PackageManagerCorePrivate::createOwnedOperation(const QString &type) Operation *PackageManagerCorePrivate::takeOwnedOperation(Operation *operation) { if (!m_ownedOperations.contains(operation)) - return 0; + return nullptr; m_ownedOperations.removeAll(operation); return operation; @@ -939,7 +939,7 @@ void PackageManagerCorePrivate::connectOperationToInstaller(Operation *const ope { Q_ASSERT(operationPartSize); QObject *const operationObject = dynamic_cast< QObject*> (operation); - if (operationObject != 0) { + if (operationObject != nullptr) { const QMetaObject *const mo = operationObject->metaObject(); if (mo->indexOfSignal(QMetaObject::normalizedSignature("outputTextChanged(QString)")) > -1) { connect(operationObject, SIGNAL(outputTextChanged(QString)), ProgressCoordinator::instance(), @@ -1653,7 +1653,7 @@ bool PackageManagerCorePrivate::runPackageUpdater() // build a list of undo operations based on the checked state of the component foreach (Operation *operation, performedOperationsOld) { const QString &name = operation->value(QLatin1String("component")).toString(); - Component *component = componentsByName.value(name, 0); + Component *component = componentsByName.value(name, nullptr); if (!component) component = m_core->componentByName(PackageManagerCore::checkableName(name)); if (component) @@ -2374,7 +2374,7 @@ void PackageManagerCorePrivate::storeCheckState() void PackageManagerCorePrivate::connectOperationCallMethodRequest(Operation *const operation) { QObject *const operationObject = dynamic_cast (operation); - if (operationObject != 0) { + if (operationObject != nullptr) { const QMetaObject *const mo = operationObject->metaObject(); if (mo->indexOfSignal(QMetaObject::normalizedSignature("requestBlockingExecution(QString)")) > -1) { connect(operationObject, SIGNAL(requestBlockingExecution(QString)), @@ -2417,7 +2417,7 @@ OperationList PackageManagerCorePrivate::sortOperationsBasedOnComponentDependenc void PackageManagerCorePrivate::handleMethodInvocationRequest(const QString &invokableMethodName) { QObject *obj = QObject::sender(); - if (obj != 0) + if (obj != nullptr) QMetaObject::invokeMethod(obj, qPrintable(invokableMethodName)); } diff --git a/src/libs/installer/packagemanagercoredata.cpp b/src/libs/installer/packagemanagercoredata.cpp index 3b35794cf..ebacbf938 100644 --- a/src/libs/installer/packagemanagercoredata.cpp +++ b/src/libs/installer/packagemanagercoredata.cpp @@ -108,7 +108,7 @@ void PackageManagerCoreData::setDynamicPredefinedVariables() QString dir = QLatin1String("/opt"); #ifdef Q_OS_WIN TCHAR buffer[MAX_PATH + 1] = { 0 }; - SHGetFolderPath(0, CSIDL_PROGRAM_FILES, 0, 0, buffer); + SHGetFolderPath(nullptr, CSIDL_PROGRAM_FILES, nullptr, 0, buffer); dir = QString::fromWCharArray(buffer); #elif defined (Q_OS_OSX) dir = QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation).value(0); diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp index 0e2577850..3fd35a5c8 100644 --- a/src/libs/installer/packagemanagergui.cpp +++ b/src/libs/installer/packagemanagergui.cpp @@ -95,7 +95,7 @@ class DynamicInstallerPage : public PackageManagerPage Q_PROPERTY(bool complete READ isComplete WRITE setComplete) public: - explicit DynamicInstallerPage(QWidget *widget, PackageManagerCore *core = 0) + explicit DynamicInstallerPage(QWidget *widget, PackageManagerCore *core = nullptr) : PackageManagerPage(core) , m_widget(widget) { @@ -398,7 +398,7 @@ void PackageManagerGui::setMaxSize() */ PackageManagerGui::~PackageManagerGui() { - m_core->setGuiObject(0); + m_core->setGuiObject(nullptr); delete d; } @@ -665,7 +665,7 @@ void PackageManagerGui::wizardPageInsertionRequested(QWidget *widget, wizardPageRemovalRequested(widget); int pageId = static_cast(page) - 1; - while (QWizard::page(pageId) != 0) + while (QWizard::page(pageId) != nullptr) --pageId; // add it @@ -679,7 +679,7 @@ void PackageManagerGui::wizardPageRemovalRequested(QWidget *widget) { foreach (int pageId, pageIds()) { DynamicInstallerPage *const dynamicPage = qobject_cast(page(pageId)); - if (dynamicPage == 0) + if (dynamicPage == nullptr) continue; if (dynamicPage->widget() != widget) continue; @@ -710,7 +710,7 @@ void PackageManagerGui::wizardWidgetInsertionRequested(QWidget *widget, void PackageManagerGui::wizardWidgetRemovalRequested(QWidget *widget) { Q_ASSERT(widget); - widget->setParent(0); + widget->setParent(nullptr); packageManagerCore()->controlScriptEngine()->removeFromGlobalObject(widget); packageManagerCore()->componentScriptEngine()->removeFromGlobalObject(widget); } @@ -721,9 +721,9 @@ void PackageManagerGui::wizardWidgetRemovalRequested(QWidget *widget) */ void PackageManagerGui::wizardPageVisibilityChangeRequested(bool visible, int p) { - if (visible && page(p) == 0) { + if (visible && page(p) == nullptr) { setPage(p, d->m_defaultPages[p]); - } else if (!visible && page(p) != 0) { + } else if (!visible && page(p) != nullptr) { d->m_defaultPages[p] = page(p); removePage(p); } @@ -753,7 +753,7 @@ QWidget *PackageManagerGui::pageByObjectName(const QString &name) const return p; } qWarning() << "No page found for object name" << name; - return 0; + return nullptr; } /*! @@ -781,7 +781,7 @@ QWidget *PackageManagerGui::pageWidgetByObjectName(const QString &name) const return p; } qWarning() << "No page found for object name" << name; - return 0; + return nullptr; } /*! @@ -1057,7 +1057,7 @@ PackageManagerPage::PackageManagerPage(PackageManagerCore *core) : m_complete(true) , m_needsSettingsButton(false) , m_core(core) - , validatorComponent(0) + , validatorComponent(nullptr) { if (!m_core->settings().titleColor().isEmpty()) { m_titleColor = m_core->settings().titleColor(); @@ -1192,8 +1192,8 @@ bool PackageManagerPage::validatePage() void PackageManagerPage::insertWidget(QWidget *widget, const QString &siblingName, int offset) { QWidget *sibling = findChild(siblingName); - QWidget *parent = sibling ? sibling->parentWidget() : 0; - QLayout *layout = parent ? parent->layout() : 0; + QWidget *parent = sibling ? sibling->parentWidget() : nullptr; + QLayout *layout = parent ? parent->layout() : nullptr; QBoxLayout *blayout = qobject_cast(layout); if (blayout) { @@ -1264,13 +1264,13 @@ IntroductionPage::IntroductionPage(PackageManagerCore *core) : PackageManagerPage(core) , m_updatesFetched(false) , m_allPackagesFetched(false) - , m_label(0) - , m_msgLabel(0) - , m_errorLabel(0) - , m_progressBar(0) - , m_packageManager(0) - , m_updateComponents(0) - , m_removeAllComponents(0) + , m_label(nullptr) + , m_msgLabel(nullptr) + , m_errorLabel(nullptr) + , m_progressBar(nullptr) + , m_packageManager(nullptr) + , m_updateComponents(nullptr) + , m_removeAllComponents(nullptr) { setObjectName(QLatin1String("IntroductionPage")); setColoredTitle(tr("Setup - %1").arg(productName())); @@ -1347,7 +1347,7 @@ IntroductionPage::IntroductionPage(PackageManagerCore *core) connect(core, &PackageManagerCore::metaJobProgress, m_taskButton->progress(), &QWinTaskbarProgress::setValue); } else { - m_taskButton = 0; + m_taskButton = nullptr; } #endif } @@ -2802,7 +2802,7 @@ void PerformInstallationPage::toggleDetailsWereChanged() */ FinishedPage::FinishedPage(PackageManagerCore *core) : PackageManagerPage(core) - , m_commitButton(0) + , m_commitButton(nullptr) { setObjectName(QLatin1String("FinishedPage")); setColoredTitle(tr("Completing the %1 Wizard").arg(productName())); @@ -2835,7 +2835,7 @@ void FinishedPage::entering() if (m_commitButton) { disconnect(m_commitButton, &QAbstractButton::clicked, this, &FinishedPage::handleFinishClicked); - m_commitButton = 0; + m_commitButton = nullptr; } if (packageManagerCore()->isMaintainer()) { diff --git a/src/libs/installer/performinstallationform.cpp b/src/libs/installer/performinstallationform.cpp index b66cbb5bd..28506bcde 100644 --- a/src/libs/installer/performinstallationform.cpp +++ b/src/libs/installer/performinstallationform.cpp @@ -76,18 +76,18 @@ using namespace QInstaller; */ PerformInstallationForm::PerformInstallationForm(QObject *parent) : QObject(parent) - , m_progressBar(0) - , m_progressLabel(0) - , m_detailsButton(0) - , m_detailsBrowser(0) - , m_updateTimer(0) + , m_progressBar(nullptr) + , m_progressLabel(nullptr) + , m_detailsButton(nullptr) + , m_detailsBrowser(nullptr) + , m_updateTimer(nullptr) { #ifdef Q_OS_WIN if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7) { m_taskButton = new QWinTaskbarButton(this); m_taskButton->progress()->setVisible(true); } else { - m_taskButton = 0; + m_taskButton = nullptr; } #endif } diff --git a/src/libs/installer/progresscoordinator.cpp b/src/libs/installer/progresscoordinator.cpp index 1a3f4e33f..d3fbd764f 100644 --- a/src/libs/installer/progresscoordinator.cpp +++ b/src/libs/installer/progresscoordinator.cpp @@ -59,8 +59,8 @@ ProgressCoordinator::~ProgressCoordinator() ProgressCoordinator *ProgressCoordinator::instance() { - static ProgressCoordinator *instance = 0; - if (instance == 0) + static ProgressCoordinator *instance =nullptr; + if (instance == nullptr) instance = new ProgressCoordinator(qApp); return instance; } diff --git a/src/libs/installer/qprocesswrapper.cpp b/src/libs/installer/qprocesswrapper.cpp index 1bf60ead2..7cd5ad7d1 100644 --- a/src/libs/installer/qprocesswrapper.cpp +++ b/src/libs/installer/qprocesswrapper.cpp @@ -109,7 +109,7 @@ bool QProcessWrapper::startDetached(const QString &program, const QStringList &a const QPair result = w.callRemoteMethod >(QLatin1String(Protocol::QProcessStartDetached), program, arguments, workingDirectory); - if (pid != 0) + if (pid != nullptr) *pid = result.second; w.processSignals(); return result.first; diff --git a/src/libs/installer/registerfiletypeoperation.cpp b/src/libs/installer/registerfiletypeoperation.cpp index bcae422d7..27794652f 100644 --- a/src/libs/installer/registerfiletypeoperation.cpp +++ b/src/libs/installer/registerfiletypeoperation.cpp @@ -133,7 +133,7 @@ bool RegisterFileTypeOperation::performOperation() setValue(QLatin1String("newType"), readHive(&settings, classesFileType)); // force the shell to invalidate its cache - SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); + SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nullptr, nullptr); return true; #else @@ -192,7 +192,7 @@ bool RegisterFileTypeOperation::undoOperation() settings.remove(classesApplications); // force the shell to invalidate its cache - SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); + SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nullptr, nullptr); return true; #else diff --git a/src/libs/installer/remoteclient.cpp b/src/libs/installer/remoteclient.cpp index c6f5e535f..e208620cb 100644 --- a/src/libs/installer/remoteclient.cpp +++ b/src/libs/installer/remoteclient.cpp @@ -31,7 +31,7 @@ namespace QInstaller { -RemoteClient *RemoteClient::s_instance = 0; +RemoteClient *RemoteClient::s_instance = nullptr; RemoteClient::RemoteClient() : d_ptr(new RemoteClientPrivate(this)) @@ -88,7 +88,7 @@ void RemoteClient::shutdown() void RemoteClient::destroy() { delete s_instance; - s_instance = 0; + s_instance = nullptr; } bool RemoteClient::isActive() const diff --git a/src/libs/installer/remoteobject.cpp b/src/libs/installer/remoteobject.cpp index 49c111610..c9c822299 100644 --- a/src/libs/installer/remoteobject.cpp +++ b/src/libs/installer/remoteobject.cpp @@ -39,9 +39,9 @@ namespace QInstaller { RemoteObject::RemoteObject(const QString &wrappedType, QObject *parent) : QObject(parent) - , dummy(0) + , dummy(nullptr) , m_type(wrappedType) - , m_socket(0) + , m_socket(nullptr) { Q_ASSERT_X(!m_type.isEmpty(), Q_FUNC_INFO, "The wrapped Qt type needs to be passed as " "argument and cannot be empty."); @@ -78,7 +78,7 @@ bool RemoteObject::authorize() return true; } delete m_socket; - m_socket = 0; + m_socket = nullptr; return false; } diff --git a/src/libs/installer/remoteserverconnection.cpp b/src/libs/installer/remoteserverconnection.cpp index 61bacc0c5..5a47bc472 100644 --- a/src/libs/installer/remoteserverconnection.cpp +++ b/src/libs/installer/remoteserverconnection.cpp @@ -44,10 +44,10 @@ RemoteServerConnection::RemoteServerConnection(qintptr socketDescriptor, const Q QObject *parent) : QThread(parent) , m_socketDescriptor(socketDescriptor) - , m_process(0) - , m_engine(0) + , m_process(nullptr) + , m_engine(nullptr) , m_authorizationKey(key) - , m_signalReceiver(0) + , m_signalReceiver(nullptr) { setObjectName(QString::fromLatin1("RemoteServerConnection(%1)").arg(socketDescriptor)); } @@ -146,10 +146,10 @@ void RemoteServerConnection::run() } else if (type == QLatin1String(Protocol::QProcess)) { m_signalReceiver->m_receivedSignals.clear(); m_process->deleteLater(); - m_process = 0; + m_process = nullptr; } else if (type == QLatin1String(Protocol::QAbstractFileEngine)) { delete m_engine; - m_engine = 0; + m_engine = nullptr; } return; } diff --git a/src/libs/installer/scriptengine.cpp b/src/libs/installer/scriptengine.cpp index bea1e8e75..994fa1406 100644 --- a/src/libs/installer/scriptengine.cpp +++ b/src/libs/installer/scriptengine.cpp @@ -97,7 +97,7 @@ void QDesktopServicesProxy::findRecursion(const QString &path, const QString &pa GuiProxy::GuiProxy(ScriptEngine *engine, QObject *parent) : QObject(parent), m_engine(engine), - m_gui(0) + m_gui(nullptr) { } diff --git a/src/libs/installer/settings.cpp b/src/libs/installer/settings.cpp index 21bbe8b4c..bc9024ac5 100644 --- a/src/libs/installer/settings.cpp +++ b/src/libs/installer/settings.cpp @@ -135,7 +135,7 @@ static QStringList readArgumentAttributes(QXmlStreamReader &reader, Settings::Pa return arguments; } -static QSet readRepositories(QXmlStreamReader &reader, bool isDefault, Settings::ParseMode parseMode, QString *displayName = 0) +static QSet readRepositories(QXmlStreamReader &reader, bool isDefault, Settings::ParseMode parseMode, QString *displayName = nullptr) { qDebug()<<__FUNCTION__; QSet set; diff --git a/src/libs/installer/sysinfo_win.cpp b/src/libs/installer/sysinfo_win.cpp index 69c1744ca..508ce7a6e 100644 --- a/src/libs/installer/sysinfo_win.cpp +++ b/src/libs/installer/sysinfo_win.cpp @@ -57,7 +57,7 @@ VolumeInfo updateVolumeSizeInformation(const VolumeInfo &info) ULARGE_INTEGER freeBytesPerUser; VolumeInfo update = info; - if (GetDiskFreeSpaceExA(qPrintable(info.volumeDescriptor()), &freeBytesPerUser, &bytesTotal, NULL)) { + if (GetDiskFreeSpaceExA(qPrintable(info.volumeDescriptor()), &freeBytesPerUser, &bytesTotal, nullptr)) { update.setSize(bytesTotal.QuadPart); update.setAvailableSize(freeBytesPerUser.QuadPart); } @@ -197,7 +197,7 @@ bool killProcess(const ProcessInfo &process, int msecs) // If we can't open the process with PROCESS_TERMINATE rights, then we give up immediately. HANDLE hProc = OpenProcess(SYNCHRONIZE | PROCESS_TERMINATE, false, process.id); - if (hProc == 0) + if (hProc == nullptr) return false; // TerminateAppEnum() posts WM_CLOSE to all windows whose PID matches your process's. @@ -212,4 +212,4 @@ bool killProcess(const ProcessInfo &process, int msecs) return returnValue; } -} \ No newline at end of file +} diff --git a/src/libs/installer/unziptask.cpp b/src/libs/installer/unziptask.cpp index f1f0dd0a1..e0fb5449a 100644 --- a/src/libs/installer/unziptask.cpp +++ b/src/libs/installer/unziptask.cpp @@ -89,7 +89,7 @@ public: m_futureInterface->waitForResume(); COM_TRY_BEGIN - *outStream = 0; + *outStream = nullptr; m_currentIndex = index; if (askExtractMode != NArchive::NExtract::NAskMode::kExtract) return E_FAIL; @@ -160,8 +160,8 @@ public: const bool writeCreationTime = GetTime(kpidCTime, &creationTime); const bool writeModificationTime = GetTime(kpidMTime, &modificationTime); - m_outFileStream->SetTime((writeCreationTime ? &creationTime : NULL), - (writeAccessTime ? &accessTime : NULL), (writeModificationTime ? &modificationTime : NULL)); + m_outFileStream->SetTime((writeCreationTime ? &creationTime : nullptr), + (writeAccessTime ? &accessTime : nullptr), (writeModificationTime ? &modificationTime : nullptr)); m_totalUnpacked += m_outFileStream->ProcessedSize; m_outFileStream->Close(); diff --git a/src/libs/installer/utils.cpp b/src/libs/installer/utils.cpp index a11ac774e..e4e3212ac 100644 --- a/src/libs/installer/utils.cpp +++ b/src/libs/installer/utils.cpp @@ -85,16 +85,16 @@ bool QInstaller::startDetached(const QString &program, const QStringList &argume bool success = false; #ifdef Q_OS_WIN PROCESS_INFORMATION pinfo; - STARTUPINFOW startupInfo = { sizeof(STARTUPINFO), 0, 0, 0, + STARTUPINFOW startupInfo = { sizeof(STARTUPINFO), nullptr, nullptr, nullptr, static_cast(CW_USEDEFAULT), static_cast(CW_USEDEFAULT), static_cast(CW_USEDEFAULT), static_cast(CW_USEDEFAULT), - 0, 0, 0, STARTF_USESHOWWINDOW, SW_HIDE, 0, 0, 0, 0, 0 + 0, 0, 0, STARTF_USESHOWWINDOW, SW_HIDE, 0, nullptr, nullptr, nullptr, nullptr }; // That's the difference over QProcess::startDetached(): STARTF_USESHOWWINDOW, SW_HIDE. const QString commandline = QInstaller::createCommandline(program, arguments); - if (CreateProcessW(0, (wchar_t*) commandline.utf16(), - 0, 0, false, CREATE_UNICODE_ENVIRONMENT | CREATE_NEW_CONSOLE, - 0, workingDirectory.isEmpty() ? 0 : (wchar_t*) workingDirectory.utf16(), + if (CreateProcessW(nullptr, (wchar_t*) commandline.utf16(), + nullptr, nullptr, false, CREATE_UNICODE_ENVIRONMENT | CREATE_NEW_CONSOLE, + nullptr, workingDirectory.isEmpty() ? nullptr : (wchar_t*) workingDirectory.utf16(), &startupInfo, &pinfo)) { success = true; CloseHandle(pinfo.hThread); @@ -244,7 +244,7 @@ bool QInstaller::VerboseWriter::flush(VerboseWriterOutput *output) if (output->write(logFileName, QIODevice::ReadWrite | QIODevice::Append | QIODevice::Text, buffer.data())) { preFileBuffer.close(); - stream.setDevice(0); + stream.setDevice(nullptr); return true; } return false; @@ -341,7 +341,7 @@ static QVector qWinCmdLine(Char *cmdParam, int length, int &argc) argv[argc++] = start; } } - argv[argc] = 0; + argv[argc] = nullptr; return argv; } @@ -419,14 +419,14 @@ QString QInstaller::createCommandline(const QString &program, const QStringList QString QInstaller::windowsErrorString(int errorCode) { QString ret; - wchar_t *string = 0; + wchar_t *string = nullptr; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, + nullptr, errorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR) &string, 0, - NULL); + nullptr); ret = QString::fromWCharArray(string); LocalFree((HLOCAL) string); -- cgit v1.2.3 From bf87c91dfe16881c366775549364862372dde8f7 Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Tue, 8 Jan 2019 14:00:12 +0200 Subject: Fix ability to select node which children are unstable Task-number: QTIFW-1260 Change-Id: If806f62382eb430c858cb483e3bd25562df7b21a Reviewed-by: Iikka Eklund --- src/libs/installer/componentmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libs') diff --git a/src/libs/installer/componentmodel.cpp b/src/libs/installer/componentmodel.cpp index 186b37e41..69c709060 100644 --- a/src/libs/installer/componentmodel.cpp +++ b/src/libs/installer/componentmodel.cpp @@ -585,7 +585,7 @@ QSet ComponentModel::updateCheckedState(const ComponentSet &compone checkable = false; } - if ((!node->isCheckable() && checkable) || !node->isEnabled() || !node->autoDependencies().isEmpty()) + if ((!node->isCheckable() && checkable) || !node->isEnabled() || !node->autoDependencies().isEmpty() || node->isUnstable()) continue; Qt::CheckState newState = state; -- cgit v1.2.3 From afd61c9700ea24569ade2af9e7ec0a268b02b98a Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Tue, 8 Jan 2019 12:33:05 +0200 Subject: Hide category widgets in updater mode We don't need categories in updater mode, the categories were accidently visible if we first visited the 'Add or remove components' page before going to 'Update components' Task-number: QTIFW-1259 Change-Id: I945c2b7e8cdfbb8bfeefbfa0ed07222189573179 Reviewed-by: Iikka Eklund --- src/libs/installer/componentselectionpage_p.cpp | 9 +++++++++ src/libs/installer/componentselectionpage_p.h | 1 + src/libs/installer/packagemanagergui.cpp | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src/libs') diff --git a/src/libs/installer/componentselectionpage_p.cpp b/src/libs/installer/componentselectionpage_p.cpp index 9b8c86efb..f77e0ae4b 100644 --- a/src/libs/installer/componentselectionpage_p.cpp +++ b/src/libs/installer/componentselectionpage_p.cpp @@ -213,6 +213,15 @@ void ComponentSelectionPagePrivate::setupCategoryLayout() m_mainHLayout->insertWidget(0, m_categoryWidget); } +void ComponentSelectionPagePrivate::showCategoryLayout(bool show) +{ + if (show) { + setupCategoryLayout(); + } + if (m_categoryWidget) + m_categoryWidget->setVisible(show); +} + void ComponentSelectionPagePrivate::updateTreeView() { m_checkDefault->setVisible(m_core->isInstaller() || m_core->isPackageManager()); diff --git a/src/libs/installer/componentselectionpage_p.h b/src/libs/installer/componentselectionpage_p.h index bc1e6ed7a..ece8ef911 100644 --- a/src/libs/installer/componentselectionpage_p.h +++ b/src/libs/installer/componentselectionpage_p.h @@ -64,6 +64,7 @@ public: void showCompressedRepositoryButton(); void hideCompressedRepositoryButton(); void setupCategoryLayout(); + void showCategoryLayout(bool show); void updateTreeView(); public slots: diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp index 3fd35a5c8..dfa7542c6 100644 --- a/src/libs/installer/packagemanagergui.cpp +++ b/src/libs/installer/packagemanagergui.cpp @@ -1912,7 +1912,9 @@ void ComponentSelectionPage::entering() setModified(isComplete()); if (core->settings().repositoryCategories().count() > 0 && !core->isOfflineOnly() && !core->isUpdater()) { - d->setupCategoryLayout(); + d->showCategoryLayout(true); + } else { + d->showCategoryLayout(false); } d->showCompressedRepositoryButton(); } -- cgit v1.2.3 From f265c9f43685d842ec5305b4d6b667e55bdb79ba Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Fri, 11 Jan 2019 07:21:39 +0200 Subject: Do not allow unstable component install Unstable component was installed if component had unresolved dependency and was fetched from category. Fixed so that unstable component which is not already installed gets never selected in restoreCheckState(). Task-id: QTIFW-1265 Change-Id: I04176d095f6d79b2aabae73b490adc36706f597a Reviewed-by: Jani Heikkinen --- src/libs/installer/packagemanagercore_p.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/libs') diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp index d28f11b43..b5916fbac 100644 --- a/src/libs/installer/packagemanagercore_p.cpp +++ b/src/libs/installer/packagemanagercore_p.cpp @@ -2354,8 +2354,13 @@ void PackageManagerCorePrivate::restoreCheckState() if (m_coreCheckedHash.isEmpty()) return; - foreach (Component *component, m_coreCheckedHash.keys()) + foreach (Component *component, m_coreCheckedHash.keys()) { component->setCheckState(m_coreCheckedHash.value(component)); + // Never allow component to be checked when it is unstable + // and not installed + if (component->isUnstable() && !component->isInstalled()) + component->setCheckState(Qt::Unchecked); + } m_coreCheckedHash.clear(); m_componentsToInstallCalculated = false; -- cgit v1.2.3 From a810460e127c254492526bf6af022aad2cd985e3 Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Mon, 14 Jan 2019 18:15:41 +0200 Subject: Revert RemoteFileEngineHandler removal Seems this is used for gaining admin rights in Windows Task-id: QTIFW-1254 Change-Id: Ia169200ead7a95d152378ba68ba9b8ad3054d5bb Reviewed-by: Antti Kokko --- src/libs/installer/packagemanagercore_p.cpp | 3 +++ src/libs/installer/packagemanagercore_p.h | 2 ++ 2 files changed, 5 insertions(+) (limited to 'src/libs') diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp index b5916fbac..c67480737 100644 --- a/src/libs/installer/packagemanagercore_p.cpp +++ b/src/libs/installer/packagemanagercore_p.cpp @@ -36,6 +36,7 @@ #include "componentmodel.h" #include "errors.h" #include "fileio.h" +#include "remotefileengine.h" #include "graph.h" #include "messageboxhandler.h" #include "packagemanagercore.h" @@ -213,6 +214,7 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core) , m_defaultModel(nullptr) , m_updaterModel(nullptr) , m_guiObject(nullptr) + , m_remoteFileEngineHandler(nullptr) { } @@ -242,6 +244,7 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core, q , m_defaultModel(nullptr) , m_updaterModel(nullptr) , m_guiObject(nullptr) + , m_remoteFileEngineHandler(new RemoteFileEngineHandler) { foreach (const OperationBlob &operation, performedOperations) { QScopedPointer op(KDUpdater::UpdateOperationFactory::instance() diff --git a/src/libs/installer/packagemanagercore_p.h b/src/libs/installer/packagemanagercore_p.h index 6f43caf3b..21ab3fc40 100644 --- a/src/libs/installer/packagemanagercore_p.h +++ b/src/libs/installer/packagemanagercore_p.h @@ -58,6 +58,7 @@ class ComponentModel; class TempDirDeleter; class InstallerCalculator; class UninstallerCalculator; +class RemoteFileEngineHandler; class PackageManagerCorePrivate : public QObject { @@ -262,6 +263,7 @@ private: ComponentModel *m_updaterModel; QObject *m_guiObject; + QScopedPointer m_remoteFileEngineHandler; private: // remove once we deprecate isSelected, setSelected etc... -- cgit v1.2.3 From 2f55dced317e7cb3cb7d69d8431bb277d51cbc62 Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Fri, 11 Jan 2019 13:23:08 +0200 Subject: Organize categories alphabetically to ComponentSelectionPage Task-number: QTIFW-1264 Change-Id: I14a54082c30107d9242632a69d73a637803c6f2d Reviewed-by: Jani Heikkinen --- src/libs/installer/componentselectionpage_p.cpp | 17 +++++++++++++---- src/libs/installer/componentselectionpage_p.h | 2 +- src/libs/installer/settings.cpp | 10 ++++++++++ src/libs/installer/settings.h | 1 + 4 files changed, 25 insertions(+), 5 deletions(-) (limited to 'src/libs') diff --git a/src/libs/installer/componentselectionpage_p.cpp b/src/libs/installer/componentselectionpage_p.cpp index f77e0ae4b..0e60788cc 100644 --- a/src/libs/installer/componentselectionpage_p.cpp +++ b/src/libs/installer/componentselectionpage_p.cpp @@ -198,7 +198,7 @@ void ComponentSelectionPagePrivate::setupCategoryLayout() connect(fetchCategoryButton, &QPushButton::clicked, this, &ComponentSelectionPagePrivate::fetchRepositoryCategories); - foreach (RepositoryCategory repository, m_core->settings().repositoryCategories()) { + foreach (RepositoryCategory repository, m_core->settings().organizedRepositoryCategories()) { QCheckBox *checkBox = new QCheckBox; checkBox->setObjectName(repository.displayname()); connect(checkBox, &QCheckBox::stateChanged, this, @@ -324,8 +324,17 @@ void ComponentSelectionPagePrivate::checkboxStateChanged() } } -void ComponentSelectionPagePrivate::enableRepositoryCategory(int index, bool enable) { - RepositoryCategory repoCategory = m_core->settings().repositoryCategories().toList().at(index); +void ComponentSelectionPagePrivate::enableRepositoryCategory(const QString &repositoryName, bool enable) +{ + QMap organizedRepositoryCategories = m_core->settings().organizedRepositoryCategories(); + + QMap::iterator i = organizedRepositoryCategories.find(repositoryName); + RepositoryCategory repoCategory; + while (i != organizedRepositoryCategories.end() && i.key() == repositoryName) { + repoCategory = i.value(); + i++; + } + RepositoryCategory replacement = repoCategory; replacement.setEnabled(enable); QSet tmpRepoCategories = m_core->settings().repositoryCategories(); @@ -374,7 +383,7 @@ void ComponentSelectionPagePrivate::fetchRepositoryCategories() QList checkboxes = m_categoryGroupBox->findChildren(); for (int i = 0; i < checkboxes.count(); i++) { checkbox = checkboxes.at(i); - enableRepositoryCategory(i, checkbox->isChecked()); + enableRepositoryCategory(checkbox->objectName(), checkbox->isChecked()); } if (!m_core->fetchRemotePackagesTree()) { diff --git a/src/libs/installer/componentselectionpage_p.h b/src/libs/installer/componentselectionpage_p.h index ece8ef911..9ebec834a 100644 --- a/src/libs/installer/componentselectionpage_p.h +++ b/src/libs/installer/componentselectionpage_p.h @@ -72,7 +72,7 @@ public slots: void selectAll(); void deselectAll(); void checkboxStateChanged(); - void enableRepositoryCategory(int index, bool enable); + void enableRepositoryCategory(const QString &repositoryName, bool enable); void updateWidgetVisibility(bool show); void fetchRepositoryCategories(); void customButtonClicked(int which); diff --git a/src/libs/installer/settings.cpp b/src/libs/installer/settings.cpp index bc9024ac5..2a10d1a8b 100644 --- a/src/libs/installer/settings.cpp +++ b/src/libs/installer/settings.cpp @@ -584,6 +584,16 @@ QSet Settings::repositoryCategories() const return variantListToSet(d->m_data.values(scRepositoryCategories)); } +QMap Settings::organizedRepositoryCategories() const +{ + QSet categories = repositoryCategories(); + QMap map; + foreach (const RepositoryCategory &category, categories) { + map.insert(category.displayname(), category); + } + return map; +} + void Settings::setDefaultRepositories(const QSet &repositories) { d->m_data.remove(scRepositories); diff --git a/src/libs/installer/settings.h b/src/libs/installer/settings.h index 0ee58639d..55b94d745 100644 --- a/src/libs/installer/settings.h +++ b/src/libs/installer/settings.h @@ -116,6 +116,7 @@ public: QSet defaultRepositories() const; QSet repositoryCategories() const; + QMap organizedRepositoryCategories() const; void setDefaultRepositories(const QSet &repositories); void addDefaultRepositories(const QSet &repositories); void addRepositoryCategories(const QSet &repositories); -- cgit v1.2.3 From 4ca310dc295e310df67ddb46437315179017d714 Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Wed, 9 Jan 2019 08:43:51 +0200 Subject: Fix Next button state in component selection view Task-number: QTIFW-1261 Change-Id: Ied506e68d430eef94d482ee2390aa5a8acc3b36e Reviewed-by: Iikka Eklund --- src/libs/installer/componentselectionpage_p.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/libs') diff --git a/src/libs/installer/componentselectionpage_p.cpp b/src/libs/installer/componentselectionpage_p.cpp index 0e60788cc..1acc2ceb5 100644 --- a/src/libs/installer/componentselectionpage_p.cpp +++ b/src/libs/installer/componentselectionpage_p.cpp @@ -352,10 +352,15 @@ void ComponentSelectionPagePrivate::updateWidgetVisibility(bool show) QSizePolicy::Expanding); m_treeViewVLayout->addSpacerItem(verticalSpacer2); m_mainHLayout->removeItem(m_descriptionVLayout); + //Hide next button during category fetch + QPushButton *const b = qobject_cast(q->gui()->button(QWizard::NextButton)); + b->setEnabled(!show); } else { QSpacerItem *item = m_treeViewVLayout->spacerItem(); m_treeViewVLayout->removeItem(item); m_mainHLayout->addLayout(m_descriptionVLayout, 2); + //Call completeChanged() to determine if NextButton should be shown or not after category fetch. + q->completeChanged(); } if (m_categoryWidget) m_categoryWidget->setDisabled(show); @@ -368,8 +373,6 @@ void ComponentSelectionPagePrivate::updateWidgetVisibility(bool show) m_uncheckAll->setVisible(!show); m_descriptionLabel->setVisible(!show); m_sizeLabel->setVisible(!show); - QPushButton *const b = qobject_cast(q->gui()->button(QWizard::NextButton)); - b->setEnabled(!show); if (QAbstractButton *bspButton = q->gui()->button(QWizard::CustomButton2)) bspButton->setEnabled(!show); -- cgit v1.2.3 From cd5168de39b0791bc2e62acc36aa6f77f75f3398 Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Wed, 16 Jan 2019 14:34:30 +0200 Subject: Add possibility to preselect categories in config.xml Change-Id: I280247cb5155622ade604074c5a71a276b0fb629 Reviewed-by: Jani Heikkinen --- src/libs/installer/componentselectionpage_p.cpp | 1 + src/libs/installer/settings.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/libs') diff --git a/src/libs/installer/componentselectionpage_p.cpp b/src/libs/installer/componentselectionpage_p.cpp index 1acc2ceb5..bfe196ca3 100644 --- a/src/libs/installer/componentselectionpage_p.cpp +++ b/src/libs/installer/componentselectionpage_p.cpp @@ -201,6 +201,7 @@ void ComponentSelectionPagePrivate::setupCategoryLayout() foreach (RepositoryCategory repository, m_core->settings().organizedRepositoryCategories()) { QCheckBox *checkBox = new QCheckBox; checkBox->setObjectName(repository.displayname()); + checkBox->setChecked(repository.isEnabled()); connect(checkBox, &QCheckBox::stateChanged, this, &ComponentSelectionPagePrivate::checkboxStateChanged); checkBox->setText(repository.displayname()); diff --git a/src/libs/installer/settings.cpp b/src/libs/installer/settings.cpp index 2a10d1a8b..96063455b 100644 --- a/src/libs/installer/settings.cpp +++ b/src/libs/installer/settings.cpp @@ -135,9 +135,9 @@ static QStringList readArgumentAttributes(QXmlStreamReader &reader, Settings::Pa return arguments; } -static QSet readRepositories(QXmlStreamReader &reader, bool isDefault, Settings::ParseMode parseMode, QString *displayName = nullptr) +static QSet readRepositories(QXmlStreamReader &reader, bool isDefault, Settings::ParseMode parseMode, + QString *displayName = nullptr, bool *preselected = false) { - qDebug()<<__FUNCTION__; QSet set; while (reader.readNextStartElement()) { if (reader.name() == QLatin1String("DisplayName")) { @@ -169,6 +169,8 @@ static QSet readRepositories(QXmlStreamReader &reader, bool isDefaul if (displayName && !displayName->isEmpty()) repo.setArchiveName(*displayName); set.insert(repo); + } else if (reader.name() == QLatin1String("Preselected")) { + *preselected = (reader.readElementText() == QLatin1String("true") ? true : false); } else { raiseError(reader, QString::fromLatin1("Unexpected element \"%1\".").arg(reader.name().toString()), parseMode); @@ -190,8 +192,10 @@ static QSet readRepositoryCategories(QXmlStreamReader &reade if (reader.name() == QLatin1String("RemoteRepositories")) { RepositoryCategory archiveRepo; QString displayName; - archiveRepo.setRepositories(readRepositories(reader, isDefault, parseMode, &displayName)); + bool preselected = false; + archiveRepo.setRepositories(readRepositories(reader, isDefault, parseMode, &displayName, &preselected)); archiveRepo.setDisplayName(displayName); + archiveRepo.setEnabled(preselected); archiveSet.insert(archiveRepo); } else if (reader.name() == QLatin1String("RepositoryCategoryDisplayname")) { *repositoryCategoryName = reader.readElementText(); -- cgit v1.2.3 From 7c3c796cbfb13afcf01755d189e01ac392ec9b2b Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Mon, 14 Jan 2019 10:16:23 +0200 Subject: Allow unstable components when categories are used Unstable component means that the component has unresolved dependency, script error etc. Installer cannot recover if we are already in component selection view and fetch new packages from a category which has unstable components if AllowUnstableComponent is false. Fixed so that allowing unstable components is forced when categories are used. Ideal solution would be to recover and rollback the install tree if unstable components are found but that requires huge changes to IFW. Task-id: QTIFW-1257 Change-Id: I786df1b8b54c238f50e15b94a06005e244417c97 Reviewed-by: Leena Miettinen Reviewed-by: Jani Heikkinen --- src/libs/installer/packagemanagergui.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libs') diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp index dfa7542c6..a053e9bff 100644 --- a/src/libs/installer/packagemanagergui.cpp +++ b/src/libs/installer/packagemanagergui.cpp @@ -1913,6 +1913,7 @@ void ComponentSelectionPage::entering() if (core->settings().repositoryCategories().count() > 0 && !core->isOfflineOnly() && !core->isUpdater()) { d->showCategoryLayout(true); + core->settings().setAllowUnstableComponents(true); } else { d->showCategoryLayout(false); } -- cgit v1.2.3 From 9c50894327b2cbb5c817a7b355c6600d92908147 Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Tue, 15 Jan 2019 07:24:11 +0200 Subject: Fix QWindowsPipeWriter error Read/write operators were not in sync causing a write fail in QWindowsPipeWriter. Task-id: QTIFW-1254 Change-Id: I0c2ead9c6af9ea0459f7ed55b09540c50cc60a6c Reviewed-by: Jani Heikkinen --- src/libs/installer/repository.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libs') diff --git a/src/libs/installer/repository.cpp b/src/libs/installer/repository.cpp index 249012786..5e31d81e2 100644 --- a/src/libs/installer/repository.cpp +++ b/src/libs/installer/repository.cpp @@ -279,7 +279,8 @@ void Repository::registerMetaType() QDataStream &operator>>(QDataStream &istream, Repository &repository) { QByteArray url, username, password, displayname, compressed; - istream >> url >> repository.m_default >> repository.m_enabled >> username >> password >> displayname; + istream >> url >> repository.m_default >> repository.m_enabled >> username >> password + >> displayname >> repository.m_archivename; repository.setUrl(QUrl::fromEncoded(QByteArray::fromBase64(url))); repository.setUsername(QString::fromUtf8(QByteArray::fromBase64(username))); repository.setPassword(QString::fromUtf8(QByteArray::fromBase64(password))); -- cgit v1.2.3 From a7382f8f40989bb7765a56bb6c10a7d28d3e6bf9 Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Fri, 18 Jan 2019 12:10:42 +0200 Subject: Fix build error in macOS Change-Id: Ib1e3cb1cead8a856d74ef23808072a085e4d268d Reviewed-by: Jani Heikkinen --- src/libs/installer/settings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libs') diff --git a/src/libs/installer/settings.cpp b/src/libs/installer/settings.cpp index 96063455b..e2beb035b 100644 --- a/src/libs/installer/settings.cpp +++ b/src/libs/installer/settings.cpp @@ -136,7 +136,7 @@ static QStringList readArgumentAttributes(QXmlStreamReader &reader, Settings::Pa } static QSet readRepositories(QXmlStreamReader &reader, bool isDefault, Settings::ParseMode parseMode, - QString *displayName = nullptr, bool *preselected = false) + QString *displayName = nullptr, bool *preselected = nullptr) { QSet set; while (reader.readNextStartElement()) { -- cgit v1.2.3 From 3d8c194690a43a6d2c48f808b02a4084bbf0142f Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Mon, 21 Jan 2019 12:19:01 +0200 Subject: Fix tmp file removal Tmp files were not removed when all or these were met: 1. Using Linux 2. Installing to a folder which needs authorization 3. Installing a component which has no metadata Tmp 'remoterepo-XXXXXX' is created before acquiring authorization. In previous version if above list was met, a tmp folder was created inside remoterepo-XXXXX after authorization leading to permission error when deleting the folder. Task-id: QTIFW-1268 Change-Id: I937fe3ce13440c817d1264c80ad060dfc966e456 Reviewed-by: Iikka Eklund --- src/libs/installer/metadatajob.cpp | 7 +++++++ src/libs/kdtools/filedownloader.cpp | 14 -------------- src/libs/kdtools/filedownloader.h | 1 - 3 files changed, 7 insertions(+), 15 deletions(-) (limited to 'src/libs') diff --git a/src/libs/installer/metadatajob.cpp b/src/libs/installer/metadatajob.cpp index e210528e1..7b80eefa9 100644 --- a/src/libs/installer/metadatajob.cpp +++ b/src/libs/installer/metadatajob.cpp @@ -606,7 +606,14 @@ MetadataJob::Status MetadataJob::parseUpdatesXml(const QList &re item.insert(TaskRole::Checksum, packageHash.toLatin1()); item.insert(TaskRole::Authenticator, QVariant::fromValue(authenticator)); item.insert(TaskRole::Name, packageName); + m_packages.append(item); + } else { + QString fileName = metadata.directory + QLatin1Char('/') + packageName; + QDir directory(fileName); + if (!directory.exists()) { + directory.mkdir(fileName); + } } } } diff --git a/src/libs/kdtools/filedownloader.cpp b/src/libs/kdtools/filedownloader.cpp index 5574a3af6..fce1a6208 100644 --- a/src/libs/kdtools/filedownloader.cpp +++ b/src/libs/kdtools/filedownloader.cpp @@ -660,18 +660,6 @@ void KDUpdater::FileDownloader::resetCheckSumData() d->m_hash.reset(); } -/*! - Creates a directory structure for \a fileName if it does not exist. -*/ -void KDUpdater::FileDownloader::createDirectoryForFile(const QString fileName) -{ - QFileInfo fileInfo(fileName); - if (!fileInfo.absoluteDir().exists()) { - QDir filePath = fileInfo.absoluteDir(); - filePath.mkdir(filePath.absolutePath()); - } -} - /*! Returns a copy of the proxy factory that this FileDownloader object is using to determine the proxies to be used for requests. @@ -825,7 +813,6 @@ void KDUpdater::LocalFileDownloader::doDownload() file->open(); d->destination = file; } else { - createDirectoryForFile(d->destFileName); d->destination = new QFile(d->destFileName, this); d->destination->open(QIODevice::ReadWrite | QIODevice::Truncate); } @@ -1478,7 +1465,6 @@ void KDUpdater::HttpDownloader::startDownload(const QUrl &url) file->open(); d->destination = file; } else { - createDirectoryForFile(d->destFileName); d->destination = new QFile(d->destFileName, this); d->destination->open(QIODevice::ReadWrite | QIODevice::Truncate); } diff --git a/src/libs/kdtools/filedownloader.h b/src/libs/kdtools/filedownloader.h index 10a041fba..ede20dcfa 100644 --- a/src/libs/kdtools/filedownloader.h +++ b/src/libs/kdtools/filedownloader.h @@ -140,7 +140,6 @@ protected: void addCheckSumData(const QByteArray &data); void addCheckSumData(const char *data, int length); void resetCheckSumData(); - void createDirectoryForFile(const QString fileName); private Q_SLOTS: virtual void doDownload() = 0; -- cgit v1.2.3 From 086a3e43ad2d501a5d2889be72f4b07b05d06e26 Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Fri, 25 Jan 2019 14:31:43 +0200 Subject: Reset error before every new metadata job Installer crashed when invalid QBSP package was selected and after that new categories were fetched. This was because the error message was not cleared, although the metadata job was succesfull, installer thought there was still problems causing it to eventually crash. Task-number: QTIFW-1272 Change-Id: I8a5a6fd8568dcabd9c857c462b83d0e0b77669f8 Reviewed-by: Iikka Eklund --- src/libs/installer/metadatajob.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libs') diff --git a/src/libs/installer/metadatajob.cpp b/src/libs/installer/metadatajob.cpp index 7b80eefa9..0a03e54cf 100644 --- a/src/libs/installer/metadatajob.cpp +++ b/src/libs/installer/metadatajob.cpp @@ -102,6 +102,8 @@ Repository MetadataJob::repositoryForDirectory(const QString &directory) const void MetadataJob::doStart() { + setError(Job::NoError); + setErrorString(QString()); if (!m_core) { emitFinishedWithError(Job::Canceled, tr("Missing package manager core engine.")); return; // We can't do anything here without core, so avoid tons of !m_core checks. -- cgit v1.2.3 From f229bc434329debf6467cb432571bf3a3d44f8fe Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Mon, 4 Feb 2019 09:49:14 +0200 Subject: Minor changes to category naming Change-Id: I7459535dd49047f9bf2d56a6598e9e631723444f Reviewed-by: Iikka Eklund --- src/libs/installer/componentselectionpage_p.cpp | 2 +- src/libs/installer/settings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libs') diff --git a/src/libs/installer/componentselectionpage_p.cpp b/src/libs/installer/componentselectionpage_p.cpp index bfe196ca3..8d023a501 100644 --- a/src/libs/installer/componentselectionpage_p.cpp +++ b/src/libs/installer/componentselectionpage_p.cpp @@ -193,7 +193,7 @@ void ComponentSelectionPagePrivate::setupCategoryLayout() m_categoryGroupBox->setTitle(m_core->settings().repositoryCategoryDisplayName()); m_categoryGroupBox->setObjectName(QLatin1String("CategoryGroupBox")); QVBoxLayout *categoryLayout = new QVBoxLayout(m_categoryGroupBox); - QPushButton *fetchCategoryButton = new QPushButton(tr("Fetch")); + QPushButton *fetchCategoryButton = new QPushButton(tr("Refresh")); fetchCategoryButton->setObjectName(QLatin1String("FetchCategoryButton")); connect(fetchCategoryButton, &QPushButton::clicked, this, &ComponentSelectionPagePrivate::fetchRepositoryCategories); diff --git a/src/libs/installer/settings.cpp b/src/libs/installer/settings.cpp index e2beb035b..e1e4f0c13 100644 --- a/src/libs/installer/settings.cpp +++ b/src/libs/installer/settings.cpp @@ -826,7 +826,7 @@ void Settings::setSaveDefaultRepositories(bool save) QString Settings::repositoryCategoryDisplayName() const { QString displayName = d->m_data.value(QLatin1String(scRepositoryCategoryDisplayName)).toString(); - return displayName.isEmpty() ? tr("Package categories") : displayName; + return displayName.isEmpty() ? tr("Show package categories") : displayName; } void Settings::setRepositoryCategoryDisplayName(const QString& name) -- cgit v1.2.3 From 2a791f276dadc75afb39e4d3d44ca056c1912447 Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Mon, 4 Feb 2019 10:39:56 +0200 Subject: Add tooltip for categories Change-Id: I852a236bc2cff0d532a825581e3da4dcdcbbab90 Reviewed-by: Iikka Eklund --- src/libs/installer/componentselectionpage_p.cpp | 1 + src/libs/installer/repositorycategory.cpp | 13 ++++++++++++- src/libs/installer/repositorycategory.h | 4 ++++ src/libs/installer/settings.cpp | 10 ++++++++-- 4 files changed, 25 insertions(+), 3 deletions(-) (limited to 'src/libs') diff --git a/src/libs/installer/componentselectionpage_p.cpp b/src/libs/installer/componentselectionpage_p.cpp index 8d023a501..4e7acc837 100644 --- a/src/libs/installer/componentselectionpage_p.cpp +++ b/src/libs/installer/componentselectionpage_p.cpp @@ -205,6 +205,7 @@ void ComponentSelectionPagePrivate::setupCategoryLayout() connect(checkBox, &QCheckBox::stateChanged, this, &ComponentSelectionPagePrivate::checkboxStateChanged); checkBox->setText(repository.displayname()); + checkBox->setToolTip(repository.tooltip()); categoryLayout->addWidget(checkBox); } diff --git a/src/libs/installer/repositorycategory.cpp b/src/libs/installer/repositorycategory.cpp index af7f6e818..42fb41c99 100644 --- a/src/libs/installer/repositorycategory.cpp +++ b/src/libs/installer/repositorycategory.cpp @@ -58,7 +58,8 @@ RepositoryCategory::RepositoryCategory() Constructs a new category by using all fields of the given category \a other. */ RepositoryCategory::RepositoryCategory(const RepositoryCategory &other) - : m_displayname(other.m_displayname), m_data(other.m_data), m_enabled(other.m_enabled) + : m_displayname(other.m_displayname), m_data(other.m_data), m_enabled(other.m_enabled), + m_tooltip(other.m_tooltip) { registerMetaType(); } @@ -86,6 +87,16 @@ void RepositoryCategory::setDisplayName(const QString &displayname) m_displayname = displayname; } +QString RepositoryCategory::tooltip() const +{ + return m_tooltip; +} + +void RepositoryCategory::setTooltip(const QString &tooltip) +{ + m_tooltip = tooltip; +} + /*! Returns the list of repositories the category has. */ diff --git a/src/libs/installer/repositorycategory.h b/src/libs/installer/repositorycategory.h index 315af761b..98d5df7bd 100644 --- a/src/libs/installer/repositorycategory.h +++ b/src/libs/installer/repositorycategory.h @@ -50,6 +50,9 @@ public: QString displayname() const; void setDisplayName(const QString &displayname); + QString tooltip() const; + void setTooltip(const QString &tooltip); + QSet repositories() const; void setRepositories(const QSet repositories); void addRepository(const Repository repository); @@ -68,6 +71,7 @@ public: private: QVariantHash m_data; QString m_displayname; + QString m_tooltip; bool m_enabled; }; diff --git a/src/libs/installer/settings.cpp b/src/libs/installer/settings.cpp index e1e4f0c13..13eb2ce40 100644 --- a/src/libs/installer/settings.cpp +++ b/src/libs/installer/settings.cpp @@ -136,7 +136,8 @@ static QStringList readArgumentAttributes(QXmlStreamReader &reader, Settings::Pa } static QSet readRepositories(QXmlStreamReader &reader, bool isDefault, Settings::ParseMode parseMode, - QString *displayName = nullptr, bool *preselected = nullptr) + QString *displayName = nullptr, bool *preselected = nullptr, + QString *tooltip = nullptr) { QSet set; while (reader.readNextStartElement()) { @@ -169,6 +170,8 @@ static QSet readRepositories(QXmlStreamReader &reader, bool isDefaul if (displayName && !displayName->isEmpty()) repo.setArchiveName(*displayName); set.insert(repo); + } else if (reader.name() == QLatin1String("Tooltip")) { + *tooltip = reader.readElementText(); } else if (reader.name() == QLatin1String("Preselected")) { *preselected = (reader.readElementText() == QLatin1String("true") ? true : false); } else { @@ -192,9 +195,12 @@ static QSet readRepositoryCategories(QXmlStreamReader &reade if (reader.name() == QLatin1String("RemoteRepositories")) { RepositoryCategory archiveRepo; QString displayName; + QString tooltip; bool preselected = false; - archiveRepo.setRepositories(readRepositories(reader, isDefault, parseMode, &displayName, &preselected)); + archiveRepo.setRepositories(readRepositories(reader, isDefault, parseMode, + &displayName, &preselected, &tooltip)); archiveRepo.setDisplayName(displayName); + archiveRepo.setTooltip(tooltip); archiveRepo.setEnabled(preselected); archiveSet.insert(archiveRepo); } else if (reader.name() == QLatin1String("RepositoryCategoryDisplayname")) { -- cgit v1.2.3 From d6768e5a16521c11fffb4b50eaf085f8c13272a7 Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Tue, 22 Jan 2019 08:52:47 +0100 Subject: Write desktop entry and items to the correct folders Data should not be written to directories in XDG_DATA_DIRS. The spec state that files should only be writen to the directory in XDG_DATA_HOME. Change-Id: I755963fa2f70d03c77d7beec0e3f87accde925d0 Fixes: QTIFW-1269 Reviewed-by: Nikos Chantziaras Reviewed-by: Leena Miettinen Reviewed-by: Katja Marttila --- src/libs/installer/createdesktopentryoperation.cpp | 6 +----- src/libs/installer/installiconsoperation.cpp | 10 ++++------ 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'src/libs') diff --git a/src/libs/installer/createdesktopentryoperation.cpp b/src/libs/installer/createdesktopentryoperation.cpp index d2e71b14f..17e165777 100644 --- a/src/libs/installer/createdesktopentryoperation.cpp +++ b/src/libs/installer/createdesktopentryoperation.cpp @@ -49,17 +49,13 @@ QString CreateDesktopEntryOperation::absoluteFileName() if (hasValue(QLatin1String("directory"))) return QDir(value(QLatin1String("directory")).toString()).absoluteFilePath(filename); - QStringList XDG_DATA_DIRS = QString::fromLocal8Bit(qgetenv("XDG_DATA_DIRS")) - .split(QLatin1Char(':'), - QString::SkipEmptyParts); QStringList XDG_DATA_HOME = QString::fromLocal8Bit(qgetenv("XDG_DATA_HOME")) .split(QLatin1Char(':'), QString::SkipEmptyParts); - XDG_DATA_DIRS.push_back(QLatin1String("/usr/share")); // default path XDG_DATA_HOME.push_back(QDir::home().absoluteFilePath(QLatin1String(".local/share"))); // default path - const QStringList directories = XDG_DATA_DIRS + XDG_DATA_HOME; + const QStringList directories = XDG_DATA_HOME; QString directory; for (QStringList::const_iterator it = directories.begin(); it != directories.end(); ++it) { if (it->isEmpty()) diff --git a/src/libs/installer/installiconsoperation.cpp b/src/libs/installer/installiconsoperation.cpp index 4b8346e18..15d47c72a 100644 --- a/src/libs/installer/installiconsoperation.cpp +++ b/src/libs/installer/installiconsoperation.cpp @@ -42,20 +42,18 @@ QString InstallIconsOperation::targetDirectory() if (hasValue(QLatin1String("targetdirectory"))) return value(QLatin1String("targetdirectory")).toString(); - QStringList XDG_DATA_DIRS = QString::fromLocal8Bit(qgetenv("XDG_DATA_DIRS")) + QStringList XDG_DATA_HOME = QString::fromLocal8Bit(qgetenv("XDG_DATA_HOME")) .split(QLatin1Char(':'), QString::SkipEmptyParts); - XDG_DATA_DIRS.push_back(QLatin1String("/usr/share/pixmaps")); // default path - XDG_DATA_DIRS.push_back(QDir::home().absoluteFilePath(QLatin1String(".local/share/icons"))); // default path - XDG_DATA_DIRS.push_back(QDir::home().absoluteFilePath(QLatin1String(".icons"))); // default path + XDG_DATA_HOME.push_back(QDir::home().absoluteFilePath(QLatin1String(".local/share/icons"))); // default path QString directory; - const QStringList& directories = XDG_DATA_DIRS; + const QStringList& directories = XDG_DATA_HOME; for (QStringList::const_iterator it = directories.begin(); it != directories.end(); ++it) { if (it->isEmpty()) continue; - // our default dirs are correct, XDG_DATA_DIRS set via env need "icon" at the end + // our default dirs are correct, XDG_DATA_HOME set via env needs "icon" at the end if ((it + 1 == directories.end()) || (it + 2 == directories.end()) || (it + 3 == directories.end())) directory = QDir(*it).absolutePath(); else -- cgit v1.2.3 From f9fe3bc4526b8b091ad261ed465bcd353db7de5e Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Wed, 6 Feb 2019 15:10:15 +0200 Subject: Change quantity information unit text Task-number: QTIFW-1288 Change-Id: Ie5a6fdc27bb5eb96b080638839ee09f06370848e Reviewed-by: Jani Heikkinen --- src/libs/installer/fileutils.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/libs') diff --git a/src/libs/installer/fileutils.cpp b/src/libs/installer/fileutils.cpp index 590654ed7..4347c67da 100644 --- a/src/libs/installer/fileutils.cpp +++ b/src/libs/installer/fileutils.cpp @@ -130,14 +130,14 @@ QString QInstaller::humanReadableSize(const qint64 &size, int precision) static QStringList measures; if (measures.isEmpty()) measures << QCoreApplication::translate("QInstaller", "bytes") - << QCoreApplication::translate("QInstaller", "KiB") - << QCoreApplication::translate("QInstaller", "MiB") - << QCoreApplication::translate("QInstaller", "GiB") - << QCoreApplication::translate("QInstaller", "TiB") - << QCoreApplication::translate("QInstaller", "PiB") - << QCoreApplication::translate("QInstaller", "EiB") - << QCoreApplication::translate("QInstaller", "ZiB") - << QCoreApplication::translate("QInstaller", "YiB"); + << QCoreApplication::translate("QInstaller", "KB") + << QCoreApplication::translate("QInstaller", "MB") + << QCoreApplication::translate("QInstaller", "GB") + << QCoreApplication::translate("QInstaller", "TB") + << QCoreApplication::translate("QInstaller", "PB") + << QCoreApplication::translate("QInstaller", "EB") + << QCoreApplication::translate("QInstaller", "ZB") + << QCoreApplication::translate("QInstaller", "YB"); QStringListIterator it(measures); QString measure(it.next()); -- cgit v1.2.3 From 6f655ff6408ca7060f02860f8a3c84e28381f820 Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Tue, 19 Feb 2019 13:22:59 +0200 Subject: Fix essential update Essential components should be updated before any other component is updated/installed. This did not happen always as when one essential component was found and that did not have any updates, the search was stopped and normal install flow was continued. Fixed so that all essential components are checked if they contain update. Task-number: QTIFW-1299 Change-Id: I754c50f672dd5f13105c710522603e90799d61c5 Reviewed-by: Iikka Eklund --- src/libs/installer/packagemanagercore.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libs') diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp index a80fc608e..78198156e 100644 --- a/src/libs/installer/packagemanagercore.cpp +++ b/src/libs/installer/packagemanagercore.cpp @@ -1220,17 +1220,17 @@ bool PackageManagerCore::fetchPackagesTree(const PackagesList &packages, const L const QString name = update->data(scName).toString(); if (!installedPackages.contains(name)) { success = false; - break; // unusual, the maintenance tool should always be available + continue; // unusual, the maintenance tool should always be available } const LocalPackage localPackage = installedPackages.value(name); const QString updateVersion = update->data(scVersion).toString(); if (KDUpdater::compareVersion(updateVersion, localPackage.version) <= 0) - break; // remote version equals or is less than the installed maintenance tool + continue; // remote version equals or is less than the installed maintenance tool const QDate updateDate = update->data(scReleaseDate).toDate(); if (localPackage.lastUpdateDate >= updateDate) - break; // remote release date equals or is less than the installed maintenance tool + continue; // remote release date equals or is less than the installed maintenance tool success = false; break; // we found a newer version of the maintenance tool -- cgit v1.2.3 From 2d6458cd9d61da107e7cd088644157264b1cc4ef Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Wed, 20 Feb 2019 13:44:32 +0200 Subject: Fix RepositoryUpdate functionality After adding the categories, RepositoryUpdate got broken. This commit fixes the issue Task-number: QTIFW-1300 Change-Id: I01671a547712088d344852dc169661ac9587894e Reviewed-by: Antti Kokko --- src/libs/installer/metadatajob.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libs') diff --git a/src/libs/installer/metadatajob.cpp b/src/libs/installer/metadatajob.cpp index 0a03e54cf..3beda7ef2 100644 --- a/src/libs/installer/metadatajob.cpp +++ b/src/libs/installer/metadatajob.cpp @@ -700,11 +700,13 @@ MetadataJob::Status MetadataJob::parseUpdatesXml(const QList &re if (tmpRepositories.count() > 0) { s.addTemporaryRepositories(tmpRepositories, true); QFile::remove(result.target()); + m_metaFromDefaultRepositories.clear(); return XmlDownloadRetry; } } else if (s.updateDefaultRepositories(repositoryUpdates) == Settings::UpdatesApplied) { if (m_core->isMaintainer()) m_core->writeMaintenanceConfigFiles(); + m_metaFromDefaultRepositories.clear(); QFile::remove(result.target()); return XmlDownloadRetry; } -- cgit v1.2.3