Commit Graph

219 Commits

Author SHA1 Message Date
Itay Grudev
0d07dd387a
GitHub Actions Multiple platforms support
ubuntu-latest, windows-latest, macos-latest
2020-01-03 10:43:13 +00:00
Itay Grudev
a14320382c
GitHub Actions Exact Qt version specificatoin 2020-01-03 10:38:52 +00:00
Itay Grudev
0296d0b61e
Github Action building with multiple Qt versions
Implemented using the matrix strategy and multiple qt versions
2020-01-03 10:35:41 +00:00
Itay Grudev
4e4f310a58
Github Actions: Building examples as well 2020-01-03 10:26:13 +00:00
Itay Grudev
275dcf3fc0
Added step to install Qt in GitHub Actions 2020-01-03 10:18:30 +00:00
Itay Grudev
af768f44a7
Create build-linux-cmake.yml 2020-01-03 10:11:40 +00:00
Itay Grudev
16ea64b254
Merge pull request #76 from itay-grudev/android_fallback
Android and iOS fallback
2019-10-13 10:39:37 +03:00
Itay Grudev
c5b4d4028d v3.0.18 2019-10-13 10:35:50 +03:00
Itay Grudev
117336df79 Fallback for iOS as well 2019-10-13 10:34:28 +03:00
Itay Grudev
5e223a7f74 Disables SingleApplication support on Android. Fixes #52 2019-10-11 16:50:52 +03:00
Itay Grudev
33975c1743
Update CHANGELOG.md 2019-10-11 16:35:03 +03:00
Hennadii Chernyshchyk
81465e1eec Add CMake support (#66)
* Add CMake support

* Remove unused 'tr()'

* Add option to specify a class for inheritance

* Use modern syntax

* Rework CMakeLists.txt
Thanks to @akallabeth

* Add CMake build rules for examples
2019-10-11 16:30:11 +03:00
iakov
196bb34af6 Fix compilation warning/error (#74)
Fix `comparison between signed and unsigned integer expressions` problem.
User ID is a positive integer  in Linux/UNIX(macOS, FreeBSD, Solaris), also `geteuid()` never fails with return code.
2019-10-10 14:47:25 +03:00
Itay Grudev
e18babe559
Update CHANGELOG.md 2019-09-22 20:41:33 +03:00
Jonas Kvinge
2c959069b7 Use geteuid and getpwuid to get username on Unix, fallback to environment variable (#72)
* Use geteuid and getpwuid to get username on Unix, fallback to environment variable

* Remove QProcess include
2019-09-22 20:39:45 +03:00
Itay Grudev
fec44d13d5
v3.0.15 2019-08-23 23:08:44 +03:00
Itay Grudev
acdc141d9d
v3.0.15 2019-08-23 23:08:07 +03:00
Itay Grudev
71e83871ae
Update CHANGELOG.md 2019-08-23 23:07:43 +03:00
Jonas Kvinge
1aad265585 Fix return value of sendMessage() (#68) 2019-08-23 23:02:50 +03:00
Jonas Kvinge
791f6b1cae Fix spelling and typos (#70) 2019-08-23 22:57:28 +03:00
Itay Grudev
c43bd4d388
Update FUNDING.yml 2019-05-30 04:56:40 +01:00
Itay Grudev
fefa2ced34
Create FUNDING.yml 2019-05-30 04:56:00 +01:00
Itay Grudev
7163d166a1
Fixed typo in Windows.md 2019-02-25 15:16:39 +00:00
Itay Grudev
adac9a30aa
v3.0.14 2019-01-22 12:23:51 +00:00
Patrizio Bekerle
b24d5394a5 fixed build process below Qt 5.6 (#57) 2018-12-14 20:41:55 +02:00
Patrizio Bekerle
2fac2a3804 fixed a typo (#55) 2018-11-30 16:08:31 +00:00
Itay Grudev
c6bc2a3e52
v3.0.13a 2018-10-04 14:29:21 +00:00
Francis Giraldeau
0db27016b0 Async socket processing (#49)
* Process socket events asynchronously

Avoid blocking the event loop using waitForReadyRead(). Instead, process the
initialization in two phases. It was necessary to add a map to keep track of
the state of the initial message processing

Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>

* Fix undefined variable on Windows

The timout variable does not exists in this scope, we can safely remove the
Q_UNUSED.

Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>

* Fix validation logic of initial message

I modified the logic to a positive value, but the modification was incomplete
and caused the initial message to be incorrectly considered as invalid.

Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>

* Use the proper socket when receiving message

The socket variable is a class member, but we really want to use
nextConnSocket when receiving the message in the lambda.

Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>
2018-09-10 22:35:38 +01:00
Itay Grudev
9357d19042
v3.0.12a Removed custom signal handling. 2018-07-27 12:59:31 +03:00
Itay Grudev
46b2204a3f
Proposed SA changes still containing a race condition (#48) 2018-07-27 04:29:55 +03:00
Francis Giraldeau
f975da90cc Fix sendmessage (#46)
* Fix send message example

If a secondary instance sends a message immediately after connecting, the
message follows the init message. This causes the slotConnectionEstablished to
read and consume the tail of the message and interpret it as the checksum. The
checksum fails and the connection becomes invalid.

To avoid this race, we prefix the init message with its length. This way, we
consume only the data relevant to the init message.

This patch fixes the sending_arguments example.

Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>

* Fix include file case

Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>
2018-07-27 02:10:14 +03:00
Karl G
a36a327ddf replace -lAdvapi32 with -ladvapi32 which broke the build on mxe (#43)
This should not break any windows builds as the windows filesystem is case-insensitive.
2018-07-27 01:56:39 +03:00
Itay Grudev
c03d32ec17 v3.0.10 Code cleanup 2017-12-03 17:15:45 +00:00
Jedidiah Buck McCready
a956ae47d1 removed c style casts and eliminated all clang warnings, ... (#38)
* removed c style casts and eliminated all clang warnings, fixed instanceId reading from only one byte in deserialization of message, cleaned up serialization code using QDataStream, changed connection type to use quint8 enum rather than char

* renamed SingleAppConnectionType to ConnectionType, added initialization values to all ConnectionType enum cases
2017-12-03 17:04:02 +00:00
Itay Grudev
4f03651072 Primary PID support (#36)
* Added the ability to bring the primary application window to the foreground on Windows systems by adding an option flag. THis option can only be used in Windows development and in applications derived from QApplication with a QMainWindow object.
Because the primary application needs to be instructed to go to the foreground, the option SecondaryNotification must also be set to use this functionality

* Changed the ability to bring the primary application window to the front as discussed in itay-grudev/SingleApplication#31.

Now the process ID of the primary application get stored and is accessible for other instances of the application. It is to the developer to bring the applications windows to the front. For convenience the accompanying readme now contains a paragraph with example of how to do this on Windows systems.

* v3.0.9 Added SingleApplicationPrivate::primaryPid()
2017-10-02 12:17:41 +01:00
Itay Grudev
6fbf6bffc8
Fixed typo in the CHANGELOG.md 2017-08-20 20:41:00 +03:00
Itay Grudev
ec5123f56e
v3.0.8
Signed-off-by: Itay Grudev <itay@grudev.com>
2017-08-20 20:37:03 +03:00
BG4444
ca149f4436 bugfix - change QApplication to macro QAPPLICATION_CLASS (#34)
Bug fix - changed QApplication to macro QCoreApplication when invoking QApplication::instance()
2017-08-20 20:30:29 +03:00
Itay Grudev
00a0da8b00 v3.0.7a 2017-04-23 14:31:52 +03:00
Itay Grudev
c2a6faca68 Removed QMutex for thread safe behaviour and support for multiple SingleApplication instances
Problem raised by @retmas in #24
2017-04-23 14:31:32 +03:00
Vitaly Tonkacheyev
eee5d9544b Fixed compilation error: cannot convert wchar_t* to LPSTR {aka char*} (#29) 2017-02-23 13:41:11 +00:00
Evgeny
d561026d83 Remove magic chars from code - use more readable code style (#28) 2017-02-22 13:27:48 +00:00
Itay Grudev
87a81e5780
Removed version number from README.md 2017-02-02 04:38:55 +00:00
Itay Grudev
51b7ecc524
v3.0.6a 2017-02-02 04:35:46 +00:00
Itay Grudev
8892a54e12
Bug Fix Calculator example not raising it's window on Windows 2017-02-02 04:35:05 +00:00
Itay Grudev
4841681918 Reverted GetUserName API usage on Windows (#25)
* Added back support for getting username on Windows

* Fixed typo in singleapplication.pri

* Compiler specific Advapi32.lib links

* Removed username debug statement
2017-02-02 04:28:00 +00:00
Itay Grudev
1c5164ed10 Fixed typo in README.md 2017-02-01 05:14:16 +00:00
Itay Grudev
1c52aaf284
v3.0.5a 2017-01-31 17:38:21 +00:00
Itay Grudev
cf347c47af Refactored SingleApplicationPrivate destructor.
Deleted the separate cleanUp method as it’s not used from anywhere but
the destructor.
2017-01-30 17:47:01 +00:00
retmas
b0078af7d3 Fix memory leak on SingleApplicationPrivate destruction (#23)
The issue is non critical as if the library is used properly this destructor is not called until the end of the program anyway.
2017-01-30 17:38:16 +00:00