Hello community, here is the log from the commit of package orion for openSUSE:Factory checked in at 2018-03-12 12:12:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/orion (Old) and /work/SRC/openSUSE:Factory/.orion.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "orion" Mon Mar 12 12:12:38 2018 rev:16 rq:585461 version:1.6.5+git~20180311 Changes: -------- --- /work/SRC/openSUSE:Factory/orion/orion.changes 2018-02-19 13:02:55.837830054 +0100 +++ /work/SRC/openSUSE:Factory/.orion.new/orion.changes 2018-03-12 12:12:51.909025055 +0100 @@ -1,0 +2,38 @@ +Sun Mar 11 13:58:00 UTC 2018 - [email protected] + +- Update to version 1.6.5+git~20180311: + * bump appveyor qt ver (#229) + +------------------------------------------------------------------- +Sun Mar 04 15:16:53 UTC 2018 - [email protected] + +- Update to version 1.6.5+git~20180304: + * set widths on startup to fix tiny window bug + * add timeout + * drop runguard, use simple lockfile for single instancing + * fix window launching size + +------------------------------------------------------------------- +Sun Mar 04 10:15:54 UTC 2018 - [email protected] + +- Update to version 1.6.5+git~20180304: + * ver 1.6.5 + * CI automations for building installer packages (#228) + +------------------------------------------------------------------- +Sat Mar 03 12:21:42 UTC 2018 - [email protected] + +- Update to version 1.6.1+git~20180302: + * qt -> qt5 + * travis badge + * appveyor badge + +------------------------------------------------------------------- +Sun Feb 25 15:46:43 UTC 2018 - [email protected] + +- Update to version 1.6.1+git~20180225: + * fix user ban messages, do not display timeouts and bans twice if it was the user who banned the person + * fix some warnings, and clean up code + * display when user gets timed out or banned + +------------------------------------------------------------------- Old: ---- orion-1.6.1+git~20171212.tar.xz New: ---- orion-1.6.5+git~20180311.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ orion.spec ++++++ --- /var/tmp/diff_new_pack.mZID2z/_old 2018-03-12 12:12:53.104982385 +0100 +++ /var/tmp/diff_new_pack.mZID2z/_new 2018-03-12 12:12:53.108982243 +0100 @@ -17,10 +17,10 @@ Name: orion -Version: 1.6.1+git~20171212 +Version: 1.6.5+git~20180311 Release: 0 Summary: Twitch stream client using Qt -License: GPL-3.0 +License: GPL-3.0-only Url: http://alamminsalo.github.io/orion/ Source: %{name}-%{version}.tar.xz ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.mZID2z/_old 2018-03-12 12:12:53.184979531 +0100 +++ /var/tmp/diff_new_pack.mZID2z/_new 2018-03-12 12:12:53.184979531 +0100 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/alamminsalo/orion.git</param> - <param name="changesrevision">ed4c051a969b0e9857f1a2c2f060bcdb8f748d4a</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">da84aed545aef432320cba99af11ca233cf43f40</param></service></servicedata> \ No newline at end of file ++++++ orion-1.6.1+git~20171212.tar.xz -> orion-1.6.5+git~20180311.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orion-1.6.1+git~20171212/.travis.yml new/orion-1.6.5+git~20180311/.travis.yml --- old/orion-1.6.1+git~20171212/.travis.yml 2017-12-12 20:13:26.000000000 +0100 +++ new/orion-1.6.5+git~20180311/.travis.yml 2018-03-11 07:56:17.000000000 +0100 @@ -1,6 +1,6 @@ os: - osx - + env: - QTBREWVER=5.9 @@ -14,7 +14,8 @@ - $HOME/Library/Caches/Homebrew before_install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install qt@$QTBREWVER jq; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install qt5 jq; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip2 install dmgbuild; fi script: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export QTDIR=$(brew info --json=v1 qt | jq -r '.[0].bottle.stable.cellar + "/" + .[0].name + "/" + .[0].installed[0].version'); fi @@ -23,36 +24,16 @@ - make - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash distfiles/deploy_mac.sh; fi - mkdir -p artifacts - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then zip -vr --symlinks artifacts/orion.app.zip orion.app/; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then dmgbuild -s distfiles/settings.py "Orion $TRAVIS_TAG" "orion-$TRAVIS_TAG.dmg"; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mv "orion-$TRAVIS_TAG.dmg" artifacts/; fi deploy: - - provider: releases - # To use this, create a Github token with the "public_repo" permission, and create an env var GITHUB_API_KEY in the Travis' project settings, making sure "Display value in build log" is set to OFF - api_key: '$GITHUB_API_KEY' - file: 'artifacts/orion.app.zip' - skip_cleanup: true - on: - tags: true - all_branches: true - # To use this, create an AWS S3 bucket with public read access, create IAM policy with the text below replacing the placeholder with the bucket name, - # create an AWS user for automation (with access key/secret) and give them that IAM policy, and set the env vars indicated in the Travis' project settings, making sure "Display value in build log" is set to OFF - - provider: s3 - access_key_id: "$AWS_ACCESS_KEY_ID" - secret_access_key: "$AWS_SECRET_ACCESS_KEY" - bucket: "$AWS_S3_BUCKET" - region: "$AWS_REGION" - # Example policy to allow writes to a bucket - # { - # "Version": "2012-10-17", - # "Statement": [ - # { - # "Effect": "Allow", - # "Action": "s3:PutObject", - # "Resource": "arn:aws:s3:::BUCKET-NAME-GOES-HERE/*" - # } - # ] - # } - local_dir: artifacts - skip_cleanup: true - on: - all_branches: true + - provider: releases + # To use this, create a Github token with the "public_repo" permission, and create an env var GITHUB_API_KEY in the Travis' project settings, making sure "Display value in build log" is set to OFF + api_key: '$GITHUB_API_KEY' + file: 'artifacts/orion-$TRAVIS_TAG.dmg' + skip_cleanup: true + prerelease: true + on: + tags: true + all_branches: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orion-1.6.1+git~20171212/README.md new/orion-1.6.5+git~20180311/README.md --- old/orion-1.6.1+git~20171212/README.md 2017-12-12 20:13:26.000000000 +0100 +++ new/orion-1.6.5+git~20180311/README.md 2018-03-11 07:56:17.000000000 +0100 @@ -1,6 +1,9 @@ # Orion +[](https://ci.appveyor.com/project/alamminsalo/orion/branch/master) +[](https://travis-ci.org/alamminsalo/orion) + [Webpage](https://alamminsalo.github.io/orion) QML/C++-written desktop client for Twitch.tv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orion-1.6.1+git~20171212/appveyor.yml new/orion-1.6.5+git~20180311/appveyor.yml --- old/orion-1.6.1+git~20171212/appveyor.yml 2017-12-12 20:13:26.000000000 +0100 +++ new/orion-1.6.5+git~20180311/appveyor.yml 2018-03-11 07:56:17.000000000 +0100 @@ -12,63 +12,31 @@ configuration: debug install: - - if %platform%==x86 set mpv_platform=i686 - - if %platform%==x64 set mpv_platform=x86_64 - - set MPVDIR=c:\mpv - - if %platform%==x86 set MPVLIBDIR=%MPVDIR%\32 - - if %platform%==x64 set MPVLIBDIR=%MPVDIR%\64 - - if not exist "%MPVDIR%" mkdir "%MPVDIR%" - - ps: | - if (!(Test-Path "${env:mpvdir}\mpv-dev.7z")) { - # TLS 1.2 is required by the site - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - $libmpv_site_uri = [System.Uri]"https://mpv.srsfckn.biz/" - $libmpv_downloads_page = Invoke-WebRequest $libmpv_site_uri - $libmpv_download_url_rel = $libmpv_downloads_page.AllElements | Where {$_.href -like "*/mpv-dev-*.7z"} | sort -Property href -Descending | select -First 1 -ExpandProperty href - $libmpv_download_url = New-Object System.Uri -ArgumentList ($libmpv_site_uri, $libmpv_download_url_rel) - echo "Downloading ${libmpv_download_url} to mpv-dev.7z" - $libmpv_download_url | Out-File "${env:mpvdir}\version.txt" - Start-FileDownload "${libmpv_download_url}" -FileName "${env:mpvdir}\mpv-dev.7z" - } - Start-FileDownload "https://raw.githubusercontent.com/mpv-player/mpv/master/libmpv/mpv.def" -FileName "${env:mpvdir}\mpv_dl.def" - @("EXPORTS") + (Get-Content "${env:mpvdir}\mpv_dl.def") | Set-Content "${env:mpvdir}\mpv.def" - - type %MPVDIR%\version.txt - - if %platform%==x86 set QTDIR=C:\Qt\5.8\msvc2015 - - if %platform%==x64 set QTDIR=C:\Qt\5.8\msvc2015_64 + - if %platform%==x86 set QTDIR=C:\Qt\5.9.3\msvc2015 + - if %platform%==x64 set QTDIR=C:\Qt\5.9.3\msvc2015_64 - if %platform%==x86 set PATH=%QTDIR%\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH% - if %platform%==x64 set PATH=%QTDIR%\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH% - - cd "%MPVDIR%" - - 7z x -y mpv-dev.7z - - dir /s - - set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt;%MPVDIR%\include - - if %platform%==x86 set LIB=%QTDIR%\lib;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10150.0\ucrt\x86;%MPVLIBDIR% - - if %platform%==x64 set LIB=%QTDIR%\lib;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\lib\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10150.0\ucrt\x64;%MPVLIBDIR% + - set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt + - if %platform%==x86 set LIB=%QTDIR%\lib;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10150.0\ucrt\x86 + - if %platform%==x64 set LIB=%QTDIR%\lib;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\lib\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10150.0\ucrt\x64 - set VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC - if %platform%==x86 set OPENSSL_DIR=C:\OpenSSL-Win32 - if %platform%==x64 set OPENSSL_DIR=C:\OpenSSL-Win64 -cache: - - c:\mpv\mpv-dev.7z -> appveyor.yml - - c:\mpv\version.txt -> appveyor.yml - build_script: - cmd: >- echo APPVEYOR_BUILD_FOLDER=%APPVEYOR_BUILD_FOLDER% cd %APPVEYOR_BUILD_FOLDER% - qmake orion.pro + qmake orion.pro "CONFIG+=multimedia" mkdir libs - copy /y "%MPVLIBDIR%\mpv-1.dll" libs - copy /y "%OPENSSL_DIR%\ssleay32.dll" libs copy /y "%OPENSSL_DIR%\libeay32.dll" libs - lib /def:%MPVDIR%\mpv.def /name:%MPVLIBDIR%\mpv-1.dll /out:%MPVLIBDIR%\mpv.lib /MACHINE:%platform% - nmake %configuration% %QTDIR%\bin\windeployqt --qmldir src\qml %configuration%\orion.exe @@ -77,18 +45,26 @@ after_build: - 7z a orion_%configuration%_%platform%_snapshot_%APPVEYOR_REPO_COMMIT%.zip . -x!.git - - copy /y %MPVDIR%\mpv-dev.7z . - del %configuration%\*.obj - del %configuration%\*.cpp - del %configuration%\*.h - del %configuration%\*.res - if %configuration%==release copy "resources\orion-installer.iss" orion-installer.iss - - if %configuration%==release "C:\Program Files (x86)\Inno Setup 5\iscc.exe" /DPlatform=%platform% /DAdditionalRedist="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\1033\vcredist_%platform%.exe" /F"orion-%APPVEYOR_REPO_COMMIT%-%platform%" "orion-installer.iss" + - if %configuration%==release "C:\Program Files (x86)\Inno Setup 5\iscc.exe" /DPlatform=%platform% /DAdditionalRedist="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\1033\vcredist_%platform%.exe" /F"orion-%configuration%-%platform%" "orion-installer.iss" artifacts: - path: orion_$(configuration)_$(platform)_snapshot_$(APPVEYOR_REPO_COMMIT).zip name: orion windows $(configuration) $(platform) snapshot zip - - path: mpv-dev.7z - name: libmpv dev archive used for build - - path: orion-$(APPVEYOR_REPO_COMMIT)-$(platform).exe + - path: orion-$(configuration)-$(platform).exe name: Windows installer + +deploy: +- provider: GitHub + auth_token: + secure: kna2fyW9Q70WCBxJn/YYJ4pupSRog8FFp6BhKOjr6rtfMIGGtN52UuiMtc90RTla + artifact: orion-$(configuration)-$(platform).exe + prerelease: true + force_update: true + on: + configuration: release + appveyor_repo_tag: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orion-1.6.1+git~20171212/distfiles/settings.py new/orion-1.6.5+git~20180311/distfiles/settings.py --- old/orion-1.6.1+git~20171212/distfiles/settings.py 1970-01-01 01:00:00.000000000 +0100 +++ new/orion-1.6.5+git~20180311/distfiles/settings.py 2018-03-11 07:56:17.000000000 +0100 @@ -0,0 +1,4 @@ +# Settings for dmgbuild + +files = [ 'orion.app' ] +symlinks = { 'Applications': '/Applications' } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orion-1.6.1+git~20171212/orion.pro new/orion-1.6.5+git~20180311/orion.pro --- old/orion-1.6.1+git~20171212/orion.pro 2017-12-12 20:13:26.000000000 +0100 +++ new/orion-1.6.5+git~20180311/orion.pro 2018-03-11 07:56:17.000000000 +0100 @@ -13,7 +13,7 @@ TARGET = orion -VERSION = 1.6.1 +VERSION = 1.6.5 DEFINES += APP_VERSION=\\\"v$$VERSION\\\" DEFINES += APP_NAME=\\\"Orion\\\" @@ -26,7 +26,6 @@ src/util/jsonparser.cpp \ src/model/channellistmodel.cpp \ src/model/gamelistmodel.cpp \ - src/util/runguard.cpp \ src/model/vod.cpp \ src/model/vodlistmodel.cpp \ src/model/vodmanager.cpp \ @@ -49,7 +48,6 @@ src/model/channellistmodel.h \ src/model/gamelistmodel.h \ src/util/m3u8parser.h \ - src/util/runguard.h \ src/model/vod.h \ src/model/vodlistmodel.h \ src/model/vodmanager.h \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orion-1.6.1+git~20171212/src/main.cpp new/orion-1.6.5+git~20180311/src/main.cpp --- old/orion-1.6.1+git~20171212/src/main.cpp 2017-12-12 20:13:26.000000000 +0100 +++ new/orion-1.6.5+git~20180311/src/main.cpp 2018-03-11 07:56:17.000000000 +0100 @@ -20,8 +20,8 @@ #include <QFontDatabase> #include <QIcon> #include <QQuickWindow> +#include <QLockFile> -#include "util/runguard.h" #include "model/channelmanager.h" #include "network/networkmanager.h" #include "model/vodmanager.h" @@ -98,9 +98,9 @@ #ifndef Q_OS_ANDROID //Single application solution - RunGuard guard("wz0dPKqHv3vX0BBsUFZt"); - if ( !guard.tryToRun() ){ - guard.sendWakeup(); + QLockFile lockfile(QDir::temp().absoluteFilePath("wz0dPKqHv3vX0BBsUFZt.lock")); + if (!lockfile.tryLock(100)) { + // Already running return -1; } @@ -113,9 +113,9 @@ parser.addOption(debugOption); parser.process(app); +#ifndef QT_DEBUG bool showDebugOutput = parser.isSet(debugOption); -#ifndef QT_DEBUG if (!showDebugOutput) { qInstallMessageHandler(noisyFailureMsgHandler); } @@ -163,9 +163,6 @@ if (rootWin) { if (SettingsManager::getInstance()->minimizeOnStartup()) rootWin->hide(); - - //Connect to runguard events - QObject::connect(&guard, &RunGuard::anotherProcessTriggered, rootWin, &QQuickWindow::show); } #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orion-1.6.1+git~20171212/src/model/ircchat.cpp new/orion-1.6.5+git~20180311/src/model/ircchat.cpp --- old/orion-1.6.1+git~20171212/src/model/ircchat.cpp 2017-12-12 20:13:26.000000000 +0100 +++ new/orion-1.6.5+git~20180311/src/model/ircchat.cpp 2018-03-11 07:56:17.000000000 +0100 @@ -54,7 +54,6 @@ _bitsProvider(nullptr), _badgeProvider(nullptr), sock(nullptr), - replayMode(false), netman(NetworkManager::getInstance()) { @@ -179,7 +178,7 @@ qDebug() << "Joined channel " << channel; } -void IrcChat::replay(const QString channel, const QString channelId, const quint64 vodId, double vodStartEpochTime, double playbackOffset) { +void IrcChat::replay(const QString channel, const QString channelId, const quint64 vodId, double /*vodStartEpochTime*/, double playbackOffset) { replayMode = true; roomInitCommon(channel, channelId); @@ -1222,7 +1221,9 @@ return; } - if(cmd.contains("NOTICE")) { + if(cmd.contains("NOTICE") && !cmd.contains(QRegExp("\\bban_success")) + && !cmd.contains(QRegExp("\\btimeout_success"))) + { QString text = cmd.remove(0, cmd.indexOf(':', cmd.indexOf("NOTICE")) + 1); emit noticeReceived(text); return; @@ -1252,7 +1253,7 @@ _emoteSetIDs.append(entry.toInt()); } emit emoteSetIDsChanged(); - } + } else if (tag.key == "color") { qDebug() << "Setting user global color to" << tag.value; userGlobalColor = tag.value; @@ -1309,6 +1310,33 @@ } return; } + + if(cmd.contains("CLEARCHAT")) { + //@ban-duration=<ban-duration>;ban-reason=<ban-reason> :tmi.twitch.tv CLEARCHAT #<channel> :<user> + QString user = cmd.mid(cmd.lastIndexOf(":")+1); + QString banText = "ban-reason"; + int banIndex = cmd.indexOf(banText) + banText.count(); + QString banReason = cmd.mid( banIndex + 1, + cmd.indexOf(";", banIndex) - banIndex - 1); + banReason.replace(QString("\\s"), QString(" ")); + + QString durationText = "ban-duration"; + if(cmd.contains(durationText)) { + int durationIndex = cmd.indexOf(durationText)+durationText.count(); + QString banDuration = cmd.mid(durationIndex + 1, + cmd.indexOf(";") - durationIndex - 1); + QString banText = QString("%1 has been timed out for %2 seconds. %3") + .arg(user).arg(banDuration).arg(banReason); + emit noticeReceived(banText); + } + else { + QString banText = QString("%1 is now banned from this room. %2") + .arg(user).arg(banReason); + emit noticeReceived(banText); + } + return; + } + qDebug() << "Unrecognized chat command:" << cmd; } @@ -1437,4 +1465,3 @@ netman->editUserBlock(user_id, blockUserName, isBlock); } } - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orion-1.6.1+git~20171212/src/model/ircchat.h new/orion-1.6.5+git~20180311/src/model/ircchat.h --- old/orion-1.6.1+git~20171212/src/model/ircchat.h 2017-12-12 20:13:26.000000000 +0100 +++ new/orion-1.6.5+git~20180311/src/model/ircchat.h 2018-03-11 07:56:17.000000000 +0100 @@ -61,9 +61,6 @@ { Q_OBJECT - NetworkManager *netman; - SettingsManager *settings; - //emote download QDir emoteDir; QString emoteDirPathImpl; @@ -158,7 +155,7 @@ void getBlockedUserList(); private: - qint16 user_id; + quint16 user_id; static const qint16 PORT; static const QString HOST; @@ -171,6 +168,7 @@ static const QString BTTV_EMOTES_URL_FORMAT_LODPI; static const QString IMAGE_PROVIDER_BITS; + SettingsManager *settings; URLFormatImageProvider _emoteProvider; URLFormatImageProvider _bttvEmoteProvider; BitsImageProvider * _bitsProvider; @@ -202,7 +200,7 @@ QSslSocket *sock; QString room; QString roomChannelId; - bool replayMode; + bool replayMode = false; // map of channel name -> list of pairs (badge name, badge version) QMap<QString, QList<QPair<QString, QString>>> badgesByChannel; bool logged_in; @@ -238,6 +236,8 @@ QMap<QString, QString> lastGlobalBttvEmoteFixedStrings; QMap<QString, QString> lastCurChannelBttvEmoteFixedStrings; + NetworkManager *netman; + enum ImageEntryKind { emote, bits, bttvEmote }; struct InlineImageInfo { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orion-1.6.1+git~20171212/src/qml/main.qml new/orion-1.6.5+git~20180311/src/qml/main.qml --- old/orion-1.6.1+git~20171212/src/qml/main.qml 2017-12-12 20:13:26.000000000 +0100 +++ new/orion-1.6.5+git~20180311/src/qml/main.qml 2018-03-11 07:56:17.000000000 +0100 @@ -27,6 +27,11 @@ // Application main font font.family: Settings.font || appFont.name + height: 600 + width: 700 + minimumHeight: 480 + minimumWidth: 480 + // Style settings Material.theme: Settings.lightTheme ? Material.Light : Material.Dark diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orion-1.6.1+git~20171212/src/util/runguard.cpp new/orion-1.6.5+git~20180311/src/util/runguard.cpp --- old/orion-1.6.1+git~20171212/src/util/runguard.cpp 2017-12-12 20:13:26.000000000 +0100 +++ new/orion-1.6.5+git~20180311/src/util/runguard.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,129 +0,0 @@ -#include "runguard.h" - -#include <QDebug> -#include <QCryptographicHash> -#include <QObject> - -namespace -{ - -QString generateKeyHash( const QString& key, const QString& salt ) -{ - QByteArray data; - - data.append( key.toUtf8() ); - data.append( salt.toUtf8() ); - data = QCryptographicHash::hash( data, QCryptographicHash::Sha1 ).toHex(); - - return data; -} - -} - - -RunGuard::RunGuard( const QString& key ) - : key( key ) - , memLockKey( generateKeyHash( key, "_memLockKey" ) ) - , sharedmemKey( generateKeyHash( key, "_sharedmemKey" ) ) - , sharedMem( sharedmemKey ) - , memLock( memLockKey, 1 ) -{ - memLock.acquire(); - { - QSharedMemory fix( sharedmemKey ); // Fix for *nix: http://habrahabr.ru/post/173281/ - fix.attach(); - } - memLock.release(); -} - -RunGuard::~RunGuard() -{ - timer->stop(); - timer->deleteLater(); - release(); -} - -bool RunGuard::isAnotherRunning() -{ - if ( sharedMem.isAttached() ){ - return false; - } - - memLock.acquire(); - const bool isRunning = sharedMem.attach(); - if ( isRunning ){ - sharedMem.detach(); - } - memLock.release(); - - return isRunning; -} - -bool RunGuard::tryToRun() -{ - if ( isAnotherRunning() ){ // Extra check - return false; - } - - memLock.acquire(); - const bool result = sharedMem.create( sizeof( quint64 ) ); - memLock.release(); - if ( !result ) - { - release(); - return false; - } - - setTimer(); - - return true; -} - -void RunGuard::release() -{ - memLock.acquire(); - if ( sharedMem.isAttached() ) - sharedMem.detach(); - memLock.release(); -} - -void RunGuard::setTimer() -{ - timer = new QTimer(); - connect(timer, &QTimer::timeout, this, &RunGuard::update); - timer->start(250); -} - -void RunGuard::sendWakeup() -{ - sharedMem.attach(); - sharedMem.lock(); - *(quint64*)sharedMem.data() = 1; - sharedMem.unlock(); - sharedMem.detach(); -} - -void RunGuard::update() -{ - if (*(quint64*)sharedMem.constData() == 1){ - qDebug() << "Another process attempted to start!"; - - //Reset back the flag - sharedMem.lock(); - *(quint64*)sharedMem.data() = 0; - sharedMem.unlock(); - - emit anotherProcessTriggered(); - } -} - - - - - - - - - - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orion-1.6.1+git~20171212/src/util/runguard.h new/orion-1.6.5+git~20180311/src/util/runguard.h --- old/orion-1.6.1+git~20171212/src/util/runguard.h 2017-12-12 20:13:26.000000000 +0100 +++ new/orion-1.6.5+git~20180311/src/util/runguard.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,40 +0,0 @@ -#ifndef RUNGUARD_H -#define RUNGUARD_H - -#include <QObject> -#include <QTimer> -#include <QSharedMemory> -#include <QSystemSemaphore> - - -class RunGuard: public QObject -{ - Q_OBJECT -public: - RunGuard( const QString& key ); - virtual ~RunGuard(); - - bool isAnotherRunning(); - bool tryToRun(); - void release(); - void setTimer(); - void sendWakeup(); - -public slots: - void update(); - -signals: - void anotherProcessTriggered(); - -private: - const QString key; - const QString memLockKey; - const QString sharedmemKey; - - QTimer *timer; - QSharedMemory sharedMem; - QSystemSemaphore memLock; -}; - - -#endif // RUNGUARD./
