mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
GnomeKeyring: Port to Qt6
Limit the timestamp to 32 bits. Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
parent
4f953aa0aa
commit
1e9b37bccb
@ -126,7 +126,7 @@ endif()
|
|||||||
# Optional: GnomeKeyring
|
# Optional: GnomeKeyring
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
if (PKG_CONFIG_FOUND)
|
if (PKG_CONFIG_FOUND)
|
||||||
option(BUILD_KEYRING "Gnome keyring password plugin" OFF)
|
option(BUILD_KEYRING "Gnome keyring password plugin" ON)
|
||||||
if (BUILD_KEYRING)
|
if (BUILD_KEYRING)
|
||||||
pkg_check_modules(GNOME_KEYRING IMPORTED_TARGET gnome-keyring-1 )
|
pkg_check_modules(GNOME_KEYRING IMPORTED_TARGET gnome-keyring-1 )
|
||||||
endif()
|
endif()
|
||||||
|
@ -24,6 +24,17 @@ extern "C" {
|
|||||||
#include "gnome-keyring.h"
|
#include "gnome-keyring.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO QT6 - should we just start storing timestamps as 64-bit instead?
|
||||||
|
static uint Q_DATETIME_TOTIME_T(const QDateTime &dateTime)
|
||||||
|
{
|
||||||
|
if (!dateTime.isValid())
|
||||||
|
return uint(-1);
|
||||||
|
qint64 retval = dateTime.toMSecsSinceEpoch() / 1000;
|
||||||
|
if (quint64(retval) >= Q_UINT64_C(0xFFFFFFFF))
|
||||||
|
return uint(-1);
|
||||||
|
return uint(retval);
|
||||||
|
}
|
||||||
|
|
||||||
static PasswordEntry createEntry(GnomeKeyringFound* item)
|
static PasswordEntry createEntry(GnomeKeyringFound* item)
|
||||||
{
|
{
|
||||||
PasswordEntry entry;
|
PasswordEntry entry;
|
||||||
@ -141,7 +152,7 @@ void GnomeKeyringPasswordBackend::addEntry(const PasswordEntry &entry)
|
|||||||
initialize();
|
initialize();
|
||||||
|
|
||||||
PasswordEntry stored = entry;
|
PasswordEntry stored = entry;
|
||||||
stored.updated = QDateTime::currentDateTime().toTime_t();
|
stored.updated = Q_DATETIME_TOTIME_T(QDateTime::currentDateTime());
|
||||||
|
|
||||||
storeEntry(stored);
|
storeEntry(stored);
|
||||||
|
|
||||||
@ -201,7 +212,7 @@ void GnomeKeyringPasswordBackend::updateLastUsed(PasswordEntry &entry)
|
|||||||
{
|
{
|
||||||
initialize();
|
initialize();
|
||||||
|
|
||||||
entry.updated = QDateTime::currentDateTime().toTime_t();
|
entry.updated = Q_DATETIME_TOTIME_T(QDateTime::currentDateTime());
|
||||||
|
|
||||||
GnomeKeyringAttributeList* attributes = createAttributes(entry);
|
GnomeKeyringAttributeList* attributes = createAttributes(entry);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user