Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
fdbdf50c
Commit
fdbdf50c
authored
15 years ago
by
Thorbjørn Lindeijer
Browse files
Options
Downloads
Patches
Plain Diff
Fixed warnings about absolutePath on empty filename in git plugin
Reviewed-by:
Friedemann Kleint
<
Friedemann.Kleint@nokia.com
>
parent
cce26703
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/git/gitplugin.cpp
+15
-14
15 additions, 14 deletions
src/plugins/git/gitplugin.cpp
with
15 additions
and
14 deletions
src/plugins/git/gitplugin.cpp
+
15
−
14
View file @
fdbdf50c
...
...
@@ -427,30 +427,31 @@ void GitPlugin::diffCurrentProject()
QFileInfo
GitPlugin
::
currentFile
()
const
{
QString
fileName
=
m_core
->
fileManager
()
->
currentFile
();
QFileInfo
fileInfo
(
fileName
);
return
fileInfo
;
return
QFileInfo
(
m_core
->
fileManager
()
->
currentFile
());
}
QString
GitPlugin
::
getWorkingDirectory
()
{
QString
workingDirectory
;
if
(
const
ProjectExplorer
::
ProjectExplorerPlugin
*
p
=
ProjectExplorer
::
ProjectExplorerPlugin
::
instance
())
if
(
p
&&
p
->
currentNode
())
workingDirectory
=
QFileInfo
(
p
->
currentNode
()
->
path
()).
absolutePath
();
if
(
const
ProjectExplorer
::
ProjectExplorerPlugin
*
p
=
ProjectExplorer
::
ProjectExplorerPlugin
::
instance
())
{
if
(
p
&&
p
->
currentNode
())
{
const
QString
currentPath
=
p
->
currentNode
()
->
path
();
if
(
!
currentPath
.
isEmpty
())
workingDirectory
=
QFileInfo
(
currentPath
).
absolutePath
();
}
}
if
(
Git
::
Constants
::
debug
>
1
)
qDebug
()
<<
Q_FUNC_INFO
<<
"Project"
<<
workingDirectory
;
if
(
workingDirectory
.
isEmpty
())
workingDirectory
=
QFileInfo
(
m_core
->
fileManager
()
->
currentFile
()).
absolutePath
();
if
(
workingDirectory
.
isEmpty
())
{
const
QString
currentFileName
=
m_core
->
fileManager
()
->
currentFile
();
if
(
!
currentFileName
.
isEmpty
())
workingDirectory
=
QFileInfo
(
currentFileName
).
absolutePath
();
}
if
(
Git
::
Constants
::
debug
>
1
)
qDebug
()
<<
Q_FUNC_INFO
<<
"file"
<<
workingDirectory
;
if
(
workingDirectory
.
isEmpty
())
{
VCSBase
::
VCSBaseOutputWindow
::
instance
()
->
appendError
(
tr
(
"Could not find working directory"
));
return
QString
();
}
return
workingDirectory
;
}
...
...
@@ -469,7 +470,7 @@ void GitPlugin::statusFile()
void
GitPlugin
::
logFile
()
{
const
QFileInfo
fileInfo
=
currentFile
();
const
QFileInfo
fileInfo
=
currentFile
();
const
QString
fileName
=
fileInfo
.
fileName
();
const
QString
workingDirectory
=
fileInfo
.
absolutePath
();
m_gitClient
->
log
(
workingDirectory
,
fileName
);
...
...
@@ -631,7 +632,7 @@ bool GitPlugin::editorAboutToClose(Core::IEditor *iEditor)
tr
(
"Do you want to commit the change?"
),
tr
(
"The commit message check failed. Do you want to commit the change?"
),
&
settings
.
promptToSubmit
,
!
m_submitActionTriggered
);
m_submitActionTriggered
=
false
;
m_submitActionTriggered
=
false
;
switch
(
answer
)
{
case
VCSBase
::
VCSBaseSubmitEditor
::
SubmitCanceled
:
return
false
;
// Keep editing and change file
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment