summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-11-19 12:00:31 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-11-19 12:07:15 (GMT)
commit8e401cd4ae0133531613a3e097acc57979d78f50 (patch)
tree58e7572913a2c0d38af6a321fc44a5566a9b859d /src/corelib
parenta1e1867ae3cac6b54cd06e9fc0ad1aa0b476fe9d (diff)
parent732e0d01df867200546ddb5e6f8695f263e1ee0d (diff)
downloadQt-8e401cd4ae0133531613a3e097acc57979d78f50.zip
Qt-8e401cd4ae0133531613a3e097acc57979d78f50.tar.gz
Qt-8e401cd4ae0133531613a3e097acc57979d78f50.tar.bz2
Merge branch '4.6' of oslo-staging-1 into 4.6
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qiodevice.cpp3
-rw-r--r--src/corelib/kernel/qtcore_eval.cpp26
2 files changed, 17 insertions, 12 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index e4e6a15..b84961f 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -1404,6 +1404,9 @@ bool QIODevicePrivate::putCharHelper(char c)
*/
bool QIODevice::getChar(char *c)
{
+ Q_D(QIODevice);
+ CHECK_READABLE(getChar, false);
+
char ch;
return (1 == read(c ? c : &ch, 1));
}
diff --git a/src/corelib/kernel/qtcore_eval.cpp b/src/corelib/kernel/qtcore_eval.cpp
index fe47a30..d5eb8c2 100644
--- a/src/corelib/kernel/qtcore_eval.cpp
+++ b/src/corelib/kernel/qtcore_eval.cpp
@@ -88,23 +88,12 @@ static const char will_shutdown_now[] =
"timeout and will shut down.\n"
"Contact http://qt.nokia.com/about/contact-us for pricing and purchasing information.\n";
-static int qt_eval_days_left()
+static int qt_eval_is_supported()
{
const char *const license_key = qt_eval_key_data + 12;
// fast fail
if (!qt_eval_key_data[0] || !*license_key)
- return -2;
-
- QDate today = QDate::currentDate();
- QDate build = QLibraryInfo::buildDate();
- return qMax(-1, today.daysTo(build) + 30);
-}
-
-static int qt_eval_is_supported()
-{
- const char *const license_key = qt_eval_key_data + 12;
- if (!qt_eval_key_data[0] || !*license_key)
return -1;
// is this an unsupported evaluation?
@@ -123,6 +112,16 @@ static int qt_eval_is_supported()
return -1;
}
+static int qt_eval_days_left()
+{
+ if (qt_eval_is_supported() < 0)
+ return -2;
+
+ QDate today = QDate::currentDate();
+ QDate build = QLibraryInfo::buildDate();
+ return qMax(-1, today.daysTo(build) + 30);
+}
+
static QString qt_eval_string()
{
const char *msg;
@@ -178,6 +177,9 @@ public:
void qt_core_eval_init(uint type)
{
+ if (!type)
+ return; // GUI app
+
switch (qt_eval_days_left()) {
case -2:
return;