i2pd/qt/i2pd_qt/widgetlockregistry.h

28 lines
568 B
C
Raw Normal View History

#ifndef WIDGETLOCKREGISTRY_H
#define WIDGETLOCKREGISTRY_H
#include <vector>
#include <widgetlock.h>
class widgetlockregistry {
std::vector<widgetlock*> locks;
public:
widgetlockregistry() : locks() {}
2017-09-08 10:59:19 +03:00
virtual ~widgetlockregistry() {}
void add(widgetlock* lock) {
locks.push_back(lock);
}
void deleteListeners() {
while(!locks.empty()) {
2017-09-08 10:59:19 +03:00
widgetlock* lock = locks.back();
lock->deleteListener();
delete lock;
locks.pop_back();
}
}
};
#endif // WIDGETLOCKREGISTRY_H