Skip to content

Commit

Permalink
SYNERGY1-1545 Accept business licenses in basic/pro builds (deskflow#…
Browse files Browse the repository at this point in the history
…7188)

* SYNERGY1-1545 Accept business licenses in basic/pro builds

* Update ChangeLog
  • Loading branch information
SerhiiGadzhilov authored Jun 8, 2022
1 parent 0d7bc0d commit de48bb2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Bug fixes:
Enhancements:
- #7143 Ability to stop Synergy on the login screen
- #7157 Synergy Business accepts only business licenses
- #7188 Synergy Basic\Pro accepts business licenses
- #7166 Replace language notifications with warnings in logs
- #7181 Fedora 36 support to CI system

Expand Down
6 changes: 2 additions & 4 deletions src/gui/src/LicenseManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@ LicenseManager::setSerialKey(SerialKey serialKey, bool acceptExpired)
throw std::runtime_error("Serial key expired");
}

#ifdef SYNERGY_BUSINESS
if (!serialKey.isValid()) {
#ifdef SYNERGY_BUSINESS
throw std::runtime_error("The serial key is not compatible with the business version of Synergy.");
#else
throw std::runtime_error("The serial key is not compatible with the consumer version of Synergy.");
#endif
}
#endif

if (serialKey != m_serialKey) {
using std::swap;
Expand Down
3 changes: 2 additions & 1 deletion src/lib/shared/SerialKeyEdition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const std::map<std::string, Edition>& getSerialTypes()
{SerialKeyEdition::BASIC, kBasic},
{SerialKeyEdition::PRO, kPro},
{SerialKeyEdition::BASIC_CHINA, kBasic_China},
{SerialKeyEdition::PRO_CHINA, kPro_China}
{SerialKeyEdition::PRO_CHINA, kPro_China},
{SerialKeyEdition::BUSINESS, kBusiness}
};
#endif
return serialTypes;
Expand Down
6 changes: 3 additions & 3 deletions src/test/unittests/shared/SerialKeyEditionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ TEST(SerialKeyEditionTests, SetEditionProChina)
TEST(SerialKeyEditionTests, NameConstructor)
{
SerialKeyEdition edition(SerialKeyEdition::BUSINESS);
EXPECT_EQ(kUnregistered, edition.getType());
EXPECT_FALSE(edition.isValid());
EXPECT_EQ(kBusiness, edition.getType());
EXPECT_TRUE(edition.isValid());
}

TEST(SerialKeyEditionTests, isValid)
Expand All @@ -92,7 +92,7 @@ TEST(SerialKeyEditionTests, isValid)
EXPECT_TRUE(edition.isValid());

edition.setType(Edition::kBusiness);
EXPECT_FALSE(edition.isValid());
EXPECT_TRUE(edition.isValid());

edition.setType(Edition::kPro);
EXPECT_TRUE(edition.isValid());
Expand Down

0 comments on commit de48bb2

Please sign in to comment.