Commit 3260dd73 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compiles without deprecated method

parent 6cca6686
......@@ -49,7 +49,9 @@ set_package_properties(Bolt PROPERTIES DESCRIPTION "Thunderbolt device manager"
TYPE RUNTIME)
#################################################
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
endif()
if (BUILD_TESTING)
add_subdirectory(autotests)
endif()
......
......@@ -227,5 +227,5 @@ void FakeDevice::Authorize(const QString &flags)
{
std::this_thread::sleep_for(1s); // simulate this operation taking time
mAuthFlags = flags;
mStatus = QLatin1Literal("authorized");
mStatus = QLatin1String("authorized");
}
......@@ -161,14 +161,14 @@ QDBusObjectPath FakeManager::EnrollDevice(const QString &uid,
return QDBusObjectPath();
}
auto &device = deviceIt->second;
if (policy == QLatin1Literal("default")) {
if (policy == QLatin1String("default")) {
device->setPolicy(defaultPolicy());
} else {
device->setPolicy(policy);
}
device->setAuthFlags(flags);
device->setStored(true);
device->setStatus(QLatin1Literal("authorized"));
device->setStatus(QLatin1String("authorized"));
return device->dbusPath();
}
......@@ -183,6 +183,6 @@ void FakeManager::ForgetDevice(const QString &uid)
}
auto &device = deviceIt->second;
device->setStored(false);
device->setStatus(QLatin1Literal("connected"));
device->setStatus(QLatin1String("connected"));
}
......@@ -138,13 +138,13 @@ QString Device::sysfsPath() const
QDateTime Device::connectTime() const
{
const auto val = mInterface->connectTime();
return val == 0 ? QDateTime() : QDateTime::fromTime_t(val);
return val == 0 ? QDateTime() : QDateTime::fromSecsSinceEpoch(val);
}
QDateTime Device::authorizeTime() const
{
const auto val = mInterface->authorizeTime();
return val == 0 ? QDateTime() : QDateTime::fromTime_t(val);
return val == 0 ? QDateTime() : QDateTime::fromSecsSinceEpoch(val);
}
bool Device::stored() const
......@@ -167,7 +167,7 @@ KeyState Device::keyState() const
QDateTime Device::storeTime() const
{
const auto val = mInterface->storeTime();
return val == 0 ? QDateTime() : QDateTime::fromTime_t(val);
return val == 0 ? QDateTime() : QDateTime::fromSecsSinceEpoch(val);
}
QString Device::label() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment