Beispiel #1
0
/* nemo_window_slot_update_title:
 * 
 * Re-calculate the slot title.
 * Called when the location or view has changed.
 * @slot: The NemoWindowSlot in question.
 * 
 */
void
nemo_window_slot_update_title (NemoWindowSlot *slot)
{
	NemoWindow *window;
	char *title;
	gboolean do_sync = FALSE;

	title = nemo_compute_title_for_location (slot->location);
	window = nemo_window_slot_get_window (slot);

	if (g_strcmp0 (title, slot->title) != 0) {
		do_sync = TRUE;

		g_free (slot->title);
		slot->title = title;
		title = NULL;
	}

	if (strlen (slot->title) > 0 &&
	    slot->current_location_bookmark != NULL) {
		do_sync = TRUE;
	}

	if (do_sync) {
		nemo_window_sync_title (window, slot);
	}

	if (title != NULL) {
		g_free (title);
	}
}
Beispiel #2
0
static void
nemo_bookmark_connect_file (NemoBookmark *bookmark)
{
    if (bookmark->details->file != NULL) {
        DEBUG ("%s: file already connected, returning",
               nemo_bookmark_get_name (bookmark));
        return;
    }

    if (bookmark->details->exists) {
        DEBUG ("%s: creating file", nemo_bookmark_get_name (bookmark));

        bookmark->details->file = nemo_file_get (bookmark->details->location);
        g_assert (!nemo_file_is_gone (bookmark->details->file));

        g_signal_connect_object (bookmark->details->file, "changed",
                     G_CALLBACK (bookmark_file_changed_callback), bookmark, 0);
    }

    if (bookmark->details->icon == NULL ||
        bookmark->details->symbolic_icon == NULL) {
        nemo_bookmark_set_icon_to_default (bookmark);
    }

    if (bookmark->details->file != NULL &&
        nemo_file_check_if_ready (bookmark->details->file, NEMO_FILE_ATTRIBUTE_INFO)) {
        bookmark_set_name_from_ready_file (bookmark, bookmark->details->file);
    }

    if (bookmark->details->name == NULL) {
        bookmark->details->name = nemo_compute_title_for_location (bookmark->details->location);
    }
}