~ubuntu-branches/ubuntu/trusty/nautilus/trusty-proposed

« back to all changes in this revision

Viewing changes to .pc/zg_activity_logging.patch/libnautilus-private/nautilus-file.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:
4238
4238
NautilusIconInfo *
4239
4239
nautilus_file_get_icon (NautilusFile *file,
4240
4240
                        int size,
 
4241
                        int scale,
4241
4242
                        NautilusFileIconFlags flags)
4242
4243
{
4243
4244
        NautilusIconInfo *icon;
4255
4256
        }
4256
4257
 
4257
4258
        if (gicon != NULL) {
4258
 
                icon = nautilus_icon_info_lookup (gicon, size);
 
4259
                icon = nautilus_icon_info_lookup (gicon, size, scale);
4259
4260
                g_object_unref (gicon);
4260
4261
 
4261
4262
                return icon;
4265
4266
               flags & NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE);
4266
4267
        
4267
4268
        if (flags & NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE) {
4268
 
                modified_size = size;
 
4269
                modified_size = size * scale;
4269
4270
        } else {
4270
 
                modified_size = size * cached_thumbnail_size / NAUTILUS_ICON_SIZE_STANDARD;
 
4271
                modified_size = size * scale * cached_thumbnail_size / NAUTILUS_ICON_SIZE_STANDARD;
4271
4272
                DEBUG ("Modifying icon size to %d, as our cached thumbnail size is %d",
4272
4273
                       modified_size, cached_thumbnail_size);
4273
4274
        }
4276
4277
            nautilus_file_should_show_thumbnail (file)) {
4277
4278
                if (file->details->thumbnail) {
4278
4279
                        int w, h, s;
4279
 
                        double scale;
 
4280
                        double thumb_scale;
4280
4281
 
4281
4282
                        raw_pixbuf = g_object_ref (file->details->thumbnail);
4282
4283
 
4286
4287
                        s = MAX (w, h);                 
4287
4288
                        /* Don't scale up small thumbnails in the standard view */
4288
4289
                        if (s <= cached_thumbnail_size) {
4289
 
                                scale = (double)size / NAUTILUS_ICON_SIZE_STANDARD;
 
4290
                                thumb_scale = (double)size / NAUTILUS_ICON_SIZE_STANDARD;
4290
4291
                        }
4291
4292
                        else {
4292
 
                                scale = (double)modified_size / s;
 
4293
                                thumb_scale = (double)modified_size / s;
4293
4294
                        }
4294
4295
                        /* Make sure that icons don't get smaller than NAUTILUS_ICON_SIZE_SMALLEST */
4295
 
                        if (s*scale <= NAUTILUS_ICON_SIZE_SMALLEST) {
4296
 
                                scale = (double) NAUTILUS_ICON_SIZE_SMALLEST / s;
 
4296
                        if (s*thumb_scale <= NAUTILUS_ICON_SIZE_SMALLEST) {
 
4297
                                thumb_scale = (double) NAUTILUS_ICON_SIZE_SMALLEST / s;
4297
4298
                        }
4298
4299
 
4299
4300
                        scaled_pixbuf = gdk_pixbuf_scale_simple (raw_pixbuf,
4300
 
                                                                 MAX (w * scale, 1),
4301
 
                                                                 MAX (h * scale, 1),
 
4301
                                                                 MAX (w * thumb_scale, 1),
 
4302
                                                                 MAX (h * thumb_scale, 1),
4302
4303
                                                                 GDK_INTERP_BILINEAR);
4303
4304
 
4304
4305
                        /* We don't want frames around small icons */
4305
 
                        if (!gdk_pixbuf_get_has_alpha (raw_pixbuf) || s >= 128) {
 
4306
                        if (!gdk_pixbuf_get_has_alpha (raw_pixbuf) || s >= 128 * scale) {
4306
4307
                                nautilus_ui_frame_image (&scaled_pixbuf);
4307
4308
                        }
4308
4309
 
4312
4313
                           image instead. We don't want to compare to exactly 100%,
4313
4314
                           since the zoom level 150% gives thumbnails at 144, which is
4314
4315
                           ok to scale up from 128. */
4315
 
                        if (modified_size > 128*1.25 &&
 
4316
                        if (modified_size > 128 * 1.25 * scale &&
4316
4317
                            !file->details->thumbnail_wants_original &&
4317
4318
                            nautilus_can_thumbnail_internally (file)) {
4318
4319
                                /* Invalidate if we resize upward */
4321
4322
                        }
4322
4323
 
4323
4324
                        DEBUG ("Returning thumbnailed image, at size %d %d",
4324
 
                               (int) (w * scale), (int) (h * scale));
 
4325
                               (int) (w * thumb_scale), (int) (h * thumb_scale));
4325
4326
                        
4326
 
                        icon = nautilus_icon_info_new_for_pixbuf (scaled_pixbuf);
 
4327
                        icon = nautilus_icon_info_new_for_pixbuf (scaled_pixbuf, scale);
4327
4328
                        g_object_unref (scaled_pixbuf);
4328
4329
                        return icon;
4329
4330
                } else if (file->details->thumbnail_path == NULL &&
4343
4344
                gicon = nautilus_file_get_gicon (file, flags);
4344
4345
        
4345
4346
        if (gicon) {
4346
 
                icon = nautilus_icon_info_lookup (gicon, size);
 
4347
                icon = nautilus_icon_info_lookup (gicon, size, scale);
4347
4348
                if (nautilus_icon_info_is_fallback (icon)) {
4348
4349
                        g_object_unref (icon);
4349
 
                        icon = nautilus_icon_info_lookup (get_default_file_icon (flags), size);
 
4350
                        icon = nautilus_icon_info_lookup (get_default_file_icon (flags), size, scale);
4350
4351
                }
4351
4352
                g_object_unref (gicon);
4352
4353
                return icon;
4353
4354
        } else {
4354
 
                return nautilus_icon_info_lookup (get_default_file_icon (flags), size);
 
4355
                return nautilus_icon_info_lookup (get_default_file_icon (flags), size, scale);
4355
4356
        }
4356
4357
}
4357
4358
 
4359
4360
nautilus_file_get_icon_pixbuf (NautilusFile *file,
4360
4361
                               int size,
4361
4362
                               gboolean force_size,
 
4363
                               int scale,
4362
4364
                               NautilusFileIconFlags flags)
4363
4365
{
4364
4366
        NautilusIconInfo *info;
4365
4367
        GdkPixbuf *pixbuf;
4366
4368
 
4367
 
        info = nautilus_file_get_icon (file, size, flags);
 
4369
        info = nautilus_file_get_icon (file, size, scale, flags);
4368
4370
        if (force_size) {
4369
4371
                pixbuf =  nautilus_icon_info_get_pixbuf_at_size (info, size);
4370
4372
        } else {
7655
7657
        res = get_attributes_for_default_sort_type (file, &is_recent, &is_download, &is_trash, &is_search);
7656
7658
 
7657
7659
        if (res) {
7658
 
                if (is_recent || is_download) {
 
7660
                if (is_recent) {
 
7661
                        retval = NAUTILUS_FILE_SORT_BY_ATIME;
 
7662
                } else if (is_download) {
7659
7663
                        retval = NAUTILUS_FILE_SORT_BY_MTIME;
7660
7664
                } else if (is_trash) {
7661
7665
                        retval = NAUTILUS_FILE_SORT_BY_TRASHED_TIME;