Skip to content

Commit c38dc6d

Browse files
committed
refactor: rename single-instance feature
1 parent ef5b6fb commit c38dc6d

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ xdg-portal = ["ashpd"]
4343
# XXX Use "a11y"; which is causing a panic currently
4444
applet = ["wayland", "tokio", "cosmic-panel-config", "ron"]
4545
applet-token = []
46-
zbus = ["dep:zbus", "serde", "ron"]
46+
single-instance = ["dep:zbus", "serde", "ron"]
4747

4848
[dependencies]
4949
apply = "0.3.0"

src/app/cosmic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ where
179179
})
180180
.map(super::Message::Cosmic),
181181
window_events.map(super::Message::Cosmic),
182-
#[cfg(feature = "zbus")]
182+
#[cfg(feature = "single-instance")]
183183
self.app
184184
.core()
185185
.single_instance

src/app/mod.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use iced::Subscription;
4949
use iced::{window, Application as IcedApplication};
5050
pub use message::Message;
5151
use url::Url;
52-
#[cfg(feature = "zbus")]
52+
#[cfg(feature = "single-instance")]
5353
use {
5454
iced_futures::futures::channel::mpsc::{Receiver, Sender},
5555
iced_futures::futures::SinkExt,
@@ -122,7 +122,7 @@ pub fn run<App: Application>(settings: Settings, flags: App::Flags) -> iced::Res
122122

123123
cosmic::Cosmic::<App>::run(iced)
124124
}
125-
#[cfg(feature = "zbus")]
125+
#[cfg(feature = "single-instance")]
126126
#[derive(Debug, Clone)]
127127
pub struct DbusActivationMessage<Action = String, Args = Vec<String>> {
128128
pub activation_token: Option<String>,
@@ -142,10 +142,10 @@ pub enum DbusActivationDetails<Action = String, Args = Vec<String>> {
142142
args: Args,
143143
},
144144
}
145-
#[cfg(feature = "zbus")]
145+
#[cfg(feature = "single-instance")]
146146
#[derive(Debug, Default)]
147147
pub struct DbusActivation(Option<Sender<DbusActivationMessage>>);
148-
#[cfg(feature = "zbus")]
148+
#[cfg(feature = "single-instance")]
149149
impl DbusActivation {
150150
#[must_use]
151151
pub fn new() -> Self {
@@ -159,7 +159,7 @@ impl DbusActivation {
159159
}
160160
}
161161

162-
#[cfg(feature = "zbus")]
162+
#[cfg(feature = "single-instance")]
163163
#[dbus_proxy(interface = "org.freedesktop.DbusActivation")]
164164
pub trait DbusActivationInterface {
165165
/// Activate the application.
@@ -181,7 +181,7 @@ pub trait DbusActivationInterface {
181181
) -> zbus::Result<()>;
182182
}
183183

184-
#[cfg(feature = "zbus")]
184+
#[cfg(feature = "single-instance")]
185185
#[dbus_interface(interface = "org.freedesktop.DbusActivation")]
186186
impl DbusActivation {
187187
async fn activate(&mut self, platform_data: HashMap<&str, Value<'_>>) {
@@ -258,7 +258,7 @@ impl DbusActivation {
258258
}
259259
}
260260

261-
#[cfg(feature = "zbus")]
261+
#[cfg(feature = "single-instance")]
262262

263263
/// Launch a COSMIC application with the given [`Settings`].
264264
/// If the application is already running, the arguments will be passed to the
@@ -349,15 +349,15 @@ where
349349
/// Default async executor to use with the app.
350350
type Executor: iced_futures::Executor;
351351

352-
#[cfg(feature = "zbus")]
352+
#[cfg(feature = "single-instance")]
353353
/// Argument received [`Application::new`].
354354
type Flags: Clone + CosmicFlags;
355355

356-
#[cfg(not(feature = "zbus"))]
356+
#[cfg(not(feature = "single-instance"))]
357357
/// Argument received [`Application::new`].
358358
type Flags: Clone;
359359

360-
#[cfg(feature = "zbus")]
360+
#[cfg(feature = "single-instance")]
361361
/// Message type specific to our app.
362362
type Message: Clone
363363
+ From<
@@ -369,7 +369,7 @@ where
369369
+ Send
370370
+ 'static;
371371

372-
#[cfg(not(feature = "zbus"))]
372+
#[cfg(not(feature = "single-instance"))]
373373
/// Message type specific to our app.
374374
type Message: Clone + std::fmt::Debug + Send + 'static;
375375

@@ -626,7 +626,7 @@ impl<App: Application> ApplicationExt for App {
626626
}
627627
}
628628

629-
#[cfg(feature = "zbus")]
629+
#[cfg(feature = "single-instance")]
630630
fn single_instance_subscription<App: ApplicationExt>() -> Subscription<Message<App::Message>> {
631631
use iced_futures::futures::StreamExt;
632632

0 commit comments

Comments
 (0)