aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2014-01-12 22:30:31 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-25 21:53:44 (GMT)
commit4bfbcf0bbf3c6e4375d1745c210a2d811e9f7fb9 (patch)
tree8edab8f4957132999751e85b1ab910d0c4a4e004
parent612f27883d00f43b9c3b328d0dd481f26c1d924b (diff)
build plugin: fix stuff broken recently
-save the directory entered by the user in the lineedit -save the modifications done by the user to the target set name targetSelected() has to be called explicitely, because it is not selected if previously target set index 0 was active and we change again to index 0. Alex
-rw-r--r--addons/katebuild-plugin/plugin_katebuild.cpp31
-rw-r--r--addons/katebuild-plugin/plugin_katebuild.h2
2 files changed, 31 insertions, 2 deletions
diff --git a/addons/katebuild-plugin/plugin_katebuild.cpp b/addons/katebuild-plugin/plugin_katebuild.cpp
index 375171a..7aae225 100644
--- a/addons/katebuild-plugin/plugin_katebuild.cpp
+++ b/addons/katebuild-plugin/plugin_katebuild.cpp
@@ -181,10 +181,11 @@ KateBuildView::KateBuildView(KTextEditor::Plugin *plugin, KTextEditor::MainWindo
connect(m_proc, SIGNAL(readyReadStandardOutput()),this, SLOT(slotReadReadyStdOut()));
connect(m_targetsUi->targetCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(targetSelected(int)));
- connect(m_targetsUi->targetCombo, SIGNAL(editTextChanged(QString)), this, SLOT(targetsChanged()));
+ connect(m_targetsUi->targetCombo->lineEdit(), SIGNAL(textEdited(QString)), this, SLOT(slotTargetSetNameChanged(const QString&)));
connect(m_targetsUi->newTarget, SIGNAL(clicked()), this, SLOT(targetNew()));
connect(m_targetsUi->copyTarget, SIGNAL(clicked()), this, SLOT(targetCopy()));
connect(m_targetsUi->deleteTarget, SIGNAL(clicked()), this, SLOT(targetDelete()));
+ connect(m_targetsUi->buildDir, SIGNAL(textChanged(const QString&)), this, SLOT(slotBuildDirChanged(const QString&)));
connect(m_win, SIGNAL(unhandledShortcutOverride(QEvent*)),
this, SLOT(handleEsc(QEvent*)));
@@ -302,14 +303,15 @@ void KateBuildView::readSessionConfig(const KConfigGroup& cg)
m_targetsUi->targetCombo->addItem(m_targetList[i].name);
}
- m_targetsUi->targetCombo->blockSignals(false);
// update the targets menu
targetsChanged();
// select the last active target if possible
m_targetsUi->targetCombo->setCurrentIndex(tmpIndex);
+ targetSelected(tmpIndex);
+ m_targetsUi->targetCombo->blockSignals(false);
}
/******************************************************************/
@@ -879,6 +881,17 @@ void KateBuildView::slotBrowseClicked()
}
/******************************************************************/
+void KateBuildView::slotBuildDirChanged(const QString& dir)
+{
+ TargetSet* tgtSet = currentTargetSet();
+ if (tgtSet == 0) {
+ return;
+ }
+
+ tgtSet->defaultDir = dir;
+}
+
+/******************************************************************/
void KateBuildView::slotCellChanged(int row, int column)
{
TargetSet* tgtSet = currentTargetSet();
@@ -1065,6 +1078,7 @@ void KateBuildView::targetSelected(int index)
// Set the new values
bool wasBlocked = m_targetsUi->targetsList->blockSignals(true);
+ bool dirWasBlocked = m_targetsUi->buildDir->blockSignals(true);
m_targetsUi->buildDir->setText(m_targetList[index].defaultDir);
@@ -1077,6 +1091,7 @@ void KateBuildView::targetSelected(int index)
}
m_targetsUi->targetsList->blockSignals(wasBlocked);
+ m_targetsUi->buildDir->blockSignals(dirWasBlocked);
m_targetsUi->targetsList->resizeColumnsToContents();
@@ -1114,6 +1129,18 @@ void KateBuildView::setTargetRowContents(int row, const TargetSet& tgtSet, const
/******************************************************************/
+void KateBuildView::slotTargetSetNameChanged(const QString& name)
+{
+ TargetSet* tgtSet = currentTargetSet();
+ if (tgtSet == 0) {
+ return;
+ }
+
+ tgtSet->name = name;
+ targetsChanged();
+}
+
+/******************************************************************/
void KateBuildView::targetsChanged()
{
QStringList items;
diff --git a/addons/katebuild-plugin/plugin_katebuild.h b/addons/katebuild-plugin/plugin_katebuild.h
index aa3e2f2..43fc5e2 100644
--- a/addons/katebuild-plugin/plugin_katebuild.h
+++ b/addons/katebuild-plugin/plugin_katebuild.h
@@ -99,6 +99,8 @@ class KateBuildView : public QObject, public KXMLGUIClient, public KTextEditor::
void targetCopy();
void targetDelete();
void targetNext();
+ void slotBuildDirChanged(const QString& dir);
+ void slotTargetSetNameChanged(const QString& name);
void slotShowErrors(bool);
void slotShowWarnings(bool);