Remove c++11 auto iterators :(

This commit is contained in:
Mark Watkins 2014-05-07 04:03:13 +10:00
parent feec1ca758
commit 8aa0c2b8b4
11 changed files with 100 additions and 102 deletions

View File

@ -1259,8 +1259,8 @@ EventDataType gGraph::MaxY()
return rmax_y = f_maxy;
}
auto iterEnd = m_layers.constEnd();
for (auto iter = m_layers.constBegin(); iter != iterEnd; ++iter) {
QVector<Layer *>::const_iterator iterEnd = m_layers.constEnd();
for (QVector<Layer *>::const_iterator iter = m_layers.constBegin(); iter != iterEnd; ++iter) {
Layer *layer = *iter;
if (layer->isEmpty()) {
continue;
@ -1291,8 +1291,8 @@ EventDataType gGraph::physMinY()
//if (m_enforceMinY) return rmin_y=f_miny;
auto iterEnd = m_layers.constEnd();
for (auto iter = m_layers.constBegin(); iter != iterEnd; ++iter) {
QVector<Layer *>::const_iterator iterEnd = m_layers.constEnd();
for (QVector<Layer *>::const_iterator iter = m_layers.constBegin(); iter != iterEnd; ++iter) {
Layer *layer = *iter;
if (layer->isEmpty()) {
continue;
@ -1322,8 +1322,8 @@ EventDataType gGraph::physMaxY()
// if (m_enforceMaxY) return rmax_y=f_maxy;
auto iterEnd = m_layers.constEnd();
for (auto iter = m_layers.constBegin(); iter != iterEnd; ++iter) {
QVector<Layer *>::const_iterator iterEnd = m_layers.constEnd();
for (QVector<Layer *>::const_iterator iter = m_layers.constBegin(); iter != iterEnd; ++iter) {
Layer *layer = *iter;
if (layer->isEmpty()) {
continue;

View File

@ -25,7 +25,7 @@ Day::Day(Machine *m)
}
Day::~Day()
{
for (auto s = sessions.begin(); s != sessions.end(); ++s) {
for (QList<Session *>::iterator s = sessions.begin(); s != sessions.end(); ++s) {
delete(*s);
}
}
@ -35,8 +35,8 @@ MachineType Day::machine_type() const
}
Session *Day::find(SessionID sessid)
{
auto end=sessions.end();
for (auto s = sessions.begin(); s != end; ++s) {
QList<Session *>::iterator end=sessions.end();
for (QList<Session *>::iterator s = sessions.begin(); s != end; ++s) {
if ((*s)->session() == sessid) {
return (*s);
}
@ -59,12 +59,12 @@ EventDataType Day::settings_sum(ChannelID code)
{
EventDataType val = 0;
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session &sess = *(*it);
if (sess.enabled()) {
auto set = sess.settings.find(code);
QHash<ChannelID, QVariant>::iterator set = sess.settings.find(code);
if (set != sess.settings.end()) {
val += set.value().toDouble();
@ -81,8 +81,8 @@ EventDataType Day::settings_max(ChannelID code)
EventDataType max = min;
EventDataType value;
auto end = sessions.end();
for(auto it = sessions.begin(); it < end; ++it) {
QList<Session *>::iterator end = sessions.end();
for(QList<Session *>::iterator it = sessions.begin(); it < end; ++it) {
Session &sess = *(*it);
if (sess.enabled()) {
value = sess.settings.value(code, min).toDouble();
@ -101,9 +101,9 @@ EventDataType Day::settings_min(ChannelID code)
EventDataType min = max;
EventDataType value;
auto end=sessions.end();
QList<Session *>::iterator end=sessions.end();
for(auto it = sessions.begin(); it < end; ++it) {
for(QList<Session *>::iterator it = sessions.begin(); it < end; ++it) {
Session &sess = *(*it);
if (sess.enabled()) {
value = sess.settings.value(code, max).toDouble();
@ -121,11 +121,11 @@ EventDataType Day::settings_avg(ChannelID code)
EventDataType val = 0;
int cnt = 0;
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; it++) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; it++) {
Session &sess = *(*it);
if (sess.enabled()) {
auto set = sess.settings.find(code);
QHash<ChannelID, QVariant>::iterator set = sess.settings.find(code);
if (set != sess.settings.end()) {
val += set.value().toDouble();
@ -143,12 +143,12 @@ EventDataType Day::settings_wavg(ChannelID code)
{
double s0 = 0, s1 = 0, s2 = 0, tmp;
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; it++) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; it++) {
Session &sess = *(*it);
if (sess.enabled()) {
auto set = sess.settings.find(code);
QHash<ChannelID, QVariant>::iterator set = sess.settings.find(code);
if (set != sess.settings.end()) {
s0 = sess.hours();
@ -187,16 +187,16 @@ EventDataType Day::percentile(ChannelID code, EventDataType percentile)
// First Calculate count of all events
bool timeweight;
auto sess_end = sessions.end();
for (auto sess_it = sessions.begin(); sess_it != sess_end; sess_it++) {
QList<Session *>::iterator sess_end = sessions.end();
for (QList<Session *>::iterator sess_it = sessions.begin(); sess_it != sess_end; sess_it++) {
Session &sess = *(*sess_it);
if (!sess.enabled()) { continue; }
auto ei = sess.m_valuesummary.find(code);
QHash<ChannelID, QHash<EventStoreType, EventStoreType> >::iterator ei = sess.m_valuesummary.find(code);
if (ei == sess.m_valuesummary.end()) { continue; }
auto tei = sess.m_timesummary.find(code);
QHash<ChannelID, QHash<EventStoreType, quint32> >::iterator tei = sess.m_timesummary.find(code);
timeweight = (tei != sess.m_timesummary.end());
gain = sess.m_gain[code];
@ -215,17 +215,17 @@ EventDataType Day::percentile(ChannelID code, EventDataType percentile)
//qint64 tval;
if (timeweight) {
auto teival_end = tei.value().end();
for (auto it = tei.value().begin(); it != teival_end; ++it) {
QHash<EventStoreType, quint32>::iterator teival_end = tei.value().end();
for (QHash<EventStoreType, quint32>::iterator it = tei.value().begin(); it != teival_end; ++it) {
value = it.key();
weight = it.value();
SN += weight;
wmap[value] += weight;
}
} else {
auto eival_end = ei.value().end();
QHash<EventStoreType, EventStoreType>::iterator eival_end = ei.value().end();
for (auto it = ei.value().begin(); it != eival_end; ++it) {
for (QHash<EventStoreType, EventStoreType>::iterator it = ei.value().begin(); it != eival_end; ++it) {
value = it.key();
weight = it.value();
@ -241,8 +241,8 @@ EventDataType Day::percentile(ChannelID code, EventDataType percentile)
// Build sorted list of value/counts
ValueCount vc;
auto wmap_end = wmap.end();
for (auto it = wmap.begin(); it != wmap_end; it++) {
QHash<EventStoreType, qint64>::iterator wmap_end = wmap.end();
for (QHash<EventStoreType, qint64>::iterator it = wmap.begin(); it != wmap_end; it++) {
vc.value = EventDataType(it.key()) * gain;
vc.count = it.value();
vc.p = 0;
@ -314,8 +314,8 @@ EventDataType Day::avg(ChannelID code)
// Cache this?
int cnt = 0;
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session &sess = *(*it);
if (sess.enabled() && sess.m_avg.contains(code)) {
@ -334,8 +334,8 @@ EventDataType Day::sum(ChannelID code)
// Cache this?
EventDataType val = 0;
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session &sess = *(*it);
if (sess.enabled() && sess.m_sum.contains(code)) {
@ -351,9 +351,9 @@ EventDataType Day::wavg(ChannelID code)
double s0 = 0, s1 = 0, s2 = 0;
qint64 d;
auto end = sessions.end();
QList<Session *>::iterator end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session &sess = *(*it);
if (sess.enabled() && sess.m_wavg.contains(code)) {
@ -383,8 +383,8 @@ qint64 Day::total_time()
// Remember sessions may overlap..
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session &sess = *(*it);
if (sess.enabled()) {
@ -402,8 +402,8 @@ qint64 Day::total_time()
// This is my implementation of a typical "brace counting" algorithm mentioned here:
// http://stackoverflow.com/questions/7468948/problem-calculating-overlapping-date-ranges
auto rend = range.end();
for (auto rit = range.begin(); rit != rend; ++rit) {
QMultiMap<qint64, bool>::iterator rend = range.end();
for (QMultiMap<qint64, bool>::iterator rit = range.begin(); rit != rend; ++rit) {
b = rit.value();
if (!b) {
@ -430,9 +430,9 @@ qint64 Day::total_time()
bool Day::hasEnabledSessions()
{
auto end = sessions.end();
QList<Session *>::iterator end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
if ((*it)->enabled()) {
return true;
}
@ -463,8 +463,8 @@ qint64 Day::first(ChannelID code)
qint64 date = 0;
qint64 tmp;
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session & sess=*(*it);
if (sess.enabled()) {
@ -488,8 +488,8 @@ qint64 Day::last(ChannelID code)
qint64 date = 0;
qint64 tmp;
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; it++) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; it++) {
Session & sess = *(*it);
if (sess.enabled()) {
@ -514,8 +514,8 @@ EventDataType Day::Min(ChannelID code)
EventDataType tmp;
bool first = true;
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; it++) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; it++) {
Session & sess = *(*it);
if (sess.enabled() && sess.m_min.contains(code)) {
@ -540,8 +540,8 @@ EventDataType Day::physMin(ChannelID code)
EventDataType tmp;
bool first = true;
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session & sess = *(*it);
if (sess.enabled() && sess.m_min.contains(code)) {
@ -564,9 +564,9 @@ bool Day::hasData(ChannelID code, SummaryType type)
{
bool has = false;
auto end = sessions.end();
QList<Session *>::iterator end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session & sess = *(*it);
if (sess.enabled()) {
@ -635,8 +635,8 @@ EventDataType Day::Max(ChannelID code)
EventDataType tmp;
bool first = true;
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session & sess = *(*it);
if (sess.enabled() && sess.m_max.contains(code)) {
@ -661,8 +661,8 @@ EventDataType Day::physMax(ChannelID code)
EventDataType tmp;
bool first = true;
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session & sess = *(*it);
if (sess.enabled() && sess.m_max.contains(code)) {
@ -685,8 +685,8 @@ EventDataType Day::cph(ChannelID code)
//EventDataType h=0;
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session & sess = *(*it);
if (sess.enabled() && sess.m_cnt.contains(code)) {
@ -703,8 +703,8 @@ EventDataType Day::sph(ChannelID code)
EventDataType sum = 0;
EventDataType h = 0;
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session & sess = *(*it);
if (sess.enabled() && sess.m_sum.contains(code)) {
@ -722,8 +722,8 @@ int Day::count(ChannelID code)
{
int sum = 0;
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session & sess = *(*it);
if (sess.enabled()) {
@ -736,12 +736,12 @@ int Day::count(ChannelID code)
bool Day::settingExists(ChannelID id)
{
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session & sess = *(*it);
if (sess.enabled()) {
auto set = sess.settings.find(id);
QHash<ChannelID, QVariant>::iterator set = sess.settings.find(id);
if (set != sess.settings.end()) {
return true;
@ -754,8 +754,8 @@ bool Day::settingExists(ChannelID id)
bool Day::eventsLoaded()
{
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session & sess = *(*it);
if (sess.eventsLoaded()) {
@ -768,8 +768,8 @@ bool Day::eventsLoaded()
bool Day::channelExists(ChannelID id)
{
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session & sess = *(*it);
if (sess.enabled() && sess.eventlist.contains(id)) {
@ -782,9 +782,9 @@ bool Day::channelExists(ChannelID id)
bool Day::channelHasData(ChannelID id)
{
auto end = sessions.end();
QList<Session *>::iterator end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session & sess = *(*it);
if (sess.enabled()) {
@ -820,8 +820,8 @@ qint64 Day::first()
qint64 date = 0;
qint64 tmp;
auto end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
QList<Session *>::iterator end = sessions.end();
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session & sess = *(*it);
if (sess.enabled()) {
@ -846,9 +846,9 @@ qint64 Day::last()
qint64 date = 0;
qint64 tmp;
auto end = sessions.end();
QList<Session *>::iterator end = sessions.end();
for (auto it = sessions.begin(); it != end; ++it) {
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
Session & sess = *(*it);
if (sess.enabled()) {

View File

@ -422,8 +422,8 @@ int PRS1Loader::OpenMachine(Machine *m, QString path, Profile *profile)
new_sessions.clear(); // this hash is used by OpenFile
// for each p0/p1/p2/etc... folder
for (auto p = paths.begin(); p != paths.end(); p++) {
dir.setPath(*p);
for (int p=0; p < size; ++p) {
dir.setPath(paths.at(p));
if (!dir.exists() || !dir.isReadable()) { continue; }
@ -465,7 +465,7 @@ int PRS1Loader::OpenMachine(Machine *m, QString path, Profile *profile)
// Scan through new sessions and parse event and waveform data
// NOTE: this function could be multithreaded.
for (auto it = new_sessions.begin(); it != new_sessions.end(); ++it) {
for (QHash<SessionID, Session *>::iterator it = new_sessions.begin(); it != new_sessions.end(); ++it) {
sid = it.key();
if (sessfiles.contains(sid)) {
@ -497,7 +497,7 @@ int PRS1Loader::OpenMachine(Machine *m, QString path, Profile *profile)
cnt = 0;
// Scan through parsed sessions, do a little cleanup and add to machine object
for (auto it = new_sessions.begin(); it != new_sessions.end(); ++it) {
for (QHash<SessionID, Session *>::iterator it = new_sessions.begin(); it != new_sessions.end(); ++it) {
Session *sess = it.value();
if ((sess->length()) <= 0) {

View File

@ -37,8 +37,8 @@ const QString STR_UnknownModel = "Resmed S9 ???";
const QString & lookupModel(quint16 model)
{
auto end = Resmed_Model_Map.end();
for (auto it = Resmed_Model_Map.begin(); it != end; ++it) {
QHash<QString, QList<quint16> >::iterator end = Resmed_Model_Map.end();
for (QHash<QString, QList<quint16> >::iterator it = Resmed_Model_Map.begin(); it != end; ++it) {
QList<quint16> & list = it.value();
for (int i=0; i < list.size(); ++i) {
if (list.at(i) == model) {
@ -61,7 +61,7 @@ const QString STR_ext_gz = ".gz";
EDFSignal *EDFParser::lookupSignal(ChannelID ch)
{
// Get list of all known foreign language names for this channel
auto channames = resmed_codes.find(ch);
QHash<ChannelID, QStringList>::iterator channames = resmed_codes.find(ch);
if (channames == resmed_codes.end()) {
// no alternatives strings found for this channel
@ -70,7 +70,7 @@ EDFSignal *EDFParser::lookupSignal(ChannelID ch)
// Scan through EDF's list of signals to see if any match
for (int i = 0; i < channames.value().size(); i++) {
auto jj = lookup.find(channames.value()[i]);
QHash<QString, EDFSignal *>::iterator jj = lookup.find(channames.value()[i]);
if (jj == lookup.end()) {
continue;
@ -87,7 +87,7 @@ EDFSignal *EDFParser::lookupSignal(ChannelID ch)
// Check if given string matches any alternative signal names for this channel
bool matchSignal(ChannelID ch, const QString & name)
{
auto channames = resmed_codes.find(ch);
QHash<ChannelID, QStringList>::iterator channames = resmed_codes.find(ch);
if (channames == resmed_codes.end()) {
return false;
@ -121,7 +121,7 @@ EDFParser::EDFParser(QString name)
}
EDFParser::~EDFParser()
{
for (auto s = edfsignals.begin(); s != edfsignals.end(); s++) {
for (QVector<EDFSignal>::iterator s = edfsignals.begin(); s != edfsignals.end(); s++) {
if ((*s).data) { delete [](*s).data; }
}
@ -572,7 +572,7 @@ int ResmedLoader::Open(QString &path, Profile *profile)
///////////////////////////////////////////////////////////////////////////////////
// Parse the idmap into machine objects properties, (overwriting any old values)
///////////////////////////////////////////////////////////////////////////////////
for (auto i = idmap.begin(); i != idmap.end(); i++) {
for (QHash<QString, QString>::iterator i = idmap.begin(); i != idmap.end(); i++) {
m->properties[i.key()] = i.value();
}
@ -1502,8 +1502,8 @@ int ResmedLoader::Open(QString &path, Profile *profile)
hash[CPAP_RespRate] = "RR"; // Is this a setting to force respiratory rate on S/T machines? or an average
hash[CPAP_PresReliefSet] = "Easy-Breathe";
for (auto it = hash.begin(); it != hash.end(); ++it) {
auto a = stredf.lookup.find(it.value());
for (QHash<ChannelID, QString>::iterator it = hash.begin(); it != hash.end(); ++it) {
QHash<QString, EDFSignal *>::iterator a = stredf.lookup.find(it.value());
if (a != stredf.lookup.end()) {
sig = a.value();
sess->settings[it.key()] = EventDataType(sig->data[dn] * sig->gain);

View File

@ -28,7 +28,7 @@ void RegisterLoader(MachineLoader *loader)
}
void DestroyLoaders()
{
for (auto i = m_loaders.begin(); i != m_loaders.end(); i++) {
for (QList<MachineLoader *>::iterator i = m_loaders.begin(); i != m_loaders.end(); i++) {
delete(*i);
}
@ -41,7 +41,7 @@ MachineLoader::MachineLoader()
MachineLoader::~MachineLoader()
{
for (auto m = m_machlist.begin(); m != m_machlist.end(); m++) {
for (QList<Machine *>::iterator m = m_machlist.begin(); m != m_machlist.end(); m++) {
delete *m;
}
}

View File

@ -72,7 +72,7 @@ Profile::~Profile()
delete session;
delete general;
for (auto it = machlist.begin(); it != machlist.end(); it++) {
for (QHash<MachineID, Machine *>::iterator it = machlist.begin(); it != machlist.end(); it++) {
delete it.value();
}
m_opened=false;

View File

@ -248,7 +248,7 @@ void UpdaterWindow::ParseUpdateXML(QIODevice *dev)
QStringList versions;
for (auto it = updateparser.releases.begin(); it != updateparser.releases.end(); ++it) {
for (QHash<QString, Release>::iterator it = updateparser.releases.begin(); it != updateparser.releases.end(); ++it) {
versions.push_back(it.key());
}

View File

@ -117,8 +117,8 @@ MainWindow::MainWindow(QWidget *parent) :
ui->action_Screenshot->setEnabled(false);
#endif
#endif
auto machines = p_profile->GetMachines(MT_CPAP);
for (auto it = machines.begin(); it != machines.end(); ++it) {
QList<Machine *> machines = p_profile->GetMachines(MT_CPAP);
for (QList<Machine *>::iterator it = machines.begin(); it != machines.end(); ++it) {
QString mclass=(*it)->GetClass();
if (mclass == STR_MACH_ResMed) {
qDebug() << "ResMed machine found.. locking Session splitting capabilities";

View File

@ -70,8 +70,8 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) :
}*/
}
auto machines = p_profile->GetMachines(MT_CPAP);
for (auto it = machines.begin(); it != machines.end(); ++it) {
QList<Machine *> machines = p_profile->GetMachines(MT_CPAP);
for (QList<Machine *>::iterator it = machines.begin(); it != machines.end(); ++it) {
QString mclass=(*it)->GetClass();
if (mclass == STR_MACH_ResMed) {
ui->combineSlider->setEnabled(false);

View File

@ -541,7 +541,7 @@ QString Statistics::GenerateHTML()
QList<Period> periods;
bool skipsection = false;;
for (auto i = rows.begin(); i != rows.end(); ++i) {
for (QList<StatisticsRow>::iterator i = rows.begin(); i != rows.end(); ++i) {
StatisticsRow &row = (*i);
QString name;

View File

@ -127,14 +127,12 @@ void initTranslations(QSettings & settings) {
layout2.addWidget(&lang_combo, 1);
layout2.addWidget(&lang_okbtn);
for (auto it = langNames.begin(); it != langNames.end(); ++it) {
for (QHash<QString, QString>::iterator it = langNames.begin(); it != langNames.end(); ++it) {
const QString & code = it.key();
const QString & name = it.value();
lang_combo.addItem(name, code);
}
langsel.connect(&lang_okbtn, SIGNAL(clicked()), &langsel, SLOT(close()));
langsel.exec();