forked from qt-creator/qt-creator
VCSBase: fix working dir in VCSBaseClient::view()
The working directory for the job was wrong in the case where the source argument is already a path. The fix tests file/dir nature of the source and ensures a valid path is given to the job command. Merge-request: 281 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -399,7 +399,9 @@ void VCSBaseClient::view(const QString &source, const QString &id)
|
||||
VCSBase::VCSBaseEditorWidget *editor = createVCSEditor(kind, title, source,
|
||||
true, "view", id);
|
||||
|
||||
QSharedPointer<VCSJob> job(new VCSJob(QFileInfo(source).absolutePath(), args, editor));
|
||||
const QFileInfo fi(source);
|
||||
const QString workingDirPath = fi.isFile() ? fi.absolutePath() : source;
|
||||
QSharedPointer<VCSJob> job(new VCSJob(workingDirPath, args, editor));
|
||||
enqueueJob(job);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user