Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
7311e425
Commit
7311e425
authored
Aug 27, 2010
by
Alessandro Portale
Browse files
Replaced enum updateFiles with more logical bool getters.
parent
aaae1420
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.cpp
View file @
7311e425
...
...
@@ -99,10 +99,24 @@ GeneratedFileInfo::GeneratedFileInfo()
,
version
(
-
1
)
,
dataChecksum
(
0
)
,
statedChecksum
(
0
)
,
updateReason
(
Undefined
)
{
}
bool
GeneratedFileInfo
::
isUpToDate
()
const
{
return
!
isOutdated
()
&&
!
wasModified
();
}
bool
GeneratedFileInfo
::
isOutdated
()
const
{
return
version
<
QmlStandaloneApp
::
stubVersion
();
}
bool
GeneratedFileInfo
::
wasModified
()
const
{
return
dataChecksum
!=
statedChecksum
;
}
QmlStandaloneApp
::
QmlStandaloneApp
()
:
m_loadDummyData
(
false
)
,
m_orientation
(
Auto
)
...
...
@@ -635,15 +649,8 @@ QList<GeneratedFileInfo> QmlStandaloneApp::fileUpdates(const QString &mainProFil
data
.
replace
(
'\x0D'
,
""
);
data
.
replace
(
'\x0A'
,
""
);
newFile
.
dataChecksum
=
qChecksum
(
data
.
constData
(),
data
.
length
());
if
(
newFile
.
version
<
stubVersion
())
newFile
.
updateReason
=
GeneratedFileInfo
::
HasOutdatedVersion
;
else
if
(
newFile
.
version
>
stubVersion
())
newFile
.
updateReason
=
GeneratedFileInfo
::
HasFutureVersion
;
else
if
(
newFile
.
dataChecksum
!=
newFile
.
statedChecksum
)
newFile
.
updateReason
=
GeneratedFileInfo
::
ContentChanged
;
else
newFile
.
updateReason
=
GeneratedFileInfo
::
IsUpToDate
;
result
.
append
(
newFile
);
if
(
!
newFile
.
isUpToDate
())
result
.
append
(
newFile
);
}
return
result
;
}
...
...
src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.h
View file @
7311e425
...
...
@@ -88,22 +88,17 @@ struct GeneratedFileInfo
SymbianSvgIconFile
};
enum
UpdateReason
{
Undefined
,
IsUpToDate
,
HasOutdatedVersion
,
HasFutureVersion
,
ContentChanged
};
GeneratedFileInfo
();
bool
isUpToDate
()
const
;
bool
isOutdated
()
const
;
bool
wasModified
()
const
;
File
file
;
QFileInfo
fileInfo
;
int
version
;
quint16
dataChecksum
;
quint16
statedChecksum
;
UpdateReason
updateReason
;
};
class
QmlStandaloneApp
:
public
QObject
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment