MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / flags

Method flags

App/Client/Recent/RecentModel.cpp:17–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17Qt::ItemFlags CRecentModel::flags(const QModelIndex &index) const
18{
19 auto f = QAbstractTableModel::flags(index);
20 if (!index.isValid())
21 return f;
22
23 if(index.row() >= m_Items.count())
24 return f;
25
26 auto item = m_Items.at(index.row());
27 QString szFile = item.GetFile();
28 if(szFile.isEmpty()) {
29 return f;
30 }
31
32 bool bExist = false;
33 QFileInfo fi(szFile);
34 if(m_pParameterApp->GetGlobalParameters()->GetSaveSettingsType()
35 == CParameterGlobal::SaveSettingsType::File) {
36 bExist = fi.exists();
37 } else {
38 bExist = m_pDatabase->HasFileContents(item);
39 }
40
41 if(bExist)
42 f |= Qt::ItemIsEnabled;
43 else
44 f &= ~Qt::ItemIsEnabled;
45 return f;
46}
47
48QVariant CRecentModel::headerData(int section, Qt::Orientation orientation, int role) const
49{

Callers

nothing calls this directly

Calls 6

isValidMethod · 0.80
GetSaveSettingsTypeMethod · 0.80
HasFileContentsMethod · 0.80
GetFileMethod · 0.45
isEmptyMethod · 0.45
GetGlobalParametersMethod · 0.45

Tested by

no test coverage detected