Hello community, here is the log from the commit of package zeal for openSUSE:Factory checked in at 2016-10-13 11:32:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/zeal (Old) and /work/SRC/openSUSE:Factory/.zeal.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "zeal" Changes: -------- --- /work/SRC/openSUSE:Factory/zeal/zeal.changes 2016-09-30 15:31:58.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.zeal.new/zeal.changes 2016-10-13 11:32:02.000000000 +0200 @@ -1,0 +2,10 @@ +Tue Oct 11 19:01:38 UTC 2016 - [email protected] + +- Update to 0.3.1 + * Fixed random crashing on application start and exit. (#595) + * Fixed web view hanging caused by URLs with no schema. (#532) + * Fixed docset removal on Windows. (#621) + * Fixed race condition (and warning) in docset removal logic. + * Fixed docset selection with Select All shortcut (Ctrl+A). + +------------------------------------------------------------------- Old: ---- zeal-0.3.0.tar.gz New: ---- zeal-0.3.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ zeal.spec ++++++ --- /var/tmp/diff_new_pack.avq5dD/_old 2016-10-13 11:32:03.000000000 +0200 +++ /var/tmp/diff_new_pack.avq5dD/_new 2016-10-13 11:32:03.000000000 +0200 @@ -17,7 +17,7 @@ Name: zeal -Version: 0.3.0 +Version: 0.3.1 Release: 0 Summary: Offline API documentation browser License: GPL-3.0 ++++++ zeal-0.3.0.tar.gz -> zeal-0.3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zeal-0.3.0/README.md new/zeal-0.3.1/README.md --- old/zeal-0.3.0/README.md 2016-09-23 05:56:02.000000000 +0200 +++ new/zeal-0.3.1/README.md 2016-10-10 08:05:43.000000000 +0200 @@ -35,7 +35,7 @@ ## How to use -After installing Zeal, you need to download docsets. Go to *File->Options->Docsets*, select the ones you want, and click the *Download* button. +After installing Zeal, you need to download docsets. Go to *Tools->Docsets*, select the ones you want, and click the *Download* button. ## How to compile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zeal-0.3.0/qmake/common.pri new/zeal-0.3.1/qmake/common.pri --- old/zeal-0.3.0/qmake/common.pri 2016-09-23 05:56:02.000000000 +0200 +++ new/zeal-0.3.1/qmake/common.pri 2016-10-10 08:05:43.000000000 +0200 @@ -30,7 +30,7 @@ UI_DIR = $$BUILD_ROOT/.ui # Application version -VERSION = 0.3.0 +VERSION = 0.3.1 DEFINES += ZEAL_VERSION=\\\"$${VERSION}\\\" # Browser engine @@ -63,3 +63,10 @@ unix:!macx { isEmpty(PREFIX): PREFIX = /usr } + +unix:!macx:packagesExist(appindicator-0.1) { + CONFIG += link_pkgconfig + PKGCONFIG += appindicator-0.1 gtk+-2.0 + DEFINES += USE_APPINDICATOR + message("AppIndicator support: Yes.") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zeal-0.3.0/src/libs/core/application.cpp new/zeal-0.3.1/src/libs/core/application.cpp --- old/zeal-0.3.0/src/libs/core/application.cpp 2016-09-23 05:56:02.000000000 +0200 +++ new/zeal-0.3.1/src/libs/core/application.cpp 2016-10-10 08:05:43.000000000 +0200 @@ -23,6 +23,7 @@ #include "application.h" #include "extractor.h" +#include "networkaccessmanager.h" #include "settings.h" #include <registry/docsetregistry.h> @@ -35,7 +36,6 @@ #include <QJsonDocument> #include <QJsonObject> #include <QMetaObject> -#include <QNetworkAccessManager> #include <QNetworkProxy> #include <QNetworkReply> #include <QScopedPointer> @@ -59,7 +59,7 @@ m_instance = this; m_settings = new Settings(this); - m_networkManager = new QNetworkAccessManager(this); + m_networkManager = new NetworkAccessManager(this); // Extractor setup m_extractorThread = new QThread(this); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zeal-0.3.0/src/libs/core/networkaccessmanager.cpp new/zeal-0.3.1/src/libs/core/networkaccessmanager.cpp --- old/zeal-0.3.0/src/libs/core/networkaccessmanager.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/zeal-0.3.1/src/libs/core/networkaccessmanager.cpp 2016-10-10 08:05:43.000000000 +0200 @@ -0,0 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Oleg Shparber +** Contact: https://go.zealdocs.org/l/contact +** +** This file is part of Zeal. +** +** Zeal is free software: you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation, either version 3 of the License, or +** (at your option) any later version. +** +** Zeal is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with Zeal. If not, see <https://www.gnu.org/licenses/>. +** +****************************************************************************/ + +#include "networkaccessmanager.h" + +#include <QNetworkRequest> + +using namespace Zeal::Core; + +NetworkAccessManager::NetworkAccessManager(QObject *parent) + : QNetworkAccessManager(parent) +{ +} + +QNetworkReply *NetworkAccessManager::createRequest(QNetworkAccessManager::Operation op, + const QNetworkRequest &request, + QIODevice *outgoingData) +{ + // Detect URLs without schema, and prevent them from being requested on a local filesytem. + const QUrl url = request.url(); + if (url.scheme() == QLatin1String("file") && !url.host().isEmpty()) + return QNetworkAccessManager::createRequest(GetOperation, QNetworkRequest(), outgoingData); + + return QNetworkAccessManager::createRequest(op, request, outgoingData); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zeal-0.3.0/src/libs/core/networkaccessmanager.h new/zeal-0.3.1/src/libs/core/networkaccessmanager.h --- old/zeal-0.3.0/src/libs/core/networkaccessmanager.h 1970-01-01 01:00:00.000000000 +0100 +++ new/zeal-0.3.1/src/libs/core/networkaccessmanager.h 2016-10-10 08:05:43.000000000 +0200 @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Oleg Shparber +** Contact: https://go.zealdocs.org/l/contact +** +** This file is part of Zeal. +** +** Zeal is free software: you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation, either version 3 of the License, or +** (at your option) any later version. +** +** Zeal is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with Zeal. If not, see <https://www.gnu.org/licenses/>. +** +****************************************************************************/ + +#ifndef ZEAL_CORE_NETWORKACCESSMANAGER_H +#define ZEAL_CORE_NETWORKACCESSMANAGER_H + +#include <QNetworkAccessManager> + +namespace Zeal { +namespace Core { + +class NetworkAccessManager : public QNetworkAccessManager +{ + Q_OBJECT +public: + NetworkAccessManager(QObject *parent = nullptr); + +protected: + QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, + QIODevice *outgoingData = nullptr) override; +}; + +} // namespace Core +} // namespace Zeal + +#endif // ZEAL_CORE_NETWORKACCESSMANAGER_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zeal-0.3.0/src/libs/ui/docsetsdialog.cpp new/zeal-0.3.1/src/libs/ui/docsetsdialog.cpp --- old/zeal-0.3.0/src/libs/ui/docsetsdialog.cpp 2016-09-23 05:56:02.000000000 +0200 +++ new/zeal-0.3.1/src/libs/ui/docsetsdialog.cpp 2016-10-10 08:05:43.000000000 +0200 @@ -98,7 +98,7 @@ [this, selectionModel]() { ui->removeDocsetsButton->setEnabled(selectionModel->hasSelection()); - for (const QModelIndex &index : selectionModel->selectedIndexes()) { + for (const QModelIndex &index : selectionModel->selectedRows()) { if (index.data(ListModel::UpdateAvailableRole).toBool()) { ui->updateSelectedDocsetsButton->setEnabled(true); return; @@ -135,7 +135,7 @@ selectionModel = ui->availableDocsetList->selectionModel(); connect(selectionModel, &QItemSelectionModel::selectionChanged, [this, selectionModel]() { - for (const QModelIndex &index : selectionModel->selectedIndexes()) { + for (const QModelIndex &index : selectionModel->selectedRows()) { if (!index.data(ProgressItemDelegate::ShowProgressRole).toBool()) { ui->downloadDocsetsButton->setEnabled(true); return; @@ -217,7 +217,7 @@ void DocsetsDialog::updateSelectedDocsets() { - for (const QModelIndex &index : ui->installedDocsetList->selectionModel()->selectedIndexes()) { + for (const QModelIndex &index : ui->installedDocsetList->selectionModel()->selectedRows()) { if (!index.data(Registry::ListModel::UpdateAvailableRole).toBool()) continue; @@ -245,7 +245,7 @@ int ret; - const QModelIndexList selectedIndexes = selectonModel->selectedIndexes(); + const QModelIndexList selectedIndexes = selectonModel->selectedRows(); if (selectedIndexes.size() == 1) { const QString docsetTitle = selectedIndexes.first().data().toString(); ret = QMessageBox::question(this, QStringLiteral("Zeal"), @@ -286,7 +286,7 @@ void DocsetsDialog::downloadSelectedDocsets() { QItemSelectionModel *selectionModel = ui->availableDocsetList->selectionModel(); - for (const QModelIndex &index : selectionModel->selectedIndexes()) { + for (const QModelIndex &index : selectionModel->selectedRows()) { selectionModel->select(index, QItemSelectionModel::Deselect); // Do nothing if a download is already in progress. @@ -693,18 +693,21 @@ const QString tmpPath = docsetPath + QLatin1String(".deleteme.") + QString::number(QDateTime::currentMSecsSinceEpoch()); - // Rename first to allow simultaneous installation. - // TODO: Check for error - QDir().rename(docsetPath, tmpPath); - + // Remove from registry first to avoid renaming files in use on Windows. m_docsetRegistry->remove(name); - QFuture<bool> future = QtConcurrent::run([tmpPath] { - return QDir(tmpPath).removeRecursively(); - }); + // Rename first to allow simultaneous installation. + if (!QDir().rename(docsetPath, tmpPath)) { + const QString error = tr("Cannot delete docset <b>%1</b>! Please try closing other " + "applications first, as they may be accessing the docset " + "files.").arg(title); + QMessageBox::warning(this, QStringLiteral("Zeal"), error); + m_docsetsBeingDeleted.removeOne(name); + m_docsetRegistry->addDocset(docsetPath); + return; + } QFutureWatcher<bool> *watcher = new QFutureWatcher<bool>(); - watcher->setFuture(future); connect(watcher, &QFutureWatcher<void>::finished, [=] { if (!watcher->result()) { QMessageBox::warning(this, QStringLiteral("Zeal"), @@ -719,6 +722,10 @@ m_docsetsBeingDeleted.removeOne(name); }); + + watcher->setFuture(QtConcurrent::run([tmpPath] { + return QDir(tmpPath).removeRecursively(); + })); } void DocsetsDialog::updateCombinedProgress() @@ -749,7 +756,7 @@ ui->addFeedButton->setEnabled(true); QItemSelectionModel *selectionModel = ui->installedDocsetList->selectionModel(); bool hasSelectedUpdates = false; - for (const QModelIndex &index : selectionModel->selectedIndexes()) { + for (const QModelIndex &index : selectionModel->selectedRows()) { if (index.data(Registry::ListModel::UpdateAvailableRole).toBool()) { hasSelectedUpdates = true; break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zeal-0.3.0/src/libs/ui/forms/docsetsdialog.ui new/zeal-0.3.1/src/libs/ui/forms/docsetsdialog.ui --- old/zeal-0.3.0/src/libs/ui/forms/docsetsdialog.ui 2016-09-23 05:56:02.000000000 +0200 +++ new/zeal-0.3.1/src/libs/ui/forms/docsetsdialog.ui 2016-10-10 08:05:43.000000000 +0200 @@ -32,6 +32,9 @@ <property name="selectionMode"> <enum>QAbstractItemView::ExtendedSelection</enum> </property> + <property name="selectionBehavior"> + <enum>QAbstractItemView::SelectRows</enum> + </property> <property name="iconSize"> <size> <width>16</width> @@ -116,6 +119,9 @@ <property name="selectionMode"> <enum>QAbstractItemView::ExtendedSelection</enum> </property> + <property name="selectionBehavior"> + <enum>QAbstractItemView::SelectRows</enum> + </property> <property name="iconSize"> <size> <width>16</width> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zeal-0.3.0/src/libs/ui/ui.pri new/zeal-0.3.1/src/libs/ui/ui.pri --- old/zeal-0.3.0/src/libs/ui/ui.pri 2016-09-23 05:56:02.000000000 +0200 +++ new/zeal-0.3.1/src/libs/ui/ui.pri 2016-10-10 08:05:43.000000000 +0200 @@ -2,13 +2,6 @@ QT += widgets -unix:!macx:packagesExist(appindicator-0.1) { - CONFIG += link_pkgconfig - PKGCONFIG += appindicator-0.1 gtk+-2.0 - DEFINES += USE_APPINDICATOR - message("AppIndicator support: Yes.") -} - # QxtGlobalShortcut dependencies unix:!macx { QT += x11extras
