Skip to content

Commit

Permalink
fix: add dbus flag
Browse files Browse the repository at this point in the history
  • Loading branch information
edfloreshz committed Jul 11, 2024
1 parent 01c72b3 commit e14da23
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 24 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ emojis = "0.6.1"
[dependencies.libcosmic]
git = "https://github.com/pop-os/libcosmic.git"
default-features = false
features = ["multi-window", "tokio", "winit", "wgpu"]
features = ["multi-window", "tokio", "winit", "wgpu", "dbus-config"]

[dependencies.smol_str]
version = "0.2.1"
Expand Down
3 changes: 2 additions & 1 deletion dev.edfloreshz.Tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
"command": "tasks",
"finish-args": [
"--share=ipc",
"--socket=fallback-x11",
"--socket=wayland",
"--socket=fallback-x11",
"--talk-name=com.system76.CosmicSettingsDaemon.*",
"--device=dri"
],
"build-options": {
Expand Down
16 changes: 9 additions & 7 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use std::{env, process};
use chrono::{Local, NaiveDate};
use cli_clipboard::{ClipboardContext, ClipboardProvider};
use cosmic::app::{message, Core, Message as CosmicMessage};
use cosmic::cosmic_config::Update;
use cosmic::cosmic_theme::ThemeMode;
use cosmic::iced::alignment::{Horizontal, Vertical};
use cosmic::iced::keyboard::{Key, Modifiers};
use cosmic::iced::{
Expand Down Expand Up @@ -68,7 +70,7 @@ pub enum Message {
Key(Modifiers, Key),
Modifiers(Modifiers),
AppTheme(usize),
SystemThemeModeChange(cosmic_theme::ThemeMode),
SystemThemeModeChange,
OpenNewListDialog,
OpenRenameListDialog,
OpenDeleteListDialog,
Expand Down Expand Up @@ -499,30 +501,30 @@ impl Application for Tasks {
Self::APP_ID.into(),
CONFIG_VERSION,
)
.map(|update| {
.map(|update: Update<ThemeMode>| {
if !update.errors.is_empty() {
log::info!(
"errors loading config {:?}: {:?}",
update.keys,
update.errors
);
}
Message::SystemThemeModeChange(update.config)
Message::SystemThemeModeChange
}),
cosmic_config::config_subscription::<_, cosmic_theme::ThemeMode>(
TypeId::of::<ThemeSubscription>(),
cosmic_theme::THEME_MODE_ID.into(),
cosmic_theme::ThemeMode::version(),
)
.map(|update| {
.map(|update: Update<ThemeMode>| {
if !update.errors.is_empty() {
log::info!(
"errors loading theme mode {:?}: {:?}",
update.keys,
update.errors
);
}
Message::SystemThemeModeChange(update.config)
Message::SystemThemeModeChange
}),
];

Expand Down Expand Up @@ -715,7 +717,7 @@ impl Application for Tasks {
config_set!(app_theme, app_theme);
return self.update_config();
}
Message::SystemThemeModeChange(_) => {
Message::SystemThemeModeChange => {
return self.update_config();
}
Message::FetchLists => {
Expand Down Expand Up @@ -835,7 +837,7 @@ impl Application for Tasks {
let entity = self.nav_model.active();
self.nav_model.text_set(entity, name.clone());
if let Some(list) = self.nav_model.active_data_mut::<List>() {
list.name = name.clone();
list.name.clone_from(&name);
let command = Command::perform(
todo::update_list(list.clone(), self.service.clone()),
|_| message::none(),
Expand Down
10 changes: 4 additions & 6 deletions src/app/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ impl TasksConfig {
pub fn config() -> TasksConfig {
match Self::config_handler() {
Some(config_handler) => {
let config =
TasksConfig::get_entry(&config_handler).unwrap_or_else(|(errs, config)| {
log::info!("errors loading config: {:?}", errs);
config
});
config
TasksConfig::get_entry(&config_handler).unwrap_or_else(|(errs, config)| {
log::info!("errors loading config: {:?}", errs);
config
})
}
None => TasksConfig::default(),
}
Expand Down
5 changes: 2 additions & 3 deletions src/app/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ pub fn set_icon_cache() {
pub fn get_flags() -> Flags {
let (config_handler, config) = (TasksConfig::config_handler(), TasksConfig::config());

let flags = Flags {
Flags {
config_handler,
config,
};
flags
}
}

pub fn migrate(prev_app_id: &str) {
Expand Down
2 changes: 1 addition & 1 deletion src/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl Content {
let mut commands = Vec::new();
match message {
Message::List(list) => {
self.list = list.clone();
self.list.clone_from(&list);
if let Some(list) = list {
commands.push(Command::GetTasks(list.id().clone()));
}
Expand Down
8 changes: 3 additions & 5 deletions src/details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use crate::fl;

pub struct Details {
pub task: Option<Task>,
pub is_editable: bool,
pub priority_model: segmented_button::Model<segmented_button::SingleSelect>,
pub subtask_input: String,
pub subtasks: SlotMap<DefaultKey, Task>,
Expand Down Expand Up @@ -69,7 +68,6 @@ impl Details {
Self {
task: None,
priority_model,
is_editable: false,
subtask_input: String::new(),
subtasks: SlotMap::new(),
editing: SecondaryMap::new(),
Expand All @@ -82,12 +80,12 @@ impl Details {
match message {
Message::SetTitle(title) => {
if let Some(ref mut task) = &mut self.task {
task.title = title.clone();
task.title.clone_from(&title);
}
}
Message::SetNotes(notes) => {
if let Some(ref mut task) = &mut self.task {
task.notes = notes.clone();
task.notes.clone_from(&notes);
}
}
Message::Favorite(favorite) => {
Expand Down Expand Up @@ -117,7 +115,7 @@ impl Details {
Message::SetSubTaskTitle(id, title) => {
let task = self.subtasks.get_mut(id);
if let Some(task) = task {
task.title = title.clone();
task.title.clone_from(&title);
}
}
Message::CompleteSubTask(id, completed) => {
Expand Down

0 comments on commit e14da23

Please sign in to comment.