summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehw
Commit message (Collapse)AuthorAgeFilesLines
* tdehw lib: fixed detection of mountable optical disks with incompleteMichele Calgaro2020-11-241-6/+8
| | | | | | | partition table. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 99b855062b2a684a88b4c2b85a4a548ce66793be)
* tdehwlib: Add regular monitoring of power supply device status,Slávek Banko2020-10-071-1/+10
| | | | | | | | | | 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 fb1316c785f2e026316a48b7cade322026490ee2)
* tdehwlib: Add a read of the current switch state before invokingSlávek Banko2020-02-261-0/+1
| | | | | | | | | 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 8bfa123fb66d2765b7cce78415831a499b4e9e9d)
* tdehwlib: Add event device classification according to the provided switches.Slávek Banko2020-02-231-3/+9
| | | | | | | | 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 f68fadda81d0e107d904a08db30bd8cccbbd1a21)
* Prevent tdenetworkmanager from crashing when using unmanaged devices.Michele Calgaro2020-02-221-37/+46
| | | | | | | This relates to bug 2929. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 3192a72a465d6e5051ab77a43e75716bb641441c)
* tdehwlib: Unify units of battery values.Slávek Banko2020-02-161-8/+42
| | | | | | | | | | | 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 c088fbf55bde4faa68a6d51ba44085bd97c1e4e2)
* tdehwlib: Add allowed access for plugdev group members.Slávek Banko2020-02-091-0/+28
| | | | | | | 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 7f7f7322f9986a25ceef33dc2f47853846e2ec88)
* Removed explicit usage of the 'register' keyword.Michele Calgaro2020-01-301-1/+1
| | | | | Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit aa98dbfe80580169f3df12489a77e8b904a1d9b9)
* tdehwlib: Adjusted parsing of battery informationSlávek Banko2020-01-231-8/+24
| | | | | | | | | | | | + 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 ecd1e4bd401a00be11f4d8bbaff01718f29f9118)
* tdehwlib: Fix parsing of CPU cores frequency informationSlávek Banko2020-01-091-77/+71
| | | | | | | | | | | | | | | | | + 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 ba82cdf5be78b46889dc0d1e3906e353489925ad)
* tdehw: Fix wrong merge location in prior commit.Slávek Banko2020-01-081-3/+3
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 8856d5dde1a086f94b6875fd96fa6d3e479de170)
* tdehwlib: Adjusted parsing of battery informationSlávek Banko2020-01-082-10/+36
| | | | | | | | | | | | | | | | | | | | | | | + 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 86c1d896c748bf5117ccfe28b20e48a7e2a70c8d)
* tdehwlib: Classify the charger as an AC adapter, not as a battery.Slávek Banko2020-01-081-0/+1
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 3b0f07f2cdf3c5228b6d38b33fb5f2bc8fa0542d)
* tdehw: avoid crashing kded when using udisks/udisks2 to operate onMichele Calgaro2019-07-071-0/+6
| | | | | | | drives that contain dashes. This relates to issue #32. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 32566accdab31f598381e7e68330055f4a7178f1)
* tdehw: improved code for mount table.Michele Calgaro2019-07-052-20/+18
| | | | | Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 09835dceb73b0e814fb7b2e915b8055d67fa83c9)
* tdehwlib: Fix the flag setting whether the storage device contains the file ↵Slávek Banko2019-02-271-1/+1
| | | | | | | | | system. This resolves bug 2232, bug 2607 and bug 2946. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit dfe3c9649f649f2dbd7eac60e3847d4e978e24f4)
* Fixed support for logind power state calls.Michele Calgaro2019-02-241-35/+34
| | | | | | | This resolves bug 2661 and bug 2975. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit c49ee53043b73fac7fe7e956360f1e3cdc342c6e)
* Fix crash in tdehwlib if /sys/devices/system/cpu/cpu* is not accessibleSlávek Banko2017-09-231-3/+5
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 051acc7df5ff02d7bb1ad92b9be95efdc553d6c0)
* tdehwlib: Use TDENetworkDevice in TDENetworkConnectionManager instead of MAC ↵Slávek Banko2017-06-175-159/+51
| | | | | | | | | | | | | | | | | | 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 e0fd34a1bd2c6412171bcceb19520d129bbcb66d)
* tdehwlib: Add a rule for classifying parport deviceSlávek Banko2017-06-171-1/+2
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit eb6f8213d42aac2911c7b8880628c786b0223935)
* tdehwlib: Add a rule for classifying remote control devicesSlávek Banko2017-06-171-0/+4
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit cc4f1996df344ff06b34931a362037af25a66ef9)
* tdehwlib: Allow to gather connection information on virtual net devicesSlávek Banko2017-06-171-1/+2
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit d1280c31d9394e157c10d1d9a493763f03c3d285)
* tdehwlib: Allow to classify virtual devices by subsystemSlávek Banko2017-06-171-3/+3
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit a73511a98d46bd9cceff8da7819b8ab523b9ad6c)
* Fix memory leak after processing udev_monitorSlávek Banko2017-03-251-0/+3
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit d2b61ae9dac0e38c8f2853a41a3fb194fd794cf7)
* Fix memory leak after processing udev_deviceSlávek Banko2017-03-251-0/+2
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 1a5bc0e4ffef4e8baef9f3554ba3184fbc674211)
* Probe partitions to get filesystem typeTimothy Pearson2016-09-081-4/+2
| | | | | | This fixes problems with LUKS partitions not being detected (cherry picked from commit 30c008d5512bf83039d2e24d2e737303f68a42af)
* Properly classify Lenovo USB camera platform subdevicesTimothy Pearson2016-09-081-0/+5
| | | | (cherry picked from commit b18bff9ad82dd217efa1adefb3ab8308b0344c49)
* Fix crash in tdehwlib on partitions without parent diskr14.0.3Slávek Banko2016-02-111-6/+9
| | | | | | | 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 36481f68c1cbb7c55a7325d709311e20b9c2ce54)
* Fix mountable flag for disk partitionsSlávek Banko2016-02-041-1/+5
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit ff469a69ff7951e429b5ce48187906aac5ad89f9)
* Add a rule for classifying ATA Compact Flash AdapterSlávek Banko2016-02-041-1/+2
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 613eadbbc35a25f19c205c32eeeb0b890d468aa6)
* Fix icon of mounted camera in tdehwlibSlávek Banko2016-02-041-1/+1
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit ef7180dad939e407f0efd9a02ffcac6ab249f866)
* Set partition disk type and status based on the parent deviceSlávek Banko2016-02-041-1/+15
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 51046798068760d062a1924fff4a99c7b8a60b71)
* Set hotpluggable flag for flash disks instead of removableSlávek Banko2016-02-041-1/+1
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit f8fbb3bd78ac30e41c81261b4a71c61dcead811f)
* Force removable flag for flask disks in tdehwlibSlávek Banko2016-01-311-0/+10
| | | | | | | This resolves Bug 2473 Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit dc350e6c6406a78621763c2d4fcbea8deca01c7c)
* Fix crash in tdehwlib if not exists /sys/devices/system/cpuSlávek Banko2016-01-271-13/+15
| | | | | | | This resolves Bug 2584 Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit f4fb3a8e71882fec8beffccf0ba3c5eb54310c89)
* Fix ZIP drive classification in tdehwlibSlávek Banko2016-01-271-8/+9
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 6dfc04c51a9c2086e2f6a4be75ec847e8ef9f6fb)
* Classify flash drives as HDD in tdehwlibSlávek Banko2016-01-271-1/+6
| | | | | | | This relates to Bug 2473 Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 6a2a9de49cc8987d0f43bc1076db81771fe2f50e)
* Fix using of custom mountpoints with pmount in tdehwlibSlávek Banko2016-01-231-1/+12
| | | | | | | This partially resolves Bug 2576 Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit c10124c96557042d5a9c0170dd2883557997be3e)
* Prefer encoded disk labels in tdehwlibSlávek Banko2016-01-231-1/+7
| | | | | | | because it contains unadjusted disk labels Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 893ac9fad0249a9ed959e2e8e28952415291b3a2)
* Add floppy into disk type clasification in tdehwlibSlávek Banko2016-01-231-0/+5
| | | | | | | This resolves Bug 2567 Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit ba2a3bc188922722090b4afd1623451886b1520c)
* Fix disk type clasification in tdehwlibSlávek Banko2016-01-231-12/+6
| | | | | | | This resolves Bug 2473 Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 68102d50e99fe35442f78be21cf8b720481e7e0b)
* Fix calculation of remaining charging time in TDE hardware librarySlávek Banko2015-12-041-2/+7
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 075cf11458a98245a47505b944c5606c1b86afb2)
* Fix hardware class file matching algorithmTimothy Pearson2015-10-023-15/+51
| | | | | | Fix overly broad floppy device matching rules This resolves Bug 2534 (cherry picked from commit fd0de2b581ab3f3bab7bc540d8348f994464723f)
* Add mount indicator to tdehwlib storage device iconsTimothy Pearson2015-10-021-19/+24
| | | | (cherry picked from commit feaced1b3cdb36d0b841207b92b40cab58d5437b)
* Fix hang in TDENetMask::fromCIDRMask() due to point-to-point connectionsSlávek Banko2015-05-241-2/+4
| | | | | Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit a0189f32f7f986760ab9a5f9b6a71ff09d64c4bf)
* Classify memstick_host devicesTimothy Pearson2015-04-071-1/+2
| | | | (cherry picked from commit 669345d6b80ea91a19a93400798629c94055216e)
* Bring keyboard icon into XDG complianceTimothy Pearson2015-03-261-1/+1
| | | | (cherry picked from commit 3e23bfa58d9488d44099dffd4b05bc456ae28022)
* Bring printer1 icon into XDG complianceTimothy Pearson2015-03-261-1/+1
| | | | (cherry picked from commit 61f6eb5a1e6d7094d993d6e26f4c02c94b3fa1c3)
* Bring mouse icon into XDG complianceTimothy Pearson2015-03-261-1/+1
| | | | (cherry picked from commit 891dbd6b985ac3279cc03af699ced0f6d8672911)
* Rename most device icons to comply with XDG standardsTimothy Pearson2015-03-042-17/+17
| | | | (cherry picked from commit 86686421b5b46ca556cf11f71cc5a0098bbe4970)