Fix FileManager thread panic and other misc improvements

- Add shut down logic for FileManager thread
- Add an unit test for filemanager_thread
This commit is contained in:
Zhen Zhang 2016-05-24 21:53:48 +08:00
parent caada0fb33
commit 96b2093121
6 changed files with 46 additions and 3 deletions

View file

@ -6,7 +6,7 @@ use ipc_channel::ipc::IpcSender;
use std::path::PathBuf;
use uuid::Uuid;
#[derive(Deserialize, Serialize)]
#[derive(Debug, Deserialize, Serialize)]
pub struct SelectedFile {
pub id: Uuid,
pub filename: PathBuf,
@ -28,6 +28,9 @@ pub enum FileManagerThreadMsg {
/// Delete the FileID entry
DeleteFileID(Uuid),
/// Shut down this thread
Exit,
}
pub type FileManagerResult<T> = Result<T, FileManagerThreadError>;