Skip to content

Commit 2415231

Browse files
committed
Rename feature ksni to linux-ksni
1 parent d12cba1 commit 2415231

File tree

11 files changed

+96
-96
lines changed

11 files changed

+96
-96
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ default = ["libxdo"]
1515
libxdo = ["dep:libxdo"]
1616
common-controls-v6 = []
1717
serde = ["dep:serde", "dpi/serde"]
18-
ksni = ["arc-swap"]
18+
linux-ksni = ["arc-swap"]
1919

2020
[dependencies]
2121
arc-swap = { version = "1.7.1", optional = true }

src/items/check.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
use std::{cell::RefCell, mem, rc::Rc};
66

7-
#[cfg(all(feature = "ksni", target_os = "linux"))]
7+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
88
use std::sync::Arc;
99

10-
#[cfg(all(feature = "ksni", target_os = "linux"))]
10+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
1111
use arc_swap::ArcSwap;
1212

1313
use crate::{accelerator::Accelerator, sealed::IsMenuItemBase, IsMenuItem, MenuId, MenuItemKind};
@@ -22,7 +22,7 @@ use crate::{accelerator::Accelerator, sealed::IsMenuItemBase, IsMenuItem, MenuId
2222
pub struct CheckMenuItem {
2323
pub(crate) id: Rc<MenuId>,
2424
pub(crate) inner: Rc<RefCell<crate::platform_impl::MenuChild>>,
25-
#[cfg(all(feature = "ksni", target_os = "linux"))]
25+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
2626
pub(crate) compat: Arc<ArcSwap<crate::CompatMenuItem>>,
2727
}
2828

@@ -42,7 +42,7 @@ impl IsMenuItem for CheckMenuItem {
4242
}
4343

4444
impl CheckMenuItem {
45-
#[cfg(all(feature = "ksni", target_os = "linux"))]
45+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
4646
pub(crate) fn compat_menu_item(
4747
item: &crate::platform_impl::MenuChild,
4848
) -> crate::CompatMenuItem {
@@ -73,13 +73,13 @@ impl CheckMenuItem {
7373
None,
7474
);
7575

76-
#[cfg(all(feature = "ksni", target_os = "linux"))]
76+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
7777
let compat = Self::compat_menu_item(&inner);
7878

7979
Self {
8080
id: Rc::new(inner.id().clone()),
8181
inner: Rc::new(RefCell::new(inner)),
82-
#[cfg(all(feature = "ksni", target_os = "linux"))]
82+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
8383
compat: Arc::new(ArcSwap::from_pointee(compat)),
8484
}
8585
}
@@ -104,13 +104,13 @@ impl CheckMenuItem {
104104
Some(id.clone()),
105105
);
106106

107-
#[cfg(all(feature = "ksni", target_os = "linux"))]
107+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
108108
let compat = Self::compat_menu_item(&inner);
109109

110110
Self {
111111
id: Rc::new(id),
112112
inner: Rc::new(RefCell::new(inner)),
113-
#[cfg(all(feature = "ksni", target_os = "linux"))]
113+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
114114
compat: Arc::new(ArcSwap::from_pointee(compat)),
115115
}
116116
}
@@ -132,10 +132,10 @@ impl CheckMenuItem {
132132
let mut inner = self.inner.borrow_mut();
133133
inner.set_text(text.as_ref());
134134

135-
#[cfg(all(feature = "ksni", target_os = "linux"))]
135+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
136136
self.compat.store(Arc::new(Self::compat_menu_item(&inner)));
137137

138-
#[cfg(all(feature = "ksni", target_os = "linux"))]
138+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
139139
crate::send_menu_update();
140140
}
141141

@@ -149,10 +149,10 @@ impl CheckMenuItem {
149149
let mut inner = self.inner.borrow_mut();
150150
inner.set_enabled(enabled);
151151

152-
#[cfg(all(feature = "ksni", target_os = "linux"))]
152+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
153153
self.compat.store(Arc::new(Self::compat_menu_item(&inner)));
154154

155-
#[cfg(all(feature = "ksni", target_os = "linux"))]
155+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
156156
crate::send_menu_update();
157157
}
158158

@@ -171,10 +171,10 @@ impl CheckMenuItem {
171171
let mut inner = self.inner.borrow_mut();
172172
inner.set_checked(checked);
173173

174-
#[cfg(all(feature = "ksni", target_os = "linux"))]
174+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
175175
self.compat.store(Arc::new(Self::compat_menu_item(&inner)));
176176

177-
#[cfg(all(feature = "ksni", target_os = "linux"))]
177+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
178178
crate::send_menu_update();
179179
}
180180

src/items/icon.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
use std::{cell::RefCell, mem, rc::Rc};
66

7-
#[cfg(all(feature = "ksni", target_os = "linux"))]
7+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
88
use std::sync::Arc;
99

10-
#[cfg(all(feature = "ksni", target_os = "linux"))]
10+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
1111
use arc_swap::ArcSwap;
1212

1313
use crate::{
@@ -26,7 +26,7 @@ use crate::{
2626
pub struct IconMenuItem {
2727
pub(crate) id: Rc<MenuId>,
2828
pub(crate) inner: Rc<RefCell<crate::platform_impl::MenuChild>>,
29-
#[cfg(all(feature = "ksni", target_os = "linux"))]
29+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
3030
pub(crate) compat: Arc<ArcSwap<crate::CompatMenuItem>>,
3131
}
3232

@@ -46,7 +46,7 @@ impl IsMenuItem for IconMenuItem {
4646
}
4747

4848
impl IconMenuItem {
49-
#[cfg(all(feature = "ksni", target_os = "linux"))]
49+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
5050
pub(crate) fn compat_menu_item(
5151
item: &crate::platform_impl::MenuChild,
5252
) -> crate::CompatMenuItem {
@@ -81,13 +81,13 @@ impl IconMenuItem {
8181
None,
8282
);
8383

84-
#[cfg(all(feature = "ksni", target_os = "linux"))]
84+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
8585
let compat = Self::compat_menu_item(&inner);
8686

8787
Self {
8888
id: Rc::new(inner.id().clone()),
8989
inner: Rc::new(RefCell::new(inner)),
90-
#[cfg(all(feature = "ksni", target_os = "linux"))]
90+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
9191
compat: Arc::new(ArcSwap::from_pointee(compat)),
9292
}
9393
}
@@ -112,13 +112,13 @@ impl IconMenuItem {
112112
Some(id.clone()),
113113
);
114114

115-
#[cfg(all(feature = "ksni", target_os = "linux"))]
115+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
116116
let compat = Self::compat_menu_item(&inner);
117117

118118
Self {
119119
id: Rc::new(id),
120120
inner: Rc::new(RefCell::new(inner)),
121-
#[cfg(all(feature = "ksni", target_os = "linux"))]
121+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
122122
compat: Arc::new(ArcSwap::from_pointee(compat)),
123123
}
124124
}
@@ -144,13 +144,13 @@ impl IconMenuItem {
144144
None,
145145
);
146146

147-
#[cfg(all(feature = "ksni", target_os = "linux"))]
147+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
148148
let compat = Self::compat_menu_item(&inner);
149149

150150
Self {
151151
id: Rc::new(inner.id().clone()),
152152
inner: Rc::new(RefCell::new(inner)),
153-
#[cfg(all(feature = "ksni", target_os = "linux"))]
153+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
154154
compat: Arc::new(ArcSwap::from_pointee(compat)),
155155
}
156156
}
@@ -178,13 +178,13 @@ impl IconMenuItem {
178178
Some(id.clone()),
179179
);
180180

181-
#[cfg(all(feature = "ksni", target_os = "linux"))]
181+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
182182
let compat = Self::compat_menu_item(&inner);
183183

184184
Self {
185185
id: Rc::new(id),
186186
inner: Rc::new(RefCell::new(inner)),
187-
#[cfg(all(feature = "ksni", target_os = "linux"))]
187+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
188188
compat: Arc::new(ArcSwap::from_pointee(compat)),
189189
}
190190
}
@@ -206,10 +206,10 @@ impl IconMenuItem {
206206
let mut inner = self.inner.borrow_mut();
207207
inner.set_text(text.as_ref());
208208

209-
#[cfg(all(feature = "ksni", target_os = "linux"))]
209+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
210210
self.compat.store(Arc::new(Self::compat_menu_item(&inner)));
211211

212-
#[cfg(all(feature = "ksni", target_os = "linux"))]
212+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
213213
crate::send_menu_update();
214214
}
215215

@@ -223,10 +223,10 @@ impl IconMenuItem {
223223
let mut inner = self.inner.borrow_mut();
224224
inner.set_enabled(enabled);
225225

226-
#[cfg(all(feature = "ksni", target_os = "linux"))]
226+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
227227
self.compat.store(Arc::new(Self::compat_menu_item(&inner)));
228228

229-
#[cfg(all(feature = "ksni", target_os = "linux"))]
229+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
230230
crate::send_menu_update();
231231
}
232232

@@ -245,10 +245,10 @@ impl IconMenuItem {
245245
let mut inner = self.inner.borrow_mut();
246246
inner.set_icon(icon);
247247

248-
#[cfg(all(feature = "ksni", target_os = "linux"))]
248+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
249249
self.compat.store(Arc::new(Self::compat_menu_item(&inner)));
250250

251-
#[cfg(all(feature = "ksni", target_os = "linux"))]
251+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
252252
crate::send_menu_update();
253253
}
254254

src/items/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mod normal;
88
mod predefined;
99
mod submenu;
1010

11-
#[cfg(all(feature = "ksni", target_os = "linux"))]
11+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
1212
mod compat;
1313

1414
pub use check::*;
@@ -17,7 +17,7 @@ pub use normal::*;
1717
pub use predefined::*;
1818
pub use submenu::*;
1919

20-
#[cfg(all(feature = "ksni", target_os = "linux"))]
20+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
2121
pub use compat::*;
2222

2323
#[cfg(test)]

src/items/normal.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use std::{cell::RefCell, mem, rc::Rc};
22

3-
#[cfg(all(feature = "ksni", target_os = "linux"))]
3+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
44
use std::sync::Arc;
55

6-
#[cfg(all(feature = "ksni", target_os = "linux"))]
6+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
77
use arc_swap::ArcSwap;
88

99
use crate::{accelerator::Accelerator, sealed::IsMenuItemBase, IsMenuItem, MenuId, MenuItemKind};
@@ -16,7 +16,7 @@ use crate::{accelerator::Accelerator, sealed::IsMenuItemBase, IsMenuItem, MenuId
1616
pub struct MenuItem {
1717
pub(crate) id: Rc<MenuId>,
1818
pub(crate) inner: Rc<RefCell<crate::platform_impl::MenuChild>>,
19-
#[cfg(all(feature = "ksni", target_os = "linux"))]
19+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
2020
pub(crate) compat: Arc<ArcSwap<crate::CompatMenuItem>>,
2121
}
2222

@@ -36,7 +36,7 @@ impl IsMenuItem for MenuItem {
3636
}
3737

3838
impl MenuItem {
39-
#[cfg(all(feature = "ksni", target_os = "linux"))]
39+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
4040
pub(crate) fn compat_menu_item(
4141
item: &crate::platform_impl::MenuChild,
4242
) -> crate::CompatMenuItem {
@@ -57,13 +57,13 @@ impl MenuItem {
5757
pub fn new<S: AsRef<str>>(text: S, enabled: bool, accelerator: Option<Accelerator>) -> Self {
5858
let inner = crate::platform_impl::MenuChild::new(text.as_ref(), enabled, accelerator, None);
5959

60-
#[cfg(all(feature = "ksni", target_os = "linux"))]
60+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
6161
let compat = Self::compat_menu_item(&inner);
6262

6363
Self {
6464
id: Rc::new(inner.id().clone()),
6565
inner: Rc::new(RefCell::new(inner)),
66-
#[cfg(all(feature = "ksni", target_os = "linux"))]
66+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
6767
compat: Arc::new(ArcSwap::from_pointee(compat)),
6868
}
6969
}
@@ -86,13 +86,13 @@ impl MenuItem {
8686
Some(id.clone()),
8787
);
8888

89-
#[cfg(all(feature = "ksni", target_os = "linux"))]
89+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
9090
let compat = Self::compat_menu_item(&inner);
9191

9292
Self {
9393
id: Rc::new(id),
9494
inner: Rc::new(RefCell::new(inner)),
95-
#[cfg(all(feature = "ksni", target_os = "linux"))]
95+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
9696
compat: Arc::new(ArcSwap::from_pointee(compat)),
9797
}
9898
}
@@ -114,10 +114,10 @@ impl MenuItem {
114114
let mut inner = self.inner.borrow_mut();
115115
inner.set_text(text.as_ref());
116116

117-
#[cfg(all(feature = "ksni", target_os = "linux"))]
117+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
118118
self.compat.store(Arc::new(Self::compat_menu_item(&inner)));
119119

120-
#[cfg(all(feature = "ksni", target_os = "linux"))]
120+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
121121
crate::send_menu_update();
122122
}
123123

@@ -131,10 +131,10 @@ impl MenuItem {
131131
let mut inner = self.inner.borrow_mut();
132132
inner.set_enabled(enabled);
133133

134-
#[cfg(all(feature = "ksni", target_os = "linux"))]
134+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
135135
self.compat.store(Arc::new(Self::compat_menu_item(&inner)));
136136

137-
#[cfg(all(feature = "ksni", target_os = "linux"))]
137+
#[cfg(all(feature = "linux-ksni", target_os = "linux"))]
138138
crate::send_menu_update();
139139
}
140140

0 commit comments

Comments
 (0)