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
9ef11006
Commit
9ef11006
authored
15 years ago
by
dt
Browse files
Options
Downloads
Patches
Plain Diff
Add some (disabled) debug output
parent
551114de
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/qt4projectmanager/qtuicodemodelsupport.cpp
+26
-12
26 additions, 12 deletions
src/plugins/qt4projectmanager/qtuicodemodelsupport.cpp
with
26 additions
and
12 deletions
src/plugins/qt4projectmanager/qtuicodemodelsupport.cpp
+
26
−
12
View file @
9ef11006
...
@@ -50,13 +50,15 @@ Qt4UiCodeModelSupport::Qt4UiCodeModelSupport(CppTools::CppModelManagerInterface
...
@@ -50,13 +50,15 @@ Qt4UiCodeModelSupport::Qt4UiCodeModelSupport(CppTools::CppModelManagerInterface
m_fileName
(
uiHeaderFile
),
m_fileName
(
uiHeaderFile
),
m_updateIncludingFiles
(
false
)
m_updateIncludingFiles
(
false
)
{
{
// qDebug()<<"ctor Qt4UiCodeModelSupport for"<<m_sourceName;
if
(
debug
)
qDebug
()
<<
"ctor Qt4UiCodeModelSupport for"
<<
m_sourceName
<<
uiHeaderFile
;
init
();
init
();
}
}
Qt4UiCodeModelSupport
::~
Qt4UiCodeModelSupport
()
Qt4UiCodeModelSupport
::~
Qt4UiCodeModelSupport
()
{
{
// qDebug()<<"dtor ~Qt4UiCodeModelSupport for"<<m_sourceName;
if
(
debug
)
qDebug
()
<<
"dtor ~Qt4UiCodeModelSupport for"
<<
m_sourceName
;
}
}
void
Qt4UiCodeModelSupport
::
init
()
void
Qt4UiCodeModelSupport
::
init
()
...
@@ -67,7 +69,8 @@ void Qt4UiCodeModelSupport::init()
...
@@ -67,7 +69,8 @@ void Qt4UiCodeModelSupport::init()
if
(
uiHeaderTime
.
isValid
()
&&
(
uiHeaderTime
>
sourceTime
))
{
if
(
uiHeaderTime
.
isValid
()
&&
(
uiHeaderTime
>
sourceTime
))
{
QFile
file
(
m_fileName
);
QFile
file
(
m_fileName
);
if
(
file
.
open
(
QFile
::
ReadOnly
))
{
if
(
file
.
open
(
QFile
::
ReadOnly
))
{
// qDebug()<<"ui*h file is more recent then source file, using information from ui*h file"<<m_fileName;
if
(
debug
)
qDebug
()
<<
"ui*h file is more recent then source file, using information from ui*h file"
<<
m_fileName
;
QTextStream
stream
(
&
file
);
QTextStream
stream
(
&
file
);
m_contents
=
stream
.
readAll
().
toUtf8
();
m_contents
=
stream
.
readAll
().
toUtf8
();
m_cacheTime
=
uiHeaderTime
;
m_cacheTime
=
uiHeaderTime
;
...
@@ -75,17 +78,20 @@ void Qt4UiCodeModelSupport::init()
...
@@ -75,17 +78,20 @@ void Qt4UiCodeModelSupport::init()
}
}
}
}
// qDebug()<<"ui*h file not found, or not recent enough, trying to create it on the fly";
if
(
debug
)
qDebug
()
<<
"ui*h file not found, or not recent enough, trying to create it on the fly"
;
QFile
file
(
m_sourceName
);
QFile
file
(
m_sourceName
);
if
(
file
.
open
(
QFile
::
ReadOnly
))
{
if
(
file
.
open
(
QFile
::
ReadOnly
))
{
QTextStream
stream
(
&
file
);
QTextStream
stream
(
&
file
);
const
QString
contents
=
stream
.
readAll
();
const
QString
contents
=
stream
.
readAll
();
if
(
runUic
(
contents
))
{
if
(
runUic
(
contents
))
{
// qDebug()<<"created on the fly";
if
(
debug
)
qDebug
()
<<
"created on the fly"
;
return
;
return
;
}
else
{
}
else
{
// uic run was unsuccesfull
// uic run was unsuccesfull
// qDebug()<<"uic run wasn't succesfull";
if
(
debug
)
qDebug
()
<<
"uic run wasn't succesfull"
;
m_cacheTime
=
QDateTime
();
m_cacheTime
=
QDateTime
();
m_contents
=
QByteArray
();
m_contents
=
QByteArray
();
// and if the header file wasn't there, next time we need to update
// and if the header file wasn't there, next time we need to update
...
@@ -95,7 +101,8 @@ void Qt4UiCodeModelSupport::init()
...
@@ -95,7 +101,8 @@ void Qt4UiCodeModelSupport::init()
return
;
return
;
}
}
}
else
{
}
else
{
// qDebug()<<"Could open "<<m_sourceName<<"needed for the cpp model";
if
(
debug
)
qDebug
()
<<
"Could open "
<<
m_sourceName
<<
"needed for the cpp model"
;
m_contents
=
QByteArray
();
m_contents
=
QByteArray
();
}
}
}
}
...
@@ -114,6 +121,10 @@ void Qt4UiCodeModelSupport::setFileName(const QString &name)
...
@@ -114,6 +121,10 @@ void Qt4UiCodeModelSupport::setFileName(const QString &name)
{
{
if
(
m_fileName
==
name
&&
m_cacheTime
.
isValid
())
if
(
m_fileName
==
name
&&
m_cacheTime
.
isValid
())
return
;
return
;
if
(
debug
)
qDebug
()
<<
"Qt4UiCodeModelSupport::setFileName"
<<
name
;
m_fileName
=
name
;
m_fileName
=
name
;
m_contents
.
clear
();
m_contents
.
clear
();
m_cacheTime
=
QDateTime
();
m_cacheTime
=
QDateTime
();
...
@@ -156,12 +167,14 @@ void Qt4UiCodeModelSupport::updateFromEditor(const QString &formEditorContents)
...
@@ -156,12 +167,14 @@ void Qt4UiCodeModelSupport::updateFromEditor(const QString &formEditorContents)
void
Qt4UiCodeModelSupport
::
updateFromBuild
()
void
Qt4UiCodeModelSupport
::
updateFromBuild
()
{
{
// qDebug()<<"Qt4UiCodeModelSupport::updateFromBuild() for file"<<m_sourceName;
if
(
debug
)
qDebug
()
<<
"Qt4UiCodeModelSupport::updateFromBuild() for file"
<<
m_sourceName
;
// This is mostly a fall back for the cases when uic couldn't be run
// This is mostly a fall back for the cases when uic couldn't be run
// it pays special attention to the case where a ui_*h was newly created
// it pays special attention to the case where a ui_*h was newly created
QDateTime
sourceTime
=
QFileInfo
(
m_sourceName
).
lastModified
();
QDateTime
sourceTime
=
QFileInfo
(
m_sourceName
).
lastModified
();
if
(
m_cacheTime
.
isValid
()
&&
m_cacheTime
>=
sourceTime
)
{
if
(
m_cacheTime
.
isValid
()
&&
m_cacheTime
>=
sourceTime
)
{
// qDebug()<<"Cache is still more recent then source";
if
(
debug
)
qDebug
()
<<
"Cache is still more recent then source"
;
return
;
return
;
}
else
{
}
else
{
QFileInfo
fi
(
m_fileName
);
QFileInfo
fi
(
m_fileName
);
...
@@ -169,7 +182,8 @@ void Qt4UiCodeModelSupport::updateFromBuild()
...
@@ -169,7 +182,8 @@ void Qt4UiCodeModelSupport::updateFromBuild()
if
(
uiHeaderTime
.
isValid
()
&&
(
uiHeaderTime
>
sourceTime
))
{
if
(
uiHeaderTime
.
isValid
()
&&
(
uiHeaderTime
>
sourceTime
))
{
if
(
m_cacheTime
>=
uiHeaderTime
)
if
(
m_cacheTime
>=
uiHeaderTime
)
return
;
return
;
// qDebug()<<"found ui*h updating from it";
if
(
debug
)
qDebug
()
<<
"found ui*h updating from it"
;
QFile
file
(
m_fileName
);
QFile
file
(
m_fileName
);
if
(
file
.
open
(
QFile
::
ReadOnly
))
{
if
(
file
.
open
(
QFile
::
ReadOnly
))
{
...
@@ -180,8 +194,8 @@ void Qt4UiCodeModelSupport::updateFromBuild()
...
@@ -180,8 +194,8 @@ void Qt4UiCodeModelSupport::updateFromBuild()
return
;
return
;
}
}
}
}
if
(
debug
)
//
qDebug()<<"ui*h not found or not more recent then source not changing anything";
qDebug
()
<<
"ui*h not found or not more recent then source not changing anything"
;
}
}
}
}
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