mirror of
https://gitlab.freedesktop.org/upower/power-profiles-daemon.git
synced 2026-05-05 07:38:13 +02:00
power-profiles-daemon: Add a single restart drivers function
It's easy enough, but let's use the same code everywhere
This commit is contained in:
parent
42866c5ce3
commit
932d3888b3
2 changed files with 12 additions and 7 deletions
|
|
@ -1106,14 +1106,20 @@ has_required_drivers (PpdApp *data)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
restart_profile_drivers (PpdApp *data)
|
||||
{
|
||||
stop_profile_drivers (data);
|
||||
start_profile_drivers (data);
|
||||
}
|
||||
|
||||
static void
|
||||
driver_probe_request_cb (PpdDriver *driver,
|
||||
gpointer user_data)
|
||||
{
|
||||
PpdApp *data = user_data;
|
||||
|
||||
stop_profile_drivers (data);
|
||||
start_profile_drivers (data);
|
||||
restart_profile_drivers (data);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1282,10 +1288,9 @@ bail:
|
|||
}
|
||||
|
||||
void
|
||||
restart_profile_drivers (void)
|
||||
restart_profile_drivers_for_default_app (void)
|
||||
{
|
||||
stop_profile_drivers (ppd_app);
|
||||
start_profile_drivers (ppd_app);
|
||||
restart_profile_drivers (ppd_app);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include <termios.h>
|
||||
|
||||
extern void main_loop_quit (void);
|
||||
void restart_profile_drivers (void);
|
||||
void restart_profile_drivers_for_default_app (void);
|
||||
|
||||
struct _PpdDriverFake
|
||||
{
|
||||
|
|
@ -88,7 +88,7 @@ check_keyboard (GIOChannel *source,
|
|||
break;
|
||||
case 'r':
|
||||
g_print ("Restarting profile drivers\n");
|
||||
restart_profile_drivers ();
|
||||
restart_profile_drivers_for_default_app ();
|
||||
break;
|
||||
case 'q':
|
||||
case 'x':
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue