Debian Codegraph @

src/hopmodel.cpp

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 /***************************************************************************
2 hopmodel.cpp
3 -------------------
4 Hop model
5 -------------------
6 Copyright 2006-2008, David Johnson
7 Please see the header file for copyright and license information
8 ***************************************************************************/
9
10 #include <QApplication>
11 #include <QMessageBox>
12 #include <QPair>
13
14 #include "data.h"cxx . . $ `<file>/src/data.h`/
15 #include "hopmodel.h"cxx . . $ `<file>/src/hopmodel.h`/
16
17 using namespace Resource;
18
19 //////////////////////////////////////////////////////////////////////////////
20 // HopModel()
21 // ------------
22 // Constructor
23
24 HopModelcxx . . $ HopModel#::HopModelcxx . . $ HopModel#HopModel(3810d98dad0f8a86).(QObjectcxx . . $ QObject# *parent, HopListcxx . . $ HopList# *list)
25 : QAbstractTableModelcxx . . $ QAbstractTableModel#(parent), list_cxx . . $ HopModel#list_.(list)
26 {}
27
28 HopModelcxx . . $ HopModel#::~cxx . . $ HopModel#`~HopModel`(ced63f7c635d850d).HopModelcxx . . $ HopModel#() {}
29
30 //////////////////////////////////////////////////////////////////////////////
31 // flush()
32 // -------
33 // Reset the model
•34 // The reset() method is obsolete with Qt5.
35
36 void HopModelcxx . . $ HopModel#::flushcxx . . $ HopModel#flush(49f6e7a06ebc5aa8).()
37 {
•38 // reset();
39 }
40
41 //////////////////////////////////////////////////////////////////////////////
42 // data()
43 // ------
44 // Return data at index
45
46 QVariantcxx . . $ QVariant# HopModelcxx . . $ HopModel#::datacxx . . $ HopModel#data(69b5b18a001c0029).(const QModelIndexcxx . . $ QModelIndex# &index, int role) const
47 {
48 if (!index.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).()) return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).();
49 if (index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).() >= list_cxx . . $ HopModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).()) return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).();
50
51 // row is the entry in the QList
52 const Hopcxx . . $ Hop# &hop = list_cxx . . $ HopModel#list_.->atcxx . . $ QList#at(e2681f9bb6b2f357).(index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).());
53
54 // column is the hop "field"
55 if (role == Qtcxx . . $ Qt/::DisplayRolecxx . . $ Qt/DisplayRole.) {
56 switch (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).()) {
57 case NAMEcxx . . $ HopModel#NAME.:
58 return hopcxx . . $ QVariant#QVariant(3520e46b33348bf6)..namecxx . . $ Hop#name(a2fb7a6ce195d51).();
59 case WEIGHTcxx . . $ HopModel#WEIGHT.:
60 return hopcxx . . $ QVariant#QVariant(3520e46b33348bf6)..weightcxx . . $ Hop#weight(e805bc742de5fe4b).().toStringcxx . . $ Quantity#toString(3f3c3d0e9c0eb37f).(3);
61 case ALPHAcxx . . $ HopModel#ALPHA.:
62 return QStringcxx . . $ QVariant#QVariant(3520e46b33348bf6).::numbercxx . . $ QString#number(ac5d358e2e30f7ea).(hop.alphacxx . . $ Hop#alpha(21b6c25e127938e2).(), 'f', 1) +cxx . . $ operator+(501d4570f8fec4c9). '%';
63 case TIMEcxx . . $ HopModel#TIME.:
64 return QStringcxx . . $ QVariant#QVariant(3520e46b33348bf6).::numbercxx . . $ QString#number(da83c6b4fd8c0e98).(hop.timecxx . . $ Hop#time(ddd8539a2fcdd4ce).()) +cxx . . $ operator+(fab9b4f80031f353). trcxx . . $ HopModel#tr(75d9f1c324b4579d).(" min", "minutes");
65 case TYPEcxx . . $ HopModel#TYPE.:
66 return hopcxx . . $ QVariant#QVariant(3520e46b33348bf6)..typecxx . . $ Hop#type(a2fb7a6ce195d51).();
67 default:
68 return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).();
69 }
70 } else if (role == Qtcxx . . $ Qt/::EditRolecxx . . $ Qt/EditRole.) {
71 switch (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).()) {
72 case NAMEcxx . . $ HopModel#NAME.:
73 return hopcxx . . $ QVariant#QVariant(3520e46b33348bf6)..namecxx . . $ Hop#name(a2fb7a6ce195d51).();
74 case WEIGHTcxx . . $ HopModel#WEIGHT.: {
75 // return converted quantity
76 Weightcxx . . $ Weight# weight = hopcxx . . $ Weight#Weight(fcd19e49ee58ab66)..weightcxx . . $ Hop#weight(e805bc742de5fe4b).();
77 weight.convertcxx . . $ Quantity#convert(7d797d468467b63d).(Datacxx . . $ Data#::instancecxx . . $ Data#instance(ddf71f0b6dfdf13b).()->defaultHopUnitcxx . . $ Data#defaultHopUnit(1a4d46a500733df5).());
78 return weightcxx . . $ QVariant#QVariant(ba8836b59fb42830)..amountcxx . . $ Quantity#amount(21b6c25e127938e2).();
79 }
80 case ALPHAcxx . . $ HopModel#ALPHA.:
81 return hopcxx . . $ QVariant#QVariant(ba8836b59fb42830)..alphacxx . . $ Hop#alpha(21b6c25e127938e2).();
82 case TIMEcxx . . $ HopModel#TIME.:
83 return hopcxx . . $ QVariant#QVariant(cb2f890c2fdad230)..timecxx . . $ Hop#time(ddd8539a2fcdd4ce).();
84 case TYPEcxx . . $ HopModel#TYPE.:
85 return hopcxx . . $ QVariant#QVariant(3520e46b33348bf6)..typecxx . . $ Hop#type(a2fb7a6ce195d51).();
86 default:
87 return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).();
88 }
89 } else if (role == Qtcxx . . $ Qt/::TextAlignmentRolecxx . . $ Qt/TextAlignmentRole.) {
90 switch (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).()) {
91 case NAMEcxx . . $ HopModel#NAME.:
92 case TYPEcxx . . $ HopModel#TYPE.:
93 return Qtcxx . . $ QVariant#QVariant(d4f767463ce0a6b3).::AlignLeftcxx . . $ Qt/AlignLeft.;
94 case WEIGHTcxx . . $ HopModel#WEIGHT.:
95 case ALPHAcxx . . $ HopModel#ALPHA.:
96 case TIMEcxx . . $ HopModel#TIME.:
97 default:
98 return Qtcxx . . $ QVariant#QVariant(d4f767463ce0a6b3).::AlignRightcxx . . $ Qt/AlignRight.;
99 }
100 } else {
101 return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).();
102 }
103 }
104
105 //////////////////////////////////////////////////////////////////////////////
106 // setData()
107 // ---------
108 // Set data at index
109
110 bool HopModelcxx . . $ HopModel#::setDatacxx . . $ HopModel#setData(6d1d8401440d0a2c).(const QModelIndexcxx . . $ QModelIndex# &index,
111 const QVariantcxx . . $ QVariant# &value, int role)
112 {
113 static bool deleting = false;
114
115 Hopcxx . . $ Hop# hopcxx . . $ Hop#Hop(49f6e7a06ebc5aa8).;
116 QStringcxx . . $ QString# namecxx . . $ QString#QString(ced63f7c635d850d).;
117 int row = index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).();
118 int column = index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).();
119
120 if (!index.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).()) return false;
121 if (role != Qtcxx . . $ Qt/::EditRolecxx . . $ Qt/EditRole.) return false;
122 if (row >= list_cxx . . $ HopModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).()) return false;
123
124 // grab existing hop
125 if (row < list_cxx . . $ HopModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).()) hop =cxx . . $ Hop#`operator=`(a5d063c8d945c6bf). list_cxx . . $ HopModel#list_.->valuecxx . . $ QList#value(b4be2ec6940d8d62).(row);
126
127 switch (column) {
128 case NAMEcxx . . $ HopModel#NAME.:
129 // editing name as several special cases
130 name =cxx . . $ QString#`operator=`(4f35bf974e7f8568). value.toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).();
131
132 // deleting name deletes hop
133 if (name.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) {
134 if (row >= list_cxx . . $ HopModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).()) return false; // already blank
135
136 // TODO: for some reason this gets entered recursively...
137 if (deleting) return false;
138 deleting = true;
139
140 int status = QMessageBoxcxx . . $ QMessageBox#::questioncxx . . $ QMessageBox#question(a9e3742e6f7b4147).(QApplicationcxx . . $ QApplication#::activeWindowcxx . . $ QApplication#activeWindow(9b769eeb00a33a04).(),
141 TITLEcxx . . $ Resource/TITLE. +cxx . . $ operator+(57364c1b23444736). trcxx . . $ HopModel#tr(75d9f1c324b4579d).(" - Delete?"),
142 trcxx . . $ HopModel#tr(75d9f1c324b4579d).("Do you wish to remove this entry?"),
143 QMessageBoxcxx . . $ QMessageBox#::Yescxx . . $ QMessageBox#Yes. |cxx . . $ `operator|`(67530149e923fc12). QMessageBoxcxx . . $ QMessageBox#::Cancelcxx . . $ QMessageBox#Cancel.);
144 if (status == QMessageBoxcxx . . $ QMessageBox#::Yescxx . . $ QMessageBox#Yes.) {
145 // remove hop
146 beginRemoveRowscxx . . $ QAbstractItemModel#beginRemoveRows(d1f44b3c3a3f9fa).(index.parentcxx . . $ QModelIndex#parent(a394cbc57608ce34).(), row, row);
147
148 list_cxx . . $ HopModel#list_.->removeAtcxx . . $ QList#removeAt(d4f767463ce0a6b3).(row);
149 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! modifiedcxx . . $ HopModel#modified(49f6e7a06ebc5aa8).();
150 endRemoveRowscxx . . $ QAbstractItemModel#endRemoveRows(49f6e7a06ebc5aa8).();
151
152 deleting = false;
153 return true;
154 } else {
155 // ignore
156 deleting = false;
157 return false;
158 }
159 }
160
161 // no change, nothing to do
162 if (name ==cxx . . $ `operator==`(5bc2975d2d751687). list_cxx . . $ HopModel#list_.->atcxx . . $ QList#at(e2681f9bb6b2f357).(row).namecxx . . $ Hop#name(a2fb7a6ce195d51).()) {
163 return false;
164 }
165
166 // changed name
167 hop.setNamecxx . . $ Hop#setName(3520e46b33348bf6).(name);
168 if (Datacxx . . $ Data#::instancecxx . . $ Data#instance(ddf71f0b6dfdf13b).()->hasHopcxx . . $ Data#hasHop(e1defb592416720d).(name)) {
169 Hopcxx . . $ Hop# newhop = Datacxx . . $ Data#::instancecxx . . $ Data#instance(ddf71f0b6dfdf13b).()->hopcxx . . $ Data#hop(55a2afcaaa77ea27).(name);
170 // we don't override weight or time
171 hop.setTypecxx . . $ Hop#setType(3520e46b33348bf6).(newhop.typecxx . . $ Hop#type(a2fb7a6ce195d51).());
172 hop.setAlphacxx . . $ Hop#setAlpha(ba8836b59fb42830).(newhop.alphacxx . . $ Hop#alpha(21b6c25e127938e2).());
173 }
174 break;
175
176 case WEIGHTcxx . . $ HopModel#WEIGHT.:
177 hop.setWeightcxx . . $ Hop#setWeight(fcd19e49ee58ab66).(Weightcxx . . $ Weight#Weight(2884c06fcedbb8a7).(value.toDoublecxx . . $ QVariant#toDouble(1bd8e57dd4a29c14).(),
178 Datacxx . . $ Data#::instancecxx . . $ Data#instance(ddf71f0b6dfdf13b).()->defaultHopUnitcxx . . $ Data#defaultHopUnit(1a4d46a500733df5).()));
179 break;
180
181 case ALPHAcxx . . $ HopModel#ALPHA.:
182 hop.setAlphacxx . . $ Hop#setAlpha(ba8836b59fb42830).(value.toDoublecxx . . $ QVariant#toDouble(1bd8e57dd4a29c14).());
183 break;
184
185 case TIMEcxx . . $ HopModel#TIME.:
186 hop.setTimecxx . . $ Hop#setTime(cb2f890c2fdad230).(value.toUIntcxx . . $ QVariant#toUInt(870b63f89c7fb98).());
187 break;
188
189 case TYPEcxx . . $ HopModel#TYPE.:
190 hop.setTypecxx . . $ Hop#setType(3520e46b33348bf6).(value.toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).());
191 break;
192
193 default:
194 return false;
195 }
196
197 list_cxx . . $ HopModel#list_.->replacecxx . . $ QList#replace(20dcc09d4a3213bb).(row, hop);
198 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! modifiedcxx . . $ HopModel#modified(49f6e7a06ebc5aa8).();
199
200 // whole row may have changed
201 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! dataChangedcxx . . $ QAbstractItemModel#dataChanged(ae8a85c811f0c28a).(index.siblingcxx . . $ QModelIndex#sibling(ed2c7c7bbed3ca7f).(row, NAMEcxx . . $ HopModel#NAME.),
202 index.siblingcxx . . $ QModelIndex#sibling(ed2c7c7bbed3ca7f).(row, TIMEcxx . . $ HopModel#TIME.));
203
204 return true;
205 }
206
207 //////////////////////////////////////////////////////////////////////////////
208 // insertRows()
209 // ------------
210 // Insert rows into table
211
212 bool HopModelcxx . . $ HopModel#::insertRowscxx . . $ HopModel#insertRows(c4e00837c4ba3150).(int row, int count, const QModelIndexcxx . . $ QModelIndex#&)
213 {
214 if (count != 1) return false; // only insert one row at a time
215 if ((row < 0) || (row >= list_cxx . . $ HopModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).())) row = list_cxx . . $ HopModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).();
216
217 Hopcxx . . $ Hop# hop = Datacxx . . $ Data#::instancecxx . . $ Data#instance(ddf71f0b6dfdf13b).()->hopcxx . . $ Data#hop(55a2afcaaa77ea27).(trcxx . . $ HopModel#tr(75d9f1c324b4579d).("Generic"));
218
219 beginInsertRowscxx . . $ QAbstractItemModel#beginInsertRows(d1f44b3c3a3f9fa).(QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).(), row, row);
220 list_cxx . . $ HopModel#list_.->insertcxx . . $ QList#insert(20dcc09d4a3213bb).(row, hop);
221 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! modifiedcxx . . $ HopModel#modified(49f6e7a06ebc5aa8).();
222 endInsertRowscxx . . $ QAbstractItemModel#endInsertRows(49f6e7a06ebc5aa8).();
223 return true;
224 }
225
226 //////////////////////////////////////////////////////////////////////////////
227 // removeRows()
228 // ------------
229 // Remove rows from table
230
231 bool HopModelcxx . . $ HopModel#::removeRowscxx . . $ HopModel#removeRows(c4e00837c4ba3150).(int row, int count, const QModelIndexcxx . . $ QModelIndex#&)
232 {
233 if (count != 1) return false; // only remove one row at a time
234 if ((row < 0) || (row >= list_cxx . . $ HopModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).())) return false;
235
236 int status = QMessageBoxcxx . . $ QMessageBox#::questioncxx . . $ QMessageBox#question(a9e3742e6f7b4147).(QApplicationcxx . . $ QApplication#::activeWindowcxx . . $ QApplication#activeWindow(9b769eeb00a33a04).(),
237 TITLEcxx . . $ Resource/TITLE. +cxx . . $ operator+(57364c1b23444736). trcxx . . $ HopModel#tr(75d9f1c324b4579d).(" - Delete?"),
238 trcxx . . $ HopModel#tr(75d9f1c324b4579d).("Do you wish to remove this entry?"),
239 QMessageBoxcxx . . $ QMessageBox#::Yescxx . . $ QMessageBox#Yes. |cxx . . $ `operator|`(67530149e923fc12). QMessageBoxcxx . . $ QMessageBox#::Cancelcxx . . $ QMessageBox#Cancel.);
240 if (status == QMessageBoxcxx . . $ QMessageBox#::Cancelcxx . . $ QMessageBox#Cancel.) {
241 return false;
242 }
243
244 beginRemoveRowscxx . . $ QAbstractItemModel#beginRemoveRows(d1f44b3c3a3f9fa).(QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).(), row, row);
245 list_cxx . . $ HopModel#list_.->removeAtcxx . . $ QList#removeAt(d4f767463ce0a6b3).(row);
246 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! modifiedcxx . . $ HopModel#modified(49f6e7a06ebc5aa8).();
247 endRemoveRowscxx . . $ QAbstractItemModel#endRemoveRows(49f6e7a06ebc5aa8).();
248 return true;
249 }
250
251 //////////////////////////////////////////////////////////////////////////////
252 // headerData()
253 // ------------
254 // Return header information
255
256 QVariantcxx . . $ QVariant# HopModelcxx . . $ HopModel#::headerDatacxx . . $ HopModel#headerData(b8cfec0985494997).(int section, Qtcxx . . $ Qt/::Orientationcxx . . $ Qt/Orientation# orientation,
257 int role) const
258 {
259 if (orientation == Qtcxx . . $ Qt/::Horizontalcxx . . $ Qt/Horizontal. && role == Qtcxx . . $ Qt/::DisplayRolecxx . . $ Qt/DisplayRole.) {
260 switch (section) {
261 case NAMEcxx . . $ HopModel#NAME.:
262 return trcxx . . $ QVariant#QVariant(3520e46b33348bf6).("Hop");
263 case WEIGHTcxx . . $ HopModel#WEIGHT.:
264 return trcxx . . $ QVariant#QVariant(3520e46b33348bf6).("Weight");
265 case ALPHAcxx . . $ HopModel#ALPHA.:
266 return trcxx . . $ QVariant#QVariant(3520e46b33348bf6).("Alpha");
267 case TIMEcxx . . $ HopModel#TIME.:
268 return trcxx . . $ QVariant#QVariant(3520e46b33348bf6).("Time");
269 case TYPEcxx . . $ HopModel#TYPE.:
270 return trcxx . . $ QVariant#QVariant(3520e46b33348bf6).("Type");
271 default:
272 return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).();
273 }
274 }
275
276 return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).();
277 }
278
279 //////////////////////////////////////////////////////////////////////////////
280 // flags()
281 // ------
282 // Return flags at index
283
284 Qtcxx . . $ Qt/::ItemFlagscxx . . $ Qt/ItemFlags# HopModelcxx . . $ HopModel#::flagscxx . . $ HopModel#flags(36b38c1b3d3f7b45).(const QModelIndexcxx . . $ QModelIndex# &index) const
285 {
286 if (!index.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).()) return Qtcxx . . $ QFlags#QFlags(93d577a3e9528307).::ItemIsEnabledcxx . . $ Qt/ItemIsEnabled.;
287
288 return QAbstractTableModelcxx . . $ QAbstractTableModel#::flagscxx . . $ QAbstractTableModel#flags(36b38c1b3d3f7b45).(index) |cxx . . $ QFlags#`operator|`(2cc1994e0be6f18e). Qtcxx . . $ Qt/::ItemIsEditablecxx . . $ Qt/ItemIsEditable.;
289 }
290
291 //////////////////////////////////////////////////////////////////////////////
292 // rowCount()
293 // ----------
294 // Return number of rows of data
295
296 int HopModelcxx . . $ HopModel#::rowCountcxx . . $ HopModel#rowCount(e3878d4d6cd9529c).(const QModelIndexcxx . . $ QModelIndex# &) const
297 {
298 return list_cxx . . $ HopModel#list_.->countcxx . . $ QList#count(455f465bc33b4cdf).();
299 }
300
301 //////////////////////////////////////////////////////////////////////////////
302 // columnCount()
303 // -------------
304 // Return number of columns of data
305
306 int HopModelcxx . . $ HopModel#::columnCountcxx . . $ HopModel#columnCount(e3878d4d6cd9529c).(const QModelIndexcxx . . $ QModelIndex# &) const
307 {
308 return COUNTcxx . . $ HopModel#COUNT.;
309 }
310
311 //////////////////////////////////////////////////////////////////////////////
312 // sort()
313 // ------
314 // Sort by column
315
316 void HopModelcxx . . $ HopModel#::sortcxx . . $ HopModel#sort(11168df8d4e8286d).(int column, Qtcxx . . $ Qt/::SortOrdercxx . . $ Qt/SortOrder# order)
317 {
318 QListcxx . . $ QList#<QPaircxx . . $ QPair#<QStringcxx . . $ QString#,Hopcxx . . $ Hop#> > sortlistcxx . . $ QList#QList(ced63f7c635d850d).;
319
320 foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`!(Hop hop, *list_) {
321 QStringcxx . . $ QString# fieldcxx . . $ QString#QString(ced63f7c635d850d).;
322 switch (column) {
323 case NAMEcxx . . $ HopModel#NAME.:
324 field =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). hop.namecxx . . $ Hop#name(a2fb7a6ce195d51).();
325 break;
326 case WEIGHTcxx . . $ HopModel#WEIGHT.:
327 field =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::numbercxx . . $ QString#number(ac5d358e2e30f7ea).(hop.weightcxx . . $ Hop#weight(e805bc742de5fe4b).().amountcxx . . $ Quantity#amount(21b6c25e127938e2).()).rightJustifiedcxx . . $ QString#rightJustified(63a88914f7cad4ec).(8,'0'cxx . . $ QChar#QChar(f349c77f591a7878).);
328 break;
329 case ALPHAcxx . . $ HopModel#ALPHA.:
330 field =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::numbercxx . . $ QString#number(ac5d358e2e30f7ea).(hop.alphacxx . . $ Hop#alpha(21b6c25e127938e2).(),'f',1).rightJustifiedcxx . . $ QString#rightJustified(63a88914f7cad4ec).(8,'0'cxx . . $ QChar#QChar(f349c77f591a7878).);
331 break;
332 case TYPEcxx . . $ HopModel#TYPE.:
333 field =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). hop.typecxx . . $ Hop#type(a2fb7a6ce195d51).();
334 break;
335 case TIMEcxx . . $ HopModel#TIME.:
336 default:
337 field =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::numbercxx . . $ QString#number(da83c6b4fd8c0e98).(hop.timecxx . . $ Hop#time(ddd8539a2fcdd4ce).()).rightJustifiedcxx . . $ QString#rightJustified(63a88914f7cad4ec).(8,'0'cxx . . $ QChar#QChar(f349c77f591a7878).);
338 break;
339 }
340 sortlist.appendcxx . . $ QList#append(77d9f17553126ecb).(QPaircxx . . $ QPair#QPair(ce1e23113bcdb2b4).<QStringcxx . . $ QString#,Hopcxx . . $ Hop#>(field, hop));
341 }
342
343 // sort list
344 qSortcxx . . $ qSort(249673c20e2b8d5).(sortlist.begincxx . . $ QList#begin(ca2520f641887418).(), sortlist.endcxx . . $ QList#end(ca2520f641887418).());
345
346 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! layoutAboutToBeChangedcxx . . $ QAbstractItemModel#layoutAboutToBeChanged(17ff3201f1a6fa68).();
347
348 // create new list
349 list_cxx . . $ HopModel#list_.->clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).();
350 QPaircxx . . $ QPair#<QStringcxx . . $ QString#,Hopcxx . . $ Hop#> paircxx . . $ QPair#QPair(7d94e3e767b7b77f).;
351 foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`!(pair, sortlist) {
352 if (order == Qtcxx . . $ Qt/::AscendingOrdercxx . . $ Qt/AscendingOrder.)
353 list_cxx . . $ HopModel#list_.->appendcxx . . $ QList#append(77d9f17553126ecb).(pair.secondcxx . . $ QPair#second.);
354 else
355 list_cxx . . $ HopModel#list_.->prependcxx . . $ QList#prepend(77d9f17553126ecb).(pair.secondcxx . . $ QPair#second.);
356 }
357
358 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! layoutChangedcxx . . $ QAbstractItemModel#layoutChanged(17ff3201f1a6fa68).();
359 }