~ubuntu-branches/ubuntu/precise/gedit/precise

« back to all changes in this revision

Viewing changes to gedit/gedit-document-output-stream.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-04-14 16:41:13 UTC
  • mfrom: (1.1.78 upstream)
  • Revision ID: james.westby@ubuntu.com-20100414164113-0xgl3u73pcs0ngbc
Tags: 2.30.0git20100413-0ubuntu1
* Updating to git snaptshot since 2.30.1 will be after lucid
* debian/patches/90_autoconf.patch:
  - new version update

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
}
122
122
 
123
123
static void
 
124
gedit_document_output_stream_constructed (GObject *object)
 
125
{
 
126
        GeditDocumentOutputStream *stream = GEDIT_DOCUMENT_OUTPUT_STREAM (object);
 
127
 
 
128
        if (!stream->priv->doc)
 
129
        {
 
130
                g_critical ("This should never happen, a problem happened constructing the Document Output Stream!");
 
131
                return;
 
132
        }
 
133
 
 
134
        /* Init the undoable action */
 
135
        gtk_source_buffer_begin_not_undoable_action (GTK_SOURCE_BUFFER (stream->priv->doc));
 
136
        /* clear the buffer */
 
137
        gtk_text_buffer_set_text (GTK_TEXT_BUFFER (stream->priv->doc),
 
138
                                  "", 0);
 
139
        gtk_text_buffer_set_modified (GTK_TEXT_BUFFER (stream->priv->doc),
 
140
                                      FALSE);
 
141
 
 
142
        gtk_source_buffer_end_not_undoable_action (GTK_SOURCE_BUFFER (stream->priv->doc));
 
143
}
 
144
 
 
145
static void
124
146
gedit_document_output_stream_class_init (GeditDocumentOutputStreamClass *klass)
125
147
{
126
148
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
129
151
        object_class->get_property = gedit_document_output_stream_get_property;
130
152
        object_class->set_property = gedit_document_output_stream_set_property;
131
153
        object_class->finalize = gedit_document_output_stream_finalize;
 
154
        object_class->constructed = gedit_document_output_stream_constructed;
132
155
 
133
156
        stream_class->write_fn = gedit_document_output_stream_write;
134
157
        stream_class->close_fn = gedit_document_output_stream_close;
280
303
                /* Init the undoable action */
281
304
                gtk_source_buffer_begin_not_undoable_action (GTK_SOURCE_BUFFER (ostream->priv->doc));
282
305
 
283
 
                /* clear the buffer */
284
 
                gtk_text_buffer_set_text (GTK_TEXT_BUFFER (ostream->priv->doc),
285
 
                                          "", 0);
286
 
 
287
306
                gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER (ostream->priv->doc),
288
307
                                                &ostream->priv->pos);
289
308
                ostream->priv->is_initialized = TRUE;