From: Jakob Haufe Date: Tue, 29 Sep 2020 08:49:35 +0000 (+0200) Subject: New upstream version 3.4.2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=297c5a7db3d7359f3a445758c4ac8a8b4887391e;p=minitube New upstream version 3.4.2 --- diff --git a/icons/dark/16/search-duration_active.png b/icons/dark/16/search-duration_active.png index a1d9372..9f4c751 100644 Binary files a/icons/dark/16/search-duration_active.png and b/icons/dark/16/search-duration_active.png differ diff --git a/icons/dark/16/search-duration_active@2x.png b/icons/dark/16/search-duration_active@2x.png index 4a38e7e..1b5d46a 100644 Binary files a/icons/dark/16/search-duration_active@2x.png and b/icons/dark/16/search-duration_active@2x.png differ diff --git a/icons/dark/16/search-duration_disabled.png b/icons/dark/16/search-duration_disabled.png index a1d9372..4f83f8d 100644 Binary files a/icons/dark/16/search-duration_disabled.png and b/icons/dark/16/search-duration_disabled.png differ diff --git a/icons/dark/16/search-duration_disabled@2x.png b/icons/dark/16/search-duration_disabled@2x.png index 4a38e7e..101333a 100644 Binary files a/icons/dark/16/search-duration_disabled@2x.png and b/icons/dark/16/search-duration_disabled@2x.png differ diff --git a/icons/dark/16/search-duration_normal.png b/icons/dark/16/search-duration_normal.png index a1d9372..b68ef5f 100644 Binary files a/icons/dark/16/search-duration_normal.png and b/icons/dark/16/search-duration_normal.png differ diff --git a/icons/dark/16/search-duration_normal@2x.png b/icons/dark/16/search-duration_normal@2x.png index 4a38e7e..e6c4ad3 100644 Binary files a/icons/dark/16/search-duration_normal@2x.png and b/icons/dark/16/search-duration_normal@2x.png differ diff --git a/icons/dark/16/search-time_active.png b/icons/dark/16/search-time_active.png index 4196de9..9696953 100644 Binary files a/icons/dark/16/search-time_active.png and b/icons/dark/16/search-time_active.png differ diff --git a/icons/dark/16/search-time_active@2x.png b/icons/dark/16/search-time_active@2x.png index 417dd9b..0c92bb8 100644 Binary files a/icons/dark/16/search-time_active@2x.png and b/icons/dark/16/search-time_active@2x.png differ diff --git a/icons/dark/16/search-time_disabled.png b/icons/dark/16/search-time_disabled.png index 59f9bc9..82972a2 100644 Binary files a/icons/dark/16/search-time_disabled.png and b/icons/dark/16/search-time_disabled.png differ diff --git a/icons/dark/16/search-time_disabled@2x.png b/icons/dark/16/search-time_disabled@2x.png index 7b388ef..4b22ab7 100644 Binary files a/icons/dark/16/search-time_disabled@2x.png and b/icons/dark/16/search-time_disabled@2x.png differ diff --git a/icons/dark/16/search-time_normal.png b/icons/dark/16/search-time_normal.png index e98b7d5..204833e 100644 Binary files a/icons/dark/16/search-time_normal.png and b/icons/dark/16/search-time_normal.png differ diff --git a/icons/dark/16/search-time_normal@2x.png b/icons/dark/16/search-time_normal@2x.png index 0a1b0c6..2e59fd4 100644 Binary files a/icons/dark/16/search-time_normal@2x.png and b/icons/dark/16/search-time_normal@2x.png differ diff --git a/icons/light/16/search-duration_active.png b/icons/light/16/search-duration_active.png index a1d9372..2780ba9 100644 Binary files a/icons/light/16/search-duration_active.png and b/icons/light/16/search-duration_active.png differ diff --git a/icons/light/16/search-duration_active@2x.png b/icons/light/16/search-duration_active@2x.png index 4a38e7e..cdb735d 100644 Binary files a/icons/light/16/search-duration_active@2x.png and b/icons/light/16/search-duration_active@2x.png differ diff --git a/icons/light/16/search-duration_disabled.png b/icons/light/16/search-duration_disabled.png index a1d9372..be987a5 100644 Binary files a/icons/light/16/search-duration_disabled.png and b/icons/light/16/search-duration_disabled.png differ diff --git a/icons/light/16/search-duration_disabled@2x.png b/icons/light/16/search-duration_disabled@2x.png index 4a38e7e..8c98575 100644 Binary files a/icons/light/16/search-duration_disabled@2x.png and b/icons/light/16/search-duration_disabled@2x.png differ diff --git a/icons/light/16/search-duration_normal.png b/icons/light/16/search-duration_normal.png index a1d9372..4f83f8d 100644 Binary files a/icons/light/16/search-duration_normal.png and b/icons/light/16/search-duration_normal.png differ diff --git a/icons/light/16/search-duration_normal@2x.png b/icons/light/16/search-duration_normal@2x.png index 4a38e7e..101333a 100644 Binary files a/icons/light/16/search-duration_normal@2x.png and b/icons/light/16/search-duration_normal@2x.png differ diff --git a/icons/light/16/search-time_active.png b/icons/light/16/search-time_active.png index 2d0c8f7..29a57b5 100644 Binary files a/icons/light/16/search-time_active.png and b/icons/light/16/search-time_active.png differ diff --git a/icons/light/16/search-time_active@2x.png b/icons/light/16/search-time_active@2x.png index 6caccae..6322fac 100644 Binary files a/icons/light/16/search-time_active@2x.png and b/icons/light/16/search-time_active@2x.png differ diff --git a/icons/light/16/search-time_disabled.png b/icons/light/16/search-time_disabled.png index 4d93df3..7cdb3b6 100644 Binary files a/icons/light/16/search-time_disabled.png and b/icons/light/16/search-time_disabled.png differ diff --git a/icons/light/16/search-time_disabled@2x.png b/icons/light/16/search-time_disabled@2x.png index 992f29b..1472701 100644 Binary files a/icons/light/16/search-time_disabled@2x.png and b/icons/light/16/search-time_disabled@2x.png differ diff --git a/icons/light/16/search-time_normal.png b/icons/light/16/search-time_normal.png index 59f9bc9..82972a2 100644 Binary files a/icons/light/16/search-time_normal.png and b/icons/light/16/search-time_normal.png differ diff --git a/icons/light/16/search-time_normal@2x.png b/icons/light/16/search-time_normal@2x.png index 7b388ef..4b22ab7 100644 Binary files a/icons/light/16/search-time_normal@2x.png and b/icons/light/16/search-time_normal@2x.png differ diff --git a/lib/media/src/mpv/mediampv.cpp b/lib/media/src/mpv/mediampv.cpp index 54b5010..3276f4b 100644 --- a/lib/media/src/mpv/mediampv.cpp +++ b/lib/media/src/mpv/mediampv.cpp @@ -134,6 +134,14 @@ void MediaMPV::handleMpvEvent(mpv_event *event) { } case MPV_EVENT_FILE_LOADED: + // Add separate audiofile if there is any + if (!audioFileToAdd.isEmpty()) + { + const QByteArray audioUtf8 = audioFileToAdd.toUtf8(); + const char *args2[] = {"audio-add", audioUtf8.constData(), nullptr}; + sendCommand(args2); + audioFileToAdd.clear(); + } setState(Media::PlayingState); break; @@ -258,12 +266,11 @@ void MediaMPV::playSeparateAudioAndVideo(const QString &video, const QString &au const char *args[] = {"loadfile", fileUtf8.constData(), nullptr}; sendCommand(args); - qApp->processEvents(); - - const QByteArray audioUtf8 = audio.toUtf8(); - const char *args2[] = {"audio-add", audioUtf8.constData(), nullptr}; - sendCommand(args2); + // We are playing audio as separate file. The add audio command must executed when the main file is loaded + // Otherwise the audio file doesn't gets played + audioFileToAdd = audio; + qApp->processEvents(); clearTrackState(); } @@ -320,6 +327,8 @@ Media::State MediaMPV::state() const { } void MediaMPV::play(const QString &file) { + audioFileToAdd.clear(); + const QByteArray fileUtf8 = file.toUtf8(); const char *args[] = {"loadfile", fileUtf8.constData(), nullptr}; sendCommand(args); @@ -366,6 +375,7 @@ void MediaMPV::setUserAgent(const QString &value) { } void MediaMPV::enqueue(const QString &file) { + audioFileToAdd.clear(); const QByteArray fileUtf8 = file.toUtf8(); const char *args[] = {"loadfile", fileUtf8.constData(), "append", nullptr}; sendCommand(args); diff --git a/lib/media/src/mpv/mediampv.h b/lib/media/src/mpv/mediampv.h index 1621148..9f8e0c4 100644 --- a/lib/media/src/mpv/mediampv.h +++ b/lib/media/src/mpv/mediampv.h @@ -59,6 +59,8 @@ private: Media::State currentState = Media::StoppedState; bool aboutToFinishEmitted = false; QString lastErrorString; + + QString audioFileToAdd; }; #endif // MEDIAMPV_H diff --git a/minitube.pro b/minitube.pro index d4f247f..652392f 100644 --- a/minitube.pro +++ b/minitube.pro @@ -1,7 +1,7 @@ CONFIG += c++14 exceptions_off rtti_off optimize_full TEMPLATE = app -VERSION = 3.4.1 +VERSION = 3.4.2 DEFINES += APP_VERSION="$$VERSION" APP_NAME = Minitube diff --git a/src/aboutview.cpp b/src/aboutview.cpp index 2c5b456..8820f2d 100644 --- a/src/aboutview.cpp +++ b/src/aboutview.cpp @@ -150,8 +150,8 @@ AboutView::AboutView(QWidget *parent) : View(parent) { buttonLayout->setAlignment(Qt::AlignLeft); closeButton = new QPushButton(tr("&Close"), this); closeButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); - closeButton->setDefault(true); + closeButton->setShortcut(Qt::Key_Escape); closeButton->setFocus(); connect(closeButton, SIGNAL(clicked()), MainWindow::instance(), SLOT(goBack())); buttonLayout->addWidget(closeButton); diff --git a/src/channelview.cpp b/src/channelview.cpp index eb6ccf9..0ce9a2c 100644 --- a/src/channelview.cpp +++ b/src/channelview.cpp @@ -150,7 +150,7 @@ QString ChannelView::noSubscriptionsMessage() { } void ChannelView::appear() { - updateQuery(); + updateQuery(true); MainWindow::instance()->showActionsInStatusBar(statusActions, true); setFocus(); ChannelAggregator::instance()->start(); diff --git a/src/iconutils.cpp b/src/iconutils.cpp index b58368e..5246272 100644 --- a/src/iconutils.cpp +++ b/src/iconutils.cpp @@ -33,8 +33,15 @@ void addIconFile(QIcon &icon, icon.addFile(filename, QSize(size, size), mode, state); } } + +QVector sizes; + } // namespace +void IconUtils::setSizes(const QVector &value) { + sizes = value; +} + QIcon IconUtils::fromTheme(const QString &name) { static const QLatin1String symbolic("-symbolic"); if (name.endsWith(symbolic)) return QIcon::fromTheme(name); @@ -62,7 +69,7 @@ QIcon IconUtils::fromResources(const char *name) { QIcon icon; // WARN keep these sizes updated with what we really use - for (int size : {16, 24, 32, 88}) { + for (int size : qAsConst(sizes)) { const QString pathAndName = path + QString::number(size) + QLatin1Char('/') + QLatin1String(name); QString iconFilename = pathAndName + normal + ext; diff --git a/src/iconutils.h b/src/iconutils.h index 00e764e..4db2ed3 100644 --- a/src/iconutils.h +++ b/src/iconutils.h @@ -25,6 +25,8 @@ $END_LICENSE */ class IconUtils { public: + static void setSizes(const QVector &value); + static QIcon fromTheme(const QString &name); static QIcon fromResources(const char *name); diff --git a/src/main.cpp b/src/main.cpp index e2a0c44..6332b1a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -138,6 +138,8 @@ int main(int argc, char **argv) { QNetworkProxyFactory::setUseSystemConfiguration(true); + IconUtils::setSizes({16, 24, 32, 88}); + showWindow(app, pkgDataDir); return app.exec(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1cfe622..abf71e5 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -157,7 +157,7 @@ MainWindow::MainWindow() showHome(); #endif - QTimer::singleShot(1000, this, &MainWindow::lazyInit); + QTimer::singleShot(100, this, &MainWindow::lazyInit); } void MainWindow::lazyInit() { diff --git a/src/ytvideo.cpp b/src/ytvideo.cpp index fca388a..1235481 100644 --- a/src/ytvideo.cpp +++ b/src/ytvideo.cpp @@ -245,7 +245,7 @@ void YTVideo::parseFmtUrlMap(const QString &fmtUrlMap) { qDebug() << "available formats" << urlMap.keys(); const QVector &definitions = VideoDefinition::getDefinitions(); - int previousIndex = std::max(definitions.indexOf(definition) - 1, 0); + int previousIndex = std::max(definitions.indexOf(definition), 0); for (; previousIndex >= 0; previousIndex--) { const VideoDefinition &previousDefinition = definitions.at(previousIndex); qDebug() << "Testing format" << previousDefinition.getCode();