Merge branch 'master' into SYNERGY-322-Keep-edition-in-config-if-the-new-config-doesn't-have-it
35
.github/workflows/job-build-linux-centos.yml
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
name: CentOS
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-arch64:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: symless/synergy-core:${{ matrix.distro }}
|
||||||
|
env:
|
||||||
|
GIT_COMMIT: ${{ github.sha }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
# - distro: centos7.6 #Need to install git 2.18+
|
||||||
|
- distro: centos8
|
||||||
|
|
||||||
|
name: ${{ matrix.distro }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=$(pwd)/rpm/BUILDROOT/usr ..
|
||||||
|
. ./version
|
||||||
|
make -j
|
||||||
|
|
||||||
|
- name: Run unit test
|
||||||
|
run: ./build/bin/unittests
|
||||||
35
.github/workflows/job-build-linux-debian.yml
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
name: Debian
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-arch64:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: symless/synergy-core:${{ matrix.distro }}
|
||||||
|
env:
|
||||||
|
GIT_COMMIT: ${{ github.sha }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
# - distro: debian9 #Need to install git 2.18+
|
||||||
|
- distro: debian10
|
||||||
|
|
||||||
|
name: ${{ matrix.distro }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
. ./version
|
||||||
|
make -j
|
||||||
|
|
||||||
|
- name: Run unit test
|
||||||
|
run: ./build/bin/unittests
|
||||||
36
.github/workflows/job-build-linux-fedora.yml
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
name: Fedora
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-arch64:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: symless/synergy-core:${{ matrix.distro }}
|
||||||
|
env:
|
||||||
|
GIT_COMMIT: ${{ github.sha }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
# - distro: fedora28 #Need to install git 2.18+
|
||||||
|
- distro: fedora29
|
||||||
|
- distro: fedora30
|
||||||
|
|
||||||
|
name: ${{ matrix.distro }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=$(pwd)/rpm/BUILDROOT/usr ..
|
||||||
|
. ./version
|
||||||
|
make -j
|
||||||
|
|
||||||
|
- name: Run unit test
|
||||||
|
run: ./build/bin/unittests
|
||||||
55
.github/workflows/job-build-linux-ubuntu.yml
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
name: Ubuntu
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-arch64:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: symless/synergy-core:${{ matrix.distro }}
|
||||||
|
env:
|
||||||
|
GIT_COMMIT: ${{ github.sha }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- distro: ubuntu20.04
|
||||||
|
- distro: ubuntu19.10
|
||||||
|
# - distro: ubuntu18.04 #Need to install git 2.18+
|
||||||
|
# - distro: ubuntu16.04 #Need to install git 2.18+
|
||||||
|
|
||||||
|
name: ${{ matrix.distro }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
. ./version
|
||||||
|
make -j
|
||||||
|
|
||||||
|
- name: Run unit test
|
||||||
|
run: ./build/bin/unittests
|
||||||
|
|
||||||
|
build_armhf:
|
||||||
|
runs-on: [self-hosted, armhf]
|
||||||
|
env:
|
||||||
|
GIT_COMMIT: ${{ github.sha }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
. ./version
|
||||||
|
make -j3
|
||||||
|
|
||||||
|
- name: Run unit test
|
||||||
|
run: ./build/bin/unittests
|
||||||
31
.github/workflows/job-build-mac.yml
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
name: Mac
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-arch64:
|
||||||
|
runs-on: macos-10.15
|
||||||
|
|
||||||
|
env:
|
||||||
|
GIT_COMMIT: ${{ github.sha }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: install qt
|
||||||
|
run: brew install qt
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/local/opt/qt ..
|
||||||
|
. ./version
|
||||||
|
make -j
|
||||||
|
|
||||||
|
- name: Run unit test
|
||||||
|
run: ./build/bin/unittests
|
||||||
71
.github/workflows/job-build-windows.yml
vendored
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
name: Windows
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-arch64:
|
||||||
|
runs-on: windows-2019
|
||||||
|
|
||||||
|
env:
|
||||||
|
GIT_COMMIT: ${{ github.sha }}
|
||||||
|
QT_BASE_DIR: ${{ github.workspace }}\deps\Qt
|
||||||
|
BONJOUR_BASE_DIR: ${{ github.workspace }}\deps\bonjour
|
||||||
|
QT_VERSION: 5.12.6
|
||||||
|
QT_BASE_URL: http://qt.mirror.constant.com/
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Cache Qt
|
||||||
|
id: cache-qt
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ env.QT_BASE_DIR }}
|
||||||
|
key: ${{ runner.os }}-Qt_${{ env.QT_VERSION }}
|
||||||
|
|
||||||
|
- name: Install Qt
|
||||||
|
if: steps.cache-qt.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
pip install aqtinstall
|
||||||
|
python -m aqt install --outputdir $env:QT_BASE_DIR --base $env:QT_BASE_URL $env:QT_VERSION windows desktop win64_msvc2017_64
|
||||||
|
cd $env:QT_BASE_DIR\$env:QT_VERSION\msvc2017_64
|
||||||
|
dir
|
||||||
|
|
||||||
|
- name: set QT path
|
||||||
|
run: echo "::set-env name=CMAKE_PREFIX_PATH::$env:QT_BASE_DIR\$env:QT_VERSION\msvc2017_64\"
|
||||||
|
|
||||||
|
- name: Cache Bonjour
|
||||||
|
id: cache-bonjour
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ env.BONJOUR_BASE_DIR }}
|
||||||
|
key: ${{ runner.os }}-Bonjour
|
||||||
|
|
||||||
|
- name: Install Bonjour SDK
|
||||||
|
if: steps.cache-bonjour.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
New-Item -Force -ItemType Directory -Path ".\deps\bonjour"
|
||||||
|
$client = new-object System.Net.WebClient
|
||||||
|
$client.DownloadFile("https://binaries.symless.com/bonjour/BonjourSDK.zip",".\bonjoursdk.zip")
|
||||||
|
[System.IO.Compression.ZipFile]::ExtractToDirectory(".\bonjoursdk.zip", $env:BONJOUR_BASE_DIR)
|
||||||
|
|
||||||
|
- name: set Bonjour path
|
||||||
|
run: echo "::set-env name=BONJOUR_SDK_HOME::$env:BONJOUR_BASE_DIR\BonjourSDK"
|
||||||
|
|
||||||
|
- name: Add msbuild to PATH
|
||||||
|
uses: microsoft/setup-msbuild@v1.0.1
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
. ./version
|
||||||
|
msbuild synergy-core.sln /p:Configuration=Release
|
||||||
|
|
||||||
|
- name: Run unit test
|
||||||
|
run: .\build\bin\Release\unittests.exe
|
||||||
|
|
@ -9,12 +9,16 @@ Bug fixes:
|
||||||
- #6342 Updated copyright year in version to use build date
|
- #6342 Updated copyright year in version to use build date
|
||||||
- #6771 Added Ubuntu 16 to CI/CD
|
- #6771 Added Ubuntu 16 to CI/CD
|
||||||
- #6804 Synergy loses edition when creating a System scope config
|
- #6804 Synergy loses edition when creating a System scope config
|
||||||
|
- #6660 + #6582 Add missing XAtom for utf-8 handling with Xorg
|
||||||
|
|
||||||
|
|
||||||
Enhancements:
|
Enhancements:
|
||||||
- #6750 Integrate SonarCloud for static analysis and test coverage
|
- #6750 Integrate SonarCloud for static analysis and test coverage
|
||||||
- #6792 License key expiry
|
- #6792 License key expiry
|
||||||
- #6799 Synergy "Business" edition
|
- #6799 Synergy "Business" edition
|
||||||
|
- #6803 Update Synergy icons
|
||||||
|
- #6800 Update behaviour when unregistered
|
||||||
|
- #6806 Move to Github Action for general PR builds and tests
|
||||||
|
|
||||||
v1.12.0-stable
|
v1.12.0-stable
|
||||||
===========
|
===========
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
trigger:
|
trigger: none
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- template: CI/job-doxygen.yml
|
- template: CI/job-doxygen.yml
|
||||||
|
|
@ -8,6 +7,9 @@ jobs:
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'ubuntu-16.04'
|
vmImage: 'ubuntu-16.04'
|
||||||
|
|
||||||
|
#As apparently the trigger set to none doesn't work
|
||||||
|
condition: eq(variables['Build.Reason'], 'Manual')
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
ubuntu1604:
|
ubuntu1604:
|
||||||
|
|
@ -91,6 +93,9 @@ jobs:
|
||||||
pool:
|
pool:
|
||||||
vmImage: $[ variables['image'] ]
|
vmImage: $[ variables['image'] ]
|
||||||
|
|
||||||
|
#As apparently the trigger set to none doesn't work
|
||||||
|
condition: eq(variables['Build.Reason'], 'Manual')
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
QT_PATH: '/usr/local/opt/qt/bin'
|
QT_PATH: '/usr/local/opt/qt/bin'
|
||||||
|
|
||||||
|
|
@ -113,6 +118,9 @@ jobs:
|
||||||
pool:
|
pool:
|
||||||
vmImage: $[ variables['image'] ]
|
vmImage: $[ variables['image'] ]
|
||||||
|
|
||||||
|
#As apparently the trigger set to none doesn't work
|
||||||
|
condition: eq(variables['Build.Reason'], 'Manual')
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
QT_VERSION: '5.12.6'
|
QT_VERSION: '5.12.6'
|
||||||
QLI_OUT_DIR: '.\deps\Qt'
|
QLI_OUT_DIR: '.\deps\Qt'
|
||||||
|
|
|
||||||
BIN
res/synergy.ico
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 144 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 651 B After Width: | Height: | Size: 905 B |
|
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 905 B |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 905 B |
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 1 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.7 KiB |
|
|
@ -47,7 +47,6 @@ void ActivationDialog::reject()
|
||||||
CancelActivationDialog cancelActivationDialog(this);
|
CancelActivationDialog cancelActivationDialog(this);
|
||||||
if (QDialog::Accepted == cancelActivationDialog.exec()) {
|
if (QDialog::Accepted == cancelActivationDialog.exec()) {
|
||||||
m_LicenseManager->skipActivation();
|
m_LicenseManager->skipActivation();
|
||||||
m_appConfig->activationHasRun(true);
|
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,8 @@ LicenseManager::setSerialKey(SerialKey serialKey, bool acceptExpired)
|
||||||
emit serialKeyChanged(m_serialKey);
|
emit serialKeyChanged(m_serialKey);
|
||||||
|
|
||||||
emit showLicenseNotice(getLicenseNotice());
|
emit showLicenseNotice(getLicenseNotice());
|
||||||
if (m_serialKey.isExpired(currentTime)) {
|
if (!m_serialKey.isValid()) {
|
||||||
emit LicenseExpired();
|
emit InvalidLicense();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_serialKey.edition() != serialKey.edition()) {
|
if (m_serialKey.edition() != serialKey.edition()) {
|
||||||
|
|
@ -112,8 +112,8 @@ LicenseManager::refresh()
|
||||||
m_AppConfig->clearSerialKey();
|
m_AppConfig->clearSerialKey();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (m_serialKey.isExpired(::time(0))) {
|
if (!m_serialKey.isValid()) {
|
||||||
emit LicenseExpired();
|
emit InvalidLicense();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ private:
|
||||||
signals:
|
signals:
|
||||||
void serialKeyChanged (SerialKey) const;
|
void serialKeyChanged (SerialKey) const;
|
||||||
void editionChanged (Edition) const;
|
void editionChanged (Edition) const;
|
||||||
void LicenseExpired () const;
|
void InvalidLicense () const;
|
||||||
void showLicenseNotice(const QString& notice) const;
|
void showLicenseNotice(const QString& notice) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
|
|
@ -174,8 +174,8 @@ MainWindow::MainWindow (AppConfig& appConfig,
|
||||||
connect (m_LicenseManager, SIGNAL(showLicenseNotice(QString)),
|
connect (m_LicenseManager, SIGNAL(showLicenseNotice(QString)),
|
||||||
this, SLOT(showLicenseNotice(QString)), Qt::QueuedConnection);
|
this, SLOT(showLicenseNotice(QString)), Qt::QueuedConnection);
|
||||||
|
|
||||||
connect (m_LicenseManager, SIGNAL(LicenseExpired()),
|
connect (m_LicenseManager, SIGNAL(InvalidLicense()),
|
||||||
this, SLOT(LicenseExpired()), Qt::QueuedConnection);
|
this, SLOT(InvalidLicense()), Qt::QueuedConnection);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
connect (m_AppConfig, SIGNAL(sslToggled(bool)),
|
connect (m_AppConfig, SIGNAL(sslToggled(bool)),
|
||||||
|
|
@ -613,8 +613,7 @@ void MainWindow::startSynergy()
|
||||||
{
|
{
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifndef SYNERGY_ENTERPRISE
|
||||||
SerialKey serialKey = m_LicenseManager->serialKey();
|
SerialKey serialKey = m_LicenseManager->serialKey();
|
||||||
time_t currentTime = ::time(0);
|
if (!serialKey.isValid()) {
|
||||||
if (serialKey.isExpired(currentTime)) {
|
|
||||||
if (QDialog::Rejected == raiseActivationDialog()) {
|
if (QDialog::Rejected == raiseActivationDialog()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1152,7 +1151,7 @@ void MainWindow::setEdition(Edition edition)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifndef SYNERGY_ENTERPRISE
|
||||||
void MainWindow::LicenseExpired()
|
void MainWindow::InvalidLicense()
|
||||||
{
|
{
|
||||||
stopSynergy();
|
stopSynergy();
|
||||||
m_AppConfig->activationHasRun(false);
|
m_AppConfig->activationHasRun(false);
|
||||||
|
|
@ -1379,10 +1378,8 @@ int MainWindow::raiseActivationDialog()
|
||||||
void MainWindow::on_windowShown()
|
void MainWindow::on_windowShown()
|
||||||
{
|
{
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifndef SYNERGY_ENTERPRISE
|
||||||
time_t currentTime = ::time(0);
|
if (!m_AppConfig->activationHasRun() &&
|
||||||
if (!m_AppConfig->activationHasRun()
|
!m_LicenseManager->serialKey().isValid()){
|
||||||
&& ((m_AppConfig->edition() == kUnregistered) ||
|
|
||||||
(m_LicenseManager->serialKey().isExpired(currentTime)))) {
|
|
||||||
raiseActivationDialog();
|
raiseActivationDialog();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
|
||||||
public slots:
|
public slots:
|
||||||
void setEdition(Edition edition);
|
void setEdition(Edition edition);
|
||||||
#ifndef SYNERGY_ENTERPRISE
|
#ifndef SYNERGY_ENTERPRISE
|
||||||
void LicenseExpired();
|
void InvalidLicense();
|
||||||
void showLicenseNotice(const QString& message);
|
void showLicenseNotice(const QString& message);
|
||||||
#endif
|
#endif
|
||||||
void appendLogRaw(const QString& text);
|
void appendLogRaw(const QString& text);
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,8 @@ XWindowsClipboard::XWindowsClipboard(Display* display,
|
||||||
m_converters.push_back(new XWindowsClipboardBMPConverter(m_display));
|
m_converters.push_back(new XWindowsClipboardBMPConverter(m_display));
|
||||||
m_converters.push_back(new XWindowsClipboardUTF8Converter(m_display,
|
m_converters.push_back(new XWindowsClipboardUTF8Converter(m_display,
|
||||||
"text/plain;charset=UTF-8"));
|
"text/plain;charset=UTF-8"));
|
||||||
|
m_converters.push_back(new XWindowsClipboardUTF8Converter(m_display,
|
||||||
|
"text/plain;charset=utf-8"));
|
||||||
m_converters.push_back(new XWindowsClipboardUTF8Converter(m_display,
|
m_converters.push_back(new XWindowsClipboardUTF8Converter(m_display,
|
||||||
"UTF8_STRING"));
|
"UTF8_STRING"));
|
||||||
m_converters.push_back(new XWindowsClipboardUCS2Converter(m_display,
|
m_converters.push_back(new XWindowsClipboardUCS2Converter(m_display,
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,19 @@ SerialKey::isTemporary() const
|
||||||
return m_KeyType.isTemporary();
|
return m_KeyType.isTemporary();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
SerialKey::isValid() const
|
||||||
|
{
|
||||||
|
bool Valid = true;
|
||||||
|
|
||||||
|
if (m_edition.getType() == kUnregistered || isExpired(::time(0)))
|
||||||
|
{
|
||||||
|
Valid = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Valid;
|
||||||
|
}
|
||||||
|
|
||||||
Edition
|
Edition
|
||||||
SerialKey::edition() const
|
SerialKey::edition() const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ public:
|
||||||
bool isExpired(time_t currentTime) const;
|
bool isExpired(time_t currentTime) const;
|
||||||
bool isTrial() const;
|
bool isTrial() const;
|
||||||
bool isTemporary() const;
|
bool isTemporary() const;
|
||||||
|
bool isValid() const;
|
||||||
time_t daysLeft(time_t currentTime) const;
|
time_t daysLeft(time_t currentTime) const;
|
||||||
std::string email() const;
|
std::string email() const;
|
||||||
Edition edition() const;
|
Edition edition() const;
|
||||||
|
|
|
||||||
|
|
@ -207,4 +207,23 @@ TEST(SerialKeyTests, toStringV1BasicSerialKey)
|
||||||
EXPECT_EQ(Expected, serial.toString());
|
EXPECT_EQ(Expected, serial.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(SerialKeyTests, IsValidKey_false)
|
||||||
|
{
|
||||||
|
//{v1;basic;Bob;1;email;company name;0;0}
|
||||||
|
SerialKey serial(kUnregistered);
|
||||||
|
EXPECT_EQ(false, serial.isValid());
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(SerialKeyTests, IsValidKey_true)
|
||||||
|
{
|
||||||
|
SerialKey serial(kBasic);
|
||||||
|
EXPECT_EQ(true, serial.isValid());
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(SerialKeyTests, IsValidExpiredKey_false)
|
||||||
|
{
|
||||||
|
SerialKey serial("7B76323B737562736372697074696F6E3B62617369633B426F623B313B656D61696C3B636F6D70616E79206E616D653B303B38363430307D");
|
||||||
|
EXPECT_EQ(false, serial.isValid());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||