~ubuntu-branches/ubuntu/oneiric/tracker/oneiric

« back to all changes in this revision

Viewing changes to src/miners/fs/tracker-miner-applications.c

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2011-08-26 00:26:14 UTC
  • mfrom: (4.3.17 sid)
  • Revision ID: package-import@ubuntu.com-20110826002614-4qjfs9jhh5gs4p13
Tags: 0.10.24-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
        iface->init = miner_applications_initable_init;
107
107
}
108
108
 
 
109
static void
 
110
miner_applications_basedir_add (TrackerMinerFS *fs,
 
111
                                const gchar    *basedir)
 
112
{
 
113
        GFile *file;
 
114
        gchar *path;
 
115
 
 
116
        /* Add $dir/applications */
 
117
        path = g_build_filename (basedir, "applications", NULL);
 
118
        file = g_file_new_for_path (path);
 
119
        g_message ("  Adding:'%s'", path);
 
120
        tracker_miner_fs_directory_add (fs, file, TRUE);
 
121
        g_object_unref (file);
 
122
        g_free (path);
 
123
 
 
124
        /* Add $dir/desktop-directories */
 
125
        path = g_build_filename (basedir, "desktop-directories", NULL);
 
126
        file = g_file_new_for_path (path);
 
127
        g_message ("  Adding:'%s'", path);
 
128
        tracker_miner_fs_directory_add (fs, file, TRUE);
 
129
        g_object_unref (file);
 
130
        g_free (path);
 
131
}
 
132
 
109
133
static gboolean
110
134
miner_applications_initable_init (GInitable     *initable,
111
135
                                  GCancellable  *cancellable,
112
136
                                  GError       **error)
113
137
{
114
138
        TrackerMinerFS *fs;
115
 
        GFile *file;
116
139
        GError *inner_error = NULL;
 
140
#ifdef HAVE_MEEGOTOUCH
 
141
        GFile *file;
 
142
        const gchar *path;
 
143
#endif /* HAVE_MEEGOTOUCH */
 
144
        const gchar * const *xdg_dirs;
 
145
        const gchar *user_data_dir;
 
146
        gint i;
117
147
 
118
148
        fs = TRACKER_MINER_FS (initable);
119
149
 
123
153
                return FALSE;
124
154
        }
125
155
 
126
 
        file = g_file_new_for_path ("/usr/share/applications/");
127
 
        tracker_miner_fs_directory_add (fs, file, TRUE);
128
 
        g_object_unref (file);
129
 
 
130
 
        file = g_file_new_for_path ("/usr/share/desktop-directories/");
131
 
        tracker_miner_fs_directory_add (fs, file, TRUE);
132
 
        g_object_unref (file);
 
156
        g_message ("Setting up applications to iterate from XDG system directories");
 
157
 
 
158
        /* Add all XDG system and local dirs */
 
159
        xdg_dirs = g_get_system_data_dirs ();
 
160
 
 
161
        for (i = 0; xdg_dirs[i]; i++) {
 
162
                miner_applications_basedir_add (fs, xdg_dirs[i]);
 
163
        }
 
164
 
 
165
        g_message ("Setting up applications to iterate from XDG user directories");
 
166
 
 
167
        user_data_dir = g_get_user_data_dir ();
 
168
        if (user_data_dir) {
 
169
                miner_applications_basedir_add (fs, user_data_dir);
 
170
        }
133
171
 
134
172
#ifdef HAVE_MEEGOTOUCH
135
 
        file = g_file_new_for_path ("/usr/lib/duicontrolpanel/");
 
173
        /* NOTE: We don't use miner_applications_basedir_add() for
 
174
         * this location because it is unique to MeeGoTouch.
 
175
         */
 
176
        path = "/usr/lib/duicontrolpanel/";
 
177
 
 
178
        g_message ("Setting up applications to iterate from MeegoTouch directories");
 
179
        g_message ("  Adding:'%s'", path);
 
180
 
 
181
        file = g_file_new_for_path (path);
136
182
        tracker_miner_fs_directory_add (fs, file, TRUE);
137
183
        g_object_unref (file);
138
184
        tracker_miner_applications_meego_init ();
139
185
#endif /* HAVE_MEEGOTOUCH */
140
186
 
141
 
        /* FIXME: Check XDG_DATA_DIRS and also process applications in there */
142
 
 
143
187
        return TRUE;
144
188
}
145
189
 
890
934
                               "name", "Applications",
891
935
                               "processing-pool-wait-limit", 10,
892
936
                               "processing-pool-ready-limit", 100,
893
 
                               "processing-pool-requests-limit", 10,
894
937
                               NULL);
895
938
}