Feat: Define QT_NO_KEYWORDS, allowing us to use Qt in more places
must use Q_SIGNALS, Q_SLOTS and Q_EMIT in place of signals, slots and emit macros
This commit is contained in:
parent
a31cff0225
commit
d246d9527a
53 changed files with 72 additions and 66 deletions
|
|
@ -144,6 +144,10 @@ endif()
|
|||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
|
||||
|
||||
# disables the use of signals,slots and emit
|
||||
# Instead use Q_SIGNAL, Q_SLOT and Q_EMIT
|
||||
# prevents issues when used with glib for libportal
|
||||
add_definitions(-DQT_NO_KEYWORDS)
|
||||
include(cmake/Libraries.cmake)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ public:
|
|||
static void save(bool emitSaving = true);
|
||||
static const QStringList validKeys();
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void settingsChanged(const QString key);
|
||||
void serverSettingsChanged();
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public:
|
|||
|
||||
void listen();
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void logLevelChanged(const QString &logLevel);
|
||||
void elevateModeChanged(bool elevate);
|
||||
void commandChanged(const QString &command);
|
||||
|
|
@ -38,7 +38,7 @@ private:
|
|||
void processElevate(QLocalSocket *&clientSocket, const QStringList &messageParts);
|
||||
void processCommand(QLocalSocket *&clientSocket, const QStringList &messageParts);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void handleNewConnection();
|
||||
void handleReadyRead();
|
||||
void handleDisconnected();
|
||||
|
|
|
|||
|
|
@ -7,8 +7,10 @@
|
|||
|
||||
#include "deskflow/unix/AppUtilUnix.h"
|
||||
#include "deskflow/ArgsBase.h"
|
||||
#include <filesystem>
|
||||
#include <thread>
|
||||
|
||||
#include "base/Log.h"
|
||||
#include "base/LogOutputters.h"
|
||||
#include "common/Constants.h"
|
||||
|
||||
#if WINAPI_XWINDOWS
|
||||
#include "deskflow/unix/X11LayoutsParser.h"
|
||||
|
|
@ -19,9 +21,9 @@
|
|||
#else
|
||||
#error Platform not supported.
|
||||
#endif
|
||||
#include "base/Log.h"
|
||||
#include "base/LogOutputters.h"
|
||||
#include "common/Constants.h"
|
||||
|
||||
#include <filesystem>
|
||||
#include <thread>
|
||||
|
||||
AppUtilUnix::AppUtilUnix(const IEventQueue *events)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ public:
|
|||
return m_IsFinished;
|
||||
}
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void isComplete();
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void complete(QNetworkReply *reply);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ class FileTail : public QObject
|
|||
public:
|
||||
FileTail(const QString &filePath, QObject *parent = nullptr);
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void newLine(const QString &line);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void handleFileChanged(const QString &);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public:
|
|||
void handleMessage(const QtMsgType type, const QString &fileLine, const QString &message);
|
||||
void logVerbose(const QString &message) const;
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void newLine(const QString &line);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public:
|
|||
|
||||
void hide();
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void shown();
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public:
|
|||
QMimeData *mimeData(const QModelIndexList &indexes) const override;
|
||||
bool isFull() const;
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void screensChanged();
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ class VersionChecker : public QObject
|
|||
public:
|
||||
explicit VersionChecker(QObject *parent = nullptr);
|
||||
void checkLatest() const;
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void replyFinished(QNetworkReply *reply);
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void updateFound(const QString &version);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public:
|
|||
m_showMessage = true;
|
||||
}
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void messageShowing();
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ class CommandProcess : public QObject
|
|||
public:
|
||||
CommandProcess(QString cmd, QStringList arguments, QString input = "");
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void finished();
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
QString run();
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ public:
|
|||
m_mode = mode;
|
||||
}
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void starting();
|
||||
void error(Error error);
|
||||
void logLine(const QString &line);
|
||||
|
|
@ -122,7 +122,7 @@ signals:
|
|||
void secureSocket(bool enabled);
|
||||
void daemonIpcClientConnectionFailed();
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void onProcessFinished(int exitCode, QProcess::ExitStatus);
|
||||
void onProcessReadyReadStandardOutput();
|
||||
void onProcessReadyReadStandardError();
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public:
|
|||
);
|
||||
void handleLogLine(const QString &logLine);
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void messageShowing();
|
||||
void configureClient(const QString &clientName);
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public:
|
|||
ActionDialog(QWidget *parent, const ServerConfig &config, Hotkey &hotkey, Action &action);
|
||||
~ActionDialog() override;
|
||||
|
||||
protected slots:
|
||||
protected Q_SLOTS:
|
||||
void accept() override;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public:
|
|||
return m_AddResult;
|
||||
}
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void handleButtonLeft();
|
||||
void handleButtonUp();
|
||||
void handleButtonRight();
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public:
|
|||
);
|
||||
~FingerprintDialog() override = default;
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void requestLocalPrintsDialog();
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public:
|
|||
return m_Hotkey;
|
||||
}
|
||||
|
||||
protected slots:
|
||||
protected Q_SLOTS:
|
||||
void accept() override;
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ public:
|
|||
ScreenSettingsDialog(QWidget *parent, Screen *pScreen = nullptr, const ScreenList *pScreens = nullptr);
|
||||
~ScreenSettingsDialog() override;
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void accept() override;
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void on_m_pButtonAddAlias_clicked();
|
||||
void on_m_pButtonRemoveAlias_clicked();
|
||||
void on_m_pLineEditAlias_textChanged(const QString &text);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public:
|
|||
~ServerConfigDialog() override;
|
||||
bool addClient(const QString &clientName);
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void accept() override;
|
||||
void reject() override;
|
||||
void message(const QString &message)
|
||||
|
|
@ -36,7 +36,7 @@ public slots:
|
|||
m_Message = message;
|
||||
}
|
||||
|
||||
protected slots:
|
||||
protected Q_SLOTS:
|
||||
void onScreenRemoved();
|
||||
|
||||
protected:
|
||||
|
|
@ -102,6 +102,6 @@ private:
|
|||
ScreenSetupModel m_ScreenSetupModel;
|
||||
QString m_Message = "";
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void onChange();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public:
|
|||
SettingsDialog(QWidget *parent, const IServerConfig &serverConfig, const CoreProcess &coreProcess);
|
||||
~SettingsDialog() override;
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void shown();
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -40,11 +40,11 @@ public:
|
|||
return m_state == State::Connected;
|
||||
}
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void connected();
|
||||
void connectionFailed();
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void handleDisconnected();
|
||||
void handleErrorOccurred();
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public:
|
|||
virtual QString readAllStandardOutput();
|
||||
virtual QString readAllStandardError();
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void finished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
void readyReadStandardOutput();
|
||||
void readyReadStandardError();
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class KeySequenceWidget : public QPushButton
|
|||
public:
|
||||
KeySequenceWidget(QWidget *parent, const KeySequence &seq = KeySequence());
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void keySequenceChanged();
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -27,6 +27,6 @@ public:
|
|||
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
void dropEvent(QDropEvent *event) override;
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void screenRemoved();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
class ArchStringTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
// Test are run in order top to bottom
|
||||
void convertStringWCToMB_buffer();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
class PathTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void testOpen();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
class StringTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void formatWithArgs();
|
||||
void formatedString();
|
||||
void intToString();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
class UnicodeTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void UTF32ToUTF8();
|
||||
void UTF16ToUTF8();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
class XBaseTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void empty();
|
||||
void nonEmpty();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
class SettingsTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
// Test are run in order top to bottom
|
||||
void setSettingsFile();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
class ArgParserTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
// Test are run in order top to bottom
|
||||
void isArg();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
class ClipboardChunksTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
// Test are run in order top to bottom
|
||||
void startFormatData();
|
||||
void formatDataChunk();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
class ClipboardTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
// Test are run in order top to bottom
|
||||
void initTestCase();
|
||||
void basicFunction();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
class ConfigTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
// Test are run in order top to bottom
|
||||
void initTestCase();
|
||||
void loadFile();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
class IKeyStateTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void allocDestination();
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace deskflow {
|
|||
class KeyMapTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void findBestKey_requiredDown_matchExactFirstItem();
|
||||
void findBestKey_requiredAndExtraSensitiveDown_matchExactFirstItem();
|
||||
void findBestKey_requiredAndExtraSensitiveDown_matchExactSecondItem();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
class LanguageManagerTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
// Test are run in order top to bottom
|
||||
void remoteLanguages();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
class ServerAppTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
// Test are run in order top to bottom
|
||||
void version();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
class X11LayoutParserTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
// Test are run in order top to bottom
|
||||
void initTestCase();
|
||||
void xmlParse();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
class DotEnvTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
// Test are run in order top to bottom
|
||||
void initTestCase();
|
||||
void invalidFile();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
class LoggerTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
// Test are run in order top to bottom
|
||||
void newLine();
|
||||
void noNewLine();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
class ScreenTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
// Test are run in order top to bottom
|
||||
void initTestCase();
|
||||
void basicFunctionality();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
class CommandProcessTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
// Test are run in order top to bottom
|
||||
// void initTestCase();
|
||||
void runCommand();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
class FingerprintDatabaseTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void readFile();
|
||||
void writeFile();
|
||||
void clear();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
class FingerprintTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void test_isValid();
|
||||
void test_toDbLine();
|
||||
void test_fromDbLine();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
class SecureUtilsTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void checkHex();
|
||||
void checkArt();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
class MSWindowsClipboardTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
// Test are run in order top to bottom
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
class OSXClipboardTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
// Test are run in order top to bottom
|
||||
void open();
|
||||
void singleFormat();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
class OSXKeyStateTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
// Test are run in order top to bottom
|
||||
void mapModifiersFromOSX_OSXMask();
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
class XWindowsClipboardTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
// Test are run in order top to bottom
|
||||
void defaultCtor();
|
||||
// Tests only work on X Windows
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
class ServerConfigTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void equalityCheck();
|
||||
void equalityCheck_diff_options();
|
||||
void equalityCheck_diff_alias();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
class ServerTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void SwitchToScreenInfo_alloc_screen();
|
||||
void KeyboardBroadcastInfo_alloc_stateAndSceens();
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue