switch to reading read-only

There is no need to writing into the journals
This commit is contained in:
Florian Stinglmayr 2025-04-28 08:52:11 +02:00
parent 8e07c4bf66
commit 6aeafe34c3

View File

@ -209,7 +209,7 @@ static EDErrorCode ed_journal_file_load(EDJournalFile *self,
EDJournalFilePrivate *p = ed_journal_file_get_instance_private(self); EDJournalFilePrivate *p = ed_journal_file_get_instance_private(self);
GFile *file = NULL; GFile *file = NULL;
GFileIOStream *stream = NULL; GFileInputStream *stream = NULL;
GDataInputStream *reader = NULL; GDataInputStream *reader = NULL;
EDJournalEntry *entry = NULL; EDJournalEntry *entry = NULL;
GError *e = NULL; GError *e = NULL;
@ -219,15 +219,13 @@ static EDErrorCode ed_journal_file_load(EDJournalFile *self,
file = g_file_new_for_path(p->filename); file = g_file_new_for_path(p->filename);
goto_if_true(file == NULL, done); goto_if_true(file == NULL, done);
stream = g_file_open_readwrite(file, NULL, &e); stream = g_file_read(file, NULL, &e);
if (stream == NULL) { if (stream == NULL) {
g_propagate_error(error, e); g_propagate_error(error, e);
goto done; goto done;
} }
reader = g_data_input_stream_new( reader = g_data_input_stream_new(G_INPUT_STREAM(stream));
g_io_stream_get_input_stream(G_IO_STREAM(stream))
);
if (reader == NULL) { if (reader == NULL) {
goto done; goto done;
} }