evolution-3.6.4/widgets/misc/e-selection-model-simple.c

No issues found

Incomplete coverage

Tool Failure ID Location Function Message Data
clang-analyzer no-output-found e-selection-model-simple.c Message(text='Unable to locate XML output from invoke-clang-analyzer') None
clang-analyzer no-output-found e-selection-model-simple.c Message(text='Unable to locate XML output from invoke-clang-analyzer') None
Failure running clang-analyzer ('no-output-found')
Message
Unable to locate XML output from invoke-clang-analyzer
Failure running clang-analyzer ('no-output-found')
Message
Unable to locate XML output from invoke-clang-analyzer
  1 /*
  2  *
  3  * This program is free software; you can redistribute it and/or
  4  * modify it under the terms of the GNU Lesser General Public
  5  * License as published by the Free Software Foundation; either
  6  * version 2 of the License, or (at your option) version 3.
  7  *
  8  * This program is distributed in the hope that it will be useful,
  9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 11  * Lesser General Public License for more details.
 12  *
 13  * You should have received a copy of the GNU Lesser General Public
 14  * License along with the program; if not, see <http://www.gnu.org/licenses/>
 15  *
 16  *
 17  * Authors:
 18  *		Chris Lahey <clahey@ximian.com>
 19  *
 20  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
 21  *
 22  */
 23 
 24 #ifdef HAVE_CONFIG_H
 25 #include <config.h>
 26 #endif
 27 
 28 #include "e-util/e-util.h"
 29 
 30 #include "e-selection-model-array.h"
 31 #include "e-selection-model-simple.h"
 32 
 33 static gint esms_get_row_count (ESelectionModelArray *esma);
 34 
 35 G_DEFINE_TYPE (
 36 	ESelectionModelSimple,
 37 	e_selection_model_simple,
 38 	E_SELECTION_MODEL_ARRAY_TYPE)
 39 
 40 static void
 41 e_selection_model_simple_init (ESelectionModelSimple *selection)
 42 {
 43 	selection->row_count = 0;
 44 }
 45 
 46 static void
 47 e_selection_model_simple_class_init (ESelectionModelSimpleClass *class)
 48 {
 49 	ESelectionModelArrayClass *esma_class;
 50 
 51 	esma_class = E_SELECTION_MODEL_ARRAY_CLASS (class);
 52 	esma_class->get_row_count = esms_get_row_count;
 53 }
 54 
 55 /**
 56  * e_selection_model_simple_new
 57  *
 58  * This routine creates a new #ESelectionModelSimple.
 59  *
 60  * Returns: The new #ESelectionModelSimple.
 61  */
 62 ESelectionModelSimple *
 63 e_selection_model_simple_new (void)
 64 {
 65 	return g_object_new (E_SELECTION_MODEL_SIMPLE_TYPE, NULL);
 66 }
 67 
 68 void
 69 e_selection_model_simple_set_row_count (ESelectionModelSimple *esms,
 70                                         gint row_count)
 71 {
 72 	if (esms->row_count != row_count) {
 73 		ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (esms);
 74 		if (esma->eba)
 75 			g_object_unref (esma->eba);
 76 		esma->eba = NULL;
 77 		esma->selected_row = -1;
 78 		esma->selected_range_end = -1;
 79 	}
 80 
 81 	esms->row_count = row_count;
 82 }
 83 
 84 static gint
 85 esms_get_row_count (ESelectionModelArray *esma)
 86 {
 87 	ESelectionModelSimple *esms = E_SELECTION_MODEL_SIMPLE (esma);
 88 
 89 	return esms->row_count;
 90 }
 91 
 92 void
 93 e_selection_model_simple_insert_rows (ESelectionModelSimple *esms,
 94                                       gint row,
 95                                       gint count)
 96 {
 97 	esms->row_count += count;
 98 	e_selection_model_array_insert_rows (
 99 		E_SELECTION_MODEL_ARRAY (esms), row, count);
100 }
101 
102 void
103 e_selection_model_simple_delete_rows (ESelectionModelSimple *esms,
104                                       gint row,
105                                       gint count)
106 {
107 	esms->row_count -= count;
108 	e_selection_model_array_delete_rows (
109 		E_SELECTION_MODEL_ARRAY (esms), row, count);
110 }
111 
112 void
113 e_selection_model_simple_move_row (ESelectionModelSimple *esms,
114                                    gint old_row,
115                                    gint new_row)
116 {
117 	e_selection_model_array_move_row (
118 		E_SELECTION_MODEL_ARRAY (esms), old_row, new_row);
119 }