Commit Graph

190 Commits (master)

Author SHA1 Message Date
Michele Calgaro 0b81a0c481
Rename TDEApplication::kApplication() to TDEApplication::tdeApplication() and kapp to tdeApp.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
2 weeks ago
Michele Calgaro f63f3a0b01
Fix syntax error when using tqmoc on tdestoragedevice.h
TDE now requires c++11, so the conditional code is no longer required.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 months ago
Michele Calgaro 1307964495
Rename kdemacros.* files to tdemacros.*
A dummy 'kdemacros.h' has been added to allow TDE to built till renaming is carried out across the whole code base. It will then be removed.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
8 months ago
Michele Calgaro 6f4c529b36
Use tq* headers instead of ntq* ones
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
8 months ago
Michele Calgaro bba3128085
Replace KDE_[NO_]EXPORT with TDE_[NO_]EXPORT
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
10 months ago
Michele Calgaro ba3b5b77e1
Use new TQ_METHOD, TQ_SIGNAL, TQ_SLOT defines
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
1 year ago
Michele Calgaro 5efbce071a
tdehw lib: drop definition of TDEDiskDeviceStatus::Hotpluggable
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
1 year ago
Alexander Golubev 14573faf07
Fix lvm volumes appearing as removable devices
- remove obsolete/erroneous code meddling with
  GENHD_FL_MEDIA_CHANGE_NOTIFY
- use /sys/block/<dev>/removable rather than
  /sys/block/<dev>/capabilities
- deprecate TDEDiskDeviceStatus::Hotpluggable and use
  TDEDiskDeviceStatus::Removable for all removable devices
- put some local utility function into anonymous namespace

See https://mirror.git.trinitydesktop.org/gitea/TDE/tde/issues/148

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
1 year ago
Michele Calgaro 8eb500c4e8
Replace Q_OBJECT with TQ_OBJECT
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
2 years ago
ormorph 8d96e85f7d Added compatibility for hwlib support for musl
Signed-off-by: ormorph <roma251078@mail.ru>
2 years ago
Michele Calgaro 9050bd4346
tdehw lib: power off USB devices after ejecting them when udisks/udisks2 are used.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
3 years ago
Michele Calgaro 5f795c0bb2
tdehw lib: make sure to emit hardwareRemoved signal after removing the device from the device list.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
3 years ago
Alexander Golubev 0631f76fb7
tdehw: make rtc devices appear as Timekeeping rather than Mainboard devices
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
3 years ago
Michele Calgaro 2023cc330a
Removed HAL dependant code.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
3 years ago
Slávek Banko 50a228fc2d
Use AUTOMOC for generated sources instead of a specific rule.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
3 years ago
Slávek Banko 2b3ea27bdf
tdehwlib: Prevent potential crash, when building without Network Manager support.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
3 years ago
Michele Calgaro f159fa61a9
tdehw lib: reworked device notifications to avoid repeated scanning of devices.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 years ago
Michele Calgaro de4f27a2ee
tdehw lib: removed unused and seemingly unnecessary method in storage device.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 years ago
Michele Calgaro a2edae37ac
tdehw lib: make the call to close the file explicit.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 years ago
Michele Calgaro 4a8875301d
Removed unused code related to hardware events.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 years ago
gregory guy 23303e3cc0
Update Windows Generic Device IDs.
Signed-off-by: gregory guy <gregory-tde@laposte.net>
4 years ago
gregory guy d7fad5b469
As default behaviour, use hwdata files for pci and usb ids files.
Signed-off-by: gregory guy <gregory-tde@laposte.net>
4 years ago
Slávek Banko ac7e0fac53
Fix definitions of slot constants for old cryptsetup API.
This resolves issue #137.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
4 years ago
Slávek Banko c7b651a6ca
Build tdehw library as a standalone library.
This causes tdecore API change!

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
4 years ago
Slávek Banko 9a99527f0c
Removed dbus access rules for invalid "send_destination".
For the tde_dbus_hardwarecontrol daemon, the destination is always
"org.trinitydesktop.hardwarecontrol", which provides interfaces for
individual components. The permissions for the standard dbus Introspectable
and Properties calls are therefore set together on one destination,
regardless of the interfaces for the individual components.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
4 years ago
Slávek Banko 78b2136011
tdehwlib: Allow everyone to read the status of input switches.
Reading the status of input switches seems safe so that it can be allowed
to everyone. This will prevent the log from being filled with unauthorized
access messages if the user is not a member of the plugdev group - this
resolve issue TDE/tde#44.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
4 years ago
Alexander Golubev ce09b7d5e8 tdecore/tdehw: disable SW_RADIO switch if it's the same as SW_RFKILL_ALL
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
4 years ago
Michele Calgaro 99b855062b
tdehw lib: fixed detection of mountable optical disks with incomplete
partition table.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 years ago
Michele Calgaro 07200a5475
tdehw lib: reworked code for eject operation to support return type TQStringVariantMap.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 years ago
Michele Calgaro 7bdb6be95c
Added support for locking/unlocking of LUKS disks using pmount/pumount.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 years ago
Michele Calgaro 9bc16841d1
Fixed mounting and unmounting of mapped storage devices.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 years ago
Michele Calgaro 33794c4ec3
Fixed displaying of encrypted disks.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 years ago
Michele Calgaro fe08361f7e
Added udisks2 support for unlocking/locking of encrypted disks.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 years ago
Slávek Banko fb1316c785
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>
4 years ago
Michele Calgaro d78af7ef55
Minor code refactoring of previous 2 commits.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
5 years ago
Slávek Banko 444839e053
tdehwlib: Re-enable OpenSSL < 1.1 compatibility
in tdecryptographiccarddevice.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
5 years ago
Timothy Pearson 3f6bef6371 Update for OpenSSL >= 1.1.0
Signed-off-by: Timothy Pearson <kb9vqf@pearsoncomputing.net>
5 years ago
Slávek Banko 8bfa123fb6
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>
5 years ago
Slávek Banko f68fadda81
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>
5 years ago
Michele Calgaro 3192a72a46
Prevent tdenetworkmanager from crashing when using unmanaged devices.
This relates to bug 2929.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
5 years ago
Slávek Banko c088fbf55b
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>
5 years ago
Michele Calgaro b6953843f5
Added back build options for UDISKS2, UDISKS and UDEVIL as requested by
some users.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
5 years ago
Slávek Banko 7f7f7322f9
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>
5 years ago
Michele Calgaro aa98dbfe80
Removed explicit usage of the 'register' keyword.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
5 years ago
Slávek Banko ecd1e4bd40
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>
5 years ago
Slávek Banko ba82cdf5be
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>
5 years ago
Slávek Banko 8856d5dde1
tdehw: Fix wrong merge location in prior commit.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
5 years ago
Slávek Banko 86c1d896c7
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>
5 years ago
Slávek Banko 3b0f07f2cd
tdehwlib: Classify the charger as an AC adapter, not as a battery.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
5 years ago
Michele Calgaro edcf1665f0
Removed sync dbus call code in tdenetworkmanager to align to latest
dbus-1-tqt code.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
6 years ago