~noskcaj/ubuntu/trusty/gnome-documents/3.10.2

« back to all changes in this revision

Viewing changes to src/trackerUtils.js

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2012-08-22 10:01:18 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20120822100118-3837rqfy72e1op72
Tags: 3.5.90-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
const Global = imports.global;
25
25
 
26
 
function setFavorite(urn, isFavorite, callback) {
27
 
    let sparql = ('%s { <%s> nao:hasTag nao:predefined-tag-favorite }').format((isFavorite ? 'INSERT OR REPLACE' : 'DELETE'), urn);
 
26
function setEditedName(newTitle, docId, callback) {
 
27
    let sparql = ('INSERT OR REPLACE { <%s> nfo:fileName\"%s\" }'.format(docId, newTitle));
28
28
 
29
29
    Global.connectionQueue.update(sparql, null,
30
30
        function(object, res) {
31
31
            try {
32
32
                object.update_finish(res);
33
33
            } catch (e) {
34
 
                log('Unable to set the favorite property on ' + urn + ' to ' + isFavorite + ': ' + e.toString());
 
34
                log('Unable to set the new title on ' + docId + ' to : ' + e.toString());
35
35
            }
36
36
 
37
37
            if (callback)
38
38
                callback();
39
39
        });
 
40
 
40
41
}