~elementary-apps/pantheon-files/trunk

« back to all changes in this revision

Viewing changes to libcore/gof-directory-async.vala

Enable bookmark, create non-existent, drop onto location bar for remote locations; do not show incorrect size for servers and networks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
    private async void prepare_directory (GOFFileLoadedFunc? file_loaded_func) {
158
158
        bool success = yield get_file_info ();
159
159
        if (success) {
160
 
            if (is_local && !file.is_folder ()) {
 
160
            if (!file.is_folder () && !file.is_root_network_folder ()) {
 
161
                warning ("Trying to load a non-folder - finding parent");
161
162
                var parent = file.is_connected ? location.get_parent () : null;
162
163
                if (parent != null) {
163
164
                    file = GOF.File.get (parent);
165
166
                    location = parent;
166
167
                    success = yield get_file_info ();
167
168
                } else {
 
169
                    warning ("Parent is null for file %s", file.uri);
168
170
                    success = false;
169
171
                }
 
172
            } else {
 
173
 
170
174
            }
 
175
        } else {
 
176
            warning ("Failed to get file info for file %s", file.uri);
171
177
        }
172
178
        make_ready (success, file_loaded_func); /* Only place that should call this function */
173
179
    }
180
186
        if (is_local) {
181
187
            return file.ensure_query_info ();
182
188
        }
183
 
 
184
189
        /* Must be non-local */
185
190
        if (!is_local && !yield check_network ()) {
186
191
            file.is_connected = false;
225
230
        }
226
231
        if (success) {
227
232
            debug ("got file info");
228
 
            file.ensure_query_info ();
 
233
            file.update ();
229
234
            return true;
230
235
        } else {
231
 
            debug ("Failed to get file info for %s", file.uri);
 
236
            warning ("Failed to get file info for %s", file.uri);
232
237
            return false;
233
238
        }
234
239
    }
246
251
                file.is_connected = true;
247
252
            } else {
248
253
                file.is_connected = false;
 
254
                file.is_mounted = false;
249
255
                warning ("Mount_mountable failed: %s", e.message);
250
256
                if (e is IOError.PERMISSION_DENIED || e is IOError.FAILED_HANDLED) {
251
257
                    permission_denied = true;
292
298
    private void make_ready (bool ready, GOFFileLoadedFunc? file_loaded_func = null) {
293
299
        can_load = ready;
294
300
        if (!can_load) {
295
 
            debug ("%s cannot load", file.uri);
 
301
            warning ("%s cannot load.  Connected %s, Mounted %s, Exists %s", file.uri,
 
302
                                                                             file.is_connected.to_string (),
 
303
                                                                             file.is_mounted.to_string (),
 
304
                                                                             file.exists.to_string ());
296
305
            state = State.NOT_LOADED; /* ensure state is correct */
297
306
            done_loading ();
298
307
            return;