diff options
Diffstat (limited to 'src/plugins/fs/upload.c')
-rw-r--r-- | src/plugins/fs/upload.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/plugins/fs/upload.c b/src/plugins/fs/upload.c index 071d64f1..4738d2f3 100644 --- a/src/plugins/fs/upload.c +++ b/src/plugins/fs/upload.c | |||
@@ -49,12 +49,14 @@ static GladeXML *metaXML; | |||
49 | /* ************ FSUI event handlers ************ */ | 49 | /* ************ FSUI event handlers ************ */ |
50 | 50 | ||
51 | void | 51 | void |
52 | fs_upload_update (UploadList * list, unsigned long long completed) | 52 | fs_upload_update (UploadList * list, unsigned long long completed, |
53 | unsigned long long total) | ||
53 | { | 54 | { |
54 | GtkTreeIter iter; | 55 | GtkTreeIter iter; |
55 | GtkTreePath *path; | 56 | GtkTreePath *path; |
56 | int progress; | 57 | int progress; |
57 | 58 | ||
59 | list->total = total; | ||
58 | if (list->total != 0) | 60 | if (list->total != 0) |
59 | progress = 100 * completed / list->total; | 61 | progress = 100 * completed / list->total; |
60 | else | 62 | else |
@@ -78,7 +80,10 @@ fs_upload_complete (UploadList * list, struct ECRS_URI *uri) | |||
78 | path = gtk_tree_row_reference_get_path (list->summaryViewRowReference); | 80 | path = gtk_tree_row_reference_get_path (list->summaryViewRowReference); |
79 | gtk_tree_model_get_iter (GTK_TREE_MODEL (upload_summary), &iter, path); | 81 | gtk_tree_model_get_iter (GTK_TREE_MODEL (upload_summary), &iter, path); |
80 | gtk_tree_path_free (path); | 82 | gtk_tree_path_free (path); |
81 | gtk_tree_store_set (upload_summary, &iter, UPLOAD_URISTRING, us, -1); | 83 | gtk_tree_store_set (upload_summary, &iter, |
84 | UPLOAD_URISTRING, us, | ||
85 | UPLOAD_PROGRESS, 100, | ||
86 | -1); | ||
82 | FREE (us); | 87 | FREE (us); |
83 | } | 88 | } |
84 | 89 | ||
@@ -136,6 +141,7 @@ fs_upload_started (struct FSUI_UploadList *fsui, | |||
136 | GtkTreePath *path; | 141 | GtkTreePath *path; |
137 | int progress; | 142 | int progress; |
138 | GtkTreeIter par; | 143 | GtkTreeIter par; |
144 | char * u; | ||
139 | 145 | ||
140 | ret = MALLOC (sizeof (UploadList)); | 146 | ret = MALLOC (sizeof (UploadList)); |
141 | memset (ret, 0, sizeof (UploadList)); | 147 | memset (ret, 0, sizeof (UploadList)); |
@@ -156,12 +162,17 @@ fs_upload_started (struct FSUI_UploadList *fsui, | |||
156 | { | 162 | { |
157 | gtk_tree_store_append (upload_summary, &iter, NULL); | 163 | gtk_tree_store_append (upload_summary, &iter, NULL); |
158 | } | 164 | } |
159 | if (total != 0) | 165 | if ( (total != 0) && (state != FSUI_COMPLETED_JOINED) ) |
160 | progress = 100 * completed / total; | 166 | progress = 100 * completed / total; |
161 | else | 167 | else |
162 | progress = 100; | 168 | progress = 100; |
163 | gtk_tree_store_set (upload_summary, &iter, UPLOAD_FILENAME, filename, UPLOAD_PROGRESS, progress, UPLOAD_URISTRING, "", /* FIXME: set if URI != NULL! */ | 169 | if (uri != NULL) |
170 | u = ECRS_uriToString(uri); | ||
171 | else | ||
172 | u = STRDUP(""); | ||
173 | gtk_tree_store_set (upload_summary, &iter, UPLOAD_FILENAME, filename, UPLOAD_PROGRESS, progress, UPLOAD_URISTRING, u, | ||
164 | UPLOAD_INTERNAL, ret, -1); | 174 | UPLOAD_INTERNAL, ret, -1); |
175 | FREE(u); | ||
165 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (upload_summary), &iter); | 176 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (upload_summary), &iter); |
166 | ret->summaryViewRowReference | 177 | ret->summaryViewRowReference |
167 | = gtk_tree_row_reference_new (GTK_TREE_MODEL (upload_summary), path); | 178 | = gtk_tree_row_reference_new (GTK_TREE_MODEL (upload_summary), path); |