- support QT_VERSION < 0x050400
- "Explore download dir" (under Windows)
This commit is contained in:
Martchus 2016-02-05 20:31:45 +01:00
parent 41c4790a5f
commit 9856bff438
4 changed files with 20 additions and 13 deletions

View File

@ -5,11 +5,9 @@
#include <QWizardPage> #include <QWizardPage>
#include <QNetworkProxy> #include <QNetworkProxy>
QT_BEGIN_NAMESPACE QT_FORWARD_DECLARE_CLASS(QCheckBox)
class QCheckBox; QT_FORWARD_DECLARE_CLASS(QTreeView)
class QTreeView; QT_FORWARD_DECLARE_CLASS(QItemSelection)
class QItemSelection;
QT_END_NAMESPACE
namespace Widgets { namespace Widgets {
class ClearLineEdit; class ClearLineEdit;

View File

@ -4,10 +4,8 @@
#include <QObject> #include <QObject>
#include <QSslError> #include <QSslError>
QT_BEGIN_NAMESPACE QT_FORWARD_DECLARE_CLASS(QString)
class QWidget; QT_FORWARD_DECLARE_CLASS(QWidget)
class QString;
QT_END_NAMESPACE
namespace Network { namespace Network {
class Download; class Download;

View File

@ -23,6 +23,7 @@
#include <qtutilities/aboutdialog/aboutdialog.h> #include <qtutilities/aboutdialog/aboutdialog.h>
#include <qtutilities/enterpassworddialog/enterpassworddialog.h> #include <qtutilities/enterpassworddialog/enterpassworddialog.h>
#include <qtutilities/misc/desktoputils.h>
#include <c++utilities/conversion/stringconversion.h> #include <c++utilities/conversion/stringconversion.h>
#include <c++utilities/chrono/timespan.h> #include <c++utilities/chrono/timespan.h>
@ -753,7 +754,7 @@ void MainWindow::exploreDownloadsDir()
QMessageBox::warning(this, windowTitle(), tr("There is no download target selected.")); QMessageBox::warning(this, windowTitle(), tr("There is no download target selected."));
} else { } else {
if(QDir(GeneralTargetOptionPage::targetDirectory()).exists()) { if(QDir(GeneralTargetOptionPage::targetDirectory()).exists()) {
QDesktopServices::openUrl(QUrl(QStringLiteral("file://%1").arg(GeneralTargetOptionPage::targetDirectory()), QUrl::TolerantMode)); DesktopUtils::openLocalFileOrDir(GeneralTargetOptionPage::targetDirectory());
} else { } else {
QMessageBox::warning(this, windowTitle(), tr("The selected download directory doesn't exist anymore.")); QMessageBox::warning(this, windowTitle(), tr("The selected download directory doesn't exist anymore."));
} }

View File

@ -31,15 +31,25 @@ VimeoDownload::VimeoDownload(const QString &id, QObject *parent) :
Download *VimeoDownload::infoRequestDownload(bool &success, QString &reasonForFail) Download *VimeoDownload::infoRequestDownload(bool &success, QString &reasonForFail)
{ {
const auto pathParts = initialUrl().path(QUrl::FullyDecoded).splitRef(QChar('/'), QString::SkipEmptyParts); const auto pathParts = initialUrl().path(QUrl::FullyDecoded).
#if QT_VERSION >= 0x050400
splitRef
#else
split
#endif
(QChar('/'), QString::SkipEmptyParts);
if(pathParts.size() < 2) { if(pathParts.size() < 2) {
const auto &id = pathParts.back(); const auto &id = pathParts.back();
bool isInt; bool isInt;
id.toULongLong(&isInt); id.toULongLong(&isInt);
if(isInt) { if(isInt) {
setId(id.toString()); setId(id
#if QT_VERSION >= 0x050400
.toString()
#endif
);
success = true; success = true;
return new HttpDownload(QUrl(QStringLiteral("https://player.vimeo.com/video/%1/config").arg(id.toString()))); return new HttpDownload(QUrl(QStringLiteral("https://player.vimeo.com/video/%1/config").arg(this->id())));
} }
} }
success = false; success = false;