reorder imports for no reason

This commit is contained in:
psykose 2024-11-15 10:00:41 +01:00
parent 850450fdb4
commit 36f9f5f506
Signed by: psykose
SSH key fingerprint: SHA256:pRMVjV3kRB6zl+wNx+sV8KoMnPqQAW6v8dNCxsCGZv8
8 changed files with 64 additions and 78 deletions

View file

@ -1,9 +1,11 @@
mod imp {
use crate::ui; use crate::ui;
use adw::{prelude::*, subclass::prelude::*}; use adw::{prelude::*, subclass::prelude::*};
use gtk::glib; use gtk::{gio, glib};
use tracing::{event, Level}; use tracing::{event, Level};
mod imp {
use super::*;
#[derive(Default)] #[derive(Default)]
pub struct Application {} pub struct Application {}
@ -46,8 +48,6 @@ mod imp {
} }
} }
use gtk::{gio, glib};
glib::wrapper! { glib::wrapper! {
pub struct Application(ObjectSubclass<imp::Application>) pub struct Application(ObjectSubclass<imp::Application>)
@extends adw::Application, gtk::Application, gio::Application, @extends adw::Application, gtk::Application, gio::Application,

View file

@ -1,9 +1,11 @@
mod imp {
use adw::prelude::*; use adw::prelude::*;
use gtk::glib; use gtk::glib;
use gtk::subclass::prelude::*; use gtk::subclass::prelude::*;
use std::cell::RefCell; use std::cell::RefCell;
mod imp {
use super::*;
#[derive(glib::Properties, Default)] #[derive(glib::Properties, Default)]
#[properties(wrapper_type = super::Album)] #[properties(wrapper_type = super::Album)]
pub struct Album { pub struct Album {
@ -25,8 +27,6 @@ mod imp {
impl ObjectImpl for Album {} impl ObjectImpl for Album {}
} }
use gtk::glib;
glib::wrapper! { glib::wrapper! {
pub struct Album(ObjectSubclass<imp::Album>); pub struct Album(ObjectSubclass<imp::Album>);
} }

View file

@ -1,8 +1,12 @@
mod imp { use crate::subsonic;
use adw::prelude::*; use adw::{prelude::*, subclass::prelude::*};
use gtk::subclass::prelude::*; use gtk::{gdk, glib, glib::Object};
use gtk::{gdk, glib};
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
use tokio::sync::Semaphore;
use tracing::{event, Level};
mod imp {
use super::*;
static NEXT_COUNTER: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0); static NEXT_COUNTER: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0);
@ -60,13 +64,6 @@ mod imp {
} }
} }
use crate::subsonic;
use adw::{prelude::*, subclass::prelude::*};
use glib::Object;
use gtk::{gdk, glib};
use tokio::sync::Semaphore;
use tracing::{event, Level};
// only fetch 20 thumbnails at a time // only fetch 20 thumbnails at a time
static SEM: Semaphore = Semaphore::const_new(20); static SEM: Semaphore = Semaphore::const_new(20);

View file

@ -1,12 +1,13 @@
pub mod song; pub mod song;
pub use song::Song;
mod imp {
use adw::{gdk, gio, glib, prelude::*, subclass::prelude::*}; use adw::{gdk, gio, glib, prelude::*, subclass::prelude::*};
use glib::{subclass::InitializingObject, WeakRef}; use glib::{subclass::InitializingObject, WeakRef};
pub use song::Song;
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
use tracing::{event, Level}; use tracing::{event, Level};
mod imp {
use super::*;
#[derive(gtk::CompositeTemplate, glib::Properties, Default)] #[derive(gtk::CompositeTemplate, glib::Properties, Default)]
#[template(resource = "/eu/callcc/audrey/play_queue.ui")] #[template(resource = "/eu/callcc/audrey/play_queue.ui")]
#[properties(wrapper_type = super::PlayQueue)] #[properties(wrapper_type = super::PlayQueue)]
@ -102,8 +103,6 @@ mod imp {
} }
} }
use adw::prelude::*;
use gtk::glib;
glib::wrapper! { glib::wrapper! {
pub struct PlayQueue(ObjectSubclass<imp::PlayQueue>) pub struct PlayQueue(ObjectSubclass<imp::PlayQueue>)

View file

@ -1,9 +1,12 @@
mod imp {
use crate::model::Song as ModelSong; use crate::model::Song as ModelSong;
use adw::prelude::*;
use glib::subclass::InitializingObject; use glib::subclass::InitializingObject;
use gtk::{gdk, gio, glib, prelude::*, subclass::prelude::*}; use gtk::{gdk, gio, glib, subclass::prelude::*};
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
mod imp {
use super::*;
#[derive(gtk::CompositeTemplate, glib::Properties, Default)] #[derive(gtk::CompositeTemplate, glib::Properties, Default)]
#[template(resource = "/eu/callcc/audrey/play_queue_song.ui")] #[template(resource = "/eu/callcc/audrey/play_queue_song.ui")]
#[properties(wrapper_type = super::Song)] #[properties(wrapper_type = super::Song)]
@ -174,10 +177,6 @@ mod imp {
} }
} }
use crate::model::Song as ModelSong;
use adw::prelude::*;
use gtk::glib;
glib::wrapper! { glib::wrapper! {
pub struct Song(ObjectSubclass<imp::Song>) pub struct Song(ObjectSubclass<imp::Song>)
@extends gtk::Box, gtk::Widget, @extends gtk::Box, gtk::Widget,

View file

@ -1,4 +1,3 @@
mod imp {
use crate::model::Song; use crate::model::Song;
use adw::prelude::*; use adw::prelude::*;
use adw::subclass::prelude::*; use adw::subclass::prelude::*;
@ -7,6 +6,9 @@ mod imp {
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
use tracing::{event, Level}; use tracing::{event, Level};
mod imp {
use super::*;
#[derive(glib::Properties, gtk::CompositeTemplate, Default)] #[derive(glib::Properties, gtk::CompositeTemplate, Default)]
#[properties(wrapper_type = super::Playbar)] #[properties(wrapper_type = super::Playbar)]
#[template(resource = "/eu/callcc/audrey/playbar.ui")] #[template(resource = "/eu/callcc/audrey/playbar.ui")]
@ -169,8 +171,6 @@ mod imp {
} }
} }
use gtk::glib;
glib::wrapper! { glib::wrapper! {
pub struct Playbar(ObjectSubclass<imp::Playbar>) pub struct Playbar(ObjectSubclass<imp::Playbar>)
@extends adw::Bin, gtk::Widget, @extends adw::Bin, gtk::Widget,

View file

@ -1,10 +1,12 @@
mod imp {
use adw::{glib, prelude::*, subclass::prelude::*}; use adw::{glib, prelude::*, subclass::prelude::*};
use glib::subclass::InitializingObject; use glib::subclass::InitializingObject;
use glib::WeakRef; use glib::WeakRef;
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
use tracing::{event, Level}; use tracing::{event, Level};
mod imp {
use super::*;
#[derive(gtk::CompositeTemplate, glib::Properties, Default)] #[derive(gtk::CompositeTemplate, glib::Properties, Default)]
#[template(resource = "/eu/callcc/audrey/setup.ui")] #[template(resource = "/eu/callcc/audrey/setup.ui")]
#[properties(wrapper_type = super::Setup)] #[properties(wrapper_type = super::Setup)]
@ -123,10 +125,6 @@ mod imp {
} }
} }
use adw::subclass::prelude::*;
use gtk::glib;
use tracing::{event, Level};
glib::wrapper! { glib::wrapper! {
pub struct Setup(ObjectSubclass<imp::Setup>) pub struct Setup(ObjectSubclass<imp::Setup>)
@extends adw::PreferencesDialog, adw::Dialog, gtk::Widget, @extends adw::PreferencesDialog, adw::Dialog, gtk::Widget,

View file

@ -1,8 +1,8 @@
mod imp {
use crate::model::{Album, Song}; use crate::model::{Album, Song};
use crate::{mpris, mpv}; use crate::{mpris, mpv};
use adw::prelude::*; use adw::prelude::*;
use adw::subclass::prelude::*; use adw::subclass::prelude::*;
use futures::TryStreamExt;
use glib::subclass::InitializingObject; use glib::subclass::InitializingObject;
use glib::JoinHandle; use glib::JoinHandle;
use gtk::{gdk, gio, glib}; use gtk::{gdk, gio, glib};
@ -11,6 +11,9 @@ mod imp {
use tracing::{event, span, Level}; use tracing::{event, span, Level};
use zbus::object_server::InterfaceRef; use zbus::object_server::InterfaceRef;
mod imp {
use super::*;
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub(super) enum State { pub(super) enum State {
Idle, Idle,
@ -178,9 +181,7 @@ mod imp {
gtk::style_context_add_provider_for_display(&display, &self.css_provider, 420); gtk::style_context_add_provider_for_display(&display, &self.css_provider, 420);
} }
use gio::ActionEntry; let action_seek_backward = gio::ActionEntry::builder("seek-backward")
let action_seek_backward = ActionEntry::builder("seek-backward")
.activate(glib::clone!( .activate(glib::clone!(
#[weak(rename_to = window)] #[weak(rename_to = window)]
self.obj(), self.obj(),
@ -190,7 +191,7 @@ mod imp {
)) ))
.build(); .build();
let action_seek_forward = ActionEntry::builder("seek-forward") let action_seek_forward = gio::ActionEntry::builder("seek-forward")
.activate(glib::clone!( .activate(glib::clone!(
#[weak(rename_to = window)] #[weak(rename_to = window)]
self.obj(), self.obj(),
@ -798,8 +799,6 @@ mod imp {
let api = Rc::clone(self.api.borrow().as_ref().unwrap()); let api = Rc::clone(self.api.borrow().as_ref().unwrap());
let albums_model = self.obj().albums_model().clone(); let albums_model = self.obj().albums_model().clone();
let perform = async move { let perform = async move {
use futures::TryStreamExt;
let mut albums = let mut albums =
std::pin::pin!(api.album_list_full(crate::subsonic::AlbumListType::Newest)); std::pin::pin!(api.album_list_full(crate::subsonic::AlbumListType::Newest));
while let Some(album) = albums.try_next().await? { while let Some(album) = albums.try_next().await? {
@ -841,12 +840,6 @@ mod imp {
} }
} }
use adw::prelude::*;
use adw::subclass::prelude::*;
use gtk::{gio, glib};
use std::rc::Rc;
use tracing::{event, Level};
glib::wrapper! { glib::wrapper! {
pub struct Window(ObjectSubclass<imp::Window>) pub struct Window(ObjectSubclass<imp::Window>)
@extends adw::ApplicationWindow, gtk::ApplicationWindow, gtk::Window, gtk::Widget, @extends adw::ApplicationWindow, gtk::ApplicationWindow, gtk::Window, gtk::Widget,