MCPcopy Create free account
hub / github.com/amule-project/amule / UpdateJobInfo

Method UpdateJobInfo

src/PartFileConvertDlg.cpp:162–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162void CPartFileConvertDlg::UpdateJobInfo(ConvertInfo& info)
163{
164 if (s_convert_gui) {
165 // search jobitem in listctrl
166 long item_nr = s_convert_gui->m_joblist->FindItem(-1, info.id);
167 // if it does not exist, add it
168 if (item_nr == -1) {
169 item_nr = s_convert_gui->m_joblist->InsertItem(s_convert_gui->m_joblist->GetItemCount(), info.folder.GetPrintable());
170 if (item_nr != -1) {
171 s_convert_gui->m_joblist->SetItemData(item_nr, info.id);
172 }
173 }
174 // update columns
175 if (item_nr != -1) {
176 s_convert_gui->m_joblist->SetItem(item_nr, 0, info.filename.IsOk() ? info.folder.GetPrintable() : info.filename.GetPrintable() );
177 s_convert_gui->m_joblist->SetItem(item_nr, 1, GetConversionState(info.state) );
178 if (info.size > 0) {
179 s_convert_gui->m_joblist->SetItem(item_nr, 2, CFormat(_("%s (Disk: %s)")) % CastItoXBytes(info.size) % CastItoXBytes(info.spaceneeded));
180 } else {
181 s_convert_gui->m_joblist->SetItem(item_nr, 2, "");
182 }
183 s_convert_gui->m_joblist->SetItem(item_nr, 3, info.filehash);
184 }
185 }
186}
187
188void CPartFileConvertDlg::RemoveJobInfo(unsigned id)
189{

Callers

nothing calls this directly

Calls 10

GetConversionStateFunction · 0.85
CFormatClass · 0.85
CastItoXBytesFunction · 0.85
FindItemMethod · 0.80
InsertItemMethod · 0.80
GetItemCountMethod · 0.80
GetPrintableMethod · 0.80
SetItemDataMethod · 0.80
SetItemMethod · 0.80
IsOkMethod · 0.45

Tested by

no test coverage detected