HaikuDepot: Issue with Version Dates

Resolves an issue where package version dates are not
updated in the UI as they are updated in the model.

Change-Id: Ic21954f91abb9c6f9bf0907500e189215adb70de
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5333
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Andrew Lindesay 2022-05-23 22:51:04 +12:00
parent eb9ff8e5a7
commit 7d137fd96a
3 changed files with 23 additions and 16 deletions

View File

@ -1,7 +1,7 @@
/*
* Copyright 2013-2014, Stephan Aßmus <superstippi@gmx.de>.
* Copyright 2013, Rene Gollent <rene@gollent.com>.
* Copyright 2016-2021, Andrew Lindesay <apl@lindesay.co.nz>.
* Copyright 2016-2022, Andrew Lindesay <apl@lindesay.co.nz>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
@ -1016,7 +1016,10 @@ PackageInfo::SetViewed()
void
PackageInfo::SetVersionCreateTimestamp(uint64 value)
{
if (fVersionCreateTimestamp != value) {
fVersionCreateTimestamp = value;
_NotifyListeners(PKG_CHANGED_VERSION_CREATE_TIMESTAMP);
}
}

View File

@ -1,5 +1,6 @@
/*
* Copyright 2013, Stephan Aßmus <superstippi@gmx.de>.
* Copyright 2022, Andrew Lindesay <apl@lindesay.co.nz>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef PACKAGE_INFO_LISTENER_H
@ -22,7 +23,8 @@ enum {
PKG_CHANGED_PROMINENCE = 1 << 9,
PKG_CHANGED_SIZE = 1 << 10,
PKG_CHANGED_DEPOT = 1 << 11,
PKG_CHANGED_VERSION = 1 << 12
PKG_CHANGED_VERSION = 1 << 12,
PKG_CHANGED_VERSION_CREATE_TIMESTAMP = 1 << 13
// ...
};

View File

@ -1,5 +1,5 @@
/*
* Copyright 2018-2021, Andrew Lindesay, <apl@lindesay.co.nz>.
* Copyright 2018-2022, Andrew Lindesay, <apl@lindesay.co.nz>.
* Copyright 2017, Julian Harnath, <julian.harnath@rwth-aachen.de>.
* Copyright 2015, Axel Dörfler, <axeld@pinc-software.de>.
* Copyright 2013-2014, Stephan Aßmus <superstippi@gmx.de>.
@ -966,6 +966,8 @@ PackageListView::MessageReceived(BMessage* message)
row->UpdateRepository();
if ((changes & PKG_CHANGED_VERSION) != 0)
row->UpdateVersion();
if ((changes & PKG_CHANGED_VERSION_CREATE_TIMESTAMP) != 0)
row->UpdateVersionCreateTimestamp();
}
break;
}