~ubuntu-branches/ubuntu/precise/bluefish/precise

« back to all changes in this revision

Viewing changes to src/file.c

  • Committer: Package Import Robot
  • Author(s): Daniel Leidert (dale)
  • Date: 2012-03-05 20:52:34 UTC
  • mfrom: (1.1.11) (5.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20120305205234-aajrwu047ub7u3b4
Tags: 2.2.2-1
* New upstream release.
  - Fixes various crashes (closes: #656013).
* debian/control (Standards-Version): Bumped to 3.9.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
315
315
        cm = g_slice_new(Tcheckmodified);
316
316
        cm->callback_func = callback_func;
317
317
        cm->callback_data = callback_data;
318
 
        g_object_ref(uri);
319
 
        cm->uri = uri;
320
 
        g_object_ref(curinfo);
321
 
        cm->orig_finfo = curinfo;
322
 
        g_object_ref(curinfo);
 
318
        cm->uri = g_object_ref(uri);;
 
319
        cm->orig_finfo = g_object_ref(curinfo);;
323
320
        cm->cancel = g_cancellable_new();
324
321
        /* if the user chooses ignore, the size, mtime and etag are copied into doc->fileinfo */
325
322
        g_file_query_info_async(uri, "time::modified,time::modified-usec,standard::size,etag::value", G_FILE_QUERY_INFO_NONE, G_PRIORITY_DEFAULT, cm->cancel    /*cancellable */
369
366
                if (error->code == G_IO_ERROR_CANCELLED) {
370
367
                        cns->callback_func(CHECKANDSAVE_ERROR_CANCELLED, error, cns->callback_data);
371
368
                        checkNsave_cleanup(cns);
 
369
                        return;
372
370
                } else if (error->code == G_IO_ERROR_WRONG_ETAG) {
373
371
                        if (cns->callback_func(CHECKANDSAVE_ERROR_MODIFIED, error, cns->callback_data) == CHECKNSAVE_CONT) {
374
372
                                g_file_replace_contents_async(cns->uri, cns->buffer->data, cns->buffer_size, NULL, TRUE,
851
849
                }
852
850
        }
853
851
        refcpointer_unref(refp);
854
 
        DEBUG_MSG("file2doc_finished_idle_lcb, finished data in document view %p\n", f2d->doc->view);
 
852
        DEBUG_MSG("file2doc_finished_idle_lcb, finished data\n");
855
853
        return FALSE;
856
854
}
857
855
 
938
936
                if (fi->doc->fileinfo) {
939
937
                        g_object_unref(fi->doc->fileinfo);
940
938
                }
941
 
                fi->doc->fileinfo = info;
942
 
                g_object_ref(info);
 
939
                fi->doc->fileinfo = info; /* no need to ref it, the call to g_file_query_info_finish returns a reference */
943
940
#ifdef DEBUG
944
941
                /* weird.. since I (Olivier) have a SSD in my laptop I sometimes receive wrong values 
945
942
                   for the file size here. And then I get a 'file changed on disk' error.
1001
998
        DEBUG_MSG("file_doc_fill_fileinfo, started for doc %p and uri %p at fi=%p\n", doc, uri, fi);
1002
999
        fi->doc = doc;
1003
1000
        fi->doc->info = fi;
1004
 
        g_object_ref(uri);
1005
 
        fi->uri = uri;
 
1001
        fi->uri = g_object_ref(uri);
1006
1002
        fi->cancel = g_cancellable_new();
1007
1003
        queue_push(&fiqueue, fi);
1008
1004
}