mirror of
https://github.com/xlmnxp/blue-recorder.git
synced 2024-11-23 17:13:11 +03:00
Merge pull request #72 from hamirmahal/refactor/remove-redundant-references
refactor: remove redundant references
This commit is contained in:
commit
75e2b891a7
@ -81,7 +81,7 @@ pub fn get(selection: &str, key: &str) -> String {
|
||||
.join("blue-recorder")
|
||||
.join("config.ini");
|
||||
String::from(
|
||||
Ini::load_from_file(&config_path)
|
||||
Ini::load_from_file(config_path)
|
||||
.unwrap()
|
||||
.with_section(Some(selection))
|
||||
.get(key)
|
||||
|
12
src/main.rs
12
src/main.rs
@ -6,8 +6,8 @@ mod area_capture;
|
||||
mod config_management;
|
||||
mod ffmpeg_interface;
|
||||
mod timer;
|
||||
mod wayland_record;
|
||||
mod utils;
|
||||
mod wayland_record;
|
||||
|
||||
use ffmpeg_interface::Ffmpeg;
|
||||
use gettextrs::{bindtextdomain, gettext, setlocale, textdomain, LocaleCategory};
|
||||
@ -15,19 +15,17 @@ use gtk::glib;
|
||||
use gtk::prelude::*;
|
||||
use gtk::{
|
||||
AboutDialog, Application, Builder, Button, CheckButton, ComboBoxText, CssProvider, Entry,
|
||||
FileChooserAction, FileChooserNative, Image, Label, SpinButton,
|
||||
ToggleButton, Window,
|
||||
FileChooserAction, FileChooserNative, Image, Label, SpinButton, ToggleButton, Window,
|
||||
};
|
||||
use utils::is_wayland;
|
||||
use std::cell::RefCell;
|
||||
use std::ops::Add;
|
||||
use std::path::Path;
|
||||
use std::process::{Command, Stdio};
|
||||
use std::rc::Rc;
|
||||
use timer::{recording_delay, start_timer, stop_timer};
|
||||
use utils::is_wayland;
|
||||
use wayland_record::WaylandRecorder;
|
||||
|
||||
|
||||
#[async_std::main]
|
||||
async fn main() {
|
||||
// Create new application
|
||||
@ -146,12 +144,12 @@ pub fn build_ui(application: &Application) {
|
||||
// Get audio sources
|
||||
let sources_descriptions: Vec<String> = {
|
||||
let list_sources_child = Command::new("pactl")
|
||||
.args(&["list", "sources"])
|
||||
.args(["list", "sources"])
|
||||
.stdout(Stdio::piped())
|
||||
.spawn();
|
||||
let sources_descriptions = String::from_utf8(if let Ok(..) = list_sources_child {
|
||||
Command::new("grep")
|
||||
.args(&["-e", "device.description"])
|
||||
.args(["-e", "device.description"])
|
||||
.stdin(list_sources_child.unwrap().stdout.take().unwrap())
|
||||
.output()
|
||||
.unwrap()
|
||||
|
Loading…
Reference in New Issue
Block a user