Skip to content

Commit

Permalink
Only emit the signal when the data has changed
Browse files Browse the repository at this point in the history
Refs #11377
  • Loading branch information
DanNixon committed Mar 17, 2015
1 parent ed7b868 commit 7e9ac8f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Code/Mantid/MantidQt/MantidWidgets/src/DataSelector.cpp
Expand Up @@ -24,7 +24,7 @@ namespace MantidQt
connect(m_uiForm.pbLoadFile, SIGNAL(clicked()), this, SIGNAL(loadClicked()));

//data selected changes
connect(m_uiForm.rfFileInput, SIGNAL(filesFound()), this, SLOT(handleFileInput()));
connect(m_uiForm.rfFileInput, SIGNAL(filesFoundChanged()), this, SLOT(handleFileInput()));
connect(m_uiForm.wsWorkspaceInput, SIGNAL(currentIndexChanged(int)), this, SLOT(handleWorkspaceInput()));
connect(m_uiForm.pbLoadFile, SIGNAL(clicked()), this, SLOT(handleFileInput()));

Expand Down Expand Up @@ -66,7 +66,7 @@ namespace MantidQt
/**
* Get if the file selector is currently being shown.
*
* @return :: true if it is visible, otherwise false
* @return :: true if it is visible, otherwise false
*/
bool DataSelector::isFileSelectorVisible() const
{
Expand All @@ -77,7 +77,7 @@ namespace MantidQt
/**
* Get if the workspace selector is currently being shown.
*
* @return :: true if it is visible, otherwise false
* @return :: true if it is visible, otherwise false
*/
bool DataSelector::isWorkspaceSelectorVisible() const
{
Expand Down Expand Up @@ -107,7 +107,7 @@ namespace MantidQt
if(isValid && m_autoLoad)
{
const QString wsName = getCurrentDataName();

if(!AnalysisDataService::Instance().doesExist(wsName.toStdString()))
{
//attempt to reload if we can
Expand All @@ -118,9 +118,9 @@ namespace MantidQt
loadAlg->setProperty("Filename", filepath.toStdString());
loadAlg->setProperty("OutputWorkspace", wsName.toStdString());
loadAlg->execute();

isValid = AnalysisDataService::Instance().doesExist(wsName.toStdString());

if(!isValid)
{
m_uiForm.rfFileInput->setFileProblem("The specified workspace is missing from the analysis data service");
Expand Down Expand Up @@ -448,18 +448,18 @@ namespace MantidQt
*/
void DataSelector::dropEvent(QDropEvent *de)
{
const QMimeData *mimeData = de->mimeData();
const QMimeData *mimeData = de->mimeData();
auto before_action = de->dropAction();

if (de->mimeData() && mimeData->text().contains(" = mtd[\"")){
m_uiForm.wsWorkspaceInput->dropEvent(de);
if (de->dropAction() == before_action){
if (de->dropAction() == before_action){
m_uiForm.cbInputType->setCurrentIndex(1);
return;
}
de->setDropAction(before_action);
de->setDropAction(before_action);
}

m_uiForm.rfFileInput->dropEvent(de);
if (de->dropAction() == before_action){
m_uiForm.cbInputType->setCurrentIndex(0);
Expand Down

0 comments on commit 7e9ac8f

Please sign in to comment.