Differential D1047 Diff 2606 languages/plugins/custom-definesandincludes/kcm_widget/projectpathswidget.cpp
Changeset View
Changeset View
Standalone View
Standalone View
languages/plugins/custom-definesandincludes/kcm_widget/projectpathswidget.cpp
Show All 25 Lines | |||||
26 | 26 | | |||
27 | #include <util/environmentgrouplist.h> | 27 | #include <util/environmentgrouplist.h> | ||
28 | #include <interfaces/iproject.h> | 28 | #include <interfaces/iproject.h> | ||
29 | #include <KLocalizedString> | 29 | #include <KLocalizedString> | ||
30 | #include <interfaces/icore.h> | 30 | #include <interfaces/icore.h> | ||
31 | #include <interfaces/iplugincontroller.h> | 31 | #include <interfaces/iplugincontroller.h> | ||
32 | 32 | | |||
33 | #include "../compilerprovider/compilerprovider.h" | 33 | #include "../compilerprovider/compilerprovider.h" | ||
34 | #include "../compilerprovider/settingsmanager.h" | ||||
34 | 35 | | |||
35 | #include "ui_projectpathswidget.h" | 36 | #include "ui_projectpathswidget.h" | ||
36 | #include "ui_batchedit.h" | 37 | #include "ui_batchedit.h" | ||
37 | #include "projectpathsmodel.h" | 38 | #include "projectpathsmodel.h" | ||
38 | #include "debugarea.h" | 39 | #include "debugarea.h" | ||
39 | 40 | | |||
40 | using namespace KDevelop; | 41 | using namespace KDevelop; | ||
41 | 42 | | |||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Line(s) | |||||
125 | void ProjectPathsWidget::includesChanged( const QStringList& includes ) | 126 | void ProjectPathsWidget::includesChanged( const QStringList& includes ) | ||
126 | { | 127 | { | ||
127 | definesAndIncludesDebug() << "includes changed"; | 128 | definesAndIncludesDebug() << "includes changed"; | ||
128 | updatePathsModel( includes, ProjectPathsModel::IncludesDataRole ); | 129 | updatePathsModel( includes, ProjectPathsModel::IncludesDataRole ); | ||
129 | } | 130 | } | ||
130 | 131 | | |||
131 | void ProjectPathsWidget::parserArgumentsChanged() | 132 | void ProjectPathsWidget::parserArgumentsChanged() | ||
132 | { | 133 | { | ||
133 | updatePathsModel(ui->parserWidget->parserArguments(), ProjectPathsModel::ParserArgumentsRole); | 134 | updatePathsModel(QVariant::fromValue(ui->parserWidget->parserArguments()), ProjectPathsModel::ParserArgumentsRole); | ||
134 | } | 135 | } | ||
135 | 136 | | |||
136 | void ProjectPathsWidget::updatePathsModel(const QVariant& newData, int role) | 137 | void ProjectPathsWidget::updatePathsModel(const QVariant& newData, int role) | ||
137 | { | 138 | { | ||
138 | QModelIndex idx = pathsModel->index( ui->projectPaths->currentIndex(), 0, QModelIndex() ); | 139 | QModelIndex idx = pathsModel->index( ui->projectPaths->currentIndex(), 0, QModelIndex() ); | ||
139 | if( idx.isValid() ) { | 140 | if( idx.isValid() ) { | ||
140 | bool b = pathsModel->setData( idx, newData, role ); | 141 | bool b = pathsModel->setData( idx, newData, role ); | ||
141 | if( b ) { | 142 | if( b ) { | ||
Show All 11 Lines | 149 | { | |||
153 | const QModelIndex midx = pathsModel->index( index, 0 ); | 154 | const QModelIndex midx = pathsModel->index( index, 0 ); | ||
154 | ui->includesWidget->setIncludes( pathsModel->data( midx, ProjectPathsModel::IncludesDataRole ).toStringList() ); | 155 | ui->includesWidget->setIncludes( pathsModel->data( midx, ProjectPathsModel::IncludesDataRole ).toStringList() ); | ||
155 | ui->definesWidget->setDefines( pathsModel->data( midx, ProjectPathsModel::DefinesDataRole ).value<Defines>() ); | 156 | ui->definesWidget->setDefines( pathsModel->data( midx, ProjectPathsModel::DefinesDataRole ).value<Defines>() ); | ||
156 | 157 | | |||
157 | Q_ASSERT(pathsModel->data(midx, ProjectPathsModel::CompilerDataRole).value<CompilerPointer>()); | 158 | Q_ASSERT(pathsModel->data(midx, ProjectPathsModel::CompilerDataRole).value<CompilerPointer>()); | ||
158 | 159 | | |||
159 | ui->compiler->setCurrentText(pathsModel->data(midx, ProjectPathsModel::CompilerDataRole).value<CompilerPointer>()->name()); | 160 | ui->compiler->setCurrentText(pathsModel->data(midx, ProjectPathsModel::CompilerDataRole).value<CompilerPointer>()->name()); | ||
160 | 161 | | |||
161 | ui->parserWidget->setParserArguments(pathsModel->data(midx, ProjectPathsModel::ParserArgumentsRole ).toString()); | 162 | ui->parserWidget->setParserArguments(pathsModel->data(midx, ProjectPathsModel::ParserArgumentsRole).value<ParserArguments>()); | ||
162 | 163 | | |||
163 | updateEnablements(); | 164 | updateEnablements(); | ||
164 | } | 165 | } | ||
165 | 166 | | |||
166 | void ProjectPathsWidget::clear() | 167 | void ProjectPathsWidget::clear() | ||
167 | { | 168 | { | ||
168 | bool sigDisabled = ui->projectPaths->blockSignals( true ); | 169 | bool sigDisabled = ui->projectPaths->blockSignals( true ); | ||
169 | pathsModel->setPaths( QList<ConfigEntry>() ); | 170 | pathsModel->setPaths( QList<ConfigEntry>() ); | ||
▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines |