@@ -23,10 +23,13 @@ use adwaita::{gio, glib, prelude::*, ViewStack, ViewSwitcherBar};
23
23
use gio:: Settings ;
24
24
use glib:: {
25
25
once_cell:: sync:: Lazy , once_cell:: sync:: OnceCell , subclass:: InitializingObject ,
26
- subclass:: Signal , subclass:: SignalType , FromVariant , ParamSpec , ToValue , Value ,
27
- translate:: FromGlib , SourceId
26
+ subclass:: Signal , subclass:: SignalType , translate:: FromGlib , FromVariant , ParamSpec , SourceId ,
27
+ ToValue , Value ,
28
+ } ;
29
+ use gtk:: {
30
+ subclass:: prelude:: * , Align , CompositeTemplate , Grid , Label , LayoutChild , Orientation ,
31
+ TemplateChild ,
28
32
} ;
29
- use gtk:: { subclass:: prelude:: * , CompositeTemplate , TemplateChild , Label , Grid , Orientation , LayoutChild , Align } ;
30
33
use std:: { cell:: Cell , cell:: RefCell , rc:: Rc , sync:: Arc , sync:: Mutex , sync:: MutexGuard } ;
31
34
32
35
// Modules
@@ -381,7 +384,12 @@ impl GpuPage {
381
384
// !!UNSAFE CODE HERE!!!!UNSAFE CODE HERE!!!!UNSAFE CODE HERE!!!!UNSAFE CODE HERE!!
382
385
383
386
// Get stored UUID
384
- let uuid: String = self . uuid . clone ( ) . get ( ) . expect ( "`uuid` wasn't set properly.." ) . to_string ( ) ;
387
+ let uuid: String = self
388
+ . uuid
389
+ . clone ( )
390
+ . get ( )
391
+ . expect ( "`uuid` wasn't set properly.." )
392
+ . to_string ( ) ;
385
393
386
394
// Load refresh time (s) from settings
387
395
let refresh_rate: u32 = self . get_setting :: < i32 > ( "refreshrate" ) as u32 ;
@@ -396,9 +404,13 @@ impl GpuPage {
396
404
let uuid_store: Arc < Mutex < String > > = Arc :: new ( Mutex :: new ( uuid) ) ;
397
405
398
406
// Create thread safe container for provider
399
- let provider: Option < Provider > = self . provider . clone ( ) . get ( ) . expect ( "`provider` wasn't set properly.." ) . to_owned ( ) ;
400
- let provider_store: Arc < Mutex < Option < Provider > > > =
401
- Arc :: new ( Mutex :: new ( provider) ) ;
407
+ let provider: Option < Provider > = self
408
+ . provider
409
+ . clone ( )
410
+ . get ( )
411
+ . expect ( "`provider` wasn't set properly.." )
412
+ . to_owned ( ) ;
413
+ let provider_store: Arc < Mutex < Option < Provider > > > = Arc :: new ( Mutex :: new ( provider) ) ;
402
414
403
415
// Async fill the labels
404
416
let id: SourceId = glib:: timeout_add_seconds_local ( refresh_rate, move || {
@@ -497,7 +509,12 @@ impl GpuPage {
497
509
// println!("items saved: `{:?}`", loaded_properties_data); //TEST
498
510
499
511
// Get stored UUID
500
- let uuid: String = self . uuid . clone ( ) . get ( ) . expect ( "`uuid` wasn't set properly.." ) . to_string ( ) ;
512
+ let uuid: String = self
513
+ . uuid
514
+ . clone ( )
515
+ . get ( )
516
+ . expect ( "`uuid` wasn't set properly.." )
517
+ . to_string ( ) ;
501
518
502
519
// If present in saved settings, use! otherwise follow below defaults
503
520
if let 0 = loaded_properties_data. len ( ) {
0 commit comments