summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/io.pri6
-rw-r--r--src/corelib/io/qprocess_wince.cpp3
-rw-r--r--src/corelib/tools/qdatetimeparser.cpp37
-rw-r--r--src/corelib/tools/qdatetimeparser_p.h2
4 files changed, 20 insertions, 28 deletions
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index b2bcbdf727..8d9908cd90 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -107,8 +107,6 @@ win32 {
!winrt {
SOURCES += io/qsettings_win.cpp
- HEADERS += io/qwindowspipewriter_p.h
- SOURCES += io/qwindowspipewriter.cpp
SOURCES += io/qstandardpaths_win.cpp
wince* {
@@ -117,11 +115,13 @@ win32 {
} else {
HEADERS += \
io/qwinoverlappedionotifier_p.h \
- io/qwindowspipereader_p.h
+ io/qwindowspipereader_p.h \
+ io/qwindowspipewriter_p.h
SOURCES += \
io/qprocess_win.cpp \
io/qwinoverlappedionotifier.cpp \
io/qwindowspipereader.cpp \
+ io/qwindowspipewriter.cpp \
io/qstorageinfo_win.cpp
LIBS += -lmpr
}
diff --git a/src/corelib/io/qprocess_wince.cpp b/src/corelib/io/qprocess_wince.cpp
index acacdb8540..050d6879db 100644
--- a/src/corelib/io/qprocess_wince.cpp
+++ b/src/corelib/io/qprocess_wince.cpp
@@ -33,7 +33,6 @@
#include "qprocess.h"
#include "qprocess_p.h"
-#include "qwindowspipewriter_p.h"
#include <qdir.h>
#include <qfileinfo.h>
@@ -156,7 +155,7 @@ void QProcessPrivate::startProcess()
}
// give the process a chance to start ...
- Sleep(SLEEPMIN * 2);
+ Sleep(20);
_q_startupNotification();
}
diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp
index 9ca2e1ffc0..cf4fcd4929 100644
--- a/src/corelib/tools/qdatetimeparser.cpp
+++ b/src/corelib/tools/qdatetimeparser.cpp
@@ -125,14 +125,13 @@ bool QDateTimeParser::setDigit(QDateTime &v, int index, int newVal) const
}
const SectionNode &node = sectionNodes.at(index);
- int year, month, day, hour, minute, second, msec;
- year = v.date().year();
- month = v.date().month();
- day = v.date().day();
- hour = v.time().hour();
- minute = v.time().minute();
- second = v.time().second();
- msec = v.time().msec();
+ int year = v.date().year();
+ int month = v.date().month();
+ int day = v.date().day();
+ int hour = v.time().hour();
+ int minute = v.time().minute();
+ int second = v.time().second();
+ int msec = v.time().msec();
switch (node.type) {
case Hour24Section: case Hour12Section: hour = newVal; break;
@@ -670,15 +669,7 @@ QString QDateTimeParser::sectionText(const QString &text, int sectionIndex, int
QString QDateTimeParser::sectionText(int sectionIndex) const
{
const SectionNode &sn = sectionNode(sectionIndex);
- switch (sn.type) {
- case NoSectionIndex:
- case FirstSectionIndex:
- case LastSectionIndex:
- return QString();
- default: break;
- }
-
- return displayText().mid(sn.pos, sectionSize(sectionIndex));
+ return sectionText(displayText(), sectionIndex, sn.pos);
}
@@ -1006,8 +997,10 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos
const QDate date(year, month, day);
const int diff = dayofweek - date.dayOfWeek();
- if (diff != 0 && state == Acceptable && isSet & (DayOfWeekSectionShort|DayOfWeekSectionLong)) {
- conflicts = isSet & DaySection;
+ if (diff != 0 && state == Acceptable
+ && isSet & (DayOfWeekSectionShort | DayOfWeekSectionLong)) {
+ if (isSet & DaySection)
+ conflicts = true;
const SectionNode &sn = sectionNode(currentSectionIndex);
if (sn.type & (DayOfWeekSectionShort|DayOfWeekSectionLong) || currentSectionIndex == -1) {
// dayofweek should be preferred
@@ -1371,9 +1364,9 @@ int QDateTimeParser::findDay(const QString &str1, int startDay, int sectionIndex
*/
-int QDateTimeParser::findAmPm(QString &str, int index, int *used) const
+int QDateTimeParser::findAmPm(QString &str, int sectionIndex, int *used) const
{
- const SectionNode &s = sectionNode(index);
+ const SectionNode &s = sectionNode(sectionIndex);
if (s.type != AmPmSection) {
qWarning("QDateTimeParser::findAmPm Internal error");
return -1;
@@ -1384,7 +1377,7 @@ int QDateTimeParser::findAmPm(QString &str, int index, int *used) const
return PossibleBoth;
}
const QLatin1Char space(' ');
- int size = sectionMaxSize(index);
+ int size = sectionMaxSize(sectionIndex);
enum {
amindex = 0,
diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/tools/qdatetimeparser_p.h
index a1cf8f283f..c96def6046 100644
--- a/src/corelib/tools/qdatetimeparser_p.h
+++ b/src/corelib/tools/qdatetimeparser_p.h
@@ -87,7 +87,7 @@ public:
first.pos = -1;
first.count = -1;
first.zeroesAdded = 0;
- last.type = FirstSection;
+ last.type = LastSection;
last.pos = -1;
last.count = -1;
last.zeroesAdded = 0;