Skip to content
GitLab
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
d32ad81a
Commit
d32ad81a
authored
Apr 04, 2011
by
Oswald Buddenhagen
Browse files
use QFile::open()'s return value instead of using weird isOpen() checks
parent
2f1993e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp
View file @
d32ad81a
...
...
@@ -443,8 +443,7 @@ public:
else
fileName
=
(
_styleSheetFile
.
toLocalFile
());
QFile
file
(
fileName
);
file
.
open
(
QIODevice
::
ReadOnly
);
if
(
file
.
isOpen
())
{
if
(
file
.
open
(
QIODevice
::
ReadOnly
))
{
QString
styleSheet
(
file
.
readAll
());
q
->
setStyleSheet
(
styleSheet
);
}
else
{
...
...
@@ -634,8 +633,7 @@ private:
}
QFile
file
(
path
);
file
.
open
(
QIODevice
::
ReadOnly
);
if
(
file
.
exists
()
&&
file
.
isOpen
())
{
if
(
file
.
open
(
QIODevice
::
ReadOnly
))
{
QPixmap
pixmap
(
path
);
if
(
pixmap
.
isNull
())
qWarning
()
<<
QLatin1String
(
"setIconFromFile: "
)
<<
url
<<
QLatin1String
(
" not found!"
);
...
...
@@ -700,8 +698,7 @@ private:
}
QFile
file
(
path
);
file
.
open
(
QIODevice
::
ReadOnly
);
if
(
file
.
exists
()
&&
file
.
isOpen
())
{
if
(
file
.
open
(
QIODevice
::
ReadOnly
))
{
QPixmap
pixmap
(
path
);
if
(
pixmap
.
isNull
())
qWarning
()
<<
QLatin1String
(
"setIconFromFile: "
)
<<
url
<<
QLatin1String
(
" not found!"
);
...
...
@@ -773,8 +770,7 @@ private:
}
QFile
file
(
path
);
file
.
open
(
QIODevice
::
ReadOnly
);
if
(
file
.
exists
()
&&
file
.
isOpen
())
{
if
(
file
.
open
(
QIODevice
::
ReadOnly
))
{
QPixmap
pixmap
(
path
);
if
(
pixmap
.
isNull
())
qWarning
()
<<
QLatin1String
(
"setIconFromFile: "
)
<<
url
<<
QLatin1String
(
" not found!"
);
...
...
src/plugins/qmldesigner/components/propertyeditor/layoutwidget.cpp
View file @
d32ad81a
...
...
@@ -94,8 +94,7 @@ LayoutWidget::~LayoutWidget()
{
if
(
url
.
scheme
()
==
QLatin1String
(
"file"
))
{
QFile
file
(
url
.
toLocalFile
());
file
.
open
(
QIODevice
::
ReadOnly
);
if
(
file
.
isOpen
())
{
if
(
file
.
open
(
QIODevice
::
ReadOnly
))
{
QPixmap
pixmap
(
url
.
toLocalFile
());
button
->
setIcon
(
pixmap
);
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment