Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #352 #388

Merged
merged 3 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading