~ubuntu-branches/ubuntu/hardy/gthumb/hardy-proposed

« back to all changes in this revision

Viewing changes to src/gth-browser.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2008-05-29 14:58:39 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20080529145839-cvei0exm56janrxs
Tags: 3:2.10.8-0ubuntu1
* New upstream bugfix release:
  - If the directory doesn't exists go to the closest existing parent.
    Fixes bug #495575 – infinite loop when browsing deleted dirs
  - Fixed bug #Bug 498741 – gthumb always saves thumbnails despite the
    gconf option in apps -> gthumb -> browser -> save_thumbnails set
    to "false"
  - Fixed bug #500719 – segfault when canceling batch operations
  - Fixed bug #486886: Crash opening an image with no Exif IFD1
  - Fixed bug #487982: can freeze gthumb during printing
  - Fixed a printing crash, g_free -> gtk_paper_size_free
  - Fixed bug #492111: Doesn't rotate pictures while importing
  - Fixed bug #492262: Rotate removes thumbnail
  - Fixed bug #492260: Crash on rotate on x86_64
  - Fixed bug #492169: Crash when moving directory to trash
  - Fixed bug #492370: monitor name conflict with libc on solaris10
  - Fixed exif tag read/write functions, so they can access 32-bit
    values correctly on 64-bit platforms
  - Fixed bug #476989: gthumb doesn't move images if destination
    directory is selected from folder drop down list
  - Fixed bug #495529: Search not working
  - Fixed bug #498995: gthumb gets it's locking wrong and crashes
  - When sorting by exif time, fall back to sorting by mtime if no
    exif time is present.
  - Fixed bug #438027: cancel isn't honoured in "reset exif orientation"
    progress dialog or rotation-tool dialog
  - Fixed bug #499795: silently fails to save bmp picture
  - Fixed bug #496140: Crop Window opens too large for dual-screens
  - Fixed bug #481729: Crash browsing thru images when one is empty.
  - Fixed bug #482751: gthumb crashes if it cannot find cursor.
  - Fixed bug #485721: Crash in fullscreen mode after deleting an image.
  - Fixed bug #471234: Fix build with gcc 2.x
  - Fixed bug #485998: '[' and ']' don't work in fullscreen anymore.
  - Fixed LP: #152246: gThumb does not allow to change
    picture's "Last modified date" to "Photo digitalization date
    (from EXIF data)"
* Drop 21_dont_skip_file_type.dpatch and 22_paper_size_free.dpatch: Included
  upstream.
* 90_autoconf.dpatch: Update for new version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1083
1083
                browser->priv->busy_cursor_active = TRUE;
1084
1084
 
1085
1085
        cursor = gdk_cursor_new_from_name (gtk_widget_get_display (GTK_WIDGET (browser)), "left_ptr_watch");
1086
 
        gdk_window_set_cursor (GTK_WIDGET (browser)->window, cursor);
1087
 
        gdk_cursor_unref (cursor);
 
1086
 
 
1087
        /* Use the standard "watch" cursor if "left_ptr_watch" is not defined */
 
1088
        if (cursor == NULL)
 
1089
                cursor = gdk_cursor_new (GDK_WATCH);
 
1090
 
 
1091
        if (cursor != NULL) {
 
1092
                gdk_window_set_cursor (GTK_WIDGET (browser)->window, cursor);
 
1093
                gdk_cursor_unref (cursor);
 
1094
        }
1088
1095
}
1089
1096
 
1090
1097
 
1527
1534
                                                priv->history_actions,
1528
1535
                                                priv->history_merge_id,
1529
1536
                                                priv->history,
1530
 
                                                "History",
 
1537
                                                "HistoryPopup",
1531
1538
                                                i,
1532
1539
                                                HISTORY_LIST_POPUP,
1533
1540
                                                scan->data);
2968
2975
 
2969
2976
        /* Images are handled by gThumb directly. Other supported media (video,
2970
2977
           audio) require external players, which are launched by this function. */
2971
 
        if (mime_type_is_image (browser->priv->image->mime_type))
 
2978
        if ( !mime_type_is_video (browser->priv->image->mime_type) &&
 
2979
             !mime_type_is_audio (browser->priv->image->mime_type))
2972
2980
                return FALSE;
2973
2981
 
2974
2982
        image_mime_type = browser->priv->image->mime_type;
4427
4435
        if (priv->monitor_uri == NULL)
4428
4436
                return;
4429
4437
 
4430
 
        gth_monitor_remove_uri (monitor, priv->monitor_uri);
 
4438
        gth_monitor_remove_uri (gth_monitor, priv->monitor_uri);
4431
4439
        g_free (priv->monitor_uri);
4432
4440
        priv->monitor_uri = NULL;
4433
4441
}
4450
4458
                priv->monitor_uri = add_scheme_if_absent (priv->dir_list->path);
4451
4459
        else
4452
4460
                priv->monitor_uri = g_strdup (priv->dir_list->path);
4453
 
        gth_monitor_add_uri (monitor, priv->monitor_uri);
 
4461
        gth_monitor_add_uri (gth_monitor, priv->monitor_uri);
4454
4462
}
4455
4463
 
4456
4464
 
5757
5765
                         GList           *list,
5758
5766
                         GthBrowser      *browser)
5759
5767
{
 
5768
        const char *event_name[] = {"CREATED", "DELETED", "CHANGED", "RENAMED"};
 
5769
        GList      *scan;
 
5770
        
5760
5771
        g_return_if_fail (browser != NULL);
5761
 
 
5762
 
        GList *scan;
5763
 
        char *event_name[] = {"CREATED", "DELETED", "CHANGED", "RENAMED"};
5764
5772
        debug (DEBUG_INFO, "%s:\n", event_name[event]);
5765
5773
 
5766
5774
        for (scan = list; scan; scan = scan->next) {
5884
5892
        gth_file_list_delete (priv->file_list, new_name);
5885
5893
        gth_file_list_rename (priv->file_list, old_name, new_name);
5886
5894
 
5887
 
        if (same_uri (old_name, priv->image->path))
 
5895
        if (priv->image != NULL && same_uri (old_name, priv->image->path))
5888
5896
                gth_browser_load_image_from_uri (browser, new_name);
5889
5897
}
5890
5898
 
5926
5934
            && (priv->sidebar_content == GTH_SIDEBAR_DIR_LIST)
5927
5935
            && path_in_path (old_name, priv->image->path)) 
5928
5936
        {
 
5937
                char *new_image_path = g_strdup (priv->image->path);
5929
5938
                char *new_image_name;
5930
5939
 
5931
5940
                new_image_name = g_strconcat (new_name,
5932
5941
                                              priv->image->path + strlen (old_name),
5933
5942
                                              NULL);
5934
5943
                gth_browser_notify_file_rename (browser,
5935
 
                                                priv->image->path,
 
5944
                                                new_image_path,
5936
5945
                                                new_image_name);
5937
5946
                g_free (new_image_name);
 
5947
                g_free (new_image_path);
5938
5948
        }
5939
5949
}
5940
5950
 
6334
6344
 
6335
6345
        if (result != GNOME_VFS_ERROR_EOF) {
6336
6346
                char *utf8_path;
6337
 
 
 
6347
                char *parent_dir = NULL;
 
6348
                
6338
6349
                utf8_path = gnome_vfs_unescape_string_for_display (dir_list->try_path);
6339
6350
                _gtk_error_dialog_run (GTK_WINDOW (browser),
6340
6351
                                       _("Cannot load folder \"%s\": %s\n"),
6345
6356
                set_cursor_not_busy (browser, TRUE);
6346
6357
                priv->refreshing = FALSE;
6347
6358
 
6348
 
                if (priv->history_current == NULL)
6349
 
                        gth_browser_go_to_directory (browser, get_home_uri ());
 
6359
                /* Go up a level one by one until a directory exists. */
 
6360
 
 
6361
                parent_dir = g_strdup (dir_list->try_path);
 
6362
                do {
 
6363
                        char *tmp = parent_dir;
 
6364
                        parent_dir = remove_level_from_path (tmp);
 
6365
                        g_free (tmp);
 
6366
                } while ((parent_dir != NULL) && ! path_is_dir (parent_dir));
 
6367
                                
 
6368
                if (parent_dir != NULL) { 
 
6369
                        gth_browser_go_to_directory (browser, parent_dir);
 
6370
                        g_free (parent_dir);
 
6371
                }
6350
6372
                else
6351
 
                        gth_browser_go_to_directory (browser, priv->history_current->data);
6352
 
 
 
6373
                        gth_browser_go_to_directory (browser, "file:///");
 
6374
                                
6353
6375
                return;
6354
6376
        }
6355
6377
 
7232
7254
 
7233
7255
        /**/
7234
7256
 
7235
 
        g_signal_connect_swapped (G_OBJECT (monitor),
 
7257
        g_signal_connect_swapped (G_OBJECT (gth_monitor),
7236
7258
                                  "update_bookmarks",
7237
7259
                                  G_CALLBACK (window_update_bookmark_list),
7238
7260
                                  browser);
7239
 
        g_signal_connect (G_OBJECT (monitor),
 
7261
        g_signal_connect (G_OBJECT (gth_monitor),
7240
7262
                          "update_cat_files",
7241
7263
                          G_CALLBACK (monitor_update_cat_files_cb),
7242
7264
                          browser);
7243
 
        g_signal_connect (G_OBJECT (monitor),
 
7265
        g_signal_connect (G_OBJECT (gth_monitor),
7244
7266
                          "update_files",
7245
7267
                          G_CALLBACK (monitor_update_files_cb),
7246
7268
                          browser);
7247
 
        g_signal_connect (G_OBJECT (monitor),
 
7269
        g_signal_connect (G_OBJECT (gth_monitor),
7248
7270
                          "update_directory",
7249
7271
                          G_CALLBACK (monitor_update_directory_cb),
7250
7272
                          browser);
7251
 
        g_signal_connect (G_OBJECT (monitor),
 
7273
        g_signal_connect (G_OBJECT (gth_monitor),
7252
7274
                          "update_catalog",
7253
7275
                          G_CALLBACK (monitor_update_catalog_cb),
7254
7276
                          browser);
7255
 
        g_signal_connect (G_OBJECT (monitor),
 
7277
        g_signal_connect (G_OBJECT (gth_monitor),
7256
7278
                          "update_metadata",
7257
7279
                          G_CALLBACK (monitor_update_metadata_cb),
7258
7280
                          browser);
7259
 
        g_signal_connect (G_OBJECT (monitor),
 
7281
        g_signal_connect (G_OBJECT (gth_monitor),
7260
7282
                          "file_renamed",
7261
7283
                          G_CALLBACK (monitor_file_renamed_cb),
7262
7284
                          browser);
7263
 
        g_signal_connect (G_OBJECT (monitor),
 
7285
        g_signal_connect (G_OBJECT (gth_monitor),
7264
7286
                          "directory_renamed",
7265
7287
                          G_CALLBACK (monitor_directory_renamed_cb),
7266
7288
                          browser);
7267
 
        g_signal_connect (G_OBJECT (monitor),
 
7289
        g_signal_connect (G_OBJECT (gth_monitor),
7268
7290
                          "catalog_renamed",
7269
7291
                          G_CALLBACK (monitor_catalog_renamed_cb),
7270
7292
                          browser);
7271
 
        g_signal_connect (G_OBJECT (monitor),
 
7293
        g_signal_connect (G_OBJECT (gth_monitor),
7272
7294
                          "reload_catalogs",
7273
7295
                          G_CALLBACK (monitor_reload_catalogs_cb),
7274
7296
                          browser);
7275
 
        g_signal_connect (G_OBJECT (monitor),
 
7297
        g_signal_connect (G_OBJECT (gth_monitor),
7276
7298
                          "update_icon_theme",
7277
7299
                          G_CALLBACK (monitor_update_icon_theme_cb),
7278
7300
                          browser);
7396
7418
        if (priv->fullscreen != NULL)
7397
7419
                g_signal_handlers_disconnect_by_data (G_OBJECT (priv->fullscreen), browser);
7398
7420
 
7399
 
        g_signal_handlers_disconnect_by_data (G_OBJECT (monitor), browser);
 
7421
        g_signal_handlers_disconnect_by_data (G_OBJECT (gth_monitor), browser);
7400
7422
 
7401
7423
        /* Destroy the main window. */
7402
7424