Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
Migration from Qt4 to Qt5
Browse files Browse the repository at this point in the history
  • Loading branch information
giowck committed May 8, 2016
1 parent c104f11 commit 333d3b3
Show file tree
Hide file tree
Showing 269 changed files with 460 additions and 397 deletions.
Empty file modified AUTHORS 100644 → 100755
Empty file.
Empty file modified CHANGELOG 100644 → 100755
Empty file.
Empty file modified Doxyfile 100644 → 100755
Empty file.
Empty file modified LICENSE 100644 → 100755
Empty file.
Empty file modified README.md 100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion Symphytum.pro 100644 → 100755
Expand Up @@ -4,7 +4,7 @@
#
#-------------------------------------------------

QT += core gui sql network svg
QT += core gui sql network svg widgets printsupport

macx {
TARGET = Symphytum
Expand Down
Empty file modified components/alarmmanager.cpp 100644 → 100755
Empty file.
Empty file modified components/alarmmanager.h 100644 → 100755
Empty file.
2 changes: 0 additions & 2 deletions components/backupmanager.cpp 100644 → 100755
Expand Up @@ -400,8 +400,6 @@ void BackupManager::createBackupThreadConnections(QThread *thread,
//thread delete
connect(thread, SIGNAL(finished()),
thread, SLOT(deleteLater()));
connect(thread, SIGNAL(terminated()),
thread, SLOT(deleteLater()));

//backupTask signals
connect(backupTask, SIGNAL(errorSignal(QString)),
Expand Down
Empty file modified components/backupmanager.h 100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions components/databasemanager.cpp 100644 → 100755
Expand Up @@ -16,7 +16,7 @@
#include <QtSql/QSqlQuery>
#include <QtSql/QSqlError>
#include <QtCore/QVariant>
#include <QtGui/QMessageBox>
#include <QtWidgets/QMessageBox>
#include <QtGui/QDesktopServices>
#include <QtCore/QDir>

Expand Down Expand Up @@ -127,8 +127,8 @@ QString DatabaseManager::getDatabasePath()

DatabaseManager::DatabaseManager()
{
QString dataDir = QDesktopServices::storageLocation(
QDesktopServices::DataLocation);
QString dataDir = QStandardPaths::standardLocations(
QStandardPaths::DataLocation).at(0);
m_databaseName = "data.db";
m_databasePath = dataDir.append("/");
m_databasePath.append(m_databaseName);
Expand Down
Empty file modified components/databasemanager.h 100644 → 100755
Empty file.
12 changes: 5 additions & 7 deletions components/filemanager.cpp 100644 → 100755
Expand Up @@ -16,7 +16,7 @@
#include <QtCore/QDir>
#include <QtCore/QFile>
#include <QtCore/QThread>
#include <QtGui/QMessageBox>
#include <QtWidgets/QMessageBox>
#include <QtCore/QDateTime>
#include <QtCore/QCryptographicHash>
#include <QtGui/QDesktopServices>
Expand Down Expand Up @@ -90,11 +90,11 @@ void FileTask::startFileOp()
FileManager::FileManager(QObject *parent) :
QObject(parent), m_fileOpThread(0)
{
QString dataDir = QDesktopServices::storageLocation(
QDesktopServices::DataLocation);
#ifdef Q_WS_WIN
QString dataDir = QStandardPaths::standardLocations(
QStandardPaths::DataLocation).at(0);
#ifdef Q_OS_WIN
dataDir.replace("\\", "/");
#endif // Q_WS_WIN
#endif // Q_OS_WIN
if (!QDir(dataDir).exists()) {
QDir::current().mkpath(dataDir);
}
Expand Down Expand Up @@ -465,8 +465,6 @@ void FileManager::createFileThreadConnections(QThread *thread,
//thread delete
connect(thread, SIGNAL(finished()),
thread, SLOT(deleteLater()));
connect(thread, SIGNAL(terminated()),
thread, SLOT(deleteLater()));

//fileTask signals
connect(fileTask, SIGNAL(errorSignal(QString)),
Expand Down
Empty file modified components/filemanager.h 100644 → 100755
Empty file.
Empty file modified components/formlayoutmatrix.cpp 100644 → 100755
Empty file.
Empty file modified components/formlayoutmatrix.h 100644 → 100755
Empty file.
Empty file modified components/metadataengine.cpp 100644 → 100755
Empty file.
Empty file modified components/metadataengine.h 100644 → 100755
Empty file.
Empty file modified components/settingsmanager.cpp 100644 → 100755
Empty file.
Empty file modified components/settingsmanager.h 100644 → 100755
Empty file.
Empty file modified components/sync_framework/abstractsyncdriver.cpp 100644 → 100755
Empty file.
Empty file modified components/sync_framework/abstractsyncdriver.h 100644 → 100755
Empty file.
14 changes: 7 additions & 7 deletions components/sync_framework/dropboxsyncdriver.cpp 100644 → 100755
Expand Up @@ -10,7 +10,7 @@
#include "../settingsmanager.h"

#include <QtCore/QFileInfo>
#include <QtGui/QApplication>
#include <QtWidgets/QApplication>


//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -190,7 +190,7 @@ void DropboxSyncDriver::processFinished(int exitCode,
token = list.at(i + 1);
}
}
QString encodedToken = QString(token.toAscii().toBase64());
QString encodedToken = QString(token.toLatin1().toBase64());
m_accessTokenEncoded = encodedToken;
SettingsManager s;
s.saveEncodedAccessToken(encodedToken);
Expand Down Expand Up @@ -324,11 +324,11 @@ void DropboxSyncDriver::startRequest()
QString accessToken;
QString command;

#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
pythonInterpreterPath = QApplication::applicationDirPath()
.append("/sync/").append("dropbox_client.exe");
#endif
#ifdef Q_WS_MAC
#ifdef Q_OS_OSX
if (QSysInfo::MacintoshVersion <= QSysInfo::MV_10_6)
pythonInterpreterPath = "python2.6";
else
Expand All @@ -337,14 +337,14 @@ void DropboxSyncDriver::startRequest()
path.append("dropbox_client.py");
args.append(path);
#endif
#ifdef Q_WS_X11
#ifdef Q_OS_LINUX
pythonInterpreterPath = "python2";
args.append("/usr/share/symphytum/sync/dropbox_client.py");
#endif

//decode access token
accessToken = QString(
QByteArray::fromBase64(m_accessTokenEncoded.toAscii()));
QByteArray::fromBase64(m_accessTokenEncoded.toLatin1()));

//decode app secret
QString s2;
Expand All @@ -357,7 +357,7 @@ void DropboxSyncDriver::startRequest()
s1.append(m_appSecretEncoded.at(i));
}
QString e = s1 + s2;
appSecret = QString(QByteArray::fromBase64(e.toAscii()));
appSecret = QString(QByteArray::fromBase64(e.toLatin1()));

//init command and etra args
QStringList extraArgs; //extra arguments for specific command
Expand Down
Empty file modified components/sync_framework/dropboxsyncdriver.h 100644 → 100755
Empty file.
Empty file modified components/sync_framework/scripts/dropbox_client.py 100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions components/sync_framework/syncengine.cpp 100644 → 100755
Expand Up @@ -476,8 +476,8 @@ SyncEngine::SyncEngine(QObject *parent) :
m_currentEngineOperation(NoSpecialOp),
m_cloudSessionOpened(false)
{
QString dataDir = QDesktopServices::storageLocation(
QDesktopServices::DataLocation);
QString dataDir = QStandardPaths::standardLocations(
QStandardPaths::DataLocation).at(0);
m_metadataFileName = "sync.meta";
m_metadataFilePath = dataDir.append("/");
m_metadataFilePath.append(m_metadataFileName);
Expand Down
Empty file modified components/sync_framework/syncengine.h 100644 → 100755
Empty file.
Empty file modified components/sync_framework/syncsession.cpp 100644 → 100755
Empty file.
Empty file modified components/sync_framework/syncsession.h 100644 → 100755
Empty file.
Empty file modified components/undocommands.cpp 100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion components/undocommands.h 100644 → 100755
Expand Up @@ -13,7 +13,7 @@
// Headers
//-----------------------------------------------------------------------------

#include <QtGui/QUndoCommand>
#include <QtWidgets/QUndoCommand>
#include <QtCore/QVariant>
#include <QtCore/QList>

Expand Down
4 changes: 2 additions & 2 deletions components/updatemanager.cpp 100644 → 100755
Expand Up @@ -13,8 +13,8 @@
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QNetworkReply>
#include <QtCore/QStringList>
#include <QtGui/QMessageBox>
#include <QtGui/QApplication>
#include <QtWidgets/QMessageBox>
#include <QtWidgets/QApplication>
#include <QtGui/QDesktopServices>


Expand Down
Empty file modified components/updatemanager.h 100644 → 100755
Empty file.
Empty file modified doc/deployment/README 100644 → 100755
Empty file.
Empty file modified doc/deployment/pyinstaller dropbox howto 100644 → 100755
Empty file.
Empty file modified doc/design/HACKING 100644 → 100755
Empty file.
Empty file modified doc/design/Standard Database Design 100644 → 100755
Empty file.
Empty file modified doc/translation/README 100644 → 100755
Empty file.
Empty file modified main.cpp 100644 → 100755
Empty file.
Empty file modified models/collectionlistmodel.cpp 100644 → 100755
Empty file.
Empty file modified models/collectionlistmodel.h 100644 → 100755
Empty file.
Empty file modified models/standardmodel.cpp 100644 → 100755
Empty file.
Empty file modified models/standardmodel.h 100644 → 100755
Empty file.
Empty file modified models/testmodel.cpp 100644 → 100755
Empty file.
Empty file modified models/testmodel.h 100644 → 100755
Empty file.
Empty file modified resources/images/icons/LICENSE 100644 → 100755
Empty file.
Empty file modified resources/images/icons/add.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/alarm.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/collectionlistitem.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/deletecollection.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/deletefield.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/deleterecord.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/draghere.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/dropbox.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/duplicatefield.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/duplicaterecord.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/export.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/initConflict.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/newcollection.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/newfield.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/newrecord.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/nextrecord.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/previousrecord.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/remove.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/revConflict.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/settings_advanced.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/settings_appearance.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/settings_general.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/symphytum.icns 100644 → 100755
Empty file.
Empty file modified resources/images/icons/symphytum.ico 100644 → 100755
Empty file.
Empty file modified resources/images/icons/symphytum.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/icons/sync.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/sample/LICENSE 100644 → 100755
Empty file.
Empty file modified resources/images/sample/calendula.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/images/sample/coffea.jpg 100644 → 100755
Empty file modified resources/images/sample/symphytum.jpg 100644 → 100755
Empty file modified resources/languages/qt_de.qm 100644 → 100755
Empty file.
Empty file modified resources/languages/symphytum_de.qm 100644 → 100755
Empty file.
Empty file modified resources/languages/symphytum_it.qm 100644 → 100755
Empty file.
Empty file modified resources/resources.qrc 100644 → 100755
Empty file.
Empty file modified resources/src/icons/LICENSE 100644 → 100755
Empty file.
Empty file modified resources/src/icons/README 100644 → 100755
Empty file.
Empty file modified resources/src/icons/searchline_clear.svg 100644 → 100755
Empty file modified resources/src/icons/searchline_icon.svg 100644 → 100755
Empty file modified stuff/3rdparty_licenses.html 100644 → 100755
Empty file.
Empty file modified stuff/dropbox-python-sdk/dropbox-python-sdk-1.5.1.zip 100644 → 100755
Empty file.
Empty file modified stuff/dropbox-python-sdk/patches/chunked_upload_output.patch 100644 → 100755
Empty file.
Empty file modified stuff/installers/PKGBUILD 100644 → 100755
Empty file.
Empty file modified stuff/installers/deb/usr/share/pixmaps/symphytum.png 100644 → 100755
Empty file modified stuff/installers/deb/usr/share/pixmaps/symphytum.xpm 100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified stuff/installers/deb/usr/share/symphytum/sync/dropbox/rest.pyc 100644 → 100755
Empty file.
Empty file.
Empty file modified stuff/installers/deb/usr/share/symphytum/sync/dropbox/six.pyc 100644 → 100755
Empty file.
Empty file modified stuff/installers/deb/usr/share/symphytum/sync/dropbox/util.py 100644 → 100755
Empty file.
Empty file modified stuff/installers/deb/usr/share/symphytum/sync/dropbox/util.pyc 100644 → 100755
Empty file.
Empty file modified stuff/installers/deb/usr/share/symphytum/sync/dropbox_client.py 100644 → 100755
Empty file.
Empty file.
Empty file modified stuff/installers/dmg/dmgback.png 100644 → 100755
Empty file modified stuff/installers/dmg/dmgback.xcf 100644 → 100755
Empty file.
Empty file modified stuff/installers/dmg/g29827.png 100644 → 100755
Empty file modified stuff/installers/symphytum.iss 100644 → 100755
Empty file.
Empty file modified stuff/logo/symphytum.png 100644 → 100755
Empty file modified stuff/logo/symphytum_64.png 100644 → 100755
Empty file modified stuff/pyinstaller-1.5.1.zip 100644 → 100755
Empty file.
Empty file modified stuff/translations/symphytum_de.ts 100644 → 100755
Empty file.
Empty file modified stuff/translations/symphytum_it.ts 100644 → 100755
Empty file.
Empty file modified tests/DatabaseManager/DatabaseManager.pro 100644 → 100755
Empty file.
Empty file modified tests/DatabaseManager/tst_databasemanagertest.cpp 100644 → 100755
Empty file.
Empty file modified tests/FormLayoutMatrix/FormLayoutMatrix.pro 100644 → 100755
Empty file.
Empty file modified tests/FormLayoutMatrix/tst_formlayoutmatrixtest.cpp 100644 → 100755
Empty file.
Empty file modified tests/FormLayoutState/FormLayoutState.pro 100644 → 100755
Empty file.
Empty file modified tests/FormLayoutState/tst_formlayoutstatetest.cpp 100644 → 100755
Empty file.
Empty file modified tests/FormWidgetValidator/FormWidgetValidator.pro 100644 → 100755
Empty file.
Empty file modified tests/FormWidgetValidator/tst_formwidgetvalidatortest.cpp 100644 → 100755
Empty file.
Empty file modified tests/MetadataEngine/MetadataEngine.pro 100644 → 100755
Empty file.
Empty file modified tests/MetadataEngine/tst_metadataenginetest.cpp 100644 → 100755
Empty file.
Empty file modified tests/MetadataPropertiesParser/MetadataPropertiesParser.pro 100644 → 100755
Empty file.
Empty file.
Empty file modified ui/aboutdialog.ui 100644 → 100755
Empty file.
Empty file modified ui/addfielddialog.ui 100644 → 100755
Empty file.
Empty file modified ui/alarmlistdialog.ui 100644 → 100755
Empty file.
Empty file modified ui/backupdialog.ui 100644 → 100755
Empty file.
Empty file modified ui/checkboxfieldwizard.ui 100644 → 100755
Empty file.
Empty file modified ui/comboboxfieldwizard.ui 100644 → 100755
Empty file.
Empty file modified ui/creationdatefieldwizard.ui 100644 → 100755
Empty file.
Empty file modified ui/datefieldwizard.ui 100644 → 100755
Empty file.
Empty file modified ui/emptyformwidget.ui 100644 → 100755
Empty file.
Empty file modified ui/exportdialog.ui 100644 → 100755
Empty file.
Empty file modified ui/filesfieldwizard.ui 100644 → 100755
Empty file.
Empty file modified ui/imagefieldwizard.ui 100644 → 100755
Empty file.
Empty file modified ui/importdialog.ui 100644 → 100755
Empty file.
Empty file modified ui/moddatefieldwizard.ui 100644 → 100755
Empty file.
Empty file modified ui/numberfieldwizard.ui 100644 → 100755
Empty file.
Empty file modified ui/preferencesdialog.ui 100644 → 100755
Empty file.
Empty file modified ui/printdialog.ui 100644 → 100755
Empty file.
Empty file modified ui/progressfieldwizard.ui 100644 → 100755
Empty file.
Empty file modified ui/syncconfigdialog.ui 100644 → 100755
Empty file.
Empty file modified ui/syncprocessdialog.ui 100644 → 100755
Empty file.
Empty file modified ui/textfieldwizard.ui 100644 → 100755
Empty file.
Empty file modified utils/collectionfieldcleaner.cpp 100644 → 100755
Empty file.
Empty file modified utils/collectionfieldcleaner.h 100644 → 100755
Empty file.
Empty file modified utils/definitionholder.cpp 100644 → 100755
Empty file.
Empty file modified utils/definitionholder.h 100644 → 100755
Empty file.
Empty file modified utils/formviewlayoutstate.cpp 100644 → 100755
Empty file.
Empty file modified utils/formviewlayoutstate.h 100644 → 100755
Empty file.
Empty file modified utils/formwidgetvalidator.cpp 100644 → 100755
Empty file.
Empty file modified utils/formwidgetvalidator.h 100644 → 100755
Empty file.
Empty file modified utils/maclionfullscreenprovider.h 100644 → 100755
Empty file.
14 changes: 7 additions & 7 deletions utils/maclionfullscreenprovider.mm 100644 → 100755
Expand Up @@ -8,39 +8,39 @@

#include "maclionfullscreenprovider.h"

#include <QtGui/QMainWindow>
#include <QtWidgets/QMainWindow>


//-----------------------------------------------------------------------------
// Public
//-----------------------------------------------------------------------------

void MacLionFullscreenProvider::enableWindow(QMainWindow *window)
{
{/*
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
NSView *nsview = (NSView *) window->winId();
NSWindow *nswindow = [nsview window];
[nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
#endif
#endif*/
}

void MacLionFullscreenProvider::toggleFullscreen(QMainWindow *window)
{
{/*
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
NSView *nsview = (NSView *) window->winId();
NSWindow *nswindow = [nsview window];
[nswindow toggleFullScreen:nil];
#endif
#endif*/
}

bool MacLionFullscreenProvider::isFullScreen(QMainWindow *window)
{
bool result;
bool result;/*
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
NSView *nsview = (NSView *) window->winId();
NSWindow *nswindow = [nsview window];
NSUInteger masks = [nswindow styleMask];
result = masks & NSFullScreenWindowMask;
#endif
#endif*/
return result;
}
Empty file modified utils/metadatapropertiesparser.cpp 100644 → 100755
Empty file.
Empty file modified utils/metadatapropertiesparser.h 100644 → 100755
Empty file.
Empty file modified utils/platformcolorservice.cpp 100644 → 100755
Empty file.
Empty file modified utils/platformcolorservice.h 100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions utils/qtsingleapplication/QtLockedFile
@@ -0,0 +1 @@
#include "qtlockedfile.h"
1 change: 1 addition & 0 deletions utils/qtsingleapplication/QtSingleApplication
@@ -0,0 +1 @@
#include "qtsingleapplication.h"
31 changes: 17 additions & 14 deletions utils/qtsingleapplication/qtlocalpeer.cpp 100644 → 100755
@@ -1,12 +1,11 @@
/****************************************************************************
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of a Qt Solutions component.
** This file is part of the Qt Solutions component.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
Expand All @@ -18,10 +17,10 @@
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
** the names of its contributors may be used to endorse or promote
** products derived from this software without specific prior written
** permission.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Expand All @@ -35,20 +34,23 @@
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/


#include "qtlocalpeer.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QTime>
#include <QCoreApplication>
#include <QDataStream>
#include <QTime>

#if defined(Q_OS_WIN)
#include <QtCore/QLibrary>
#include <QtCore/qt_windows.h>
#include <QLibrary>
#include <qt_windows.h>
typedef BOOL(WINAPI*PProcessIdToSessionId)(DWORD,DWORD*);
static PProcessIdToSessionId pProcessIdToSessionId = 0;
#endif
#if defined(Q_OS_UNIX) //see bug https://bugreports.qt-project.org/browse/QTSOLBUG-102
#if defined(Q_OS_UNIX)
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
Expand Down Expand Up @@ -196,6 +198,7 @@ void QtLocalPeer::receiveConnection()
QString message(QString::fromUtf8(uMsg));
socket->write(ack, qstrlen(ack));
socket->waitForBytesWritten(1000);
socket->waitForDisconnected(1000); // make sure client reads ack
delete socket;
emit messageReceived(message); //### (might take a long time to return)
}
25 changes: 13 additions & 12 deletions utils/qtsingleapplication/qtlocalpeer.h 100644 → 100755
@@ -1,12 +1,11 @@
/****************************************************************************
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of a Qt Solutions component.
** This file is part of the Qt Solutions component.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
Expand All @@ -18,10 +17,10 @@
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
** the names of its contributors may be used to endorse or promote
** products derived from this software without specific prior written
** permission.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Expand All @@ -35,14 +34,16 @@
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/

#ifndef QTLOCALPEER_H
#define QTLOCALPEER_H

#include <QtNetwork/QLocalServer>
#include <QtNetwork/QLocalSocket>
#include <QtCore/QDir>
#include <QLocalServer>
#include <QLocalSocket>
#include <QDir>

#include "qtlockedfile.h"

Expand Down
19 changes: 10 additions & 9 deletions utils/qtsingleapplication/qtlockedfile.cpp 100644 → 100755
@@ -1,12 +1,11 @@
/****************************************************************************
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of a Qt Solutions component.
** This file is part of the Qt Solutions component.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
Expand All @@ -18,10 +17,10 @@
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
** the names of its contributors may be used to endorse or promote
** products derived from this software without specific prior written
** permission.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Expand All @@ -35,6 +34,8 @@
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/

#include "qtlockedfile.h"
Expand Down

0 comments on commit 333d3b3

Please sign in to comment.