Commit Graph

110 Commits (94881853aa5725149305cad34f2d359e66243277)

Author SHA1 Message Date
Alexander Golubev 94881853aa
tdecore/tdehw: disable SW_RADIO switch if it's the same as SW_RFKILL_ALL
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit ce09b7d5e8)
4 years ago
Michele Calgaro 383d54fdcf
tdehw lib: fixed detection of mountable optical disks with incomplete
partition table.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 99b855062b)
4 years ago
Slávek Banko cb796c51ca
tdehwlib: Add regular monitoring of power supply device status,
to be able to generate a signal when the power state changes,
if the signal is not generated from udev.

This resolves issue TDE/tde#30.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit fb1316c785)
4 years ago
Slávek Banko 2f2ed5c1ae
tdehwlib: Add a read of the current switch state before invoking
a switchChanged() signal for an EV_SW input event.

This resolves the detection of closing the lid on some hardware.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 8bfa123fb6)
5 years ago
Slávek Banko 1945986691
tdehwlib: Add event device classification according to the provided switches.
This will resolve event device detection on special hardware, for example,
the LID switch on Pinebook Pro.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit f68fadda81)
5 years ago
Michele Calgaro f3cd325032
Prevent tdenetworkmanager from crashing when using unmanaged devices.
This relates to bug 2929.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 3192a72a46)
5 years ago
Slávek Banko 6350327928
tdehwlib: Unify units of battery values.
The values from energy_* and power_now are converted
from mWh and mW to Ah and A, so that the units are
equal to values from charge_* and current_now.

This resolves issue #68.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit c088fbf55b)
5 years ago
Slávek Banko a10cf06d1f
tdehwlib: Add allowed access for plugdev group members.
This is useful if the system no longer supports policy at_console.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 7f7f7322f9)
5 years ago
Michele Calgaro 41e0f335b5
Removed explicit usage of the 'register' keyword.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit aa98dbfe80)
5 years ago
Slávek Banko 352be1b977
tdehwlib: Adjusted parsing of battery information
+ Added reading of estimated time to fully charged battery
  (time_to_full_now)
  The remaining time is calculated if the value is not provided
  in the battery information.
  If the battery does not provide charging current information,
  the estimated time to charge the battery cannot be calculated.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit ecd1e4bd40)
5 years ago
Slávek Banko ddf0666f4c
tdehwlib: Fix parsing of CPU cores frequency information
+ The current frequency is parsed from the scaling_cur_freq file
  If the current frequency is not found in /proc/cpuinfo, the attempt
  to read value from cpuinfo_cur_freq failed because only root can
  read this file.
+ The have_frequency flag is not set when parsing current frequency from sysfs
  Setting the have_frequency flag after parsing current frequency for the
  first core caused the current frequency not to be parsed for other cores.
+ Frequency characteristics are parsed for all cores
  The assumption that the frequency characteristics for all cores will be
  the same as the first core is no longer reliable. There are heterogeneous
  architectures - for example ARM big.LITTLE.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit ba82cdf5be)
5 years ago
Slávek Banko d51d6d349d
tdehw: Fix wrong merge location in prior commit.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 8856d5dde1)
5 years ago
Slávek Banko 53381ab391
tdehwlib: Adjusted parsing of battery information
+ Added initialization of all values
  Some batteries do not provide all values and, without
  initialization, values may contain dubious data.
+ Added reading of current battery capacity value in percent
  (capacity)
  Some batteries may provide the current capacity value in
  percent instead of the current energy value.
+ Added check whether the battery provides current energy value
  (charge_now or energy_now)
  The current energy is calculated if the value is not provided
  in the battery information.
+ Added reading of estimated time to empty battery
  (time_to_empty_now)
  The remaining time is calculated if the value is not provided
  in the battery information.
  If the battery does not provide charging current information,
  the estimated time to charge the battery cannot be calculated.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 86c1d896c7)
5 years ago
Slávek Banko 2e7ef95663
tdehwlib: Classify the charger as an AC adapter, not as a battery.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 3b0f07f2cd)
5 years ago
Michele Calgaro c90f6c3e50
tdehw: avoid crashing kded when using udisks/udisks2 to operate on
drives that contain dashes. This relates to issue #32.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 32566accda)
6 years ago
Michele Calgaro 0f7cda9d52
tdehw: improved code for mount table.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 09835dceb7)
6 years ago
Slávek Banko 9ce98047ff
tdehwlib: Fix the flag setting whether the storage device contains the file system.
This resolves bug 2232, bug 2607 and bug 2946.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit dfe3c9649f)
6 years ago
Michele Calgaro 89609911f8
Fixed support for logind power state calls.
This resolves bug 2661 and bug 2975.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit c49ee53043)
6 years ago
Slávek Banko 7d83a0cb92 Fix crash in tdehwlib if /sys/devices/system/cpu/cpu* is not accessible
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 051acc7df5)
8 years ago
Slávek Banko 234f323f7b tdehwlib: Use TDENetworkDevice in TDENetworkConnectionManager instead of MAC address
Use interface name in TDENetworkConnectionManager_BackendNM instead of MAC address
This relates to bug 2748

The name of the network interface seems to be a more stable identifier than the MAC
address because the MAC address can be changed easily or even automatically - see
randomization of MAC addresses on wireless interfaces. Therefore, the use of the
MAC address as a network interface identifier was abandoned.

Beware, this change is an API / ABI change! However, most changes are internal
and the only one affected is application TDENetworkManager.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit e0fd34a1bd)
8 years ago
Slávek Banko a8e587a973 tdehwlib: Add a rule for classifying parport device
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit eb6f8213d4)
8 years ago
Slávek Banko 2b8dc1971b tdehwlib: Add a rule for classifying remote control devices
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit cc4f1996df)
8 years ago
Slávek Banko b0c326c2d0 tdehwlib: Allow to gather connection information on virtual net devices
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit d1280c31d9)
8 years ago
Slávek Banko 69112fe54a tdehwlib: Allow to classify virtual devices by subsystem
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit a73511a98d)
8 years ago
Slávek Banko a7009dd252 Fix memory leak after processing udev_monitor
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit d2b61ae9da)
8 years ago
Slávek Banko 9ef769d0e5 Fix memory leak after processing udev_device
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 1a5bc0e4ff)
8 years ago
Timothy Pearson dc7e40a1a9 Probe partitions to get filesystem type
This fixes problems with LUKS partitions not being detected

(cherry picked from commit 30c008d551)
9 years ago
Timothy Pearson f66944e531 Properly classify Lenovo USB camera platform subdevices
(cherry picked from commit b18bff9ad8)
9 years ago
Slávek Banko 72efbe384e Fix crash in tdehwlib on partitions without parent disk
This applies for example to the software RAID defined in the BIOS

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 36481f68c1)
9 years ago
Slávek Banko 6958076530 Fix mountable flag for disk partitions
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit ff469a69ff)
9 years ago
Slávek Banko 97e220ed39 Add a rule for classifying ATA Compact Flash Adapter
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 613eadbbc3)
9 years ago
Slávek Banko 90ed3e409b Fix icon of mounted camera in tdehwlib
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit ef7180dad9)
9 years ago
Slávek Banko c7ba84312e Set partition disk type and status based on the parent device
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 5104679806)
9 years ago
Slávek Banko 762f90beac Set hotpluggable flag for flash disks instead of removable
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit f8fbb3bd78)
9 years ago
Slávek Banko 9b33264c99 Force removable flag for flask disks in tdehwlib
This resolves Bug 2473

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit dc350e6c64)
9 years ago
Slávek Banko fd96a6c2a8 Fix crash in tdehwlib if not exists /sys/devices/system/cpu
This resolves Bug 2584

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit f4fb3a8e71)
9 years ago
Slávek Banko 111cc009ea Fix ZIP drive classification in tdehwlib
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 6dfc04c51a)
9 years ago
Slávek Banko 107e863644 Classify flash drives as HDD in tdehwlib
This relates to Bug 2473

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 6a2a9de49c)
9 years ago
Slávek Banko 0151f8494a Fix using of custom mountpoints with pmount in tdehwlib
This partially resolves Bug 2576

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit c10124c965)
9 years ago
Slávek Banko cec0b42a3c Prefer encoded disk labels in tdehwlib
because it contains unadjusted disk labels

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 893ac9fad0)
9 years ago
Slávek Banko bec14c7a28 Add floppy into disk type clasification in tdehwlib
This resolves Bug 2567

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit ba2a3bc188)
9 years ago
Slávek Banko ad6b5add68 Fix disk type clasification in tdehwlib
This resolves Bug 2473

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 68102d50e9)
9 years ago
Slávek Banko 43b1218e15 Fix calculation of remaining charging time in TDE hardware library
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 075cf11458)
9 years ago
Timothy Pearson bc746bd059 Fix hardware class file matching algorithm
Fix overly broad floppy device matching rules
This resolves Bug 2534
(cherry picked from commit fd0de2b581)
10 years ago
Timothy Pearson 55c60ed152 Add mount indicator to tdehwlib storage device icons
(cherry picked from commit feaced1b3c)
10 years ago
Slávek Banko ef12830170 Fix hang in TDENetMask::fromCIDRMask() due to point-to-point connections
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit a0189f32f7)
10 years ago
Timothy Pearson 08e045c17a Classify memstick_host devices
(cherry picked from commit 669345d6b8)
10 years ago
Timothy Pearson 799c91ef96 Bring keyboard icon into XDG compliance
(cherry picked from commit 3e23bfa58d)
10 years ago
Timothy Pearson 1a2f871729 Bring printer1 icon into XDG compliance
(cherry picked from commit 61f6eb5a1e)
10 years ago
Timothy Pearson 1646faa695 Bring mouse icon into XDG compliance
(cherry picked from commit 891dbd6b98)
10 years ago