Changeset 165 for smplayer/trunk/src/qtsingleapplication
- Timestamp:
- May 16, 2014, 9:51:55 AM (11 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 163
- Property svn:mergeinfo changed
-
smplayer/trunk/src/qtsingleapplication/qtlocalpeer.cpp
r128 r165 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 ** All rights reserved. 5 ** 6 ** Contact: Nokia Corporation (qt-info@nokia.com) 7 ** 8 ** This file is part of a Qt Solutions component. 9 ** 3 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 ** Contact: http://www.qt-project.org/legal 5 ** 6 ** This file is part of the Qt Solutions component. 7 ** 8 ** $QT_BEGIN_LICENSE:BSD$ 10 9 ** You may use this file under the terms of the BSD license as follows: 11 10 ** … … 19 18 ** the documentation and/or other materials provided with the 20 19 ** distribution. 21 ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor22 ** the names of its contributors may be used to endorse or promote23 ** products derived from this software without specific prior written24 ** permission.20 ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 ** of its contributors may be used to endorse or promote products derived 22 ** from this software without specific prior written permission. 23 ** 25 24 ** 26 25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS … … 36 35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 37 36 ** 37 ** $QT_END_LICENSE$ 38 ** 38 39 ****************************************************************************/ 39 40 40 41 41 42 #include "qtlocalpeer.h" 42 #include <Q tCore/QCoreApplication>43 #include <Q tCore/QTime>44 45 #if defined(Q_OS_WIN) 46 #include <Q tCore/QLibrary>47 #include < QtCore/qt_windows.h>43 #include <QCoreApplication> 44 #include <QTime> 45 46 #if defined(Q_OS_WIN) 47 #include <QLibrary> 48 #include <qt_windows.h> 48 49 typedef BOOL(WINAPI*PProcessIdToSessionId)(DWORD,DWORD*); 49 50 static PProcessIdToSessionId pProcessIdToSessionId = 0; 50 51 #endif 51 52 #if defined(Q_OS_UNIX) || defined(Q_OS_OS2) 53 #include <sys/types.h> 52 54 #include <time.h> 53 55 #include <unistd.h> … … 196 198 socket->write(ack, qstrlen(ack)); 197 199 socket->waitForBytesWritten(1000); 200 socket->waitForDisconnected(1000); // make sure client reads ack 198 201 delete socket; 199 202 emit messageReceived(message); //### (might take a long time to return) -
smplayer/trunk/src/qtsingleapplication/qtlocalpeer.h
r128 r165 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0 Nokia Corporationand/or its subsidiary(-ies).4 ** All rights reserved.3 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 ** Contact: http://www.qt-project.org/legal 5 5 ** 6 ** Contact: Nokia Corporation (qt-info@nokia.com)6 ** This file is part of the Qt Solutions component. 7 7 ** 8 ** This file is part of a Qt Solutions component. 9 ** 8 ** $QT_BEGIN_LICENSE:BSD$ 10 9 ** You may use this file under the terms of the BSD license as follows: 11 10 ** … … 19 18 ** the documentation and/or other materials provided with the 20 19 ** distribution. 21 ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor22 ** the names of its contributors may be used to endorse or promote23 ** products derived from this software without specific prior written24 ** permission.20 ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 ** of its contributors may be used to endorse or promote products derived 22 ** from this software without specific prior written permission. 23 ** 25 24 ** 26 25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS … … 36 35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 37 36 ** 37 ** $QT_END_LICENSE$ 38 ** 38 39 ****************************************************************************/ 39 40 … … 41 42 #define QTLOCALPEER_H 42 43 43 #include <Q tNetwork/QLocalServer>44 #include <Q tNetwork/QLocalSocket>45 #include <Q tCore/QDir>44 #include <QLocalServer> 45 #include <QLocalSocket> 46 #include <QDir> 46 47 47 48 #include "qtlockedfile.h" -
smplayer/trunk/src/qtsingleapplication/qtlockedfile.cpp
r128 r165 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0 Nokia Corporationand/or its subsidiary(-ies).4 ** All rights reserved.3 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 ** Contact: http://www.qt-project.org/legal 5 5 ** 6 ** Contact: Nokia Corporation (qt-info@nokia.com)6 ** This file is part of the Qt Solutions component. 7 7 ** 8 ** This file is part of a Qt Solutions component. 9 ** 8 ** $QT_BEGIN_LICENSE:BSD$ 10 9 ** You may use this file under the terms of the BSD license as follows: 11 10 ** … … 19 18 ** the documentation and/or other materials provided with the 20 19 ** distribution. 21 ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor22 ** the names of its contributors may be used to endorse or promote23 ** products derived from this software without specific prior written24 ** permission.20 ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 ** of its contributors may be used to endorse or promote products derived 22 ** from this software without specific prior written permission. 23 ** 25 24 ** 26 25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS … … 35 34 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 ** 37 ** $QT_END_LICENSE$ 37 38 ** 38 39 ****************************************************************************/ -
smplayer/trunk/src/qtsingleapplication/qtlockedfile.h
r128 r165 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0 Nokia Corporationand/or its subsidiary(-ies).4 ** All rights reserved.3 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 ** Contact: http://www.qt-project.org/legal 5 5 ** 6 ** Contact: Nokia Corporation (qt-info@nokia.com)6 ** This file is part of the Qt Solutions component. 7 7 ** 8 ** This file is part of a Qt Solutions component. 9 ** 8 ** $QT_BEGIN_LICENSE:BSD$ 10 9 ** You may use this file under the terms of the BSD license as follows: 11 10 ** … … 19 18 ** the documentation and/or other materials provided with the 20 19 ** distribution. 21 ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor22 ** the names of its contributors may be used to endorse or promote23 ** products derived from this software without specific prior written24 ** permission.20 ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 ** of its contributors may be used to endorse or promote products derived 22 ** from this software without specific prior written permission. 23 ** 25 24 ** 26 25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS … … 36 35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 37 36 ** 37 ** $QT_END_LICENSE$ 38 ** 38 39 ****************************************************************************/ 39 40 … … 41 42 #define QTLOCKEDFILE_H 42 43 43 #include <Q tCore/QFile>44 #include <QFile> 44 45 #ifdef Q_OS_WIN 45 #include <Q tCore/QVector>46 #include <QVector> 46 47 #endif 47 48 48 #if defined(Q_ WS_WIN)49 #if defined(Q_OS_WIN) 49 50 # if !defined(QT_QTLOCKEDFILE_EXPORT) && !defined(QT_QTLOCKEDFILE_IMPORT) 50 51 # define QT_QTLOCKEDFILE_EXPORT -
smplayer/trunk/src/qtsingleapplication/qtlockedfile_unix.cpp
r128 r165 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0 Nokia Corporationand/or its subsidiary(-ies).4 ** All rights reserved.3 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 ** Contact: http://www.qt-project.org/legal 5 5 ** 6 ** Contact: Nokia Corporation (qt-info@nokia.com)6 ** This file is part of the Qt Solutions component. 7 7 ** 8 ** This file is part of a Qt Solutions component. 9 ** 8 ** $QT_BEGIN_LICENSE:BSD$ 10 9 ** You may use this file under the terms of the BSD license as follows: 11 10 ** … … 19 18 ** the documentation and/or other materials provided with the 20 19 ** distribution. 21 ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor22 ** the names of its contributors may be used to endorse or promote23 ** products derived from this software without specific prior written24 ** permission.20 ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 ** of its contributors may be used to endorse or promote products derived 22 ** from this software without specific prior written permission. 23 ** 25 24 ** 26 25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS … … 35 34 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 ** 37 ** $QT_END_LICENSE$ 37 38 ** 38 39 ****************************************************************************/ -
smplayer/trunk/src/qtsingleapplication/qtlockedfile_win.cpp
r128 r165 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 ** All rights reserved. 5 ** 6 ** Contact: Nokia Corporation (qt-info@nokia.com) 7 ** 8 ** This file is part of a Qt Solutions component. 9 ** 3 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 ** Contact: http://www.qt-project.org/legal 5 ** 6 ** This file is part of the Qt Solutions component. 7 ** 8 ** $QT_BEGIN_LICENSE:BSD$ 10 9 ** You may use this file under the terms of the BSD license as follows: 11 10 ** … … 19 18 ** the documentation and/or other materials provided with the 20 19 ** distribution. 21 ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor22 ** the names of its contributors may be used to endorse or promote23 ** products derived from this software without specific prior written24 ** permission.20 ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 ** of its contributors may be used to endorse or promote products derived 22 ** from this software without specific prior written permission. 23 ** 25 24 ** 26 25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS … … 36 35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 37 36 ** 37 ** $QT_END_LICENSE$ 38 ** 38 39 ****************************************************************************/ 39 40 40 41 #include "qtlockedfile.h" 41 42 #include <qt_windows.h> 42 #include <Q tCore/QFileInfo>43 #include <QFileInfo> 43 44 44 45 #define MUTEX_PREFIX "QtLockedFile mutex " 45 46 // Maximum number of concurrent read locks. Must not be greater than MAXIMUM_WAIT_OBJECTS 46 47 #define MAX_READERS MAXIMUM_WAIT_OBJECTS 48 49 #if QT_VERSION >= 0x050000 50 #define QT_WA(unicode, ansi) unicode 51 #endif 47 52 48 53 Qt::HANDLE QtLockedFile::getMutexHandle(int idx, bool doCreate) -
smplayer/trunk/src/qtsingleapplication/qtsingleapplication.cpp
r128 r165 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 ** All rights reserved. 5 ** 6 ** Contact: Nokia Corporation (qt-info@nokia.com) 7 ** 8 ** This file is part of a Qt Solutions component. 9 ** 3 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 ** Contact: http://www.qt-project.org/legal 5 ** 6 ** This file is part of the Qt Solutions component. 7 ** 8 ** $QT_BEGIN_LICENSE:BSD$ 10 9 ** You may use this file under the terms of the BSD license as follows: 11 10 ** … … 19 18 ** the documentation and/or other materials provided with the 20 19 ** distribution. 21 ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor22 ** the names of its contributors may be used to endorse or promote23 ** products derived from this software without specific prior written24 ** permission.20 ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 ** of its contributors may be used to endorse or promote products derived 22 ** from this software without specific prior written permission. 23 ** 25 24 ** 26 25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS … … 36 35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 37 36 ** 37 ** $QT_END_LICENSE$ 38 ** 38 39 ****************************************************************************/ 39 40 … … 41 42 #include "qtsingleapplication.h" 42 43 #include "qtlocalpeer.h" 43 #include <Q tGui/QWidget>44 #include <QWidget> 44 45 45 46 … … 170 171 } 171 172 173 #if QT_VERSION < 0x050000 172 174 173 175 /*! … … 183 185 184 186 185 # if defined(Q_WS_X11)187 # if defined(Q_WS_X11) 186 188 /*! 187 189 Special constructor for X11, ref. the documentation of … … 221 223 sysInit(appId); 222 224 } 223 #endif 225 # endif // Q_WS_X11 226 #endif // QT_VERSION < 0x050000 224 227 225 228 -
smplayer/trunk/src/qtsingleapplication/qtsingleapplication.h
r128 r165 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0 Nokia Corporationand/or its subsidiary(-ies).4 ** All rights reserved.3 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 ** Contact: http://www.qt-project.org/legal 5 5 ** 6 ** Contact: Nokia Corporation (qt-info@nokia.com)6 ** This file is part of the Qt Solutions component. 7 7 ** 8 ** This file is part of a Qt Solutions component. 9 ** 8 ** $QT_BEGIN_LICENSE:BSD$ 10 9 ** You may use this file under the terms of the BSD license as follows: 11 10 ** … … 19 18 ** the documentation and/or other materials provided with the 20 19 ** distribution. 21 ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor22 ** the names of its contributors may be used to endorse or promote23 ** products derived from this software without specific prior written24 ** permission.20 ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 ** of its contributors may be used to endorse or promote products derived 22 ** from this software without specific prior written permission. 23 ** 25 24 ** 26 25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS … … 36 35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 37 36 ** 37 ** $QT_END_LICENSE$ 38 ** 38 39 ****************************************************************************/ 39 40 … … 41 42 #define QTSINGLEAPPLICATION_H 42 43 43 #include <Q tGui/QApplication>44 #include <QApplication> 44 45 45 46 class QtLocalPeer; 46 47 47 #if defined(Q_ WS_WIN)48 #if defined(Q_OS_WIN) 48 49 # if !defined(QT_QTSINGLEAPPLICATION_EXPORT) && !defined(QT_QTSINGLEAPPLICATION_IMPORT) 49 50 # define QT_QTSINGLEAPPLICATION_EXPORT … … 68 69 QtSingleApplication(int &argc, char **argv, bool GUIenabled = true); 69 70 QtSingleApplication(const QString &id, int &argc, char **argv); 71 #if QT_VERSION < 0x050000 70 72 QtSingleApplication(int &argc, char **argv, Type type); 71 # if defined(Q_WS_X11)73 # if defined(Q_WS_X11) 72 74 QtSingleApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0); 73 75 QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0); 74 76 QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0); 75 #endif 77 # endif // Q_WS_X11 78 #endif // QT_VERSION < 0x050000 76 79 77 80 bool isRunning(); -
smplayer/trunk/src/qtsingleapplication/qtsingleapplication.pri
r128 r165 3 3 DEPENDPATH += $$PWD 4 4 QT *= network 5 greaterThan(QT_MAJOR_VERSION, 4): QT *= widgets 5 6 6 7 qtsingleapplication-uselib:!qtsingleapplication-buildlib { -
smplayer/trunk/src/qtsingleapplication/qtsinglecoreapplication.cpp
r128 r165 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0 Nokia Corporationand/or its subsidiary(-ies).4 ** All rights reserved.3 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 ** Contact: http://www.qt-project.org/legal 5 5 ** 6 ** Contact: Nokia Corporation (qt-info@nokia.com)6 ** This file is part of the Qt Solutions component. 7 7 ** 8 ** This file is part of a Qt Solutions component. 9 ** 8 ** $QT_BEGIN_LICENSE:BSD$ 10 9 ** You may use this file under the terms of the BSD license as follows: 11 10 ** … … 19 18 ** the documentation and/or other materials provided with the 20 19 ** distribution. 21 ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor22 ** the names of its contributors may be used to endorse or promote23 ** products derived from this software without specific prior written24 ** permission.20 ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 ** of its contributors may be used to endorse or promote products derived 22 ** from this software without specific prior written permission. 23 ** 25 24 ** 26 25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS … … 35 34 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 ** 37 ** $QT_END_LICENSE$ 37 38 ** 38 39 ****************************************************************************/ -
smplayer/trunk/src/qtsingleapplication/qtsinglecoreapplication.h
r128 r165 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0 Nokia Corporationand/or its subsidiary(-ies).4 ** All rights reserved.3 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 ** Contact: http://www.qt-project.org/legal 5 5 ** 6 ** Contact: Nokia Corporation (qt-info@nokia.com)6 ** This file is part of the Qt Solutions component. 7 7 ** 8 ** This file is part of a Qt Solutions component. 9 ** 8 ** $QT_BEGIN_LICENSE:BSD$ 10 9 ** You may use this file under the terms of the BSD license as follows: 11 10 ** … … 19 18 ** the documentation and/or other materials provided with the 20 19 ** distribution. 21 ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor22 ** the names of its contributors may be used to endorse or promote23 ** products derived from this software without specific prior written24 ** permission.20 ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 ** of its contributors may be used to endorse or promote products derived 22 ** from this software without specific prior written permission. 23 ** 25 24 ** 26 25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS … … 36 35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 37 36 ** 37 ** $QT_END_LICENSE$ 38 ** 38 39 ****************************************************************************/ 39 40 … … 41 42 #define QTSINGLECOREAPPLICATION_H 42 43 43 #include <Q tCore/QCoreApplication>44 #include <QCoreApplication> 44 45 45 46 class QtLocalPeer;
Note:
See TracChangeset
for help on using the changeset viewer.