Commit Graph

361 Commits

Author SHA1 Message Date
Corentin Jabot
866a5d0c28 Make QProcess startable with open()
Add setProgram() and setArguments() methods to the QProcess api.
Add a convenient start(QIODevice::OpenMode) method.
Move the implementation of QProcess::start() to QProcess::open()
unifying the QProcess api with other QIODevice subclasses.

Change-Id: Id1af57da05f750fe8d526d391589c05ee8037bca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-05 18:39:35 +01:00
David Faure
1b582d64eb Long live QLockFile
Locking between processes, implemented with open(O_EXCL) on Unix
and CreateFile(CREATE_NEW) on Windows.

Supports detecting stale lock files and deleting them.
Advisory locking is used to prevent deletion of files that are still in use.

Change-Id: Id00ee2a4e77a29483d869037c7047c59cb909339
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-05 06:26:33 +01:00
Thiago Macieira
ccdec0b7a6 Remove excess brace added by accident
Added in 53dc49ffc8.

io.pro:44: Excess closing brace.

Change-Id: Ia3810a5a2668d96ab4604831e8ca5b49c7562956
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2013-03-04 14:54:57 +01:00
Peter Hartmann
b20d15b58b QUrl: update top level domains that may contain non-ASCII characters
Most notably, .com and .net now may contain non-ASCII characters.
list has been generated from
http://www.mozilla.org/projects/security/tld-idn-policy-list.html

Change-Id: Idc3191dc782bc4173ccb19b4bc81f4f061ca7999
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-02 10:13:27 +01:00
David Faure
e433553c1b tst_qfile: remove unused variable
Change-Id: I3c827b8a372158815cf234a548a85cf6165c189e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-27 16:00:08 +01:00
Friedemann Kleint
176383f3ec tst_qfileinfo: Fix invalid preprocessor directive.
Introduced by 5ec342fefd .

Change-Id: I28f9e093567ef1abf3898146e7183a90888262ad
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-26 19:24:36 +01:00
Oliver Wolff
53dc49ffc8 Check for network module when building according auto tests
Change-Id: I68013bf8e07be8d202b3253f997d4f4db05335a4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-19 19:20:53 +01:00
Pasi Petäjäjärvi
5ec342fefd Fix QFileInfo autotest for VxWorks.
No users/groups/symlinks on VxWorks.

Change-Id: I524a568202db2478b070b16a63ae425224c3aaa0
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-19 10:35:06 +01:00
Pasi Petäjäjärvi
7e8cc3b3ba Fix QFile autotest for VxWorks
No users/file permissions. Open function in VxWorks DKM
requires always three parameters.

Change-Id: I93fb075d82aa57e210e224bfe4ede40def82c275
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-19 10:35:06 +01:00
Pasi Petäjäjärvi
10d077fa19 Fix QSettings autotest for VxWorks
No users/groups on VxWorks.

Change-Id: I88912c93fa59dc7c00bdbb973fc34ecd631b3316
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-19 10:35:06 +01:00
Frederik Gladhorn
e65cd6f379 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/concurrent/doc/qtconcurrent.qdocconf
	src/corelib/doc/qtcore.qdocconf
	src/corelib/global/qglobal.h
	src/dbus/doc/qtdbus.qdocconf
	src/dbus/qdbusmessage.h
	src/gui/doc/qtgui.qdocconf
	src/gui/image/qimagereader.cpp
	src/network/doc/qtnetwork.qdocconf
	src/opengl/doc/qtopengl.qdocconf
	src/opengl/qgl.h
	src/plugins/platforms/windows/qwindowswindow.cpp
	src/printsupport/doc/qtprintsupport.qdocconf
	src/sql/doc/qtsql.qdocconf
	src/testlib/doc/qttestlib.qdocconf
	src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf
	src/widgets/doc/qtwidgets.qdocconf
	src/xml/doc/qtxml.qdocconf

Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
2013-02-14 14:24:57 +01:00
David Faure
b61cff8d6e qprocess autotests don't need QtGui
(this isn't true of -all- corelib/ autotests though, e.g. tst_qdatastream
uses QBitmap)

Change-Id: I314fda5d85d45cb5eece8da74156989b83cf0299
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-09 18:44:41 +01:00
Peter Hartmann
916f0ff663 QUrl effective TLDs: update table and split into chunks of 64K
The table is there to know which domains are allowed to set cookies
and which are not. There are more than 2000 new entries since the
list has last been generated.
The split to 64K chunks was made because this is the hard limit for
strings in Visual Studio.

Change-Id: I511aec062af673555e9a69442c055f75bdcd1606
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-09 10:12:44 +01:00
Sergio Ahumada
d011f64524 tests: Fix some more old references and links to Nokia
Task-number: QTBUG-28156
Change-Id: Ifb768b167203c901c5e42ce58c9aaf3db2739320
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-02-01 15:27:37 +01:00
Frederik Gladhorn
3eb588078e Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-29 11:33:35 +01:00
Thiago Macieira
edd2d9bd0a Make the null pointer dereference a volatile one
This is to ensure that the compiler won't optimise it out of existence.
Clang says it will do it:

testProcessCrash/main.cpp:50:5: warning: indirection of non-volatile null pointer will be deleted, not trap [-Wnull-dereference]
    *(char*)0 = 0;
    ^~~~~~~~~

Change-Id: Iac7771046442f869e205e8789fffdd6443d58e67
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-29 01:47:01 +01:00
Thiago Macieira
2a3d690a19 Forward-port tests on invalid port numbers from Qt 4
These tests were added to Qt 4 on commit
a17fc85b51a6bdcfa33dcff183d2b7efd667fb92

Task-number: QTBUG-28985
Change-Id: I3cf595384f14272197dcfb85943213c8f8ddeba0
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2013-01-28 21:07:41 +01:00
Sze Howe Koh
7bb43454b8 Fix minor typos in docs, printed messages & comments
Missing apostrophes

Change-Id: I3ef5e9d494fb7a37f8e6075f24cd3a274e572c23
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-01-28 18:12:41 +01:00
Friedemann Kleint
ff31462e73 Fix MinGW-Warnings in tst_qwinoverlappedionotifier.
Change-Id: I66c4e274c8b686d8a69476ad10751008f256e5a2
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-28 16:19:21 +01:00
Friedemann Kleint
2b3ed64951 Fix warning about redefinition of _WIN32_WINNT.
This is redefined by qt_windows.h

Change-Id: I6a8cb06c93c4055b166f1a214cba981d61680b9c
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-28 16:19:17 +01:00
Pasi Petäjäjärvi
f3fc2078b8 Check existence of QProcess feature before using it on Qt autotests.
VxWorks does not have QProcess support.

Change-Id: I917b769f967e9d71ec5025aae788f3e237b07aeb
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
(cherry picked from commit 416e73a0fc)
2013-01-28 16:06:15 +01:00
Frederik Gladhorn
02ba93dd3d Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I12b4d8b99bdccae53b1a978cd6eb8f4ac6fb3c76
2013-01-28 11:10:29 +01:00
Pasi Petäjäjärvi
05b4000e01 Fixed checking HOME variable return value using isEmpty()
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 <oswald.buddenhagen@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-25 08:51:09 +01:00
Frederik Gladhorn
7df08a8b63 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-23 22:12:54 +01:00
Pasi Petäjäjärvi
416e73a0fc Check existence of QProcess feature before using it on Qt autotests.
VxWorks does not have QProcess support.

Change-Id: I20ed479125097d468a1aa50afb18c3749f0fbb98
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:59 +01:00
Frederik Gladhorn
c608ec8254 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/corelib/io/qsavefile_p.h
	src/corelib/tools/qregularexpression.cpp
	src/gui/util/qvalidator.cpp
	src/gui/util/qvalidator.h

Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
2013-01-22 18:40:13 +01:00
Friedemann Kleint
c73dc44606 Fix cleanup of temporary files in test of QFileInfo.
Change-Id: I0d21fc05a7d816acab5f7284f905bf971a5c04da
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-22 13:29:25 +01:00
Friedemann Kleint
04773fe72e Reduce invocations of QFINDTESTDATA in tst_qfileinfo.
Introduce variables for the paths used in the test and
check in initTestCase().

Change-Id: Ie801266e30cd860e5bdf079c1182fe385f9598c7
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-21 12:15:01 +01:00
Friedemann Kleint
52e14e05fa Fix temporary file leak in tst_qfileinfo.
Change-Id: I0d679638d5a9564f612ae5e70717f164b74aefb0
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-21 12:14:53 +01:00
Sergio Ahumada
48e0c4df23 Update copyright year in Digia's license headers
Change-Id: Ic804938fc352291d011800d21e549c10acac66fb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-18 09:07:35 +01:00
David Faure
ff8362d65e QSaveFile autotest: restore permissions using RAII
So that the QTemporaryDir can happen even on error.

Change-Id: I728d49eac8bd65e1919fd314a95387949e134de0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:22 +01:00
David Faure
2d5fe45379 QSaveFile: test the case of an existing, but readonly, target file.
Change-Id: I296d9c2598b8c72e2fd3e6ec80a615364b7eddeb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:16 +01:00
David Faure
e993df8771 Add class QSaveFile.
This QIODevice uses a temporary file for writing, so that in case of
write errors, the writing operation is canceled, without losing any
existing file. It also avoids having a partially-written file visible
by other processes, at the final destination.

Change-Id: I9482df45751cb890b1b6f1382ec2eea3eb980627
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:11 +01:00
Frederik Gladhorn
7075e29199 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/widgets/styles/qstyleanimation.cpp

Change-Id: Iae570895be6544de80f9c1ec309d1a08c59daff8
2013-01-16 01:22:45 +01:00
Friedemann Kleint
d3dc0f2122 Fix renaming of files that differ only in case.
This currently fails on case-insensitive file
systems since the check for existence then triggered
and indicated "file already exists".

Check on the file id (inode or file id) whether
the target file is really a different file for a
case-changing rename.

Task-number: QTBUG-3570

Change-Id: I1b2d40850692e02142ee23d2c753428de00aedc6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-15 16:36:20 +01:00
David Faure
6b9545a980 QUrl: methods for converting QStringList <-> QList<QUrl>
This is a very common thing to do, e.g. in order to send urls via DBus.

Change-Id: I277902460ee1ad6780446e862e86b3c2eb8c5315
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
David Faure
327b2ba3b7 Add class QDebugStateSaver for writing QDebug operators correctly
Had to move QTextStreamPrivate to a private header, to be able to use
its new internal Params struct from qdebug.cpp

Change-Id: If28e25f27bbd04b1825a5eb3e2ef83ecad72e7b2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
Stephen Kelly
ccbff3fce5 Clean up some metatype declarations and registrations
Change-Id: I0826f6502cc45279f29f248f5f28f4fc9e6c8b4e
Reviewed-by: David Faure <david.faure@kdab.com>
2013-01-09 18:19:12 +01:00
Stephen Kelly
cf22e8ea4e Tests: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: Ifd116dee32a450ff89a9a1011e26b434765d6e95
Reviewed-by: David Faure <david.faure@kdab.com>
2013-01-06 11:23:45 +01:00
Stephen Kelly
79f1afc23c Core: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: I54523eb854619917123d8816d3cd6c3a1f5b4c55
Reviewed-by: David Faure <david.faure@kdab.com>
2013-01-04 18:39:05 +01:00
Stephen Kelly
4319f698c8 Remove metatype registration of built-in types.
As they are built-in, they are effectively registered at compile-time
already.

Change-Id: I7ae6ba16088eab5d19213fa7b07c2a7760988a86
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-03 16:15:37 +01:00
David Faure
8b2728ec38 QUrl::fromUserInput: fix for urls without a host.
QUrl::fromUserInput("http://") was invalid, which doesn't make sense
since QUrl("http://") is valid. Same for "smb:" which is actually
even more a valid URL from a user's point of view.

Change-Id: I371ac393d61b49499edf5adbbc2a90b426fe9e5d
Reviewed-by: Marco Martin <mart@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-12-23 10:50:28 +01:00
Thiago Macieira
e1a1e80d46 Make sure that the strict parser is also operating on setXxx
These cases weren't handled before.

The validateComponent function is copied from QUrlPrivate::parse, with
the added modification that it now needs to check the gen-delims for
the userinfo.

Change-Id: I055167b977199fa86b56a3a7259a7445585129c6
Reviewed-by: David Faure (KDE) <faure@kde.org>
2012-12-21 20:54:51 +01:00
Oswald Buddenhagen
586adeabe4 add and use qtHaveModule() function
this is much more elegant than the so far propagated !isEmpty(QT.foo.name).
also replace feature-specific tests (no-gui and no-widgets) and the
obsolete contains(QT_CONFIG, foo) syntax.

Change-Id: Ia4b3c8febcabf9eeca67b1f9173a523820b1038b
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Tasuku Suzuki <stasuku@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-12-21 19:05:02 +01:00
Peter Hartmann
fbdea2c993 QUrl auto tests: make sure setAuthority is consistent with setHost
... with respect to empty and null strings.

Change-Id: Ic107d5bcc8b659497a567b75a7244caceba5a715
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-12-20 16:48:36 +01:00
Peter Hartmann
cc79ed5c6a QUrl auto tests: ensure toEncoded() and toString() match wrt. empty auth
Task-number: QTBUG-8701

Change-Id: I55780a910a0d0996488475f5ce49a240f6223df0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-12-20 01:42:05 +01:00
Sergio Ahumada
5efcd5a6c3 Change ftp.qt.nokia.com -> ftp.qt-project.org
Task-number: QTBUG-28156
Change-Id: I0060144f0336791933205355b125251ccba73b3e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-12-18 23:13:35 +01:00
Stephen Kelly
348c5bd19a Fix some typos in QProcess and QSslSocket unit tests.
The QSslSocket one is both wrong and redundant as there is a
Q_DECLARE_METATYPE for it already.

Change-Id: I63d065abfb3d0e3d82a8b1f29a6752b7676db847
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-12-04 14:41:43 +01:00
Oswald Buddenhagen
4873c4151e remove pointless QT.<module>.sources references
there is no point to use this for in-module references.
cleaning it out in an attempt to purge the constants entirely.

Change-Id: I1da4d70e3778257dd43eda0bdfc71eaec1124732
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-04 13:58:29 +01:00
Sergio Ahumada
0df026de86 Stop using the name "Trolltech" in QSettings
Also change Trolltech for QtProject in other places

Task-number: QTBUG-23269
Change-Id: Ie4e344f23cab77c575562d18b481b3369ce30491
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-12-03 03:47:08 +01:00