Skip to content

Commit

Permalink
Remove password from GitHub workflows; Prepare TLS support
Browse files Browse the repository at this point in the history
  • Loading branch information
xcmd-io committed Nov 13, 2023
1 parent 6eb4a85 commit 4a59c95
Show file tree
Hide file tree
Showing 13 changed files with 240 additions and 57 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ''
1 change: 0 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ''
with:
tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
projectPath: xcmd-tauri
Expand Down
44 changes: 43 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions systemicons/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hard_tabs = false
3 changes: 2 additions & 1 deletion systemicons/src/linux/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pub mod request;

pub mod request;
33 changes: 25 additions & 8 deletions systemicons/src/linux/request.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
use std::{ffi::{CStr, CString, c_void}, fs::{self, File}, io::Read};
use gio_sys::GThemedIcon;
use glib::{gobject_ffi::g_object_unref, object::GObject};
use glib_sys::g_free;
use gtk_sys::{GTK_ICON_LOOKUP_NO_SVG, GtkIconTheme, gtk_icon_info_get_filename, gtk_icon_theme_choose_icon, gtk_icon_theme_get_default};
use gtk_sys::{
gtk_icon_info_get_filename, gtk_icon_theme_choose_icon, gtk_icon_theme_get_default,
GtkIconTheme, GTK_ICON_LOOKUP_NO_SVG,
};
use std::{
ffi::{c_void, CStr, CString},
fs::{self, File},
io::Read,
};

use crate::{Error, InnerError};

Expand All @@ -13,7 +20,7 @@ pub fn get_icon(ext: &str, size: i32) -> Result<Vec<u8>, Error> {
let mut f = File::open(&filename)?;
let metadata = fs::metadata(&filename)?;
let mut buffer = vec![0; metadata.len() as usize];
f.read(&mut buffer)?;
f.read(&mut buffer)?;
Ok(buffer)
}

Expand All @@ -33,13 +40,22 @@ pub fn get_icon_as_file(ext: &str, size: i32) -> Result<String, Error> {
let theme = gtk_icon_theme_get_default();
if theme.is_null() {
println!("You have to initialize GTK!");
return Err(Error{ message: "You have to initialize GTK!".to_string(), inner_error: InnerError::GtkInitError})
return Err(Error {
message: "You have to initialize GTK!".to_string(),
inner_error: InnerError::GtkInitError,
});
}
let theme = gtk_icon_theme_get_default();
DEFAULT_THEME = Some(theme);
}
let icon_names = gio_sys::g_themed_icon_get_names(icon as *mut GThemedIcon) as *mut *const i8;
let icon_info = gtk_icon_theme_choose_icon(DEFAULT_THEME.unwrap(), icon_names, size, GTK_ICON_LOOKUP_NO_SVG);
let icon_names =
gio_sys::g_themed_icon_get_names(icon as *mut GThemedIcon) as *mut *const i8;
let icon_info = gtk_icon_theme_choose_icon(
DEFAULT_THEME.unwrap(),
icon_names,
size,
GTK_ICON_LOOKUP_NO_SVG,
);
let filename = gtk_icon_info_get_filename(icon_info);
let res_str = CStr::from_ptr(filename);
result = res_str.to_str()?.to_string();
Expand All @@ -48,5 +64,6 @@ pub fn get_icon_as_file(ext: &str, size: i32) -> Result<String, Error> {
Ok(result)
}

pub fn init() { gtk::init().unwrap(); }

pub fn init() {
gtk::init().unwrap();
}
1 change: 0 additions & 1 deletion systemicons/src/windows/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
pub mod request;

Loading

0 comments on commit 4a59c95

Please sign in to comment.