Workaround lupdate not understanding "enum class" in some cases
Apparently this is still problematic leading to errors like `Qualifying with unknown namespace/class`. It seems that moving the enum to a different header file works. The trick to use a macro to define `enum class` ceased to work on the other hand. Specifying a function with the namespace like `void QtGui::FinalWizardPage::showResults()` leads to the same problem and also needs to be avoided.
This commit is contained in:
parent
925ce383f0
commit
dd936b4a81
|
@ -14,6 +14,7 @@ set(HEADER_FILES
|
|||
syncthingdir.h
|
||||
syncthingdev.h
|
||||
syncthingconnection.h
|
||||
syncthingconnectionenums.h
|
||||
syncthingconnectionstatus.h
|
||||
syncthingconnectionsettings.h
|
||||
syncthingnotifier.h
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef SYNCTHINGCONNECTION_H
|
||||
#define SYNCTHINGCONNECTION_H
|
||||
|
||||
#include "./syncthingconnectionenums.h"
|
||||
#include "./syncthingconnectionstatus.h"
|
||||
#include "./syncthingdev.h"
|
||||
#include "./syncthingdir.h"
|
||||
|
@ -30,12 +31,6 @@ QT_FORWARD_DECLARE_CLASS(QJsonParseError)
|
|||
class ConnectionTests;
|
||||
class MiscTests;
|
||||
|
||||
#define SYNCTHING_CONNECTOR_ENUM_CLASS enum class
|
||||
namespace Data {
|
||||
SYNCTHING_CONNECTOR_ENUM_CLASS SyncthingStatusComputionFlags : quint64;
|
||||
}
|
||||
#undef SYNCTHING_CONNECTOR_ENUM_CLASS
|
||||
|
||||
namespace Data {
|
||||
|
||||
struct SyncthingConnectionSettings;
|
||||
|
@ -52,22 +47,6 @@ struct LIB_SYNCTHING_CONNECTOR_EXPORT SyncthingLogEntry {
|
|||
QString message;
|
||||
};
|
||||
|
||||
enum class SyncthingConnectionLoggingFlags : quint64 {
|
||||
None, /**< loggingn is disabled */
|
||||
FromEnvironment = (1 << 0), /**< environment variables are checked to pull in any of the other flags dynamically */
|
||||
ApiCalls = (1 << 1), /**< log calls to Syncthing's REST-API and responses */
|
||||
ApiReplies = (1 << 2), /**< log replies from Syncthing's REST-API */
|
||||
Events = (1 << 3), /**< log events received via Syncthing's event API */
|
||||
DirsOrDevsResetted = (1 << 4), /**< log list of directories/devices when list is reset */
|
||||
All = ApiCalls | ApiReplies | Events | DirsOrDevsResetted, /** log as much as possible */
|
||||
};
|
||||
|
||||
} // namespace Data
|
||||
|
||||
CPP_UTILITIES_MARK_FLAG_ENUM_CLASS(Data, Data::SyncthingConnectionLoggingFlags)
|
||||
|
||||
namespace Data {
|
||||
|
||||
class LIB_SYNCTHING_CONNECTOR_EXPORT SyncthingConnection : public QObject {
|
||||
friend ConnectionTests;
|
||||
friend MiscTests;
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef SYNCTHINGCONNECTION_ENUMS_H
|
||||
#define SYNCTHINGCONNECTION_ENUMS_H
|
||||
|
||||
#include <c++utilities/misc/flagenumclass.h>
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
namespace Data {
|
||||
enum class SyncthingStatusComputionFlags : quint64;
|
||||
|
||||
enum class SyncthingConnectionLoggingFlags : quint64 {
|
||||
None, /**< loggingn is disabled */
|
||||
FromEnvironment = (1 << 0), /**< environment variables are checked to pull in any of the other flags dynamically */
|
||||
ApiCalls = (1 << 1), /**< log calls to Syncthing's REST-API and responses */
|
||||
ApiReplies = (1 << 2), /**< log replies from Syncthing's REST-API */
|
||||
Events = (1 << 3), /**< log events received via Syncthing's event API */
|
||||
DirsOrDevsResetted = (1 << 4), /**< log list of directories/devices when list is reset */
|
||||
All = ApiCalls | ApiReplies | Events | DirsOrDevsResetted, /** log as much as possible */
|
||||
};
|
||||
|
||||
} // namespace Data
|
||||
|
||||
CPP_UTILITIES_MARK_FLAG_ENUM_CLASS(Data, Data::SyncthingConnectionLoggingFlags)
|
||||
|
||||
#endif // SYNCTHINGCONNECTION_ENUMS_H
|
|
@ -402,7 +402,7 @@ void SyncthingService::setEnabled(bool enabled)
|
|||
/*!
|
||||
* \brief Reload all unit files.
|
||||
*/
|
||||
void Data::SyncthingService::reloadAllUnitFiles()
|
||||
void SyncthingService::reloadAllUnitFiles()
|
||||
{
|
||||
registerErrorHandler(m_currentSystemdInterface->Reload(), QT_TR_NOOP_UTF8("reload all unit files"), false, false);
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ set(WIDGETS_HEADER_FILES
|
|||
settings/settings.h
|
||||
settings/settingsdialog.h
|
||||
settings/wizard.h
|
||||
settings/wizardenums.h
|
||||
webview/webpage.h
|
||||
webview/webviewdialog.h
|
||||
misc/textviewdialog.h
|
||||
|
|
|
@ -1054,7 +1054,7 @@ bool FinalWizardPage::validatePage()
|
|||
return true;
|
||||
}
|
||||
|
||||
void QtGui::FinalWizardPage::showResults()
|
||||
void FinalWizardPage::showResults()
|
||||
{
|
||||
auto *const wizard = qobject_cast<Wizard *>(this->wizard());
|
||||
if (!wizard) {
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
#define SETTINGS_WIZARD_H
|
||||
|
||||
#include "../global.h"
|
||||
|
||||
#include <c++utilities/misc/flagenumclass.h>
|
||||
#include "./wizardenums.h"
|
||||
|
||||
#include <QWizard>
|
||||
#include <QWizardPage>
|
||||
|
@ -30,20 +29,6 @@ class AutostartWizardPage;
|
|||
class ApplyWizardPage;
|
||||
} // namespace Ui
|
||||
|
||||
enum class MainConfiguration : quint64 {
|
||||
None,
|
||||
CurrentlyRunning,
|
||||
LauncherExternal,
|
||||
LauncherBuiltIn,
|
||||
SystemdUserUnit,
|
||||
SystemdSystemUnit,
|
||||
};
|
||||
|
||||
enum class ExtraConfiguration : quint64 {
|
||||
None,
|
||||
SystemdIntegration = (1 << 0),
|
||||
};
|
||||
|
||||
class SYNCTHINGWIDGETS_EXPORT Wizard : public QWizard {
|
||||
Q_OBJECT
|
||||
friend class WizardTests;
|
||||
|
@ -255,6 +240,4 @@ private:
|
|||
|
||||
} // namespace QtGui
|
||||
|
||||
CPP_UTILITIES_MARK_FLAG_ENUM_CLASS(QtGui, QtGui::ExtraConfiguration)
|
||||
|
||||
#endif // SETTINGS_WIZARD_H
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
#ifndef SETTINGS_WIZARD_ENUMS_H
|
||||
#define SETTINGS_WIZARD_ENUMS_H
|
||||
|
||||
#include <c++utilities/misc/flagenumclass.h>
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
namespace QtGui {
|
||||
|
||||
enum class MainConfiguration : quint64 {
|
||||
None,
|
||||
CurrentlyRunning,
|
||||
LauncherExternal,
|
||||
LauncherBuiltIn,
|
||||
SystemdUserUnit,
|
||||
SystemdSystemUnit,
|
||||
};
|
||||
|
||||
enum class ExtraConfiguration : quint64 {
|
||||
None,
|
||||
SystemdIntegration = (1 << 0),
|
||||
};
|
||||
|
||||
} // namespace QtGui
|
||||
|
||||
CPP_UTILITIES_MARK_FLAG_ENUM_CLASS(QtGui, QtGui::ExtraConfiguration)
|
||||
|
||||
#endif // SETTINGS_WIZARD_H
|
Loading…
Reference in New Issue