Commit cc35cad5 authored by cerf's avatar cerf Committed by Tobias Hunger
Browse files

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: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent ac61c9a9
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment