0001-Use-preference-for-preferring-html-or-text-alt.patch

Follow preferences for selecting text or HTML message parts - Charles Lehner, 07/06/2015 05:01 AM

Download (1.82 KB)

View differences:

src/mimeview.c
376 376
		(G_OBJECT(mimeview->selection),
377 377
		 G_CALLBACK(mimeview_selection_changed), mimeview);
378 378

  
379
	/* search first text part */
380
	for (valid = gtk_tree_model_get_iter_first(model, &iter); valid;
381
	     valid = gtkut_tree_model_next(model, &iter)) {
382
		MimeInfo *partinfo;
379
	if (prefs_common.alt_prefer_html) {
380
		/* search first html part */
381
		for (valid = gtk_tree_model_get_iter_first(model, &iter);
382
		     valid; valid = gtkut_tree_model_next(model, &iter)) {
383
			MimeInfo *partinfo;
384

  
385
			gtk_tree_model_get(model, &iter, COL_MIME_INFO,
386
			    &partinfo, -1);
387

  
388
			if (partinfo && partinfo->mime_type ==
389
			    MIME_TEXT_HTML)
390
				break;
391
		}
392
	}
383 393

  
384
		gtk_tree_model_get(model, &iter, COL_MIME_INFO, &partinfo, -1);
385
		if (partinfo &&
386
		    (partinfo->mime_type == MIME_TEXT ||
387
		     partinfo->mime_type == MIME_TEXT_HTML))
388
			break;
394
	if (!prefs_common.alt_prefer_html || !valid) {
395
		/* search first text part */
396
		for (valid = gtk_tree_model_get_iter_first(model, &iter);
397
		     valid; valid = gtkut_tree_model_next(model, &iter)) {
398
			MimeInfo *partinfo;
399

  
400
			gtk_tree_model_get(model, &iter, COL_MIME_INFO,
401
			    &partinfo, -1);
402

  
403
			if (partinfo && partinfo->mime_type == MIME_TEXT)
404
				break;
405
		}
389 406
	}
407

  
390 408
	textview_show_message(mimeview->messageview->textview, mimeinfo, file);
391 409

  
392 410
	if (!valid)
393
-