void SourcesManager::clearAll() { for(int i = 0; i <= getMaximumIndexOfSource(); i++) sourceRemove(i); for(int i = 0; i <= getMaximumIndexOfGroup(); i++) groupRemove(i); }
TaskSettings::TaskSettings(QWidget *p) : QDialog(p) { setupUi(this); connect(btnAdd, SIGNAL(clicked()), this, SLOT(groupAdd())); connect(btnRemove, SIGNAL(clicked()), this, SLOT(groupRemove())); connect(btnUp, SIGNAL(clicked()), this, SLOT(groupMoveUp())); connect(btnDown, SIGNAL(clicked()), this, SLOT(groupMoveDown())); connect(lstGroups, SIGNAL(currentRowChanged(int)), this, SLOT(groupRowChanged(int))); connect(lineGroup, SIGNAL(textChanged(QString)), this, SLOT(groupLineChanged(QString))); }
void SourcesManager::groupRemoveWithSources(long groupIndex) { for(int i = 0; i < getMaximumIndexOfSource(); i++) { if (m_sources[i]->isOwnedByGroup(groupIndex)) { sourceRemove(i); } } groupRemove(groupIndex); }
void SourcesManager::groupClean() { for(int i = 0; i <= getNumberOfGroups(); i++) { if(groupGetExistence(i)) { for(int j = 0; j <= getNumberOfGroups(); j++) { if (i != j && groupGetExistence(j)) { if(groupGetNumberOfSources(i) == groupGetNumberOfSources(j)) { int check = 0; for(int k = 0; k < groupGetNumberOfSources(i); k++) { for(int l = 0; l < groupGetNumberOfSources(i); l++) { if(groupGetSourceIndex(i, k) == groupGetSourceIndex(j, l)) check++; } } if(check == groupGetNumberOfSources(j)) groupRemove(j); } } } } } for(int i = 0; i < getNumberOfGroups(); i++) { if(groupGetExistence(i)) { if(groupGetNumberOfSources(i) < 2) { groupRemove(i); } } } }