Skip to content
Commits on Source (9)
41.2 - 2022/01/09
Fixes:
* Fix duplicate condition in SyncManager (#111)
* Fix date formatting when second is single digit (#115)
* Fix excessive saves due to rogue marks
Translations:
* Updated translations:
- German (de)
41.1 - 2021/10/31
Fixes:
......
......@@ -25,6 +25,13 @@
<update_contact>aurisc4_at_gmail.com</update_contact>
<content_rating type="oars-1.1"/>
<releases>
<release version="41.2" date="2022-01-09">
<ul>
<li>Fix duplicate condition in SyncManager (#111)</li>
<li>Fix date formatting when second is single digit (#115)</li>
<li>Fix excessive saves due to rogue marks</li>
</ul>
</release>
<release version="41.1" date="2021-10-31">
<ul>
<li>Fix search box focus when very first search in window is in note (#108)</li>
......
project('gnote', 'cpp',
version: '41.1',
version: '41.2',
meson_version: '>=0.50.0',
default_options: 'cpp_std=c++14',
)
......@@ -9,7 +9,7 @@ i18n = import('i18n')
python = import('python')
gnote_release = meson.project_version().split('.')[0]
libgnote_version_info = '0.0.1'
libgnote_version_info = '0.0.2'
glib_version = '>=2.62'
gio_dep = dependency('gio-2.0', version: glib_version)
......
This diff is collapsed.
......@@ -396,6 +396,13 @@ namespace gnote {
void Note::on_buffer_mark_set(const Gtk::TextBuffer::iterator & iter,
const Glib::RefPtr<Gtk::TextBuffer::Mark> & insert)
{
auto buffer = get_buffer();
auto insert_mark = buffer->get_insert();
auto selection_mark = buffer->get_selection_bound();
if(!(insert == insert_mark || insert == selection_mark)) {
return;
}
Gtk::TextIter start, end;
if(m_buffer->get_selection_bounds(start, end)) {
m_data.data().set_cursor_position(start.get_offset());
......@@ -404,16 +411,17 @@ namespace gnote {
else if(insert->get_name() == "insert") {
m_data.data().set_cursor_position(iter.get_offset());
}
else {
return;
}
DBG_OUT("OnBufferSetMark queueing save");
queue_save(NO_CHANGE);
}
void Note::on_buffer_mark_deleted(const Glib::RefPtr<Gtk::TextBuffer::Mark> &)
void Note::on_buffer_mark_deleted(const Glib::RefPtr<Gtk::TextBuffer::Mark> & mark)
{
if(mark != get_buffer()->get_selection_bound()) {
return;
}
Gtk::TextIter start, end;
if(m_data.data().selection_bound_position() != m_data.data().cursor_position()
&& !m_buffer->get_selection_bounds(start, end)) {
......
/*
* gnote
*
* Copyright (C) 2012,2017,2020 Aurimas Cernius
* Copyright (C) 2012,2017,2020-2021 Aurimas Cernius
* Copyright (C) 2009 Hubert Figuiere
*
* Permission is hereby granted, free of charge, to any person obtaining a
......@@ -58,7 +58,7 @@ Glib::ustring date_time_to_iso8601(const Glib::DateTime & dt)
Glib::DateTime date = dt.to_utc();
char buffer[36] = {0};
std::sprintf(buffer, "%d-%02d-%02dT%02d:%02d:%02.6lfZ", date.get_year(), date.get_month(), date.get_day_of_month(), date.get_hour(), date.get_minute(), date.get_seconds());
std::sprintf(buffer, "%d-%02d-%02dT%02d:%02d:%09.6lfZ", date.get_year(), date.get_month(), date.get_day_of_month(), date.get_hour(), date.get_minute(), date.get_seconds());
retval = buffer;
return retval;
}
......
......@@ -442,15 +442,6 @@ namespace sync {
void SyncManager::handle_note_saved_or_deleted(const NoteBase::Ptr &)
{
if(m_sync_thread == NULL && m_autosync_timeout_pref_minutes > 0) {
Glib::TimeSpan time_since_last_check(Glib::DateTime::create_now_utc().difference(m_last_background_check));
Glib::TimeSpan time_until_next_check = sharp::time_span(0, m_current_autosync_timeout_minutes, 0) - time_since_last_check;
if(sharp::time_span_total_minutes(time_until_next_check) < 1) {
DBG_OUT("Note saved or deleted within a minute of next autosync...resetting sync timer");
m_current_autosync_timeout_minutes = 1;
m_autosync_timer.reset(m_current_autosync_timeout_minutes * 60000);
}
}
else if(m_sync_thread == NULL && m_autosync_timeout_pref_minutes > 0) {
DBG_OUT("Note saved or deleted...restarting sync timer");
m_last_background_check = Glib::DateTime::create_now_utc();
// Perform a sync one minute after setting change
......
/*
* gnote
*
* Copyright (C) 2017,2020 Aurimas Cernius
* Copyright (C) 2017,2020,2021 Aurimas Cernius
* Copyright (C) 2009 Hubert Figuiere
*
* This program is free software: you can redistribute it and/or modify
......@@ -48,6 +48,11 @@ SUITE(DateTime)
CHECK(bool(d));
date_string = sharp::date_time_to_iso8601(d);
CHECK_EQUAL("2009-03-24T07:34:35.540000Z", date_string);
d = Glib::DateTime::create_local(2021, 1, 2, 3, 4, 5);
CHECK(bool(d));
date_string = sharp::date_time_to_iso8601(d);
CHECK_EQUAL("2021-01-02T03:04:05.000000Z", date_string);
}
TEST(date_time_from_iso8601)
......