Skip to content

Commit 0a7ba97

Browse files
Merge pull request #924 from sdroege/timezone-adjust-time
glib: Manually implement `TimeZone::adjust_time()` instead of ignorin…
2 parents e69aa51 + eac2b69 commit 0a7ba97

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

glib/Gir.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ concurrency = "send+sync"
758758
[[object.function]]
759759
name = "adjust_time"
760760
# in-out parameter
761-
ignore = true
761+
manual = true
762762

763763
[[object]]
764764
name = "GLib.UnicodeScript"

glib/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ pub use self::{
157157
mod date;
158158
mod date_time;
159159
mod time_span;
160+
mod time_zone;
160161
pub use self::time_span::*;
161162
pub mod value;
162163
pub mod variant;

glib/src/time_zone.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Take a look at the license at the top of the repository in the LICENSE file.
2+
3+
use crate::translate::*;
4+
use crate::{TimeType, TimeZone};
5+
6+
impl TimeZone {
7+
#[doc(alias = "g_time_zone_adjust_time")]
8+
pub fn adjust_time(&self, type_: TimeType, mut time: i64) -> (i32, i64) {
9+
unsafe {
10+
let res =
11+
ffi::g_time_zone_adjust_time(self.to_glib_none().0, type_.into_glib(), &mut time);
12+
(res, time)
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)