Skip to content
Snippets Groups Projects
Commit 50a6c7b6 authored by andreas's avatar andreas
Browse files

added directory separator to path completion for dirs (thanks Marco for

the code)


git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/branches/new_shell@2361 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent fd1ce482
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,7 @@ QString OstCompleterBase::GetCommonMatch()
}
QStringList matches;
for(int i=0;i<completionCount();++i){
setCurrentRow(i);
setCurrentRow(i);
matches.append(currentCompletion().remove(0,completionPrefix().length()));
}
QString common_match;
......
......@@ -100,7 +100,7 @@ PythonShellWidget::PythonShellWidget(QWidget* parent):
SLOT(SetCompletionPrefix(const QString&)));
path_completer_->setWidget(viewport());
connect(path_completer_,SIGNAL(activated(const QString&)),this,
SLOT(InsertCompletion(const QString&)));
SLOT(InsertPathCompletion(const QString&)));
connect(path_completer_,SIGNAL(recomplete(const QString&)),this,
SLOT(Recomplete(const QString&)));
connect(this,SIGNAL(RequestPathCompletion(const QRect&,bool)),path_completer_,
......@@ -361,6 +361,13 @@ void PythonShellWidget::InsertCompletion(const QString& completion)
tc.insertText(completion);
setTextCursor(tc);
}
void PythonShellWidget::InsertPathCompletion(const QString& completion)
{
InsertCompletion(completion);
if(QFileInfo(completion).isDir()){
textCursor().insertText(QDir::separator());
}
}
void PythonShellWidget::AppendOutput(unsigned int id,const QString& output)
......
......@@ -67,6 +67,7 @@ signals:
public slots:
void InsertCompletion(const QString& completion);
void InsertPathCompletion(const QString& completion);
void AppendOutput(unsigned int id,const QString& output);
void AppendError(unsigned int id,const QString& output);
void OutputFinished(unsigned int id, bool error);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment