Fix warnings on macOS

This commit is contained in:
Federico Terzi 2019-09-16 17:52:33 +02:00
parent fa0f17e9bc
commit 2af285d01d
4 changed files with 7 additions and 9 deletions

View File

@ -50,6 +50,8 @@ pub fn check_dependencies() -> bool {
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
pub fn check_dependencies() -> bool { pub fn check_dependencies() -> bool {
// TODO: check accessibility // TODO: check accessibility
true
} }
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]

View File

@ -20,13 +20,11 @@
use std::sync::mpsc::Sender; use std::sync::mpsc::Sender;
use std::os::raw::c_void; use std::os::raw::c_void;
use crate::bridge::macos::*; use crate::bridge::macos::*;
use crate::event::{Event, KeyEvent, KeyModifier, ActionEvent, ActionType}; use crate::event::{Event, KeyEvent, KeyModifier, ActionType};
use crate::event::KeyModifier::*; use crate::event::KeyModifier::*;
use std::fs::create_dir_all;
use std::ffi::CString; use std::ffi::CString;
use std::fs; use std::fs;
use log::{info, error}; use log::{info, error};
use std::path::PathBuf;
use std::process::exit; use std::process::exit;
const STATUS_ICON_BINARY : &'static [u8] = include_bytes!("../res/mac/icon.png"); const STATUS_ICON_BINARY : &'static [u8] = include_bytes!("../res/mac/icon.png");
@ -54,7 +52,7 @@ impl MacContext {
}); });
// Initialize the status icon path // Initialize the status icon path
let espanso_dir = MacContext::get_data_dir(); let espanso_dir = super::get_data_dir();
let status_icon_target = espanso_dir.join("icon.png"); let status_icon_target = espanso_dir.join("icon.png");
if status_icon_target.exists() { if status_icon_target.exists() {

View File

@ -17,10 +17,8 @@
* along with espanso. If not, see <https://www.gnu.org/licenses/>. * along with espanso. If not, see <https://www.gnu.org/licenses/>.
*/ */
use std::io::{BufReader, Read};
use std::io::Write;
use std::os::unix::net::{UnixStream,UnixListener}; use std::os::unix::net::{UnixStream,UnixListener};
use log::{info, error, warn}; use log::{info, warn};
use std::sync::mpsc::Sender; use std::sync::mpsc::Sender;
use super::IPCCommand; use super::IPCCommand;

View File

@ -24,9 +24,9 @@ use log::{info, warn, debug};
use std::path::PathBuf; use std::path::PathBuf;
use std::process::Command; use std::process::Command;
use crate::ui::{MenuItem, MenuItemType}; use crate::ui::{MenuItem, MenuItemType};
use crate::context::macos::MacContext;
use crate::bridge::macos::{MacMenuItem, show_context_menu}; use crate::bridge::macos::{MacMenuItem, show_context_menu};
use std::os::raw::c_char; use std::os::raw::c_char;
use crate::context;
const NOTIFY_HELPER_BINARY : &'static [u8] = include_bytes!("../res/mac/EspansoNotifyHelper.zip"); const NOTIFY_HELPER_BINARY : &'static [u8] = include_bytes!("../res/mac/EspansoNotifyHelper.zip");
const DEFAULT_NOTIFICATION_DELAY : f64 = 1.5; const DEFAULT_NOTIFICATION_DELAY : f64 = 1.5;
@ -92,7 +92,7 @@ impl MacUIManager {
} }
fn initialize_notify_helper() -> PathBuf { fn initialize_notify_helper() -> PathBuf {
let espanso_dir = MacContext::get_data_dir(); let espanso_dir = context::get_data_dir();
info!("Initializing EspansoNotifyHelper in {}", espanso_dir.as_path().display()); info!("Initializing EspansoNotifyHelper in {}", espanso_dir.as_path().display());