~ubuntu-branches/ubuntu/trusty/gthumb/trusty

« back to all changes in this revision

Viewing changes to gthumb/gth-main.c

  • Committer: Package Import Robot
  • Author(s): Jackson Doak
  • Date: 2013-08-31 06:24:51 UTC
  • mfrom: (1.3.17) (5.2.24 sid)
  • Revision ID: package-import@ubuntu.com-20130831062451-0958soi720z0byp6
Tags: 3:3.2.5-1
* New upstream release. Closes: #716729 LP: #1201073
* Set myself as maintainer. Closes: #711827
* debian/control:
  - Build-depend on yelp-tools, libgstreamer1.0-dev, libsecret-1-dev,
    libgstreamer-plugins-base1.0-dev, libwebp-dev
  - Bump standards-version to 3.9.4
  - Bump debhelper to 8
  - Make git URLs canonical
  - Drop depend on libiptcdata0-dev. Closes: #697087
  - Drop depend on gnome keyring since libsecret replaces it
* debian/compat: Set as 8
* debian/rules: 
  - Add --enable-libwebp for WebP support
  - Add --disable-silent-rules for verbose building
  - Enable hardening
* Create debian/source/options
* Refresh all patches so they apply cleanly

Show diffs side-by-side

added added

removed removed

Lines of Context:
716
716
}
717
717
 
718
718
 
719
 
GthPixbufSaver *
720
 
gth_main_get_pixbuf_saver (const char *mime_type)
 
719
GthImageSaver *
 
720
gth_main_get_image_saver (const char *mime_type)
721
721
{
722
722
        GArray *savers;
723
723
        int     i;
724
724
 
725
 
        savers = gth_main_get_type_set ("pixbuf-saver");
 
725
        savers = gth_main_get_type_set ("image-saver");
726
726
        if (savers == NULL)
727
727
                return NULL;
728
728
 
729
729
        for (i = 0; i < savers->len; i++) {
730
730
                GType           saver_type;
731
 
                GthPixbufSaver *saver;
 
731
                GthImageSaver *saver;
732
732
 
733
733
                saver_type = g_array_index (savers, GType, i);
734
734
                saver = g_object_new (saver_type, NULL);
735
 
                if (gth_pixbuf_saver_can_save (saver, mime_type))
 
735
                if (gth_image_saver_can_save (saver, mime_type))
736
736
                        return saver;
737
737
 
738
738
                g_object_unref (saver);
1001
1001
GBookmarkFile *
1002
1002
gth_main_get_default_bookmarks (void)
1003
1003
{
1004
 
        char *path;
 
1004
        GFile *file;
 
1005
        char  *filename;
1005
1006
 
1006
1007
        if (Main->priv->bookmarks != NULL)
1007
1008
                return Main->priv->bookmarks;
1008
1009
 
1009
1010
        Main->priv->bookmarks = g_bookmark_file_new ();
1010
1011
 
1011
 
        path = gth_user_dir_get_file (GTH_DIR_CONFIG, GTHUMB_DIR, BOOKMARKS_FILE, NULL);
1012
 
        g_bookmark_file_load_from_file (Main->priv->bookmarks,
1013
 
                                        path,
1014
 
                                        NULL);
1015
 
        g_free (path);
 
1012
        file = gth_user_dir_get_file_for_read (GTH_DIR_CONFIG, GTHUMB_DIR, BOOKMARKS_FILE, NULL);
 
1013
        filename = g_file_get_path (file);
 
1014
        g_bookmark_file_load_from_file (Main->priv->bookmarks, filename, NULL);
 
1015
 
 
1016
        g_free (filename);
 
1017
        g_object_unref (file);
1016
1018
 
1017
1019
        return Main->priv->bookmarks;
1018
1020
}
1021
1023
void
1022
1024
gth_main_bookmarks_changed (void)
1023
1025
{
1024
 
        char *filename;
1025
 
 
1026
 
        gth_user_dir_make_dir_for_file (GTH_DIR_CONFIG, GTHUMB_DIR, BOOKMARKS_FILE, NULL);
1027
 
 
1028
 
        filename = gth_user_dir_get_file (GTH_DIR_CONFIG, GTHUMB_DIR, BOOKMARKS_FILE, NULL);
 
1026
        GFile *file;
 
1027
        char  *filename;
 
1028
 
 
1029
        file = gth_user_dir_get_file_for_write (GTH_DIR_CONFIG, GTHUMB_DIR, BOOKMARKS_FILE, NULL);
 
1030
        filename = g_file_get_path (file);
1029
1031
        g_bookmark_file_to_file (Main->priv->bookmarks, filename, NULL);
 
1032
 
1030
1033
        g_free (filename);
 
1034
        g_object_unref (file);
1031
1035
 
1032
1036
        gth_monitor_bookmarks_changed (gth_main_get_default_monitor ());
1033
1037
}
1036
1040
GthFilterFile *
1037
1041
gth_main_get_default_filter_file (void)
1038
1042
{
1039
 
        char *path;
 
1043
        GFile *file;
1040
1044
 
1041
1045
        if (Main->priv->filters != NULL)
1042
1046
                return Main->priv->filters;
1043
1047
 
1044
1048
        Main->priv->filters = gth_filter_file_new ();
1045
 
        path = gth_user_dir_get_file (GTH_DIR_CONFIG, GTHUMB_DIR, FILTERS_FILE, NULL);
1046
 
        gth_filter_file_load_from_file (Main->priv->filters, path, NULL);
1047
 
        g_free (path);
 
1049
        file = gth_user_dir_get_file_for_read (GTH_DIR_CONFIG, GTHUMB_DIR, FILTERS_FILE, NULL);
 
1050
        gth_filter_file_load_from_file (Main->priv->filters, file, NULL);
 
1051
 
 
1052
        g_object_unref (file);
1048
1053
 
1049
1054
        return Main->priv->filters;
1050
1055
}
1096
1101
void
1097
1102
gth_main_filters_changed (void)
1098
1103
{
1099
 
        char *filename;
1100
 
 
1101
 
        gth_user_dir_make_dir_for_file (GTH_DIR_CONFIG, GTHUMB_DIR, FILTERS_FILE, NULL);
1102
 
        filename = gth_user_dir_get_file (GTH_DIR_CONFIG, GTHUMB_DIR, FILTERS_FILE, NULL);
1103
 
        gth_filter_file_to_file (Main->priv->filters, filename, NULL);
1104
 
 
1105
 
        g_free (filename);
1106
 
 
 
1104
        GFile *file;
 
1105
 
 
1106
        file = gth_user_dir_get_file_for_read (GTH_DIR_CONFIG, GTHUMB_DIR, FILTERS_FILE, NULL);
 
1107
        gth_filter_file_to_file (Main->priv->filters, file, NULL);
1107
1108
        gth_monitor_filters_changed (gth_main_get_default_monitor ());
 
1109
 
 
1110
        g_object_unref (file);
1108
1111
}
1109
1112
 
1110
1113
 
1111
1114
GthTagsFile *
1112
1115
gth_main_get_default_tag_file (void)
1113
1116
{
1114
 
        char *path;
 
1117
        GFile *file;
1115
1118
 
1116
1119
        if (Main->priv->tags != NULL)
1117
1120
                return Main->priv->tags;
1118
1121
 
1119
1122
        Main->priv->tags = gth_tags_file_new ();
1120
 
        path = gth_user_dir_get_file (GTH_DIR_CONFIG, GTHUMB_DIR, TAGS_FILE, NULL);
1121
 
        gth_tags_file_load_from_file (Main->priv->tags, path, NULL);
1122
 
        g_free (path);
 
1123
        file = gth_user_dir_get_file_for_read (GTH_DIR_CONFIG, GTHUMB_DIR, TAGS_FILE, NULL);
 
1124
        gth_tags_file_load_from_file (Main->priv->tags, file, NULL);
 
1125
 
 
1126
        g_object_unref (file);
1123
1127
 
1124
1128
        return Main->priv->tags;
1125
1129
}
1135
1139
void
1136
1140
gth_main_tags_changed (void)
1137
1141
{
1138
 
        char *filename;
 
1142
        GFile *file;
1139
1143
 
1140
 
        gth_user_dir_make_dir_for_file (GTH_DIR_CONFIG, GTHUMB_DIR, TAGS_FILE, NULL);
1141
 
        filename = gth_user_dir_get_file (GTH_DIR_CONFIG, GTHUMB_DIR, TAGS_FILE, NULL);
1142
 
        gth_tags_file_to_file (Main->priv->tags, filename, NULL);
 
1144
        file = gth_user_dir_get_file_for_read (GTH_DIR_CONFIG, GTHUMB_DIR, TAGS_FILE, NULL);
 
1145
        gth_tags_file_to_file (Main->priv->tags, file, NULL);
1143
1146
        gth_monitor_tags_changed (gth_main_get_default_monitor ());
1144
1147
 
1145
 
        g_free (filename);
 
1148
        g_object_unref (file);
1146
1149
}
1147
1150
 
1148
1151
 
1199
1202
                                                "photo_importer",
1200
1203
                                                "photobucket",
1201
1204
                                                "picasaweb",
1202
 
                                                "pixbuf_savers",
1203
1205
                                                "raw_files",
1204
1206
                                                "red_eye_removal",
1205
1207
                                                "rename_series",