Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CMake
CMake
Commits
551fcc23
Commit
551fcc23
authored
Sep 23, 2009
by
Clinton Stimpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compile warnings
parent
290a6e28
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
32 deletions
+36
-32
Source/QtDialog/CMakeSetupDialog.cxx
Source/QtDialog/CMakeSetupDialog.cxx
+13
-13
Source/QtDialog/QCMakeCacheView.cxx
Source/QtDialog/QCMakeCacheView.cxx
+22
-18
Source/QtDialog/QCMakeCacheView.h
Source/QtDialog/QCMakeCacheView.h
+1
-1
No files found.
Source/QtDialog/CMakeSetupDialog.cxx
View file @
551fcc23
...
...
@@ -286,14 +286,14 @@ void CMakeSetupDialog::doConfigure()
QDir
dir
(
bindir
);
if
(
!
dir
.
exists
())
{
QString
m
essage
=
tr
(
"Build directory does not exist, "
QString
m
sg
=
tr
(
"Build directory does not exist, "
"should I create it?"
)
+
"
\n\n
"
+
tr
(
"Directory: "
);
m
essage
+=
bindir
;
m
sg
+=
bindir
;
QString
title
=
tr
(
"Create Directory"
);
QMessageBox
::
StandardButton
btn
;
btn
=
QMessageBox
::
information
(
this
,
title
,
m
essage
,
btn
=
QMessageBox
::
information
(
this
,
title
,
m
sg
,
QMessageBox
::
Yes
|
QMessageBox
::
No
);
if
(
btn
==
QMessageBox
::
No
)
{
...
...
@@ -380,11 +380,11 @@ void CMakeSetupDialog::closeEvent(QCloseEvent* e)
// prompt for close if there are unsaved changes, and we're not busy
if
(
this
->
CacheModified
)
{
QString
m
essage
=
tr
(
"You have changed options but not rebuilt, "
QString
m
sg
=
tr
(
"You have changed options but not rebuilt, "
"are you sure you want to exit?"
);
QString
title
=
tr
(
"Confirm Exit"
);
QMessageBox
::
StandardButton
btn
;
btn
=
QMessageBox
::
critical
(
this
,
title
,
m
essage
,
btn
=
QMessageBox
::
critical
(
this
,
title
,
m
sg
,
QMessageBox
::
Yes
|
QMessageBox
::
No
);
if
(
btn
==
QMessageBox
::
No
)
{
...
...
@@ -395,12 +395,12 @@ void CMakeSetupDialog::closeEvent(QCloseEvent* e)
// don't close if we're busy, unless the user really wants to
if
(
this
->
CurrentState
==
Configuring
)
{
QString
m
essage
=
"You are in the middle of a Configure.
\n
"
QString
m
sg
=
"You are in the middle of a Configure.
\n
"
"If you Exit now the configure information will be lost.
\n
"
"Are you sure you want to Exit?"
;
QString
title
=
tr
(
"Confirm Exit"
);
QMessageBox
::
StandardButton
btn
;
btn
=
QMessageBox
::
critical
(
this
,
title
,
m
essage
,
btn
=
QMessageBox
::
critical
(
this
,
title
,
m
sg
,
QMessageBox
::
Yes
|
QMessageBox
::
No
);
if
(
btn
==
QMessageBox
::
No
)
{
...
...
@@ -540,16 +540,16 @@ void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent)
this
->
ProgressBar
->
setValue
(
qRound
(
percent
*
100
));
}
void
CMakeSetupDialog
::
error
(
const
QString
&
m
essage
)
void
CMakeSetupDialog
::
error
(
const
QString
&
m
sg
)
{
this
->
Output
->
setCurrentCharFormat
(
this
->
ErrorFormat
);
this
->
Output
->
append
(
m
essage
);
this
->
Output
->
append
(
m
sg
);
}
void
CMakeSetupDialog
::
message
(
const
QString
&
m
essage
)
void
CMakeSetupDialog
::
message
(
const
QString
&
m
sg
)
{
this
->
Output
->
setCurrentCharFormat
(
this
->
MessageFormat
);
this
->
Output
->
append
(
m
essage
);
this
->
Output
->
append
(
m
sg
);
}
void
CMakeSetupDialog
::
setEnabledState
(
bool
enabled
)
...
...
@@ -677,9 +677,9 @@ void CMakeSetupDialog::doReloadCache()
void
CMakeSetupDialog
::
doDeleteCache
()
{
QString
title
=
tr
(
"Delete Cache"
);
QString
m
essage
=
"Are you sure you want to delete the cache?"
;
QString
m
sg
=
"Are you sure you want to delete the cache?"
;
QMessageBox
::
StandardButton
btn
;
btn
=
QMessageBox
::
information
(
this
,
title
,
m
essage
,
btn
=
QMessageBox
::
information
(
this
,
title
,
m
sg
,
QMessageBox
::
Yes
|
QMessageBox
::
No
);
if
(
btn
==
QMessageBox
::
No
)
{
...
...
Source/QtDialog/QCMakeCacheView.cxx
View file @
551fcc23
...
...
@@ -250,18 +250,18 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
QCMakePropertyList
newP2
=
newProps2
.
toList
();
qSort
(
newP
);
qSort
(
newP2
);
int
row
C
ount
=
0
;
int
row
_c
ount
=
0
;
foreach
(
QCMakeProperty
p
,
newP
)
{
this
->
insertRow
(
row
C
ount
);
this
->
setPropertyData
(
this
->
index
(
row
C
ount
,
0
),
p
,
true
);
row
C
ount
++
;
this
->
insertRow
(
row
_c
ount
);
this
->
setPropertyData
(
this
->
index
(
row
_c
ount
,
0
),
p
,
true
);
row
_c
ount
++
;
}
foreach
(
QCMakeProperty
p
,
newP2
)
{
this
->
insertRow
(
row
C
ount
);
this
->
setPropertyData
(
this
->
index
(
row
C
ount
,
0
),
p
,
false
);
row
C
ount
++
;
this
->
insertRow
(
row
_c
ount
);
this
->
setPropertyData
(
this
->
index
(
row
_c
ount
,
0
),
p
,
false
);
row
_c
ount
++
;
}
}
else
if
(
this
->
View
==
GroupView
)
...
...
@@ -275,7 +275,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
foreach
(
QString
key
,
newPropsTree
.
keys
())
{
QCMakePropertyList
props
=
newPropsTree
[
key
];
QCMakePropertyList
props
2
=
newPropsTree
[
key
];
QList
<
QStandardItem
*>
parentItems
;
parentItems
.
append
(
...
...
@@ -286,8 +286,10 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
parentItems
[
1
]
->
setData
(
QBrush
(
QColor
(
255
,
100
,
100
)),
Qt
::
BackgroundColorRole
);
root
->
appendRow
(
parentItems
);
foreach
(
QCMakeProperty
prop
,
props
)
int
num
=
props2
.
size
();
for
(
int
i
=
0
;
i
<
num
;
i
++
)
{
QCMakeProperty
prop
=
props2
[
i
];
QList
<
QStandardItem
*>
items
;
items
.
append
(
new
QStandardItem
());
items
.
append
(
new
QStandardItem
());
...
...
@@ -298,14 +300,16 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
foreach
(
QString
key
,
newPropsTree2
.
keys
())
{
QCMakePropertyList
props
=
newPropsTree2
[
key
];
QCMakePropertyList
props
2
=
newPropsTree2
[
key
];
QStandardItem
*
parentItem
=
new
QStandardItem
(
key
.
isEmpty
()
?
tr
(
"Ungrouped Entries"
)
:
key
);
root
->
appendRow
(
parentItem
);
foreach
(
QCMakeProperty
prop
,
props
)
int
num
=
props2
.
size
();
for
(
int
i
=
0
;
i
<
num
;
i
++
)
{
QCMakeProperty
prop
=
props2
[
i
];
QList
<
QStandardItem
*>
items
;
items
.
append
(
new
QStandardItem
());
items
.
append
(
new
QStandardItem
());
...
...
@@ -644,17 +648,17 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
// Issue 205903 fixed in Qt 4.5.0.
// Can remove this function and FileDialogFlag when minimum Qt version is 4.5
bool
QCMakeCacheModelDelegate
::
eventFilter
(
QObject
*
object
,
QEvent
*
ev
en
t
)
bool
QCMakeCacheModelDelegate
::
eventFilter
(
QObject
*
object
,
QEvent
*
evt
)
{
// workaround for what looks like a bug in Qt on Mac OS X
// where it doesn't create a QWidget wrapper for the native file dialog
// so the Qt library ends up assuming the focus was lost to something else
if
(
ev
en
t
->
type
()
==
QEvent
::
FocusOut
&&
this
->
FileDialogFlag
)
if
(
evt
->
type
()
==
QEvent
::
FocusOut
&&
this
->
FileDialogFlag
)
{
return
false
;
}
return
QItemDelegate
::
eventFilter
(
object
,
ev
en
t
);
return
QItemDelegate
::
eventFilter
(
object
,
evt
);
}
void
QCMakeCacheModelDelegate
::
setModelData
(
QWidget
*
editor
,
...
...
@@ -699,18 +703,18 @@ void QCMakeCacheModelDelegate::recordChange(QAbstractItemModel* model, const QMo
QCMakeCacheModel
*
cache_model
=
qobject_cast
<
QCMakeCacheModel
*>
(
mymodel
);
if
(
cache_model
&&
idx
.
isValid
())
{
QCMakeProperty
prop
erty
;
QCMakeProperty
prop
;
idx
=
idx
.
sibling
(
idx
.
row
(),
0
);
cache_model
->
getPropertyData
(
idx
,
prop
erty
);
cache_model
->
getPropertyData
(
idx
,
prop
);
// clean out an old one
QSet
<
QCMakeProperty
>::
iterator
iter
=
mChanges
.
find
(
prop
erty
);
QSet
<
QCMakeProperty
>::
iterator
iter
=
mChanges
.
find
(
prop
);
if
(
iter
!=
mChanges
.
end
())
{
mChanges
.
erase
(
iter
);
}
// now add the new item
mChanges
.
insert
(
prop
erty
);
mChanges
.
insert
(
prop
);
}
}
Source/QtDialog/QCMakeCacheView.h
View file @
551fcc23
...
...
@@ -42,7 +42,7 @@ public:
// get whether to show advanced entries
bool
showAdvanced
()
const
;
QSize
sizeHint
(
int
)
{
return
QSize
(
200
,
200
);
}
QSize
sizeHint
(
)
const
{
return
QSize
(
200
,
200
);
}
public
slots
:
// set whether to show advanced entries
...
...
Write
Preview
Markdown
is supported
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