From 05b4000e01ff5785739617c3069fbe0b0d36a606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Wed, 2 Jan 2013 17:43:39 +0200 Subject: Fixed checking HOME variable return value using isEmpty() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return value of the QFile::decodeName(qgetenv("HOME")); is never null if HOME environment variable is not set. So need to check the return value using isEmpty() instead. Task-number: QTBUG-28912 Change-Id: Ic57b1978d63e99b056cde35ca8cb9d2a07ff8ce8 Reviewed-by: Oswald Buddenhagen Reviewed-by: Samuel Rødal --- src/corelib/io/qfilesystemengine_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 2fc7557509..4af01f6730 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -633,7 +633,7 @@ bool QFileSystemEngine::setPermissions(const QFileSystemEntry &entry, QFile::Per QString QFileSystemEngine::homePath() { QString home = QFile::decodeName(qgetenv("HOME")); - if (home.isNull()) + if (home.isEmpty()) home = rootPath(); return QDir::cleanPath(home); } -- cgit v1.2.3 From 63569a68d2fd5ca90c4660e632fba2f3f3b37d73 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sat, 29 Dec 2012 02:09:39 +0800 Subject: Doc: Fix module name format Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtCore -> Qt Core QtDBus -> Qt D-Bus QtDesigner -> Qt Designer QtGui -> Qt GUI QtImageFormats -> Qt Image Formats QtNetwork -> Qt Network QtPrintSupport -> Qt Print Support QtScript -> Qt Script QtSql -> Qt SQL QtSvg -> Qt SVG QtTest -> Qt Test QtWebKit -> Qt WebKit QtWidgets -> Qt Widgets QtXml -> Qt XML QtConcurrent -> Qt Concurrent (partial) QtQuick -> Qt Quick (partial) Also, distinguish between "module" and "library" Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd Reviewed-by: Jerome Pasion --- src/corelib/doc/src/objectmodel/objecttrees.qdoc | 4 ++-- src/corelib/doc/src/plugins-howto.qdoc | 2 +- src/corelib/global/qfeatures.h | 2 +- src/corelib/global/qfeatures.txt | 2 +- src/corelib/io/qsettings.cpp | 4 ++-- src/corelib/itemmodels/qabstractitemmodel.cpp | 2 +- src/corelib/kernel/qcoreapplication.cpp | 2 +- src/corelib/kernel/qmetaobject.cpp | 4 ++-- src/corelib/kernel/qmimedata.cpp | 12 ++++++------ src/corelib/kernel/qvariant.cpp | 4 ++-- src/corelib/tools/qsimd.cpp | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/doc/src/objectmodel/objecttrees.qdoc b/src/corelib/doc/src/objectmodel/objecttrees.qdoc index 86b8d0ee31..407f4ce3e0 100644 --- a/src/corelib/doc/src/objectmodel/objecttrees.qdoc +++ b/src/corelib/doc/src/objectmodel/objecttrees.qdoc @@ -42,13 +42,13 @@ (keyboard shortcut) is a child of the relevant window, so when the user closes that window, the shortcut is deleted too. - \l QQuickItem, the basic visual element of the QtQuick module, inherits + \l QQuickItem, the basic visual element of the Qt Quick module, inherits from QObject, but has a concept of the \e {visual parent} which differs from that of the \e {QObject parent}. An item's visual parent may not necessarily be the same as its object parent. See \l {Concepts - Visual Parent in Qt Quick} for more details. - \l QWidget, the fundamental class of the QtWidgets module, + \l QWidget, the fundamental class of the Qt Widgets module, extends the parent-child relationship. A child normally also becomes a child widget, i.e. it is displayed in its parent's coordinate system and is graphically clipped by its parent's boundaries. For example, diff --git a/src/corelib/doc/src/plugins-howto.qdoc b/src/corelib/doc/src/plugins-howto.qdoc index b547b738f1..af15d94af2 100644 --- a/src/corelib/doc/src/plugins-howto.qdoc +++ b/src/corelib/doc/src/plugins-howto.qdoc @@ -69,7 +69,7 @@ Since the higher-level API is built on top of the lower-level API, some issues are common to both. - If you want to provide plugins for use with Qt Designer, see the QtDesigner + If you want to provide plugins for use with Qt Designer, see the Qt Designer module documentation. Topics: diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index 010ab7b9b3..7ae4863da3 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -378,7 +378,7 @@ #define QT_NO_CONTEXTMENU #endif -// QtDBus module +// Qt D-Bus module #if !defined(QT_NO_DBUS) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_DOM)) #define QT_NO_DBUS #endif diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index ad1ca5a6d5..a97309b876 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -1089,6 +1089,6 @@ Feature: DBUS Description: Provides classes for D-Bus. Section: D-Bus Requires: PROPERTIES DOM -Name: QtDBus module +Name: Qt D-Bus module SeeAlso: ??? diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 91503e3327..d7b100ba3c 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -2092,9 +2092,9 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, \section1 QVariant and GUI Types - Because QVariant is part of the \l QtCore library, it cannot provide + Because QVariant is part of the Qt Core module, it cannot provide conversion functions to data types such as QColor, QImage, and - QPixmap, which are part of \l QtGui. In other words, there is no + QPixmap, which are part of Qt GUI. In other words, there is no \c toColor(), \c toImage(), or \c toPixmap() functions in QVariant. Instead, you can use the QVariant::value() or the qVariantValue() diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index ebe38a97cd..cc9a74d99d 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -1063,7 +1063,7 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, The QAbstractItemModel class is one of the \l{Model/View Classes} and is part of Qt's \l{Model/View Programming}{model/view framework}. It can be used as the underlying data model for the item view elements in - QML or the item view classes in the QtWidgets module. + QML or the item view classes in the Qt Widgets module. If you need a model to use with an item view such as QML's List View element or the C++ widgets QListView or QTableView, you should consider diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 75ff43180c..ec808424f9 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -749,7 +749,7 @@ void QCoreApplication::setQuitLockEnabled(bool enabled) */ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event) { - // Make it possible for QtScript to hook into events even + // Make it possible for Qt Script to hook into events even // though QApplication is subclassed... bool result = false; void *cbdata[] = { receiver, event, &result }; diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index b2d3470aee..14d96e96fd 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -2804,7 +2804,7 @@ QVariant QMetaProperty::read(const QObject *object) const } // the status variable is changed by qt_metacall to indicate what it did - // this feature is currently only used by QtDBus and should not be depended + // this feature is currently only used by Qt D-Bus and should not be depended // upon. Don't change it without looking into QDBusAbstractInterface first // -1 (unchanged): normal qt_metacall, result stored in argv[0] // changed: result stored directly in value @@ -2883,7 +2883,7 @@ bool QMetaProperty::write(QObject *object, const QVariant &value) const } // the status variable is changed by qt_metacall to indicate what it did - // this feature is currently only used by QtDBus and should not be depended + // this feature is currently only used by Qt D-Bus and should not be depended // upon. Don't change it without looking into QDBusAbstractInterface first // -1 (unchanged): normal qt_metacall, result stored in argv[0] // changed: result stored directly in value, return the value of status diff --git a/src/corelib/kernel/qmimedata.cpp b/src/corelib/kernel/qmimedata.cpp index a54980513c..6e571d2969 100644 --- a/src/corelib/kernel/qmimedata.cpp +++ b/src/corelib/kernel/qmimedata.cpp @@ -452,8 +452,8 @@ bool QMimeData::hasHtml() const Returns a QVariant storing a QImage if the object can return an image; otherwise returns a null variant. - A QVariant is used because QMimeData belongs to the \l QtCore - library, whereas QImage belongs to \l QtGui. To convert the + A QVariant is used because QMimeData belongs to the Qt Core + module, whereas QImage belongs to Qt GUI. To convert the QVariant to a QImage, simply use qvariant_cast(). For example: \snippet code/src_corelib_kernel_qmimedata.cpp 5 @@ -469,8 +469,8 @@ QVariant QMimeData::imageData() const /*! Sets the data in the object to the given \a image. - A QVariant is used because QMimeData belongs to the \l QtCore - library, whereas QImage belongs to \l QtGui. The conversion + A QVariant is used because QMimeData belongs to the Qt Core + module, whereas QImage belongs to Qt GUI. The conversion from QImage to QVariant is implicit. For example: \snippet code/src_corelib_kernel_qmimedata.cpp 6 @@ -499,8 +499,8 @@ bool QMimeData::hasImage() const color (MIME type \c application/x-color); otherwise returns a null variant. - A QVariant is used because QMimeData belongs to the \l QtCore - library, whereas QColor belongs to \l QtGui. To convert the + A QVariant is used because QMimeData belongs to the Qt Core + module, whereas QColor belongs to Qt GUI. To convert the QVariant to a QColor, simply use qvariant_cast(). For example: \snippet code/src_corelib_kernel_qmimedata.cpp 7 diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index c9e0019710..60ab5506a4 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -949,8 +949,8 @@ Q_CORE_EXPORT void QVariantPrivate::registerHandler(const int /* Modules::Names \section1 A Note on GUI Types - Because QVariant is part of the QtCore library, it cannot provide - conversion functions to data types defined in QtGui, such as + Because QVariant is part of the Qt Core module, it cannot provide + conversion functions to data types defined in Qt GUI, such as QColor, QImage, and QPixmap. In other words, there is no \c toColor() function. Instead, you can use the QVariant::value() or the qvariant_cast() template function. For example: diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index 7f09743497..f2cb5e88ee 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -390,7 +390,7 @@ void qDetectCpuFeatures() // For that reason, simply forego the CPUID check at all and return the set // of features that we found at compile time, through the #defines from the // compiler. This should at least allow code to execute, even if none of - // the specialized code found in QtGui and elsewhere will ever be enabled + // the specialized code found in Qt GUI and elsewhere will ever be enabled // (it's the user's fault for using a broken compiler). // // This also disables the runtime checking that the processor actually -- cgit v1.2.3 From add16725a34f7d249c9e93d9ecbfc0c7cc488d80 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 21 Dec 2012 18:26:09 -0800 Subject: Don't use the union trick to do unlawful casts GCC 4.7 is printing this (bogus) warning: qobject.h:166:15: warning: 'QObject::findChildren(const QString&, Qt::FindChildOptions) const [with T = QMenuBar*; Qt::FindChildOptions = QFlags]::' declared with greater visibility than the type of its field 'QObject::findChildren(const QString&, Qt::FindChildOptions) const [with T = QMenuBar*; Qt::FindChildOptions = QFlags]::::typedList' [-Wattributes] Change-Id: I2d1c365e3191f3a5c7b2241deb35f0ae47d79afc Reviewed-by: Olivier Goffart Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- src/corelib/kernel/qobject.h | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 632d97ca65..a2d7dcd7ef 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -163,12 +163,8 @@ public: inline QList findChildren(const QString &aName = QString(), Qt::FindChildOptions options = Qt::FindChildrenRecursively) const { QList list; - union { - QList *typedList; - QList *voidList; - } u; - u.typedList = &list; - qt_qFindChildren_helper(this, aName, reinterpret_cast(0)->staticMetaObject, u.voidList, options); + qt_qFindChildren_helper(this, aName, reinterpret_cast(0)->staticMetaObject, + reinterpret_cast *>(&list), options); return list; } @@ -177,12 +173,8 @@ public: inline QList findChildren(const QRegExp &re, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const { QList list; - union { - QList *typedList; - QList *voidList; - } u; - u.typedList = &list; - qt_qFindChildren_helper(this, re, reinterpret_cast(0)->staticMetaObject, u.voidList, options); + qt_qFindChildren_helper(this, re, reinterpret_cast(0)->staticMetaObject, + reinterpret_cast *>(&list), options); return list; } #endif @@ -192,12 +184,8 @@ public: inline QList findChildren(const QRegularExpression &re, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const { QList list; - union { - QList *typedList; - QList *voidList; - } u; - u.typedList = &list; - qt_qFindChildren_helper(this, re, reinterpret_cast(0)->staticMetaObject, u.voidList, options); + qt_qFindChildren_helper(this, re, reinterpret_cast(0)->staticMetaObject, + reinterpret_cast *>(&list), options); return list; } #endif -- cgit v1.2.3