Esempio n. 1
1
void Configs::clearConfigs()
{    
    this->refreshConnectionPath.clear();

    // OD: Mutable List statt foreach
    QMutableListIterator<QPair<int, OpenVpn*> > i(this->myList);

    while (i.hasNext()) {
        QPair <int, OpenVpn*> entry = i.next();
        OpenVpn *obj = entry.second;

        if (!obj->isConnectionStable() && !obj->isConnecting() && !obj->isError() && obj->getAdvName().isEmpty() && !obj->isDelayed()) {
            // Objekt löschen
            delete obj;
            obj = 0;
            // Nun aus der Liste entfernen
            i.remove();
        } else {
            // Pfad merken
            this->refreshConnectionPath = obj->getConfigFullPath();
        }        
    }
}