[fractal] Remove glib_thread stuff



commit 5854606889b1dc52e78ab6c27f4c849ff853177a
Author: Alejandro Domínguez <adomu net-c com>
Date:   Wed Jul 8 12:53:09 2020 +0200

    Remove glib_thread stuff

 fractal-gtk/src/util.rs | 31 -------------------------------
 1 file changed, 31 deletions(-)
---
diff --git a/fractal-gtk/src/util.rs b/fractal-gtk/src/util.rs
index ff4a2fc5..27ce7335 100644
--- a/fractal-gtk/src/util.rs
+++ b/fractal-gtk/src/util.rs
@@ -10,37 +10,6 @@ use log::error;
 use std::fs::create_dir_all;
 use std::sync::mpsc::SendError;
 
-pub mod glib_thread_prelude {
-    pub use crate::error::Error;
-    pub use std::sync::mpsc::channel;
-    pub use std::sync::mpsc::TryRecvError;
-    pub use std::sync::mpsc::{Receiver, Sender};
-    pub use std::thread;
-}
-
-#[macro_export]
-macro_rules! glib_thread {
-    ($type: ty, $thread: expr, $glib_code: expr) => {{
-        let (tx, rx): (Sender<$type>, Receiver<$type>) = channel();
-        thread::spawn(move || {
-            let output = $thread();
-            tx.send(output).unwrap();
-        });
-
-        gtk::timeout_add(50, move || match rx.try_recv() {
-            Err(TryRecvError::Empty) => Continue(true),
-            Err(TryRecvError::Disconnected) => {
-                error!("glib_thread error");
-                Continue(false)
-            }
-            Ok(output) => {
-                $glib_code(output);
-                Continue(false)
-            }
-        });
-    }};
-}
-
 pub fn cache_dir_path(dir: Option<&str>, name: &str) -> Result<String, Error> {
     let path = CACHE_PATH.join(dir.unwrap_or_default());
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]