~ubuntu-branches/ubuntu/utopic/nautilus/utopic-proposed

« back to all changes in this revision

Viewing changes to src/nautilus-empty-view.c

  • Committer: Package Import Robot
  • Author(s): Tim Lunn
  • Date: 2014-01-02 16:50:06 UTC
  • mfrom: (1.17.43)
  • Revision ID: package-import@ubuntu.com-20140102165006-1ghk9ropzitdc8pp
Tags: 1:3.10.1-0ubuntu1
* New upstream release
* debian/control.in: bump depend on gtk+ 3.9.11
* debian/patches:
  - Dropped git patches, that are included in new version
  - 06_never_exec_nonexec_launchers.patch, refreshed
  - disconnect-extra-location-widgets.patch, dropped included in new version
  - 16_unity_new_documents.patch, refreshed
  - ubuntu_show_titlebar.patch, disable CSD titlebar on non-GNOME sessions
  - ubuntu_titlebar_css.patch, theme fixes (LP: #1272602)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include "nautilus-empty-view.h"
28
28
 
29
29
#include "nautilus-view.h"
30
 
#include "nautilus-view-factory.h"
31
30
 
32
31
#include <string.h>
33
32
#include <libnautilus-private/nautilus-file-utilities.h>
96
95
        return NULL;
97
96
}
98
97
 
99
 
static guint
100
 
nautilus_empty_view_get_item_count (NautilusView *view)
101
 
{
102
 
        return NAUTILUS_EMPTY_VIEW (view)->details->number_of_files;
103
 
}
104
 
 
105
98
static gboolean
106
99
nautilus_empty_view_is_empty (NautilusView *view)
107
100
{
269
262
        nautilus_view_class->file_changed = nautilus_empty_view_file_changed;
270
263
        nautilus_view_class->get_selection = nautilus_empty_view_get_selection;
271
264
        nautilus_view_class->get_selection_for_file_transfer = nautilus_empty_view_get_selection_for_file_transfer;
272
 
        nautilus_view_class->get_item_count = nautilus_empty_view_get_item_count;
273
265
        nautilus_view_class->is_empty = nautilus_empty_view_is_empty;
274
266
        nautilus_view_class->remove_file = nautilus_empty_view_remove_file;
275
267
        nautilus_view_class->merge_menus = nautilus_empty_view_merge_menus;
299
291
                                                           NautilusEmptyViewDetails);
300
292
}
301
293
 
302
 
static NautilusView *
303
 
nautilus_empty_view_create (NautilusWindowSlot *slot)
 
294
NautilusView *
 
295
nautilus_empty_view_new (NautilusWindowSlot *slot)
304
296
{
305
 
        NautilusEmptyView *view;
306
 
 
307
 
        g_assert (NAUTILUS_IS_WINDOW_SLOT (slot));
308
 
 
309
 
        view = g_object_new (NAUTILUS_TYPE_EMPTY_VIEW,
 
297
        return g_object_new (NAUTILUS_TYPE_EMPTY_VIEW,
310
298
                             "window-slot", slot,
311
299
                             NULL);
312
 
 
313
 
        return NAUTILUS_VIEW (view);
314
 
}
315
 
 
316
 
static gboolean
317
 
nautilus_empty_view_supports_uri (const char *uri,
318
 
                                  GFileType file_type,
319
 
                                  const char *mime_type)
320
 
{
321
 
        if (file_type == G_FILE_TYPE_DIRECTORY) {
322
 
                return TRUE;
323
 
        }
324
 
        if (strcmp (mime_type, NAUTILUS_SAVED_SEARCH_MIMETYPE) == 0){
325
 
                return TRUE;
326
 
        }
327
 
        if (g_str_has_prefix (uri, "trash:")) {
328
 
                return TRUE;
329
 
        }
330
 
        if (g_str_has_prefix (uri, EEL_SEARCH_URI)) {
331
 
                return TRUE;
332
 
        }
333
 
 
334
 
        return FALSE;
335
 
}
336
 
 
337
 
static NautilusViewInfo nautilus_empty_view = {
338
 
        NAUTILUS_EMPTY_VIEW_ID,
339
 
        "Empty",
340
 
        "Empty View",
341
 
        "_Empty View",
342
 
        "The empty view encountered an error.",
343
 
        "Display this location with the empty view.",
344
 
        nautilus_empty_view_create,
345
 
        nautilus_empty_view_supports_uri
346
 
};
347
 
 
348
 
void
349
 
nautilus_empty_view_register (void)
350
 
{
351
 
        nautilus_empty_view.id = nautilus_empty_view.id;
352
 
        nautilus_empty_view.view_combo_label = nautilus_empty_view.view_combo_label;
353
 
        nautilus_empty_view.view_menu_label_with_mnemonic = nautilus_empty_view.view_menu_label_with_mnemonic;
354
 
        nautilus_empty_view.error_label = nautilus_empty_view.error_label;
355
 
        nautilus_empty_view.display_location_label = nautilus_empty_view.display_location_label;
356
 
 
357
 
        nautilus_view_factory_register (&nautilus_empty_view);
358
300
}