src/config.cpp

changeset 21
99225eac33ba
parent 20
a5457405cc9b
child 25
256bb5c6b77f
equal deleted inserted replaced
20:a5457405cc9b 21:99225eac33ba
82 // ----------------------------------------------------------------------------- 82 // -----------------------------------------------------------------------------
83 void ConfigBox::initVersions() { 83 void ConfigBox::initVersions() {
84 m_releaseLayout = new QFormLayout (ui->zandronumVersions); 84 m_releaseLayout = new QFormLayout (ui->zandronumVersions);
85 m_testLayout = new QFormLayout (ui->betaVersions); 85 m_testLayout = new QFormLayout (ui->betaVersions);
86 86
87 for (const var& ver : cfg::devBuildNames) 87 for (const QVariant& ver : cfg::devBuildNames)
88 addVersion (ver.toString(), false); 88 addVersion (ver.toString(), false);
89 89
90 for (const var& rel : cfg::releaseNames) 90 for (const QVariant& rel : cfg::releaseNames)
91 addVersion (rel.toString(), true); 91 addVersion (rel.toString(), true);
92 } 92 }
93 93
94 // ============================================================================= 94 // =============================================================================
95 // ----------------------------------------------------------------------------- 95 // -----------------------------------------------------------------------------
116 // ============================================================================= 116 // =============================================================================
117 // ----------------------------------------------------------------------------- 117 // -----------------------------------------------------------------------------
118 void ConfigBox::initFromSettings() { 118 void ConfigBox::initFromSettings() {
119 ui->wad_pathsList->clear(); 119 ui->wad_pathsList->clear();
120 120
121 for (const var& it : cfg::wadpaths) 121 for (const QVariant& it : cfg::wadpaths)
122 addPath (it.toString()); 122 addPath (it.toString());
123 123
124 int i = 0; 124 int i = 0;
125 125
126 for (const var& ver : getVersions()) 126 for (const QVariant& ver : getVersions())
127 m_zanBinaries[i++]->setText (cfg::binaryPaths[ver.toString()].toString()); 127 m_zanBinaries[i++]->setText (cfg::binaryPaths[ver.toString()].toString());
128 128
129 ui->noDemoPrompt->setChecked (cfg::noprompt); 129 ui->noDemoPrompt->setChecked (cfg::noprompt);
130 } 130 }
131 131
139 139
140 cfg::wadpaths = wadPathList; 140 cfg::wadpaths = wadPathList;
141 cfg::noprompt = ui->noDemoPrompt->isChecked(); 141 cfg::noprompt = ui->noDemoPrompt->isChecked();
142 142
143 int i = 0; 143 int i = 0;
144 for (const var& ver : getVersions()) 144 for (const QVariant& ver : getVersions())
145 cfg::binaryPaths[ver.toString()] = m_zanBinaries[i++]->text(); 145 cfg::binaryPaths[ver.toString()] = m_zanBinaries[i++]->text();
146 146
147 cfg::save(); 147 cfg::save();
148 } 148 }
149 149

mercurial