[vlc-commits] [Git][videolan/vlc][master] 5 commits: qt: make property `UpdateModel::explicitCheck` resettable
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Thu Jul 23 15:21:17 UTC 2026
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
5ecb8c2f by Fatih Uzunoglu at 2026-07-23T16:55:12+02:00
qt: make property `UpdateModel::explicitCheck` resettable
- - - - -
2c4e8399 by Fatih Uzunoglu at 2026-07-23T16:55:12+02:00
qt: reset explicit check status in update model on legacy update dialog dismissal
- - - - -
e522d1b0 by Fatih Uzunoglu at 2026-07-23T16:55:12+02:00
qml: reset explicit check status in update model on update pane dismissal
- - - - -
6e11d522 by Fatih Uzunoglu at 2026-07-23T16:55:12+02:00
qml: do not reset update model status in update pane
This also helps not re-triggering update pane due to
binding getting re-evaluated due to `explicitCheck`
change.
This is probably not necessary in the legacy update
dialog because the slot is only called when the model
signals status change (`UpdateModel::updateStatusChanged()`).
- - - - -
cbb8f888 by Fatih Uzunoglu at 2026-07-23T16:55:12+02:00
qt: fix warning `enumeration value ‘Downloading’ not handled in switch`
- - - - -
3 changed files:
- modules/gui/qt/dialogs/help/help.cpp
- modules/gui/qt/dialogs/help/help.hpp
- modules/gui/qt/maininterface/qml/MainDisplay.qml
Changes:
=====================================
modules/gui/qt/dialogs/help/help.cpp
=====================================
@@ -376,6 +376,14 @@ bool UpdateModel::explicitCheck() const
return d->m_explicitCheck;
}
+void UpdateModel::resetExplicitCheck()
+{
+ Q_D(UpdateModel);
+ if (!d->m_explicitCheck)
+ return;
+ d->m_explicitCheck = false;
+ emit explicitCheckChanged();
+}
/*****************************************************************************
* UpdateDialog
@@ -420,6 +428,28 @@ UpdateDialog::~UpdateDialog()
saveWidgetPosition( "Update" );
}
+bool UpdateDialog::event(QEvent* event)
+{
+ assert(event);
+
+ if (Q_LIKELY(m_model))
+ {
+ switch(event->type())
+ {
+ case QEvent::Hide:
+ case QEvent::Show:
+ case QEvent::Close:
+ case QEvent::Destroy:
+ m_model->resetExplicitCheck();
+ break;
+ default:
+ break;
+ }
+ }
+
+ return QVLCFrame::event(event);
+}
+
/* Check for updates */
void UpdateDialog::checkOrDownload()
{
@@ -495,6 +525,11 @@ void UpdateDialog::updateUI( )
case UpdateModel::Unchecked:
// do nothing
break;
+ case UpdateModel::Downloading:
+ // NOTE: It is not planned to implement this in the legacy dialog.
+ // The new update pane already respects it, we are only
+ // waiting for the core to provide this information.
+ break;
}
}
=====================================
modules/gui/qt/dialogs/help/help.hpp
=====================================
@@ -95,7 +95,7 @@ public:
Q_PROPERTY(QString description READ getDescription NOTIFY updateStatusChanged FINAL)
Q_PROPERTY(QString url READ getUrl NOTIFY updateStatusChanged FINAL)
Q_PROPERTY(double progress READ getProgress NOTIFY progressChanged FINAL) // TODO
- Q_PROPERTY(bool explicitCheck READ explicitCheck NOTIFY explicitCheckChanged FINAL)
+ Q_PROPERTY(bool explicitCheck READ explicitCheck RESET resetExplicitCheck NOTIFY explicitCheckChanged FINAL)
public:
explicit UpdateModel(qt_intf_t * p_intf);
@@ -117,6 +117,7 @@ public:
QString getUrl() const;
double getProgress() const;
bool explicitCheck() const;
+ void resetExplicitCheck();
signals:
void updateStatusChanged();
@@ -135,6 +136,8 @@ public:
UpdateDialog( qt_intf_t * );
virtual ~UpdateDialog();
+ bool event(QEvent *event) override;
+
private:
Ui::updateWidget ui;
UpdateModel* m_model = nullptr;
=====================================
modules/gui/qt/maininterface/qml/MainDisplay.qml
=====================================
@@ -767,6 +767,8 @@ FocusScope {
focus: !!item
+ property int _updateStatusOnDismissal: -1
+
readonly property bool shouldShow: {
if (!updateModelIsAvailable)
return false
@@ -774,6 +776,9 @@ FocusScope {
if (UpdateModel.explicitCheck) {
return (UpdateModel.updateStatus !== UpdateModel.Unchecked)
} else {
+ if (UpdateModel.updateStatus === _updateStatusOnDismissal)
+ return false // already dismissed with the same status
+
switch (UpdateModel.updateStatus) {
case UpdateModel.Unchecked:
case UpdateModel.Checking:
@@ -789,6 +794,10 @@ FocusScope {
property alias toggleAnimation: heightBehavior.enabled
function dismiss() {
+ // This could be also be an assertion:
+ if (updateModelIsAvailable)
+ _updateStatusOnDismissal = UpdateModel.updateStatus
+
height = 0.0
}
@@ -798,8 +807,9 @@ FocusScope {
}
onActiveChanged: {
- if (updateModelIsAvailable && !active)
- UpdateModel.resetStatus()
+ if (updateModelIsAvailable && !active) {
+ UpdateModel.explicitCheck = undefined // Resets the property
+ }
}
clip: (height < implicitHeight)
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3da620912f2bb053089990f2d0c39f8ccffa2d3b...cbb8f8886522a15b52aa8ed7b895d04a90d0f287
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3da620912f2bb053089990f2d0c39f8ccffa2d3b...cbb8f8886522a15b52aa8ed7b895d04a90d0f287
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list