Skip to content

Commit 4aa0fb8

Browse files
dbus/service: Don't require an alias
As you can pass None which would allow creating custom collections
1 parent d4ce3e2 commit 4aa0fb8

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

client/src/dbus/api/service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ impl<'a> Service<'a> {
115115
pub async fn create_collection(
116116
&self,
117117
label: &str,
118-
alias: &str,
118+
alias: Option<&str>,
119119
window_id: Option<WindowIdentifier>,
120120
) -> Result<Collection<'a>, Error> {
121121
let properties = Properties::for_collection(label);
122122
let (collection_path, prompt_path) = self
123123
.inner()
124-
.call_method("CreateCollection", &(properties, alias))
124+
.call_method("CreateCollection", &(properties, alias.unwrap_or_default()))
125125
.await
126126
.map_err::<ServiceError, _>(From::from)?
127127
.body()

client/src/dbus/service.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl<'a> Service<'a> {
133133
) -> Result<Collection<'a>, Error> {
134134
match self.with_alias(alias).await {
135135
Ok(Some(collection)) => Ok(collection),
136-
Ok(None) => self.create_collection(label, alias, window_id).await,
136+
Ok(None) => self.create_collection(label, Some(alias), window_id).await,
137137
Err(err) => Err(err),
138138
}
139139
}
@@ -164,7 +164,7 @@ impl<'a> Service<'a> {
164164
pub async fn create_collection(
165165
&self,
166166
label: &str,
167-
alias: &str,
167+
alias: Option<&str>,
168168
window_id: Option<WindowIdentifier>,
169169
) -> Result<Collection<'a>, Error> {
170170
self.inner
@@ -231,11 +231,11 @@ mod tests {
231231
use super::Service;
232232

233233
#[tokio::test]
234-
#[ignore = "gnome-keyring doesn't support creating custom collections in CI"]
234+
#[ignore = "Requires prompting"]
235235
async fn create_collection() {
236236
let service = Service::new().await.unwrap();
237237
let collection = service
238-
.create_collection("somelabel", "Some Label", None)
238+
.create_collection("somelabel", None, None)
239239
.await
240240
.unwrap();
241241

0 commit comments

Comments
 (0)