Skip to content

Commit

Permalink
Fix #352 (#388)
Browse files Browse the repository at this point in the history
* Fix #352

* Code review changes

* Add missing else
  • Loading branch information
Eeems authored Oct 12, 2024
1 parent d9da86a commit 4e06c8f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
13 changes: 13 additions & 0 deletions shared/liboxide/devicesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,17 @@ namespace Oxide {
}
return physicalKeyboards;
}

const QString& DeviceSettings::version(){
static QString version;
static std::once_flag flag;
std::call_once(flag, [] {
QSettings settings("/usr/share/remarkable/update.conf", QSettings::IniFormat);
version = settings.value("REMARKABLE_RELEASE_VERSION").toString();
if (version.isEmpty()) {
qWarning() << "Failed to read version from update.conf";
}
});
return version;
}
}
5 changes: 5 additions & 0 deletions shared/liboxide/devicesettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ namespace Oxide{
* \return All virtual keyboard devices
*/
QList<event_device> virtualKeyboards();
/*!
* \brief Get the version of the OS
* \return Version string
*/
const QString& version();

private:
DeviceType _deviceType;
Expand Down
4 changes: 2 additions & 2 deletions shared/liboxide/oxide_sentry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void logMachineIdError(int error, QString name, QString path){
O_WARNING(path + " has the incorrect format");
}else if(error == -EPERM){
O_WARNING(path + " access denied");
} if(error == -EINVAL){
}else if(error == -EINVAL){
O_WARNING("Error while reading " + name + ": Buffer invalid");
}else if(error == -ENXIO){
O_WARNING("Error while reading " + name + ": No invocation ID is set");
Expand Down Expand Up @@ -168,7 +168,7 @@ namespace Oxide::Sentry{
sentry_value_set_by_key(user, "id", sentry_value_new_string(machineId()));
sentry_set_user(user);
// Setup context
std::string version = readFile("/etc/version");
const auto version = deviceSettings.version().toStdString();
sentry_set_tag("os.version", version.c_str());
sentry_set_tag("name", name);
sentry_value_t device = sentry_value_new_object();
Expand Down

0 comments on commit 4e06c8f

Please sign in to comment.