Skip to content

Commit

Permalink
- Fixing unique/single instance support (Qt >= 6.6) (bis)
Browse files Browse the repository at this point in the history
  • Loading branch information
rncbc committed Sep 26, 2023
1 parent 43a0c03 commit b549c5f
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 19 deletions.
13 changes: 7 additions & 6 deletions src/qjackctl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,16 @@ const WindowFlags WindowCloseButtonHint = WindowFlags(0x08000000);

#ifdef CONFIG_XUNIQUE

#define QJACKCTL_XUNIQUE "qjackctlApplication"

#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#ifdef CONFIG_X11

#define QJACKCTL_XUNIQUE "qjackctlApplication"

#include <unistd.h> /* for gethostname() */

#include <X11/Xatom.h>
#include <X11/Xlib.h>

#endif // CONFIG_X11
#else
#include <QSharedMemory>
Expand All @@ -107,20 +110,18 @@ const WindowFlags WindowCloseButtonHint = WindowFlags(0x08000000);
qjackctlApplication::qjackctlApplication ( int& argc, char **argv )
: QApplication(argc, argv),
m_pQtTranslator(nullptr), m_pMyTranslator(nullptr), m_pWidget(nullptr)
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#ifdef CONFIG_XUNIQUE
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#ifdef CONFIG_X11
, m_pDisplay(nullptr)
, m_aUnique(0)
, m_wOwner(0)
#endif // CONFIG_X11
#endif // CONFIG_XUNIQUE
#else
#ifdef CONFIG_XUNIQUE
, m_pMemory(nullptr)
, m_pServer(nullptr)
#endif // CONFIG_XUNIQUE
#endif
#endif // CONFIG_XUNIQUE
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
QApplication::setApplicationName(QJACKCTL_TITLE);
Expand Down
2 changes: 1 addition & 1 deletion src/translations/qjackctl_cs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="141"/>
<location filename="../qjackctl.cpp" line="142"/>
<source>JACK: %1</source>
<translation>JACK: %1</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion src/translations/qjackctl_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="141"/>
<location filename="../qjackctl.cpp" line="142"/>
<source>JACK: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion src/translations/qjackctl_es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="141"/>
<location filename="../qjackctl.cpp" line="142"/>
<source>JACK: %1</source>
<translation>JACK: %1</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion src/translations/qjackctl_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="141"/>
<location filename="../qjackctl.cpp" line="142"/>
<source>JACK: %1</source>
<translation>JACK : %1</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion src/translations/qjackctl_it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="141"/>
<location filename="../qjackctl.cpp" line="142"/>
<source>JACK: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion src/translations/qjackctl_ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="141"/>
<location filename="../qjackctl.cpp" line="142"/>
<source>JACK: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion src/translations/qjackctl_ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="141"/>
<location filename="../qjackctl.cpp" line="142"/>
<source>JACK: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion src/translations/qjackctl_nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="141"/>
<location filename="../qjackctl.cpp" line="142"/>
<source>JACK: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion src/translations/qjackctl_pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="141"/>
<location filename="../qjackctl.cpp" line="142"/>
<source>JACK: %1</source>
<translation>JACK %1</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion src/translations/qjackctl_ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="141"/>
<location filename="../qjackctl.cpp" line="142"/>
<source>JACK: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion src/translations/qjackctl_sk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="141"/>
<location filename="../qjackctl.cpp" line="142"/>
<source>JACK: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion src/translations/qjackctl_tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="141"/>
<location filename="../qjackctl.cpp" line="142"/>
<source>JACK: %1</source>
<translation>JACK: %1</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion src/translations/qjackctl_uk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="141"/>
<location filename="../qjackctl.cpp" line="142"/>
<source>JACK: %1</source>
<translation>JACK: %1</translation>
</message>
Expand Down

0 comments on commit b549c5f

Please sign in to comment.