Skip to content

Commit 49d3fe9

Browse files
Friedemann KleintFriedemann Kleint
Friedemann Kleint
authored and
Friedemann Kleint
committed
Fix compilation of the QtSingleApplication solution with Qt 5.
Change-Id: I48c20f8b96306d56bb6c365f6cb12dac795a0905 Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
1 parent 2174f11 commit 49d3fe9

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

qtsingleapplication/src/qtsingleapplication.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char *
170170
sysInit(appId);
171171
}
172172

173+
#if QT_VERSION < 0x050000
173174

174175
/*!
175176
Creates a QtSingleApplication object. The application identifier
@@ -183,7 +184,7 @@ QtSingleApplication::QtSingleApplication(int &argc, char **argv, Type type)
183184
}
184185

185186

186-
#if defined(Q_WS_X11)
187+
# if defined(Q_WS_X11)
187188
/*!
188189
Special constructor for X11, ref. the documentation of
189190
QApplication's corresponding constructor. The application identifier
@@ -221,7 +222,8 @@ QtSingleApplication::QtSingleApplication(Display* dpy, const QString &appId, int
221222
{
222223
sysInit(appId);
223224
}
224-
#endif
225+
# endif // Q_WS_X11
226+
#endif // QT_VERSION < 0x050000
225227

226228

227229
/*!

qtsingleapplication/src/qtsingleapplication.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,14 @@ class QT_QTSINGLEAPPLICATION_EXPORT QtSingleApplication : public QApplication
6868
public:
6969
QtSingleApplication(int &argc, char **argv, bool GUIenabled = true);
7070
QtSingleApplication(const QString &id, int &argc, char **argv);
71+
#if QT_VERSION < 0x050000
7172
QtSingleApplication(int &argc, char **argv, Type type);
72-
#if defined(Q_WS_X11)
73+
# if defined(Q_WS_X11)
7374
QtSingleApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
7475
QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0);
7576
QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
76-
#endif
77+
# endif // Q_WS_X11
78+
#endif // QT_VERSION < 0x050000
7779

7880
bool isRunning();
7981
QString id() const;

0 commit comments

Comments
 (0)