Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
vhdirk committed Mar 2, 2024
1 parent 79042ca commit 1879f79
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 46 deletions.
21 changes: 0 additions & 21 deletions .editorconfig

This file was deleted.

1 change: 1 addition & 0 deletions build-aux/io.github.vhdirk.Terms.Devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ modules:
builddir: true
config-opts:
- -Dprofile=development
- -Dflatpak=true
sources:
- type: dir
path: ../
2 changes: 2 additions & 0 deletions build-aux/io.github.vhdirk.Terms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ modules:
buildsystem: meson
run-tests: true
builddir: true
config-opts:
- -Dflatpak=true
sources:
- type: dir
path: ../
5 changes: 2 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ desktop_file_validate = find_program('desktop-file-validate', required: false)
appstream_util = find_program('appstream-util', required: false)
cargo = find_program('cargo', required: true)
cargo_version = run_command(cargo, '--version', check: true).stdout().strip()
message(cargo_version)
rustc_version = run_command('rustc', '--version', check: true).stdout().strip()
message(rustc_version)

version = meson.project_version()

Expand Down Expand Up @@ -77,7 +75,7 @@ if profile == 'Devel'
else
version_suffix = ''
application_id = base_id
release_date = run_command('git', 'show', '-s', '--format=%cI').stdout().strip()
release_date = run_command('git', 'show', '-s', '--format=%cI', check: false).stdout().strip()
endif
full_version += version_suffix

Expand Down Expand Up @@ -109,6 +107,7 @@ summary({

summary({
'Profile': get_option('profile'),
'Flatpak': get_option('flatpak'),
},
section: 'Build options',
)
Expand Down
6 changes: 6 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ option(
value: 'default',
description: 'The build profile for Terms. One of "default", "beta", "development" or "hack".'
)

option(
'flatpak',
type: 'boolean',
value : false
)
1 change: 0 additions & 1 deletion src/components/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ mod theme_thumbnail;
mod window;

pub use preferences_window::*;
pub use process_manager::*;

pub use shortcut_dialog::*;
pub use shortcut_row::*;
Expand Down
8 changes: 3 additions & 5 deletions src/components/terminal/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use glib::{clone, subclass::Signal, JoinHandle, Value};
use once_cell::sync::Lazy;

use crate::components::search_toolbar::SearchToolbar;
use crate::components::ProcessManager;
use crate::config::APP_NAME;
use crate::pcre2::PCRE2Flags;
use crate::settings::ScrollbackMode;
Expand Down Expand Up @@ -64,8 +63,6 @@ pub struct Terminal {

padding_provider: RefCell<Option<gtk::CssProvider>>,

process_manager: ProcessManager,

update_source: Option<glib::SourceId>,

#[template_child]
Expand Down Expand Up @@ -129,7 +126,6 @@ impl Default for Terminal {

uuid: glib::uuid_string_random().to_string(),
spawner: get_spawner(),
process_manager: ProcessManager::new(),
last_match: Default::default(),

update_source: Default::default(),
Expand Down Expand Up @@ -486,14 +482,16 @@ impl Terminal {
fn on_padding_changed(&self) {
// TODO: move to themeprovider
if let Some(padding_provider) = self.padding_provider.borrow_mut().take() {
#[allow(deprecated)]
self.term.style_context().remove_provider(&padding_provider);
}

let (top, right, bottom, left) = self.settings.terminal_padding();

let provider = gtk::CssProvider::new();
provider.load_from_data(&format!("vte-terminal {{ padding: {}px {}px {}px {}px; }}", top, right, bottom, left));
provider.load_from_string(&format!("vte-terminal {{ padding: {}px {}px {}px {}px; }}", top, right, bottom, left));

#[allow(deprecated)]
self.term.style_context().add_provider(&provider, gtk::STYLE_PROVIDER_PRIORITY_APPLICATION);
self.padding_provider.borrow_mut().replace(provider);
}
Expand Down
5 changes: 0 additions & 5 deletions src/components/terminal_tab/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,6 @@ impl TerminalTab {
self.panel_grid.selected().map(|p| p.child()).and_downcast()
}

fn set_selected(&self, _terminal: Option<Terminal>) {
// todo!();
// self.panel_grid.set_select
}

fn on_selected_panel_change(&self) {
let panel = self.panel_grid.selected();
debug!("on panel changed: {:?}", panel);
Expand Down
3 changes: 2 additions & 1 deletion src/components/theme_thumbnail/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ impl ThemeThumbnail {

if let Some(bg_color) = theme.background {
let css_provider = gtk::CssProvider::new();
css_provider.load_from_data(&format!("picture {{ background-color: {}; }}", bg_color));
css_provider.load_from_string(&format!("picture {{ background-color: {}; }}", bg_color));
#[allow(deprecated)]
img.style_context().add_provider(&css_provider, gtk::STYLE_PROVIDER_PRIORITY_APPLICATION);
}
}
Expand Down
29 changes: 19 additions & 10 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ config = configure_file(
output: 'config.rs',
configuration: global_conf
)

# Copy the config.rs output to the source directory.
run_command(
'cp',
Expand All @@ -36,6 +37,23 @@ endif

cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home', 'BUILD_IS_MESON=true' ]

cargo_command = [
'env',
cargo_env,
cargo, 'build',
cargo_options,
'&&',
'cp', 'src' / rust_target / 'terms', '@OUTPUT0@',
]

if get_option('flatpak')
cargo_command += [
'&&',
'cp', 'src' / rust_target / 'terms-toolbox', '@OUTPUT1@',
]
endif


cargo_build = custom_target(
'cargo-build',
build_by_default: true,
Expand All @@ -45,14 +63,5 @@ cargo_build = custom_target(
install: true,
install_dir: bindir,
depends: resources,
command: [
'env',
cargo_env,
cargo, 'build',
cargo_options,
'&&',
'cp', 'src' / rust_target / 'terms', '@OUTPUT0@',
'&&',
'cp', 'src' / rust_target / 'terms-toolbox', '@OUTPUT1@',
]
command: cargo_command
)

0 comments on commit 1879f79

Please sign in to comment.