Changeset View
Changeset View
Standalone View
Standalone View
projectmanagers/cmake/settings/cmakepreferences.cpp
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Line(s) | 119 | { | |||
---|---|---|---|---|---|
121 | m_prefsUi->installationPrefix->setText(CMake::currentInstallDir(m_project).toLocalFile()); | 121 | m_prefsUi->installationPrefix->setText(CMake::currentInstallDir(m_project).toLocalFile()); | ||
122 | m_prefsUi->installationPrefix->setMode(KFile::Directory); | 122 | m_prefsUi->installationPrefix->setMode(KFile::Directory); | ||
123 | const QString buildType = CMake::currentBuildType(m_project); | 123 | const QString buildType = CMake::currentBuildType(m_project); | ||
124 | if (m_prefsUi->buildType->findText(buildType) == -1) { | 124 | if (m_prefsUi->buildType->findText(buildType) == -1) { | ||
125 | m_prefsUi->buildType->addItem(buildType); | 125 | m_prefsUi->buildType->addItem(buildType); | ||
126 | } | 126 | } | ||
127 | m_prefsUi->buildType->setCurrentIndex(m_prefsUi->buildType->findText(buildType)); | 127 | m_prefsUi->buildType->setCurrentIndex(m_prefsUi->buildType->findText(buildType)); | ||
128 | m_prefsUi->extraArguments->setEditText(CMake::currentExtraArguments(m_project)); | 128 | m_prefsUi->extraArguments->setEditText(CMake::currentExtraArguments(m_project)); | ||
129 | m_prefsUi->cMakeExecutable->setText(CMake::currentCmakeExecutable(m_project)); | ||||
129 | } | 130 | } | ||
130 | 131 | | |||
131 | void CMakePreferences::reset() | 132 | void CMakePreferences::reset() | ||
132 | { | 133 | { | ||
133 | qCDebug(CMAKE) << "********loading"; | 134 | qCDebug(CMAKE) << "********loading"; | ||
134 | m_prefsUi->buildDirs->clear(); | 135 | m_prefsUi->buildDirs->clear(); | ||
135 | m_prefsUi->buildDirs->addItems( CMake::allBuildDirs(m_project) ); | 136 | m_prefsUi->buildDirs->addItems( CMake::allBuildDirs(m_project) ); | ||
136 | CMake::removeOverrideBuildDirIndex(m_project); // addItems() triggers buildDirChanged(), compensate for it | 137 | CMake::removeOverrideBuildDirIndex(m_project); // addItems() triggers buildDirChanged(), compensate for it | ||
Show All 26 Lines | 151 | { | |||
163 | 164 | | |||
164 | CMake::setCurrentInstallDir( m_project, Path(m_prefsUi->installationPrefix->text()) ); | 165 | CMake::setCurrentInstallDir( m_project, Path(m_prefsUi->installationPrefix->text()) ); | ||
165 | const QString buildType = m_prefsUi->buildType->currentText(); | 166 | const QString buildType = m_prefsUi->buildType->currentText(); | ||
166 | if (m_prefsUi->buildType->findText(buildType) == -1) { | 167 | if (m_prefsUi->buildType->findText(buildType) == -1) { | ||
167 | m_prefsUi->buildType->addItem(buildType); | 168 | m_prefsUi->buildType->addItem(buildType); | ||
168 | } | 169 | } | ||
169 | CMake::setCurrentBuildType( m_project, buildType ); | 170 | CMake::setCurrentBuildType( m_project, buildType ); | ||
170 | CMake::setCurrentExtraArguments( m_project, m_prefsUi->extraArguments->currentText() ); | 171 | CMake::setCurrentExtraArguments( m_project, m_prefsUi->extraArguments->currentText() ); | ||
172 | CMake::setCurrentCmakeExecutable( m_project, m_prefsUi->cMakeExecutable->text() ); | ||||
173 | | ||||
171 | 174 | | |||
172 | qCDebug(CMAKE) << "writing to cmake config: using builddir " << CMake::currentBuildDirIndex(m_project); | 175 | qCDebug(CMAKE) << "writing to cmake config: using builddir " << CMake::currentBuildDirIndex(m_project); | ||
173 | qCDebug(CMAKE) << "writing to cmake config: builddir path " << CMake::currentBuildDir(m_project); | 176 | qCDebug(CMAKE) << "writing to cmake config: builddir path " << CMake::currentBuildDir(m_project); | ||
174 | qCDebug(CMAKE) << "writing to cmake config: installdir " << CMake::currentInstallDir(m_project); | 177 | qCDebug(CMAKE) << "writing to cmake config: installdir " << CMake::currentInstallDir(m_project); | ||
175 | qCDebug(CMAKE) << "writing to cmake config: build type " << CMake::currentBuildType(m_project); | 178 | qCDebug(CMAKE) << "writing to cmake config: build type " << CMake::currentBuildType(m_project); | ||
176 | qCDebug(CMAKE) << "writing to cmake config: environment " << CMake::currentEnvironment(m_project); | 179 | qCDebug(CMAKE) << "writing to cmake config: environment " << CMake::currentEnvironment(m_project); | ||
180 | qCDebug(CMAKE) << "writing to cmake config: cmake executable " << CMake::currentCmakeExecutable(m_project); | ||||
181 | | ||||
177 | 182 | | |||
178 | //We run cmake on the builddir to generate it | 183 | //We run cmake on the builddir to generate it | ||
179 | configure(); | 184 | configure(); | ||
180 | } | 185 | } | ||
181 | 186 | | |||
182 | void CMakePreferences::defaults() | 187 | void CMakePreferences::defaults() | ||
183 | { | 188 | { | ||
184 | // do nothing | 189 | // do nothing | ||
▲ Show 20 Lines • Show All 162 Lines • ▼ Show 20 Line(s) | 332 | { | |||
347 | 352 | | |||
348 | qCDebug(CMAKE) << "removing from cmake config: using builddir " << curr; | 353 | qCDebug(CMAKE) << "removing from cmake config: using builddir " << curr; | ||
349 | qCDebug(CMAKE) << "removing from cmake config: builddir path " << removedPath; | 354 | qCDebug(CMAKE) << "removing from cmake config: builddir path " << removedPath; | ||
350 | qCDebug(CMAKE) << "removing from cmake config: installdir " << CMake::currentInstallDir( m_project ); | 355 | qCDebug(CMAKE) << "removing from cmake config: installdir " << CMake::currentInstallDir( m_project ); | ||
351 | qCDebug(CMAKE) << "removing from cmake config: extra args" << CMake::currentExtraArguments( m_project ); | 356 | qCDebug(CMAKE) << "removing from cmake config: extra args" << CMake::currentExtraArguments( m_project ); | ||
352 | qCDebug(CMAKE) << "removing from cmake config: buildtype " << CMake::currentBuildType( m_project ); | 357 | qCDebug(CMAKE) << "removing from cmake config: buildtype " << CMake::currentBuildType( m_project ); | ||
353 | qCDebug(CMAKE) << "removing from cmake config: environment " << CMake::currentEnvironment( m_project ); | 358 | qCDebug(CMAKE) << "removing from cmake config: environment " << CMake::currentEnvironment( m_project ); | ||
354 | 359 | | |||
360 | | ||||
355 | CMake::removeBuildDirConfig(m_project); | 361 | CMake::removeBuildDirConfig(m_project); | ||
356 | m_prefsUi->buildDirs->removeItem( curr ); // this triggers buildDirChanged() | 362 | m_prefsUi->buildDirs->removeItem( curr ); // this triggers buildDirChanged() | ||
357 | if(m_prefsUi->buildDirs->count()==0) | 363 | if(m_prefsUi->buildDirs->count()==0) | ||
358 | m_prefsUi->removeBuildDir->setEnabled(false); | 364 | m_prefsUi->removeBuildDir->setEnabled(false); | ||
359 | 365 | | |||
360 | emit changed(); | 366 | emit changed(); | ||
361 | } | 367 | } | ||
362 | 368 | | |||
Show All 38 Lines |