Skip to content

Commit

Permalink
Small correction in RepoModel
Browse files Browse the repository at this point in the history
  • Loading branch information
gesnerpassos committed Apr 17, 2013
1 parent 2394e42 commit a717baf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Code/Mantid/MantidQt/API/src/RepoModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,13 +466,14 @@ QString RepoModel::fileDescription(const QModelIndex & index){
*/
QString RepoModel::filePath(const QModelIndex & index){
RepoItem * item = static_cast<RepoItem*>(index.internalPointer());
// qDebug() << "Get file path from : " << item->path()<< endl;
Mantid::API::SCRIPTSTATUS state = repo_ptr->fileStatus(item->path().toStdString());

if (state == Mantid::API::REMOTE_ONLY
||
item->row()>1)// item is a directory
return ""; // do not open remote file, just local

if (state == Mantid::API::REMOTE_ONLY)
return "";
Mantid::API::ScriptInfo info = repo_ptr->fileInfo(item->path().toStdString());
if (info.directory)
return "";
QString path = repo_path + "/" + item->path();
return path;
}
Expand Down

0 comments on commit a717baf

Please sign in to comment.