Commit bd8a49a1 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau

Use Q_DECLARE_OPERATORS_FOR_FLAGS in same namespace as flags definition

Having the macro's definition of the operator| in the namespace of the
flags argument improves/unbreaks things for the argument-dependent
lookup of unqualified function names, e.g. when flags are combined in
calls of other methods, but there is some other operator| defined in the
namespace of the current code.

Given Q_DECLARE_OPERATORS_FOR_FLAGS creates inlined functions, this
should be a source and binary compatible change.

Qt did similar for Qt 5.12 in
https://codereview.qt-project.org/c/qt/qtbase/+/225348

GIT_SILENT
parent a498c773
Pipeline #31521 failed with stage
in 60 minutes
......@@ -198,8 +198,8 @@ private:
Q_DECLARE_PRIVATE(BreakpointModel)
};
}
Q_DECLARE_OPERATORS_FOR_FLAGS(BreakpointModel::ColumnFlags)
Q_DECLARE_OPERATORS_FOR_FLAGS(KDevelop::BreakpointModel::ColumnFlags)
}
#endif
......@@ -92,9 +92,9 @@ private:
const QScopedPointer<class IVariableControllerPrivate> d_ptr;
Q_DECLARE_PRIVATE(IVariableController)
};
Q_DECLARE_OPERATORS_FOR_FLAGS(IVariableController::UpdateTypes)
} // namespace KDevelop
Q_DECLARE_OPERATORS_FOR_FLAGS(KDevelop::IVariableController::UpdateTypes)
#endif
......@@ -228,10 +228,8 @@ Q_SIGNALS:
friend class IDocument;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(IDocumentController::DocumentActivationParams)
} // namespace KDevelop
Q_DECLARE_OPERATORS_FOR_FLAGS(KDevelop::IDocumentController::DocumentActivationParams)
#endif
......@@ -245,8 +245,9 @@ private:
const QScopedPointer<class ParseJobPrivate> d_ptr;
Q_DECLARE_PRIVATE(ParseJob)
};
}
Q_DECLARE_OPERATORS_FOR_FLAGS(KDevelop::ParseJob::SequentialProcessingFlags)
Q_DECLARE_OPERATORS_FOR_FLAGS(ParseJob::SequentialProcessingFlags)
}
#endif
......@@ -96,6 +96,8 @@ private:
virtual AbstractFunctionDeclarationData* dynamicData() = 0;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractFunctionDeclaration::FunctionSpecifiers)
///Use this to merge AbstractFunctionDeclaration into the class hierarchy. Base must be the base-class
///in the hierarchy, and Data must be the Data class of the following Declaration, and must be based on AbstractFunctionDeclarationData
///and BaseData.
......@@ -128,8 +130,7 @@ private:
return static_cast<_Data*>(Base::d_func_dynamic());
}
};
}
Q_DECLARE_OPERATORS_FOR_FLAGS(KDevelop::AbstractFunctionDeclaration::FunctionSpecifiers)
}
#endif // KDEVPLATFORM_ABSTRACTFUNCTIONDECLARATION_H
......@@ -117,8 +117,9 @@ protected:
private:
Declaration* clonePrivate() const override;
};
}
Q_DECLARE_OPERATORS_FOR_FLAGS(KDevelop::ClassMemberDeclaration::StorageSpecifiers)
Q_DECLARE_OPERATORS_FOR_FLAGS(ClassMemberDeclaration::StorageSpecifiers)
}
#endif // KDEVPLATFORM_CLASSMEMBERDECLARATION_H
......@@ -54,6 +54,8 @@ struct KDEVPLATFORMLANGUAGE_EXPORT Colorizer
Formatting m_formatting;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(Colorizer::Formatting)
class AbstractNavigationContext;
using NavigationContextPointer = QExplicitlySharedDataPointer<AbstractNavigationContext>;
......@@ -169,8 +171,7 @@ private:
const QScopedPointer<class AbstractNavigationContextPrivate> d_ptr;
Q_DECLARE_PRIVATE(AbstractNavigationContext)
};
}
Q_DECLARE_OPERATORS_FOR_FLAGS(KDevelop::Colorizer::Formatting)
}
#endif
......@@ -171,14 +171,13 @@ Q_SIGNALS:
void outputRemoved(int toolViewId, int outputId);
};
} // namespace KDevelop
Q_DECLARE_OPERATORS_FOR_FLAGS(IOutputView::Behaviours)
Q_DECLARE_OPERATORS_FOR_FLAGS(IOutputView::Options)
Q_DECLARE_OPERATORS_FOR_FLAGS(KDevelop::IOutputView::Behaviours)
Q_DECLARE_OPERATORS_FOR_FLAGS(KDevelop::IOutputView::Options)
} // namespace KDevelop
Q_DECLARE_METATYPE(KDevelop::IOutputView::StandardToolView)
Q_DECLARE_INTERFACE( KDevelop::IOutputView, "org.kdevelop.IOutputView" )
#endif
......@@ -262,8 +262,8 @@ private:
friend class OutputExecuteJobPrivate;
};
} // namespace KDevelop
Q_DECLARE_OPERATORS_FOR_FLAGS(OutputExecuteJob::JobProperties)
Q_DECLARE_OPERATORS_FOR_FLAGS(KDevelop::OutputExecuteJob::JobProperties)
} // namespace KDevelop
#endif // KDEVPLATFORM_OUTPUTEXECUTEJOB_H
......@@ -137,12 +137,10 @@ public:
virtual Path compiler(KDevelop::ProjectTargetItem* p) const = 0;
};
}
Q_DECLARE_OPERATORS_FOR_FLAGS(IBuildSystemManager::BuildFeatures)
Q_DECLARE_OPERATORS_FOR_FLAGS( KDevelop::IBuildSystemManager::BuildFeatures )
}
Q_DECLARE_INTERFACE( KDevelop::IBuildSystemManager, "org.kdevelop.IBuildSystemManager" )
#endif
......@@ -171,8 +171,9 @@ Q_SIGNALS:
void fileRenamed(const KDevelop::Path& oldFile, KDevelop::ProjectFileItem* newFile);
};
Q_DECLARE_OPERATORS_FOR_FLAGS(IProjectFileManager::Features)
}
Q_DECLARE_OPERATORS_FOR_FLAGS( KDevelop::IProjectFileManager::Features )
Q_DECLARE_INTERFACE( KDevelop::IProjectFileManager, "org.kdevelop.IProjectFileManager")
......
......@@ -42,12 +42,10 @@ namespace Sublime {
AllPositions = Left|Right|Top|Bottom /**< all tool view positions */
};
Q_DECLARE_FLAGS(Positions, Position)
Q_DECLARE_OPERATORS_FOR_FLAGS(Positions)
KDEVPLATFORMSUBLIME_EXPORT Position dockAreaToPosition(Qt::DockWidgetArea dockArea);
}
Q_DECLARE_OPERATORS_FOR_FLAGS(Sublime::Positions)
#endif
......@@ -81,6 +81,8 @@ private:
QSharedDataPointer<class VcsItemEventPrivate> d;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(VcsItemEvent::Actions)
/**
* Small container class that contains information about a single revision.
*
......@@ -116,10 +118,9 @@ private:
}
Q_DECLARE_OPERATORS_FOR_FLAGS( KDevelop::VcsItemEvent::Actions )
Q_DECLARE_METATYPE( KDevelop::VcsEvent )
Q_DECLARE_TYPEINFO( KDevelop::VcsEvent, Q_MOVABLE_TYPE );
Q_DECLARE_METATYPE( KDevelop::VcsItemEvent )
Q_DECLARE_TYPEINFO( KDevelop::VcsItemEvent, Q_MOVABLE_TYPE );
#endif
#endif
......@@ -50,6 +50,7 @@ enum DBGStateFlag
};
Q_ENUM_NS(DBGStateFlag)
Q_DECLARE_FLAGS(DBGStateFlags, DBGStateFlag)
Q_DECLARE_OPERATORS_FOR_FLAGS(DBGStateFlags)
enum DataType { typeUnknown, typeValue, typePointer, typeReference,
typeStruct, typeArray, typeQString, typeWhitespace,
......@@ -88,6 +89,4 @@ static const char LldbRemotePathEntry[] = "LLDB Remote Path";
} // end of namespace KDevMI
Q_DECLARE_OPERATORS_FOR_FLAGS(KDevMI::DBGStateFlags)
#endif // _DBGGLOBAL_H_
......@@ -63,6 +63,7 @@ enum CommandFlag {
CmdInterrupt = 1 << 4,
};
Q_DECLARE_FLAGS(CommandFlags, CommandFlag)
Q_DECLARE_OPERATORS_FOR_FLAGS(CommandFlags)
//base class for handlers
class MICommandHandler
......@@ -374,6 +375,4 @@ CliCommand::CliCommand(
} // end of namespace MI
} // end of namespace KDevMI
Q_DECLARE_OPERATORS_FOR_FLAGS(KDevMI::MI::CommandFlags)
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment