From cc35cad557b7e40e68cfb404f2e41079fea5a33b Mon Sep 17 00:00:00 2001 From: cerf Date: Fri, 25 Mar 2011 10:12:51 +0100 Subject: [PATCH] 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 --- src/plugins/vcsbase/vcsbaseclient.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index 496c86ff3d0..66f0c4b2ec3 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -399,7 +399,9 @@ void VCSBaseClient::view(const QString &source, const QString &id) VCSBase::VCSBaseEditorWidget *editor = createVCSEditor(kind, title, source, true, "view", id); - QSharedPointer job(new VCSJob(QFileInfo(source).absolutePath(), args, editor)); + const QFileInfo fi(source); + const QString workingDirPath = fi.isFile() ? fi.absolutePath() : source; + QSharedPointer job(new VCSJob(workingDirPath, args, editor)); enqueueJob(job); }