summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@nokia.com>2011-08-18 06:26:06 (GMT)
committerSergio Ahumada <sergio.ahumada@nokia.com>2011-08-18 06:26:06 (GMT)
commit06ef461b5374c42370fc350f53dba76a5d4c62f4 (patch)
treeeb33081ef8f5f3a81c3f2ce14a73090fd610ab91
parent5e435bfcad5a05c775c9d45edbd2659c87416754 (diff)
parent4b90559d0a8b693241dd79682d0d31362497468b (diff)
downloadQt-06ef461b5374c42370fc350f53dba76a5d4c62f4.zip
Qt-06ef461b5374c42370fc350f53dba76a5d4c62f4.tar.gz
Qt-06ef461b5374c42370fc350f53dba76a5d4c62f4.tar.bz2
Merge remote-tracking branch 'review/master'
-rw-r--r--config.tests/mac/xcodeversion.cpp6
-rw-r--r--demos/embedded/lightmaps/lightmaps.h2
-rw-r--r--demos/embedded/lightmaps/mapzoom.h2
-rw-r--r--demos/embedded/lightmaps/slippymap.h2
-rw-r--r--demos/mobile/guitartuner/src/guitartuner.rc2
-rw-r--r--doc/src/snippets/qcolumnview/main.cpp2
-rw-r--r--doc/src/snippets/textdocument-imagedrop/main.cpp2
-rw-r--r--doc/src/snippets/textdocument-imagedrop/textedit.h6
-rw-r--r--examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp2
-rw-r--r--examples/tutorials/gettingStarted/gsQml/filedialog/directory.cpp2
-rw-r--r--examples/tutorials/gettingStarted/gsQml/filedialog/file.cpp2
-rw-r--r--examples/tutorials/gettingStarted/gsQml/filedialog/file.h2
-rwxr-xr-xexamples/tutorials/modelview/4_headers/main.cpp2
-rw-r--r--examples/tutorials/threads/clock/clockthread.h2
-rw-r--r--src/gui/dialogs/qfiledialog_win_p.h2
-rw-r--r--tests/auto/qaudioinput/tst_qaudioinput.cpp133
-rw-r--r--tests/auto/qdialog/tst_qdialog.cpp16
-rw-r--r--tests/auto/qfiledialog/tst_qfiledialog.cpp2
-rw-r--r--tools/macdeployqt/shared/shared.cpp2
-rw-r--r--tools/macdeployqt/tests/tst_deployment_mac.cpp2
-rw-r--r--tools/qtconcurrent/codegenerator/src/codegenerator.cpp4
-rw-r--r--tools/qtestlib/wince/cetest/deployment.h2
22 files changed, 112 insertions, 87 deletions
diff --git a/config.tests/mac/xcodeversion.cpp b/config.tests/mac/xcodeversion.cpp
index df208e3..0cc3777 100644
--- a/config.tests/mac/xcodeversion.cpp
+++ b/config.tests/mac/xcodeversion.cpp
@@ -73,7 +73,7 @@ int main(int argc, const char **argv)
const char * ok3 ="3.0";
// ptr = fail1;
// printf ("string: %s\n", ptr);
-
+
int length = strlen(ptr);
if (length < 3) // expect "x.y" at least
return internal_error;
@@ -94,6 +94,6 @@ int main(int argc, const char **argv)
if (ptr[4] < '1')
return fail;
-
+
return success;
-} \ No newline at end of file
+}
diff --git a/demos/embedded/lightmaps/lightmaps.h b/demos/embedded/lightmaps/lightmaps.h
index 45b5c18..0e458ea 100644
--- a/demos/embedded/lightmaps/lightmaps.h
+++ b/demos/embedded/lightmaps/lightmaps.h
@@ -85,4 +85,4 @@ private:
bool invert;
};
-#endif \ No newline at end of file
+#endif
diff --git a/demos/embedded/lightmaps/mapzoom.h b/demos/embedded/lightmaps/mapzoom.h
index ac70a23..935660c 100644
--- a/demos/embedded/lightmaps/mapzoom.h
+++ b/demos/embedded/lightmaps/mapzoom.h
@@ -66,4 +66,4 @@ private:
QNetworkSession *networkSession;
};
-#endif \ No newline at end of file
+#endif
diff --git a/demos/embedded/lightmaps/slippymap.h b/demos/embedded/lightmaps/slippymap.h
index 64ba5c3..480dc81 100644
--- a/demos/embedded/lightmaps/slippymap.h
+++ b/demos/embedded/lightmaps/slippymap.h
@@ -84,4 +84,4 @@ private:
QUrl m_url;
};
-#endif \ No newline at end of file
+#endif
diff --git a/demos/mobile/guitartuner/src/guitartuner.rc b/demos/mobile/guitartuner/src/guitartuner.rc
index 85cee0b..b4f7a11 100644
--- a/demos/mobile/guitartuner/src/guitartuner.rc
+++ b/demos/mobile/guitartuner/src/guitartuner.rc
@@ -20,4 +20,4 @@ BEGIN
BEGIN
VALUE "Translation", 0x409, 1252
END
-END \ No newline at end of file
+END
diff --git a/doc/src/snippets/qcolumnview/main.cpp b/doc/src/snippets/qcolumnview/main.cpp
index c39a4bb..fecff12 100644
--- a/doc/src/snippets/qcolumnview/main.cpp
+++ b/doc/src/snippets/qcolumnview/main.cpp
@@ -76,4 +76,4 @@ int main(int argc, char *argv[])
columnView.show();
return app.exec();
-} \ No newline at end of file
+}
diff --git a/doc/src/snippets/textdocument-imagedrop/main.cpp b/doc/src/snippets/textdocument-imagedrop/main.cpp
index 24cd2de..0cdf3a1 100644
--- a/doc/src/snippets/textdocument-imagedrop/main.cpp
+++ b/doc/src/snippets/textdocument-imagedrop/main.cpp
@@ -49,4 +49,4 @@ int main(int argc, char * argv[])
textEdit->show();
return app.exec();
-} \ No newline at end of file
+}
diff --git a/doc/src/snippets/textdocument-imagedrop/textedit.h b/doc/src/snippets/textdocument-imagedrop/textedit.h
index 9e0492b..9db9f17 100644
--- a/doc/src/snippets/textdocument-imagedrop/textedit.h
+++ b/doc/src/snippets/textdocument-imagedrop/textedit.h
@@ -46,11 +46,11 @@
class TextEdit : public QTextEdit
{
Q_OBJECT
-
-public:
+
+public:
TextEdit(QWidget *parent=0);
bool canInsertFromMimeData( const QMimeData *source ) const;
void insertFromMimeData( const QMimeData *source );
};
-#endif \ No newline at end of file
+#endif
diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp b/examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp
index fde24d9..3b02c63 100644
--- a/examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp
+++ b/examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp
@@ -51,4 +51,4 @@ void DialogPlugin::registerTypes(const char *uri)
}
//FileDialog is the plugin name (same as the TARGET in the project file) and DialogPlugin is the plugin classs
-Q_EXPORT_PLUGIN2(FileDialog, DialogPlugin); \ No newline at end of file
+Q_EXPORT_PLUGIN2(FileDialog, DialogPlugin);
diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/directory.cpp b/examples/tutorials/gettingStarted/gsQml/filedialog/directory.cpp
index c675fc9..52bdfc7 100644
--- a/examples/tutorials/gettingStarted/gsQml/filedialog/directory.cpp
+++ b/examples/tutorials/gettingStarted/gsQml/filedialog/directory.cpp
@@ -221,4 +221,4 @@ void Directory::refresh()
}
m_fileList.append(file);
}
-} \ No newline at end of file
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/file.cpp b/examples/tutorials/gettingStarted/gsQml/filedialog/file.cpp
index 44b0915..17740f2 100644
--- a/examples/tutorials/gettingStarted/gsQml/filedialog/file.cpp
+++ b/examples/tutorials/gettingStarted/gsQml/filedialog/file.cpp
@@ -54,4 +54,4 @@ void File::setName(const QString &str){
m_name = str;
emit nameChanged();
}
-} \ No newline at end of file
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/file.h b/examples/tutorials/gettingStarted/gsQml/filedialog/file.h
index 21e8ebb..6aa6a6a 100644
--- a/examples/tutorials/gettingStarted/gsQml/filedialog/file.h
+++ b/examples/tutorials/gettingStarted/gsQml/filedialog/file.h
@@ -64,4 +64,4 @@ class File : public QObject{
QString m_name;
};
-#endif \ No newline at end of file
+#endif
diff --git a/examples/tutorials/modelview/4_headers/main.cpp b/examples/tutorials/modelview/4_headers/main.cpp
index c89829a..8a4ab8f 100755
--- a/examples/tutorials/modelview/4_headers/main.cpp
+++ b/examples/tutorials/modelview/4_headers/main.cpp
@@ -50,4 +50,4 @@ int main(int argc, char *argv[])
tableView.setModel( &myModel );
tableView.show();
return a.exec();
-} \ No newline at end of file
+}
diff --git a/examples/tutorials/threads/clock/clockthread.h b/examples/tutorials/threads/clock/clockthread.h
index 966dbea..d77a52b 100644
--- a/examples/tutorials/threads/clock/clockthread.h
+++ b/examples/tutorials/threads/clock/clockthread.h
@@ -61,4 +61,4 @@ private slots:
};
//! [1]
-#endif // CLOCKTHREAD_H \ No newline at end of file
+#endif // CLOCKTHREAD_H
diff --git a/src/gui/dialogs/qfiledialog_win_p.h b/src/gui/dialogs/qfiledialog_win_p.h
index 1ff29d2..1408057 100644
--- a/src/gui/dialogs/qfiledialog_win_p.h
+++ b/src/gui/dialogs/qfiledialog_win_p.h
@@ -240,4 +240,4 @@ DECLARE_INTERFACE_(IFileOpenDialog, IFileDialog)
STDMETHOD(GetResults)(THIS_ IShellItemArray **ppenum) PURE;
STDMETHOD(GetSelectedItems)(THIS_ IShellItemArray **ppsai) PURE;
};
-#endif \ No newline at end of file
+#endif
diff --git a/tests/auto/qaudioinput/tst_qaudioinput.cpp b/tests/auto/qaudioinput/tst_qaudioinput.cpp
index 6025bdb..0004c42 100644
--- a/tests/auto/qaudioinput/tst_qaudioinput.cpp
+++ b/tests/auto/qaudioinput/tst_qaudioinput.cpp
@@ -86,14 +86,14 @@ void tst_QAudioInput::initTestCase()
// Only perform tests if audio input device exists!
QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::availableDevices(QAudio::AudioInput);
- if(devices.size() > 0)
+ if (devices.size() > 0)
available = true;
else {
qWarning()<<"NOTE: no audio input device found, no test will be performed";
available = false;
}
- if(available)
+ if (available)
audio = new QAudioInput(format, this);
}
@@ -124,6 +124,9 @@ void tst_QAudioInput::invalidFormat_data()
void tst_QAudioInput::invalidFormat()
{
+ if (!available)
+ QSKIP("No audio input device found, no test will be performed", SkipAll);
+
QFETCH(QAudioFormat, invalidFormat);
QAudioInput audioInput(invalidFormat, this);
@@ -140,81 +143,85 @@ void tst_QAudioInput::invalidFormat()
void tst_QAudioInput::settings()
{
- if(available) {
- // Confirm the setting we added in the init function.
- QAudioFormat f = audio->format();
-
- QVERIFY(format.channels() == f.channels());
- QVERIFY(format.frequency() == f.frequency());
- QVERIFY(format.sampleSize() == f.sampleSize());
- QVERIFY(format.codec() == f.codec());
- QVERIFY(format.byteOrder() == f.byteOrder());
- QVERIFY(format.sampleType() == f.sampleType());
- }
+ if (!available)
+ QSKIP("No audio input device found, no test will be performed", SkipAll);
+
+ // Confirm the setting we added in the init function.
+ QAudioFormat f = audio->format();
+
+ QVERIFY(format.channels() == f.channels());
+ QVERIFY(format.frequency() == f.frequency());
+ QVERIFY(format.sampleSize() == f.sampleSize());
+ QVERIFY(format.codec() == f.codec());
+ QVERIFY(format.byteOrder() == f.byteOrder());
+ QVERIFY(format.sampleType() == f.sampleType());
}
void tst_QAudioInput::buffers()
{
- if(available) {
- // Should always have a buffer size greater than zero.
- int store = audio->bufferSize();
- audio->setBufferSize(4096);
- QVERIFY(audio->bufferSize() > 0);
- audio->setBufferSize(store);
- QVERIFY(audio->bufferSize() == store);
- }
+ if (!available)
+ QSKIP("No audio input device found, no test will be performed", SkipAll);
+
+ // Should always have a buffer size greater than zero.
+ int store = audio->bufferSize();
+ audio->setBufferSize(4096);
+ QVERIFY(audio->bufferSize() > 0);
+ audio->setBufferSize(store);
+ QVERIFY(audio->bufferSize() == store);
}
void tst_QAudioInput::notifyInterval()
{
- if(available) {
- QVERIFY(audio->notifyInterval() == 1000); // Default
+ if (!available)
+ QSKIP("No audio input device found, no test will be performed", SkipAll);
- audio->setNotifyInterval(500);
- QVERIFY(audio->notifyInterval() == 500); // Custom
+ QVERIFY(audio->notifyInterval() == 1000); // Default
- audio->setNotifyInterval(1000); // reset
- }
+ audio->setNotifyInterval(500);
+ QVERIFY(audio->notifyInterval() == 500); // Custom
+
+ audio->setNotifyInterval(1000); // reset
}
void tst_QAudioInput::pullFile()
{
- if(available) {
- QFile filename(SRCDIR"test.raw");
- filename.open( QIODevice::WriteOnly | QIODevice::Truncate );
-
- QSignalSpy readSignal(audio, SIGNAL(notify()));
- QSignalSpy stateSignal(audio, SIGNAL(stateChanged(QAudio::State)));
-
- // Always have default states, before start
- QVERIFY(audio->state() == QAudio::StoppedState);
- QVERIFY(audio->error() == QAudio::NoError);
- QVERIFY(audio->elapsedUSecs() == 0);
-
- audio->start(&filename);
- QTest::qWait(20);
- // Check state and periodSize() are valid non-zero values.
- QVERIFY(audio->state() == QAudio::ActiveState);
- QVERIFY(audio->error() == QAudio::NoError);
- QVERIFY(audio->elapsedUSecs() > 10000 && audio->elapsedUSecs() < 800000);
- QVERIFY(audio->periodSize() > 0);
- QVERIFY(stateSignal.count() == 1); // State changed to QAudio::ActiveState
-
- // Wait until finished...
- QTest::qWait(5000);
-
- QVERIFY(readSignal.count() > 0);
- QVERIFY(audio->processedUSecs() > 0);
-
- audio->stop();
- QTest::qWait(20);
- QVERIFY(audio->state() == QAudio::StoppedState);
- QVERIFY(audio->elapsedUSecs() == 0);
- // Can only check to make sure we got at least 1 more signal, but can be more.
- QVERIFY(stateSignal.count() > 1);
-
- filename.close();
- }
+ if (!available)
+ QSKIP("No audio input device found, no test will be performed", SkipAll);
+
+ QFile filename(SRCDIR"test.raw");
+ filename.open( QIODevice::WriteOnly | QIODevice::Truncate );
+
+ QSignalSpy readSignal(audio, SIGNAL(notify()));
+ QSignalSpy stateSignal(audio, SIGNAL(stateChanged(QAudio::State)));
+
+ // Always have default states, before start
+ QVERIFY(audio->state() == QAudio::StoppedState);
+ QVERIFY(audio->error() == QAudio::NoError);
+ QVERIFY(audio->elapsedUSecs() == 0);
+
+ audio->start(&filename);
+ QTest::qWait(20);
+ // Check state and periodSize() are valid non-zero values.
+ QVERIFY(audio->state() == QAudio::ActiveState);
+ QVERIFY(audio->error() == QAudio::NoError);
+ QVERIFY(audio->elapsedUSecs() > 10000 && audio->elapsedUSecs() < 800000);
+ QVERIFY(audio->periodSize() > 0);
+ QVERIFY(stateSignal.count() == 1); // State changed to QAudio::ActiveState
+
+ // Wait until finished...
+ QTest::qWait(5000);
+
+ QVERIFY(readSignal.count() > 0);
+ QVERIFY(audio->processedUSecs() > 0);
+
+ audio->stop();
+ QTest::qWait(20);
+ QVERIFY(audio->state() == QAudio::StoppedState);
+ QVERIFY(audio->elapsedUSecs() == 0);
+ // Can only check to make sure we got at least 1 more signal, but can be more.
+ QVERIFY(stateSignal.count() > 1);
+
+ filename.close();
}
QTEST_MAIN(tst_QAudioInput)
diff --git a/tests/auto/qdialog/tst_qdialog.cpp b/tests/auto/qdialog/tst_qdialog.cpp
index 6d9f798..86dde21 100644
--- a/tests/auto/qdialog/tst_qdialog.cpp
+++ b/tests/auto/qdialog/tst_qdialog.cpp
@@ -467,6 +467,22 @@ void tst_QDialog::throwInExec()
#if defined(Q_WS_MAC) || (defined(Q_WS_WINCE) && defined(_ARM_))
QSKIP("Throwing exceptions in exec() is not supported on this platform.", SkipAll);
#endif
+
+#if defined(Q_OS_LINUX)
+ // C++ exceptions can't be passed through glib callbacks. Skip the test if
+ // we're using the glib event loop.
+ QByteArray dispatcher = QAbstractEventDispatcher::instance()->metaObject()->className();
+ if (dispatcher.contains("Glib")) {
+ QSKIP(
+ qPrintable(QString(
+ "Throwing exceptions in exec() won't work if %1 event dispatcher is used.\n"
+ "Try running with QT_NO_GLIB=1 in environment."
+ ).arg(QString::fromLatin1(dispatcher))),
+ SkipAll
+ );
+ }
+#endif
+
int caughtExceptions = 0;
try {
ExceptionDialog dialog;
diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp
index 08d2e88..81da8a3 100644
--- a/tests/auto/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp
@@ -80,7 +80,9 @@
# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
#elif defined(Q_OS_UNIX)
#ifdef QT_BUILD_INTERNAL
+QT_BEGIN_NAMESPACE
extern Q_GUI_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded = 0);
+QT_END_NAMESPACE
#endif
#endif
diff --git a/tools/macdeployqt/shared/shared.cpp b/tools/macdeployqt/shared/shared.cpp
index 1a9a6ab..156f1de 100644
--- a/tools/macdeployqt/shared/shared.cpp
+++ b/tools/macdeployqt/shared/shared.cpp
@@ -127,7 +127,7 @@ FrameworkInfo parseOtoolLibraryLine(const QString &line, bool useDebugLibs)
while (part < parts.count()) {
const QString currentPart = parts.at(part).simplified() ;
++part;
- if (currentPart == "")
+ if (currentPart.isEmpty())
continue;
if (state == QtPath) {
diff --git a/tools/macdeployqt/tests/tst_deployment_mac.cpp b/tools/macdeployqt/tests/tst_deployment_mac.cpp
index 858dc45..5921199 100644
--- a/tools/macdeployqt/tests/tst_deployment_mac.cpp
+++ b/tools/macdeployqt/tests/tst_deployment_mac.cpp
@@ -230,4 +230,4 @@ void tst_deployment_mac::testFindAppBinarty()
QTEST_MAIN(tst_deployment_mac)
-#include "tst_deployment_mac.moc" \ No newline at end of file
+#include "tst_deployment_mac.moc"
diff --git a/tools/qtconcurrent/codegenerator/src/codegenerator.cpp b/tools/qtconcurrent/codegenerator/src/codegenerator.cpp
index b8436b9..c81fe97 100644
--- a/tools/qtconcurrent/codegenerator/src/codegenerator.cpp
+++ b/tools/qtconcurrent/codegenerator/src/codegenerator.cpp
@@ -134,7 +134,7 @@ const Compound operator+(const Item &a, const char * const text)
const Compound operator+(const char * const text, const Item &b)
{
- return Compound(Text(text), b);
+ return Compound(Text(text), b);
}
-} \ No newline at end of file
+}
diff --git a/tools/qtestlib/wince/cetest/deployment.h b/tools/qtestlib/wince/cetest/deployment.h
index f3645e0..a5ef32d 100644
--- a/tools/qtestlib/wince/cetest/deployment.h
+++ b/tools/qtestlib/wince/cetest/deployment.h
@@ -72,4 +72,4 @@ private:
inline void DeploymentHandler::setConnection(AbstractRemoteConnection *connection) { m_connection = connection; }
inline AbstractRemoteConnection* DeploymentHandler::connection() const { return m_connection; }
-#endif \ No newline at end of file
+#endif